bug 106570, prompt for master password when opening context menu, r=sgehani, sr=alecf

This commit is contained in:
morse%netscape.com 2001-10-30 21:48:08 +00:00
Родитель 7c2d86b4f3
Коммит e7d817061c
1 изменённых файлов: 10 добавлений и 0 удалений

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

@ -712,6 +712,16 @@ PRIVATE nsresult DecryptString (const char * crypt, char *& text) {
/* use SecretDecoderRing if crypt doesn't starts with prefix */
if (crypt[0] != PREFIX[0]) {
if (!SI_GetBoolPref(pref_Crypto, PR_FALSE)) {
/*
* User's data is encrypted but pref says it's not.
* This should never occur but it has been observed.
* Consequence of it happening is that user will be asked for master password
* when doing such mundane things as opening edit menu or context menu.
*/
NS_ASSERTION(PR_FALSE, "wallet.crypto pref is set incorrectly");
return NS_ERROR_FAILURE;
}
nsresult rv = wallet_CryptSetup();
if (NS_SUCCEEDED(rv)) {
rv = gSecretDecoderRing->DecryptString(crypt, &text);