diff options
author | Daniel Stenberg <daniel@haxx.se> | 2012-06-26 14:52:46 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2012-06-26 19:40:36 +0200 |
commit | 849179ba2739ab9a0ad079384b125d9c1745db5f (patch) | |
tree | 35041f2e915f085cb0c5a87ca6712e97fe43c56c /lib/ssluse.c | |
parent | 6d1ea388cbd9de7f2a944a0c64f5feaec1b1904a (diff) |
SSL cleanup: use crypto functions through the sslgen layer
curl_ntlm_msgs.c would previously use an #ifdef maze and direct
SSL-library calls instead of using the SSL layer we have for this
purpose.
Diffstat (limited to 'lib/ssluse.c')
-rw-r--r-- | lib/ssluse.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/ssluse.c b/lib/ssluse.c index 7a9f3e084..75ed134c5 100644 --- a/lib/ssluse.c +++ b/lib/ssluse.c @@ -62,6 +62,7 @@ #include <openssl/dsa.h> #include <openssl/dh.h> #include <openssl/err.h> +#include <openssl/md5.h> #else #include <rand.h> #include <x509v3.h> @@ -2786,4 +2787,23 @@ size_t Curl_ossl_version(char *buffer, size_t size) #endif /* YASSL_VERSION */ } + +void Curl_ossl_random(struct SessionHandle *data, unsigned char *entropy, + size_t length) +{ + Curl_ossl_seed(data); /* Initiate the seed if not already done */ + RAND_bytes(entropy, length); +} + +void Curl_ossl_md5sum(unsigned char *tmp, /* input */ + size_t tmplen, + unsigned char *md5sum /* output */, + size_t unused) +{ + MD5_CTX MD5pw; + (void)unused; + MD5_Init(&MD5pw); + MD5_Update(&MD5pw, tmp, tmplen); + MD5_Final(md5sum, &MD5pw); +} #endif /* USE_SSLEAY */ |