Bug 397122, NSS 3.12 alpha treats a key3.db with no global salt as having no password
authornelson%bolyard.com
Tue, 25 Sep 2007 01:14:23 +0000
changeset 8071 2797a7211742a5ad490da860b0990eeded569a6f
parent 8070 6218e806ff64463ab7934eae01193669f607b4ae
child 8072 c13e8eb5fca49049c1d3e27920525ffaf7b22e61
push idunknown
push userunknown
push dateunknown
bugs397122
Bug 397122, NSS 3.12 alpha treats a key3.db with no global salt as having no password r=rrelyea
security/nss/lib/softoken/legacydb/keydb.c
--- a/security/nss/lib/softoken/legacydb/keydb.c
+++ b/security/nss/lib/softoken/legacydb/keydb.c
@@ -1357,27 +1357,28 @@ loser:
 static SECStatus
 nsslowkey_GetPWCheckEntry(NSSLOWKEYDBHandle *handle,NSSLOWKEYPasswordEntry *entry)
 {
     DBT checkkey; /*, checkdata; */
     NSSLOWKEYDBKey *dbkey = NULL;
     SECItem   *global_salt = NULL; 
     SECItem   *item = NULL; 
     SECItem   entryData, oid;
+    SECItem   none = { siBuffer, NULL, 0 };
     SECStatus rv = SECFailure;
     SECOidTag algorithm;
 
     if (handle == NULL) {
 	/* PORT_SetError */
 	return(SECFailure);
     }
 
     global_salt = GetKeyDBGlobalSalt(handle);
     if (!global_salt) {
-	return SECFailure;
+	global_salt = &none;
     }
     if (global_salt->len > sizeof(entry->data)) {
 	/* PORT_SetError */
 	goto loser;
     }
 	
     PORT_Memcpy(entry->data, global_salt->data, global_salt->len);
     entry->salt.data = entry->data;