summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornelsonb%netscape.com <devnull@localhost>2002-11-16 03:32:39 +0000
committernelsonb%netscape.com <devnull@localhost>2002-11-16 03:32:39 +0000
commit63e455047a8195fd93a67f90ff98840c430d83eb (patch)
tree402d7dec0819b49a9f0c8e72e71b08a3a202b0c3
parent4fae03b347f0785e3406b17a771680ea52930d18 (diff)
downloadnss-hg-63e455047a8195fd93a67f90ff98840c430d83eb.tar.gz
Correct softoken routines to work with new larger SHAxxx hashes.
-rw-r--r--security/nss/lib/softoken/lowpbe.c2
-rw-r--r--security/nss/lib/softoken/pkcs11i.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/security/nss/lib/softoken/lowpbe.c b/security/nss/lib/softoken/lowpbe.c
index cc43639cd..be7e06e89 100644
--- a/security/nss/lib/softoken/lowpbe.c
+++ b/security/nss/lib/softoken/lowpbe.c
@@ -116,8 +116,8 @@ nsspkcs5_PBKDF1(const SECHashObject *hashObj, SECItem *salt, SECItem *pwd,
rv = SECFailure;
/* allocate buffers */
- hash->data = (unsigned char *)PORT_ZAlloc(SHA1_LENGTH);
hash->len = hashObj->length;
+ hash->data = (unsigned char *)PORT_ZAlloc(hash->len);
pre_hash->data = (unsigned char *)PORT_ZAlloc(ph_len);
/* in pbeSHA1TripleDESCBC there was an allocation error that made
diff --git a/security/nss/lib/softoken/pkcs11i.h b/security/nss/lib/softoken/pkcs11i.h
index ef783b918..ae92816b3 100644
--- a/security/nss/lib/softoken/pkcs11i.h
+++ b/security/nss/lib/softoken/pkcs11i.h
@@ -297,8 +297,8 @@ typedef enum {
#define PK11_MAX_BLOCK_SIZE 16
-/* currently SHA1 is the biggest hash length */
-#define PK11_MAX_MAC_LENGTH 20
+/* currently SHA512 is the biggest hash length */
+#define PK11_MAX_MAC_LENGTH 64
#define PK11_INVALID_MAC_SIZE 0xffffffff
struct PK11SessionContextStr {