diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-02-01 23:02:06 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-02-02 08:13:09 +0100 |
commit | 2c4b338f7e45f1ef8d13211a1730f167014c0c58 (patch) | |
tree | 09240aab3b67f90ee31901e162407edb205e365c /lib/vtls | |
parent | a0c5781cb65833aa4ece492fa5f37dd1511d051b (diff) | |
download | curl-2c4b338f7e45f1ef8d13211a1730f167014c0c58.tar.gz |
vtls: remove md5sum
As it is not used anymore.
Reported-by: Jacob Hoffman-Andrews
Bug: https://curl.se/mail/lib-2021-02/0000.html
Closes #6557
Diffstat (limited to 'lib/vtls')
-rw-r--r-- | lib/vtls/bearssl.c | 14 | ||||
-rw-r--r-- | lib/vtls/gskit.c | 1 | ||||
-rw-r--r-- | lib/vtls/gtls.c | 21 | ||||
-rw-r--r-- | lib/vtls/mbedtls.c | 1 | ||||
-rw-r--r-- | lib/vtls/mesalink.c | 1 | ||||
-rw-r--r-- | lib/vtls/nss.c | 19 | ||||
-rw-r--r-- | lib/vtls/openssl.c | 20 | ||||
-rw-r--r-- | lib/vtls/schannel.c | 10 | ||||
-rw-r--r-- | lib/vtls/sectransp.c | 11 | ||||
-rw-r--r-- | lib/vtls/vtls.c | 40 | ||||
-rw-r--r-- | lib/vtls/vtls.h | 9 | ||||
-rw-r--r-- | lib/vtls/wolfssl.c | 1 |
12 files changed, 0 insertions, 148 deletions
diff --git a/lib/vtls/bearssl.c b/lib/vtls/bearssl.c index 8dd262ed0..29b08c0e6 100644 --- a/lib/vtls/bearssl.c +++ b/lib/vtls/bearssl.c @@ -827,19 +827,6 @@ static void bearssl_session_free(void *ptr) free(ptr); } -static CURLcode bearssl_md5sum(unsigned char *input, - size_t inputlen, - unsigned char *md5sum, - size_t md5len UNUSED_PARAM) -{ - br_md5_context ctx; - - br_md5_init(&ctx); - br_md5_update(&ctx, input, inputlen); - br_md5_out(&ctx, md5sum); - return CURLE_OK; -} - static CURLcode bearssl_sha256sum(const unsigned char *input, size_t inputlen, unsigned char *sha256sum, @@ -876,7 +863,6 @@ const struct Curl_ssl Curl_ssl_bearssl = { Curl_none_set_engine_default, Curl_none_engines_list, Curl_none_false_start, - bearssl_md5sum, bearssl_sha256sum }; diff --git a/lib/vtls/gskit.c b/lib/vtls/gskit.c index 0095a2071..9b5f649f7 100644 --- a/lib/vtls/gskit.c +++ b/lib/vtls/gskit.c @@ -1282,7 +1282,6 @@ const struct Curl_ssl Curl_ssl_gskit = { Curl_none_set_engine_default, /* set_engine_default */ Curl_none_engines_list, /* engines_list */ Curl_none_false_start, /* false_start */ - Curl_none_md5sum, /* md5sum */ NULL /* sha256sum */ }; diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index 27c8a0536..3ddee1974 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -1618,26 +1618,6 @@ static CURLcode gtls_random(struct Curl_easy *data, return CURLE_OK; } -static CURLcode gtls_md5sum(unsigned char *tmp, /* input */ - size_t tmplen, - unsigned char *md5sum, /* output */ - size_t md5len) -{ -#if defined(USE_GNUTLS_NETTLE) - struct md5_ctx MD5pw; - md5_init(&MD5pw); - md5_update(&MD5pw, (unsigned int)tmplen, tmp); - md5_digest(&MD5pw, (unsigned int)md5len, md5sum); -#elif defined(USE_GNUTLS) - gcry_md_hd_t MD5pw; - gcry_md_open(&MD5pw, GCRY_MD_MD5, 0); - gcry_md_write(MD5pw, tmp, tmplen); - memcpy(md5sum, gcry_md_read(MD5pw, 0), md5len); - gcry_md_close(MD5pw); -#endif - return CURLE_OK; -} - static CURLcode gtls_sha256sum(const unsigned char *tmp, /* input */ size_t tmplen, unsigned char *sha256sum, /* output */ @@ -1699,7 +1679,6 @@ const struct Curl_ssl Curl_ssl_gnutls = { Curl_none_set_engine_default, /* set_engine_default */ Curl_none_engines_list, /* engines_list */ Curl_none_false_start, /* false_start */ - gtls_md5sum, /* md5sum */ gtls_sha256sum /* sha256sum */ }; diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c index 4ebd8af7d..fc3a948d1 100644 --- a/lib/vtls/mbedtls.c +++ b/lib/vtls/mbedtls.c @@ -1108,7 +1108,6 @@ const struct Curl_ssl Curl_ssl_mbedtls = { Curl_none_set_engine_default, /* set_engine_default */ Curl_none_engines_list, /* engines_list */ Curl_none_false_start, /* false_start */ - Curl_none_md5sum, /* md5sum */ mbedtls_sha256sum /* sha256sum */ }; diff --git a/lib/vtls/mesalink.c b/lib/vtls/mesalink.c index af1d55e10..b6d1005ec 100644 --- a/lib/vtls/mesalink.c +++ b/lib/vtls/mesalink.c @@ -662,7 +662,6 @@ const struct Curl_ssl Curl_ssl_mesalink = { Curl_none_set_engine_default, /* set_engine_default */ Curl_none_engines_list, /* engines_list */ Curl_none_false_start, /* false_start */ - Curl_none_md5sum, /* md5sum */ NULL /* sha256sum */ }; diff --git a/lib/vtls/nss.c b/lib/vtls/nss.c index d1357a97f..e5ab71cdf 100644 --- a/lib/vtls/nss.c +++ b/lib/vtls/nss.c @@ -2370,24 +2370,6 @@ static CURLcode nss_random(struct Curl_easy *data, return CURLE_OK; } -static CURLcode nss_md5sum(unsigned char *tmp, /* input */ - size_t tmplen, - unsigned char *md5sum, /* output */ - size_t md5len) -{ - PK11Context *MD5pw = PK11_CreateDigestContext(SEC_OID_MD5); - unsigned int MD5out; - - if(!MD5pw) - return CURLE_NOT_BUILT_IN; - - PK11_DigestOp(MD5pw, tmp, curlx_uztoui(tmplen)); - PK11_DigestFinal(MD5pw, md5sum, &MD5out, curlx_uztoui(md5len)); - PK11_DestroyContext(MD5pw, PR_TRUE); - - return CURLE_OK; -} - static CURLcode nss_sha256sum(const unsigned char *tmp, /* input */ size_t tmplen, unsigned char *sha256sum, /* output */ @@ -2462,7 +2444,6 @@ const struct Curl_ssl Curl_ssl_nss = { Curl_none_set_engine_default, /* set_engine_default */ Curl_none_engines_list, /* engines_list */ nss_false_start, /* false_start */ - nss_md5sum, /* md5sum */ nss_sha256sum /* sha256sum */ }; diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index de4c33d96..784d9f70e 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -4413,25 +4413,6 @@ static CURLcode ossl_random(struct Curl_easy *data, return (rc == 1 ? CURLE_OK : CURLE_FAILED_INIT); } -static CURLcode ossl_md5sum(unsigned char *tmp, /* input */ - size_t tmplen, - unsigned char *md5sum /* output */, - size_t unused) -{ - EVP_MD_CTX *mdctx; - unsigned int len = 0; - (void) unused; - - mdctx = EVP_MD_CTX_create(); - if(!mdctx) - return CURLE_OUT_OF_MEMORY; - EVP_DigestInit(mdctx, EVP_md5()); - EVP_DigestUpdate(mdctx, tmp, tmplen); - EVP_DigestFinal_ex(mdctx, md5sum, &len); - EVP_MD_CTX_destroy(mdctx); - return CURLE_OK; -} - #if (OPENSSL_VERSION_NUMBER >= 0x0090800fL) && !defined(OPENSSL_NO_SHA256) static CURLcode ossl_sha256sum(const unsigned char *tmp, /* input */ size_t tmplen, @@ -4504,7 +4485,6 @@ const struct Curl_ssl Curl_ssl_openssl = { ossl_set_engine_default, /* set_engine_default */ ossl_engines_list, /* engines_list */ Curl_none_false_start, /* false_start */ - ossl_md5sum, /* md5sum */ #if (OPENSSL_VERSION_NUMBER >= 0x0090800fL) && !defined(OPENSSL_NO_SHA256) ossl_sha256sum /* sha256sum */ #else diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index 5a35eb21e..0668f98f2 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -2383,15 +2383,6 @@ static void schannel_checksum(const unsigned char *input, CryptReleaseContext(hProv, 0); } -static CURLcode schannel_md5sum(unsigned char *input, - size_t inputlen, - unsigned char *md5sum, - size_t md5len) -{ - schannel_checksum(input, inputlen, md5sum, md5len, PROV_RSA_FULL, CALG_MD5); - return CURLE_OK; -} - static CURLcode schannel_sha256sum(const unsigned char *input, size_t inputlen, unsigned char *sha256sum, @@ -2435,7 +2426,6 @@ const struct Curl_ssl Curl_ssl_schannel = { Curl_none_set_engine_default, /* set_engine_default */ Curl_none_engines_list, /* engines_list */ Curl_none_false_start, /* false_start */ - schannel_md5sum, /* md5sum */ schannel_sha256sum /* sha256sum */ }; diff --git a/lib/vtls/sectransp.c b/lib/vtls/sectransp.c index dfe3d28f4..9a8f7de8d 100644 --- a/lib/vtls/sectransp.c +++ b/lib/vtls/sectransp.c @@ -3132,16 +3132,6 @@ static CURLcode sectransp_random(struct Curl_easy *data UNUSED_PARAM, return CURLE_OK; } -static CURLcode sectransp_md5sum(unsigned char *tmp, /* input */ - size_t tmplen, - unsigned char *md5sum, /* output */ - size_t md5len) -{ - (void)md5len; - (void)CC_MD5(tmp, (CC_LONG)tmplen, md5sum); - return CURLE_OK; -} - static CURLcode sectransp_sha256sum(const unsigned char *tmp, /* input */ size_t tmplen, unsigned char *sha256sum, /* output */ @@ -3319,7 +3309,6 @@ const struct Curl_ssl Curl_ssl_sectransp = { Curl_none_set_engine_default, /* set_engine_default */ Curl_none_engines_list, /* engines_list */ sectransp_false_start, /* false_start */ - sectransp_md5sum, /* md5sum */ sectransp_sha256sum /* sha256sum */ }; diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index e32773b0c..b8ab7494f 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -1036,16 +1036,6 @@ CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data, return result; } -#ifndef CURL_DISABLE_CRYPTO_AUTH -CURLcode Curl_ssl_md5sum(unsigned char *tmp, /* input */ - size_t tmplen, - unsigned char *md5sum, /* output */ - size_t md5len) -{ - return Curl_ssl->md5sum(tmp, tmplen, md5sum, md5len); -} -#endif - /* * Check whether the SSL backend supports the status_request extension. */ @@ -1156,35 +1146,6 @@ bool Curl_none_false_start(void) return FALSE; } -#ifndef CURL_DISABLE_CRYPTO_AUTH -CURLcode Curl_none_md5sum(unsigned char *input, size_t inputlen, - unsigned char *md5sum, size_t md5len UNUSED_PARAM) -{ - struct MD5_context *MD5pw; - - (void)md5len; - - MD5pw = Curl_MD5_init(Curl_DIGEST_MD5); - if(!MD5pw) - return CURLE_OUT_OF_MEMORY; - Curl_MD5_update(MD5pw, input, curlx_uztoui(inputlen)); - Curl_MD5_final(MD5pw, md5sum); - return CURLE_OK; -} -#else -CURLcode Curl_none_md5sum(unsigned char *input UNUSED_PARAM, - size_t inputlen UNUSED_PARAM, - unsigned char *md5sum UNUSED_PARAM, - size_t md5len UNUSED_PARAM) -{ - (void)input; - (void)inputlen; - (void)md5sum; - (void)md5len; - return CURLE_NOT_BUILT_IN; -} -#endif - static int multissl_init(void) { if(multissl_setup(NULL)) @@ -1248,7 +1209,6 @@ static const struct Curl_ssl Curl_ssl_multi = { Curl_none_set_engine_default, /* set_engine_default */ Curl_none_engines_list, /* engines_list */ Curl_none_false_start, /* false_start */ - Curl_none_md5sum, /* md5sum */ NULL /* sha256sum */ }; diff --git a/lib/vtls/vtls.h b/lib/vtls/vtls.h index 8c4bcce35..9666682ec 100644 --- a/lib/vtls/vtls.h +++ b/lib/vtls/vtls.h @@ -73,9 +73,6 @@ struct Curl_ssl { struct curl_slist *(*engines_list)(struct Curl_easy *data); bool (*false_start)(void); - - CURLcode (*md5sum)(unsigned char *input, size_t inputlen, - unsigned char *md5sum, size_t md5sumlen); CURLcode (*sha256sum)(const unsigned char *input, size_t inputlen, unsigned char *sha256sum, size_t sha256sumlen); }; @@ -100,8 +97,6 @@ CURLcode Curl_none_set_engine_default(struct Curl_easy *data); struct curl_slist *Curl_none_engines_list(struct Curl_easy *data); bool Curl_none_false_start(void); bool Curl_ssl_tls13_ciphersuites(void); -CURLcode Curl_none_md5sum(unsigned char *input, size_t inputlen, - unsigned char *md5sum, size_t md5len); #include "openssl.h" /* OpenSSL versions */ #include "gtls.h" /* GnuTLS versions */ @@ -258,10 +253,6 @@ void Curl_ssl_delsessionid(struct Curl_easy *data, void *ssl_sessionid); /* get N random bytes into the buffer */ CURLcode Curl_ssl_random(struct Curl_easy *data, unsigned char *buffer, size_t length); -CURLcode Curl_ssl_md5sum(unsigned char *tmp, /* input */ - size_t tmplen, - unsigned char *md5sum, /* output */ - size_t md5len); /* Check pinned public key. */ CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data, const char *pinnedpubkey, diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index 4d2b05af5..e1fa45926 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -1160,7 +1160,6 @@ const struct Curl_ssl Curl_ssl_wolfssl = { Curl_none_set_engine_default, /* set_engine_default */ Curl_none_engines_list, /* engines_list */ Curl_none_false_start, /* false_start */ - Curl_none_md5sum, /* md5sum */ wolfssl_sha256sum /* sha256sum */ }; |