Correct HMAC code to work with new larger SHAxxx hashes.

This commit is contained in:
nelsonb%netscape.com 2002-11-16 03:30:37 +00:00
Родитель dd4c5651b8
Коммит 5556b4b77f
2 изменённых файлов: 2 добавлений и 3 удалений

Просмотреть файл

@ -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) {

Просмотреть файл

@ -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.