From 5556b4b77f9b58ae3f8e8a3b9f5415b4affef009 Mon Sep 17 00:00:00 2001 From: "nelsonb%netscape.com" Date: Sat, 16 Nov 2002 03:30:37 +0000 Subject: [PATCH] Correct HMAC code to work with new larger SHAxxx hashes. --- security/nss/lib/softoken/alghmac.c | 2 +- security/nss/lib/softoken/alghmac.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/security/nss/lib/softoken/alghmac.c b/security/nss/lib/softoken/alghmac.c index a975f3f5aeb7..fb22fbd9c4f5 100644 --- a/security/nss/lib/softoken/alghmac.c +++ b/security/nss/lib/softoken/alghmac.c @@ -62,7 +62,7 @@ HMAC_Create(const SECHashObject *hash_obj, const unsigned char *secret, { HMACContext *cx; unsigned int i; - unsigned char hashed_secret[SHA1_LENGTH]; + unsigned char hashed_secret[HASH_LENGTH_MAX]; /* required by FIPS 198 Section 3 */ if (isFIPS && secret_len < hash_obj->length/2) { diff --git a/security/nss/lib/softoken/alghmac.h b/security/nss/lib/softoken/alghmac.h index 121917438f46..fe1ff59d275a 100644 --- a/security/nss/lib/softoken/alghmac.h +++ b/security/nss/lib/softoken/alghmac.h @@ -43,8 +43,7 @@ extern void HMAC_Destroy(HMACContext *cx); /* create HMAC context - * hash_alg the algorithm with which the HMAC is performed. This - * should be, SEC_OID_MD5, SEC_OID_SHA1, or SEC_OID_MD2. + * hashObj hash object from SECRawHashObjects[] * secret the secret with which the HMAC is performed. * secret_len the length of the secret. * isFIPS true if conforming to FIPS 198.