summaryrefslogtreecommitdiff
path: root/lib/vtls
diff options
context:
space:
mode:
authorPatrick Monnerat <pm@datasphere.ch>2014-10-13 14:39:50 +0200
committerPatrick Monnerat <pm@datasphere.ch>2014-10-13 14:39:50 +0200
commit8fdf832e5fa39bccab8825f95f7c46b54e12f6fb (patch)
treed9bfd78d16d63e16c1133b254498f8d0ee98476a /lib/vtls
parent476499c75c83ffa3d65da398b5759a5f2fdb980d (diff)
downloadcurl-8fdf832e5fa39bccab8825f95f7c46b54e12f6fb.tar.gz
vtls/*: deprecate have_curlssl_md5sum and set-up default md5sum implementation
Diffstat (limited to 'lib/vtls')
-rw-r--r--lib/vtls/curl_darwinssl.h3
-rw-r--r--lib/vtls/gtls.h3
-rw-r--r--lib/vtls/nssg.h3
-rw-r--r--lib/vtls/openssl.h3
-rw-r--r--lib/vtls/vtls.c12
-rw-r--r--lib/vtls/vtls.h4
6 files changed, 10 insertions, 18 deletions
diff --git a/lib/vtls/curl_darwinssl.h b/lib/vtls/curl_darwinssl.h
index f5c03d838..bcb1c741d 100644
--- a/lib/vtls/curl_darwinssl.h
+++ b/lib/vtls/curl_darwinssl.h
@@ -51,9 +51,6 @@ void Curl_darwinssl_md5sum(unsigned char *tmp, /* input */
unsigned char *md5sum, /* output */
size_t md5len);
-/* this backend provides these functions: */
-#define have_curlssl_md5sum 1
-
/* API setup for SecureTransport */
#define curlssl_init() (1)
#define curlssl_cleanup() Curl_nop_stmt
diff --git a/lib/vtls/gtls.h b/lib/vtls/gtls.h
index cd6152ca1..6e07735e8 100644
--- a/lib/vtls/gtls.h
+++ b/lib/vtls/gtls.h
@@ -53,9 +53,6 @@ void Curl_gtls_md5sum(unsigned char *tmp, /* input */
unsigned char *md5sum, /* output */
size_t md5len);
-/* this backend provides these functions: */
-#define have_curlssl_md5sum 1
-
/* API setup for GnuTLS */
#define curlssl_init Curl_gtls_init
#define curlssl_cleanup Curl_gtls_cleanup
diff --git a/lib/vtls/nssg.h b/lib/vtls/nssg.h
index 81e794902..5b97464b5 100644
--- a/lib/vtls/nssg.h
+++ b/lib/vtls/nssg.h
@@ -60,9 +60,6 @@ void Curl_nss_md5sum(unsigned char *tmp, /* input */
unsigned char *md5sum, /* output */
size_t md5len);
-/* this backend provides these functions: */
-#define have_curlssl_md5sum 1
-
/* this backend supports CURLOPT_CERTINFO */
#define have_curlssl_certinfo 1
diff --git a/lib/vtls/openssl.h b/lib/vtls/openssl.h
index 59adcd83e..7eff3deea 100644
--- a/lib/vtls/openssl.h
+++ b/lib/vtls/openssl.h
@@ -73,9 +73,6 @@ void Curl_ossl_md5sum(unsigned char *tmp, /* input */
unsigned char *md5sum /* output */,
size_t unused);
-/* this backend provides these functions: */
-#define have_curlssl_md5sum 1
-
/* this backend supports the CAPATH option */
#define have_curlssl_ca_path 1
diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c
index cd910d8f9..bd1af0133 100644
--- a/lib/vtls/vtls.c
+++ b/lib/vtls/vtls.c
@@ -68,6 +68,7 @@
#include "progress.h"
#include "share.h"
#include "timeval.h"
+#include "curl_md5.h"
#define _MPRINTF_REPLACE /* use our functions only */
#include <curl/mprintf.h>
@@ -682,14 +683,21 @@ int Curl_ssl_random(struct SessionHandle *data,
return curlssl_random(data, entropy, length);
}
-#ifdef have_curlssl_md5sum
void Curl_ssl_md5sum(unsigned char *tmp, /* input */
size_t tmplen,
unsigned char *md5sum, /* output */
size_t md5len)
{
+#ifdef curlssl_md5sum
curlssl_md5sum(tmp, tmplen, md5sum, md5len);
-}
+#else
+ MD5_context *MD5pw;
+
+ (void) md5len;
+ MD5pw = Curl_MD5_init(Curl_DIGEST_MD5);
+ Curl_MD5_update(MD5pw, tmp, tmplen);
+ Curl_MD5_final(MD5pw, md5sum);
#endif
+}
#endif /* USE_SSL */
diff --git a/lib/vtls/vtls.h b/lib/vtls/vtls.h
index 3fd0adc38..217b1d358 100644
--- a/lib/vtls/vtls.h
+++ b/lib/vtls/vtls.h
@@ -112,10 +112,6 @@ void Curl_ssl_md5sum(unsigned char *tmp, /* input */
#define SSL_SHUTDOWN_TIMEOUT 10000 /* ms */
-#ifdef have_curlssl_md5sum
-#define HAVE_CURL_SSL_MD5SUM
-#endif
-
#else
/* When SSL support is not present, just define away these function calls */
#define Curl_ssl_init() 1