Skip to content

Commit 8fdf832

Browse files
author
Patrick Monnerat
committed
vtls/*: deprecate have_curlssl_md5sum and set-up default md5sum implementation
1 parent 476499c commit 8fdf832

File tree

6 files changed

+10
-18
lines changed

6 files changed

+10
-18
lines changed

lib/vtls/curl_darwinssl.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ void Curl_darwinssl_md5sum(unsigned char *tmp, /* input */
5151
unsigned char *md5sum, /* output */
5252
size_t md5len);
5353

54-
/* this backend provides these functions: */
55-
#define have_curlssl_md5sum 1
56-
5754
/* API setup for SecureTransport */
5855
#define curlssl_init() (1)
5956
#define curlssl_cleanup() Curl_nop_stmt

lib/vtls/gtls.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ void Curl_gtls_md5sum(unsigned char *tmp, /* input */
5353
unsigned char *md5sum, /* output */
5454
size_t md5len);
5555

56-
/* this backend provides these functions: */
57-
#define have_curlssl_md5sum 1
58-
5956
/* API setup for GnuTLS */
6057
#define curlssl_init Curl_gtls_init
6158
#define curlssl_cleanup Curl_gtls_cleanup

lib/vtls/nssg.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ void Curl_nss_md5sum(unsigned char *tmp, /* input */
6060
unsigned char *md5sum, /* output */
6161
size_t md5len);
6262

63-
/* this backend provides these functions: */
64-
#define have_curlssl_md5sum 1
65-
6663
/* this backend supports CURLOPT_CERTINFO */
6764
#define have_curlssl_certinfo 1
6865

lib/vtls/openssl.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@ void Curl_ossl_md5sum(unsigned char *tmp, /* input */
7373
unsigned char *md5sum /* output */,
7474
size_t unused);
7575

76-
/* this backend provides these functions: */
77-
#define have_curlssl_md5sum 1
78-
7976
/* this backend supports the CAPATH option */
8077
#define have_curlssl_ca_path 1
8178

lib/vtls/vtls.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
#include "progress.h"
6969
#include "share.h"
7070
#include "timeval.h"
71+
#include "curl_md5.h"
7172

7273
#define _MPRINTF_REPLACE /* use our functions only */
7374
#include <curl/mprintf.h>
@@ -682,14 +683,21 @@ int Curl_ssl_random(struct SessionHandle *data,
682683
return curlssl_random(data, entropy, length);
683684
}
684685

685-
#ifdef have_curlssl_md5sum
686686
void Curl_ssl_md5sum(unsigned char *tmp, /* input */
687687
size_t tmplen,
688688
unsigned char *md5sum, /* output */
689689
size_t md5len)
690690
{
691+
#ifdef curlssl_md5sum
691692
curlssl_md5sum(tmp, tmplen, md5sum, md5len);
692-
}
693+
#else
694+
MD5_context *MD5pw;
695+
696+
(void) md5len;
697+
MD5pw = Curl_MD5_init(Curl_DIGEST_MD5);
698+
Curl_MD5_update(MD5pw, tmp, tmplen);
699+
Curl_MD5_final(MD5pw, md5sum);
693700
#endif
701+
}
694702

695703
#endif /* USE_SSL */

lib/vtls/vtls.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,6 @@ void Curl_ssl_md5sum(unsigned char *tmp, /* input */
112112

113113
#define SSL_SHUTDOWN_TIMEOUT 10000 /* ms */
114114

115-
#ifdef have_curlssl_md5sum
116-
#define HAVE_CURL_SSL_MD5SUM
117-
#endif
118-
119115
#else
120116
/* When SSL support is not present, just define away these function calls */
121117
#define Curl_ssl_init() 1

0 commit comments

Comments
 (0)