cURL / Mailing Lists / curl-library / Single Mail

curl-library

[PATCH] fixup! tool_metalink: allow to use hash algorithms provided by NSS

From: Kamil Dudka <kdudka_at_redhat.com>
Date: Tue, 30 Oct 2012 16:49:09 +0100

---
 src/tool_metalink.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/tool_metalink.c b/src/tool_metalink.c
index d8b32d0..b1e465d 100644
--- a/src/tool_metalink.c
+++ b/src/tool_metalink.c
@@ -288,7 +288,7 @@ static void MD5_Update(MD5_CTX *pctx,
 
 static void MD5_Final(unsigned char digest[16], MD5_CTX *pctx)
 {
-  nss_hash_final(pctx, digest, sizeof digest);
+  nss_hash_final(pctx, digest, 16);
 }
 
 static int SHA1_Init(SHA_CTX *pctx)
@@ -305,7 +305,7 @@ static void SHA1_Update(SHA_CTX *pctx,
 
 static void SHA1_Final(unsigned char digest[20], SHA_CTX *pctx)
 {
-  nss_hash_final(pctx, digest, sizeof digest);
+  nss_hash_final(pctx, digest, 20);
 }
 
 static int SHA256_Init(SHA256_CTX *pctx)
@@ -322,7 +322,7 @@ static void SHA256_Update(SHA256_CTX *pctx,
 
 static void SHA256_Final(unsigned char digest[32], SHA256_CTX *pctx)
 {
-  nss_hash_final(pctx, digest, sizeof digest);
+  nss_hash_final(pctx, digest, 32);
 }
 
 #elif defined(_WIN32) && !defined(USE_SSLEAY)
-- 
1.7.1
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-10-30