]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
vtls/*: deprecate have_curlssl_md5sum and set-up default md5sum implementation
authorPatrick Monnerat <pm@datasphere.ch>
Mon, 13 Oct 2014 12:39:50 +0000 (14:39 +0200)
committerPatrick Monnerat <pm@datasphere.ch>
Mon, 13 Oct 2014 12:39:50 +0000 (14:39 +0200)
lib/vtls/curl_darwinssl.h
lib/vtls/gtls.h
lib/vtls/nssg.h
lib/vtls/openssl.h
lib/vtls/vtls.c
lib/vtls/vtls.h

index f5c03d8388c4fd1830e8f7e28a9b6ead846a3722..bcb1c741d12ea45effd32860372513988c2d8b04 100644 (file)
@@ -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
index cd6152ca1eee24ad9ac786c405ecb2b6223dbd80..6e07735e8c703002735dfb82e6977b907d20143e 100644 (file)
@@ -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
index 81e794902266a2b7db039725b0b71cec229e78af..5b97464b5d6d80fda8a72803ccc91d14462d23ab 100644 (file)
@@ -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
 
index 59adcd83e9c54384ca31897a6481eff7acd31082..7eff3deeabe0e6789d9ae641baa966a9d6d1317f 100644 (file)
@@ -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
 
index cd910d8f9b146833d80600e1d60e2ce0f64ce431..bd1af013394bfa779dfe06b35d4319ca24064dd3 100644 (file)
@@ -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 */
index 3fd0adc384d58e89dfc70eecaa4a4eb7448170de..217b1d358cd71c2cbda4e48c3c224f2c9a383a1b 100644 (file)
@@ -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