[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 214/282: md4: use init/update/final functions in Secure Transpor
From: |
gnunet |
Subject: |
[gnurl] 214/282: md4: use init/update/final functions in Secure Transport |
Date: |
Wed, 01 Apr 2020 14:31:19 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 0b337ecc91f30188987dc441dc1fc67446a86676
Author: Nick Zitzmann <address@hidden>
AuthorDate: Sun Feb 23 20:23:52 2020 -0600
md4: use init/update/final functions in Secure Transport
We can use CC_MD4_Init/Update/Final without having to allocate memory
directly.
Closes #4979
---
lib/md4.c | 28 ++++++++--------------------
1 file changed, 8 insertions(+), 20 deletions(-)
diff --git a/lib/md4.c b/lib/md4.c
index b33ec8415..38f1b2bc9 100644
--- a/lib/md4.c
+++ b/lib/md4.c
@@ -97,7 +97,10 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx)
/* When OpenSSL is available we use the MD4-functions from OpenSSL */
#include <openssl/md4.h>
-#elif defined(USE_SECTRANSP)
+#elif (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && \
+ (__MAC_OS_X_VERSION_MAX_ALLOWED >= 1040)) || \
+ (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && \
+ (__IPHONE_OS_VERSION_MAX_ALLOWED >= 20000))
#include <CommonCrypto/CommonDigest.h>
@@ -106,36 +109,21 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx)
/* The last #include file should be: */
#include "memdebug.h"
-typedef struct {
- void *data;
- unsigned long size;
-} MD4_CTX;
+typedef CC_MD4_CTX MD4_CTX;
static void MD4_Init(MD4_CTX *ctx)
{
- ctx->data = NULL;
- ctx->size = 0;
+ (void)CC_MD4_Init(ctx);
}
static void MD4_Update(MD4_CTX *ctx, const void *data, unsigned long size)
{
- if(ctx->data == NULL) {
- ctx->data = malloc(size);
- if(ctx->data != NULL) {
- memcpy(ctx->data, data, size);
- ctx->size = size;
- }
- }
+ (void)CC_MD4_Update(ctx, data, (CC_LONG)size);
}
static void MD4_Final(unsigned char *result, MD4_CTX *ctx)
{
- if(ctx->data != NULL) {
- (void)CC_MD4(ctx->data, (CC_LONG) ctx->size, result);
-
- Curl_safefree(ctx->data);
- ctx->size = 0;
- }
+ (void)CC_MD4_Final(result, ctx);
}
#elif defined(USE_WIN32_CRYPTO)
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 213/282: ci/tests: some MacOS builds randomly take longer than 20min, (continued)
- [gnurl] 213/282: ci/tests: some MacOS builds randomly take longer than 20min, gnunet, 2020/04/01
- [gnurl] 199/282: mime: latch last read callback status., gnunet, 2020/04/01
- [gnurl] 204/282: Revert "mime: do not perform more than one read in a row", gnunet, 2020/04/01
- [gnurl] 222/282: sha256: Tidy up following recent changes, gnunet, 2020/04/01
- [gnurl] 221/282: sha256: Added WinCrypt implementation, gnunet, 2020/04/01
- [gnurl] 223/282: configure.ac: Disable metalink if mbedTLS is specified, gnunet, 2020/04/01
- [gnurl] 216/282: curl_escape.3: Add a link to curl_free, gnunet, 2020/04/01
- [gnurl] 219/282: sha256: Added mbedtls implementation, gnunet, 2020/04/01
- [gnurl] 225/282: Revert "sha256: Added SecureTransport implementation", gnunet, 2020/04/01
- [gnurl] 209/282: ci/tests: fine-tune Azure Pipeline timeouts with a small puffer, gnunet, 2020/04/01
- [gnurl] 214/282: md4: use init/update/final functions in Secure Transport,
gnunet <=
- [gnurl] 220/282: sha256: Added SecureTransport implementation, gnunet, 2020/04/01
- [gnurl] 224/282: dist: include tests/azure.pm in the tarball, gnunet, 2020/04/01
- [gnurl] 217/282: sha256: Added GNU TLS Nettle implementation, gnunet, 2020/04/01
- [gnurl] 200/282: mime: do not perform more than one read in a row, gnunet, 2020/04/01
- [gnurl] 218/282: sha256: Added GNU TLS gcrypt implementation, gnunet, 2020/04/01
- [gnurl] 215/282: curl_getenv.3: Fix the memory handling description, gnunet, 2020/04/01
- [gnurl] 211/282: http: mark POSTs with no body as "upload done" from the start, gnunet, 2020/04/01
- [gnurl] 212/282: multi_wait: stop loop when sread() returns zero, gnunet, 2020/04/01
- [gnurl] 227/282: ci/tests: Move CI test result creation above environment setup, gnunet, 2020/04/01
- [gnurl] 228/282: README.md: add Azure DevOps Pipelines build status badge, gnunet, 2020/04/01