Bug 453735 - When using cert9 (SQLite3) DB, set or change master password fails

r=wtc
sr=nelson


git-svn-id: svn://10.0.0.236/trunk@256932 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rrelyea%redhat.com 2009-04-15 21:34:39 +00:00
parent 7df6c971b8
commit a416798509

View File

@ -686,6 +686,16 @@ sftkdb_HasPasswordSet(SFTKDBHandle *keydb)
value.data = valueData;
value.len = sizeof(valueData);
crv = (*db->sdb_GetMetaData)(db, "password", &salt, &value);
/* If no password is set, we can update right away */
if (((keydb->db->sdb_flags & SDB_RDONLY) == 0) && keydb->update
&& crv != CKR_OK) {
/* update the peer certdb if it exists */
if (keydb->peerDB) {
sftkdb_Update(keydb->peerDB, NULL);
}
sftkdb_Update(keydb, NULL);
}
return (crv == CKR_OK) ? SECSuccess : SECFailure;
}