From: Greg Hudson Date: Fri, 11 Mar 2011 17:47:21 +0000 (+0000) Subject: Fix NSS PBKDF2 in the v4 salt (i.e. empty salt) case X-Git-Tag: krb5-1.10-alpha1~536 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=16007fbb9361745cef2a9c322e0b7e1ec2b9d77a;p=krb5.git Fix NSS PBKDF2 in the v4 salt (i.e. empty salt) case git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24700 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/crypto/nss/pbkdf2.c b/src/lib/crypto/nss/pbkdf2.c index 9a0d4fd66..10272c8d2 100644 --- a/src/lib/crypto/nss/pbkdf2.c +++ b/src/lib/crypto/nss/pbkdf2.c @@ -62,8 +62,9 @@ krb5int_pbkdf2_hmac_sha1(const krb5_data *out, unsigned long count, if (slot == NULL) return k5_nss_map_last_error(); + /* NSS treats a null saltItem.data as a request for a random salt. */ saltItem.type = siBuffer; - saltItem.data = (unsigned char *)salt->data; + saltItem.data = (salt->data == NULL) ? "" : (unsigned char *)salt->data; saltItem.len = salt->length; /* PKCS 5 was designed to be DER encoded. Algid's carry all the