summaryrefslogtreecommitdiff
path: root/lib/md5.c
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2009-02-12 20:48:40 +0000
committerDan Fandrich <dan@coneharvesters.com>2009-02-12 20:48:40 +0000
commit9a4c887c4a7279acc4cae66b11540746244e9cc3 (patch)
tree395649682d8b46f2a83c5f12d5fa772cb5517180 /lib/md5.c
parentde41c6ef4344ff7135274a0481e11c3c1a38a0d5 (diff)
downloadcurl-9a4c887c4a7279acc4cae66b11540746244e9cc3.tar.gz
Added support for Digest and NTLM authentication using GnuTLS.
Diffstat (limited to 'lib/md5.c')
-rw-r--r--lib/md5.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/lib/md5.c b/lib/md5.c
index 965578004..8f2a38dd1 100644
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -27,6 +27,24 @@
#include <string.h>
+#include "curl_md5.h"
+
+#ifdef USE_GNUTLS
+
+#include <gcrypt.h>
+
+void Curl_md5it(unsigned char *outbuffer, /* 16 bytes */
+ const unsigned char *input)
+{
+ gcry_md_hd_t ctx;
+ gcry_md_open(&ctx, GCRY_MD_MD5, 0);
+ gcry_md_write(ctx, input, (unsigned int)strlen((char *)input));
+ memcpy (outbuffer, gcry_md_read (ctx, 0), 16);
+ gcry_md_close(ctx);
+}
+
+#else
+
#ifdef USE_SSLEAY
/* When OpenSSL is available we use the MD5-function from OpenSSL */
@@ -341,8 +359,6 @@ static void Decode (UINT4 *output,
#endif /* USE_SSLEAY */
-#include "curl_md5.h"
-
void Curl_md5it(unsigned char *outbuffer, /* 16 bytes */
const unsigned char *input)
{
@@ -352,4 +368,6 @@ void Curl_md5it(unsigned char *outbuffer, /* 16 bytes */
MD5_Final(outbuffer, &ctx);
}
-#endif
+#endif /* USE_GNUTLS */
+
+#endif /* CURL_DISABLE_CRYPTO_AUTH */