From: Steve Holme Date: Thu, 20 Feb 2020 01:41:01 +0000 (+0000) Subject: sha256: Added SecureTransport implementation X-Git-Tag: curl-7_69_0~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4feb38deed33fed14ff7c370a6a9153c661dbb9c;p=thirdparty%2Fcurl.git sha256: Added SecureTransport implementation --- diff --git a/lib/sha256.c b/lib/sha256.c index db7e642de3..10ad44b493 100644 --- a/lib/sha256.c +++ b/lib/sha256.c @@ -148,6 +148,37 @@ static void SHA256_Final(unsigned char *digest, SHA256_CTX *ctx) #endif } +#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 + +#include "curl_memory.h" + +/* The last #include file should be: */ +#include "memdebug.h" + +typedef CC_SHA256_CTX SHA256_CTX; + +static void SHA256_Init(SHA256_CTX *ctx) +{ + (void) CC_SHA224_Init(ctx); +} + +static void SHA256_Update(SHA256_CTX *ctx, + const unsigned char *data, + unsigned int length) +{ + (void) CC_SHA256_Update(ctx, data, length); +} + +static void SHA256_Final(unsigned char *digest, SHA256_CTX *ctx) +{ + (void) CC_SHA256_Final(digest, ctx); +} + #else /* When no other crypto library is available we use this code segment */