aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-03-03 08:38:09 +0100
committerDaniel Stenberg <daniel@haxx.se>2020-03-03 09:36:40 +0100
commitb572e0be59d2e36b015166897467d0b7284746a8 (patch)
tree95b9492e88d08ed5d80ac38697ff26657dc44e6e
parentc537b00577b650849627470e5f101155f6136b59 (diff)
Revert "sha256: Added SecureTransport implementation"
This reverts commit 4feb38deed33fed14ff7c370a6a9153c661dbb9c (from #4956) That commit broke test 1610 on macos builds without TLS. Closes #5027
-rw-r--r--lib/sha256.c70
1 files changed, 0 insertions, 70 deletions
diff --git a/lib/sha256.c b/lib/sha256.c
index 1ef33148d..97214182b 100644
--- a/lib/sha256.c
+++ b/lib/sha256.c
@@ -161,76 +161,6 @@ 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 <CommonCrypto/CommonDigest.h>
-
-#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);
-}
-
-#elif defined(USE_WIN32_CRYPTO)
-
-#include <wincrypt.h>
-
-typedef struct {
- HCRYPTPROV hCryptProv;
- HCRYPTHASH hHash;
-} SHA256_CTX;
-
-static void SHA256_Init(SHA256_CTX *ctx)
-{
- if(CryptAcquireContext(&ctx->hCryptProv, NULL, NULL,
- PROV_RSA_AES, CRYPT_VERIFYCONTEXT)) {
- CryptCreateHash(ctx->hCryptProv, CALG_SHA_256, 0, 0, &ctx->hHash);
- }
-}
-
-static void SHA256_Update(SHA256_CTX *ctx,
- const unsigned char *data,
- unsigned int length)
-{
- CryptHashData(ctx->hHash, (unsigned char *) data, length, 0);
-}
-
-static void SHA256_Final(unsigned char *digest, SHA256_CTX *ctx)
-{
- unsigned long length;
-
- CryptGetHashParam(ctx->hHash, HP_HASHVAL, NULL, &length, 0);
- if(length == SHA256_DIGEST_LENGTH)
- CryptGetHashParam(ctx->hHash, HP_HASHVAL, digest, &length, 0);
-
- if(ctx->hHash)
- CryptDestroyHash(ctx->hHash);
-
- if(ctx->hCryptProv)
- CryptReleaseContext(ctx->hCryptProv, 0);
-}
-
#else
/* When no other crypto library is available we use this code segment */