summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrelyea%netscape.com <devnull@localhost>2001-03-29 06:28:21 +0000
committerrelyea%netscape.com <devnull@localhost>2001-03-29 06:28:21 +0000
commit1b2c3aec2c43c3050d0008b93008bd2d318a10b1 (patch)
tree23ed7d0140a091f75e13ddfb81128ec4c4d34438
parent7343b1835a3c6f1225c97dfdba13b6d8138291b8 (diff)
downloadnss-hg-1b2c3aec2c43c3050d0008b93008bd2d318a10b1.tar.gz
Sigh, try to get reasonable error messages back to the application. in this
case bad password.
-rw-r--r--security/nss/lib/pkcs12/p12d.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/security/nss/lib/pkcs12/p12d.c b/security/nss/lib/pkcs12/p12d.c
index f822a7778..9abae13c8 100644
--- a/security/nss/lib/pkcs12/p12d.c
+++ b/security/nss/lib/pkcs12/p12d.c
@@ -703,6 +703,9 @@ sec_pkcs12_decoder_safe_contents_callback(void *arg, const char *buf,
/* update the decoder */
rv = SEC_ASN1DecoderUpdate(safeContentsCtx->safeContentsDcx, buf, len);
if(rv != SECSuccess) {
+ /* if we fail while trying to decode a 'safe', it's probably because
+ * we didn't have the correct password. */
+ PORT_SetError(SEC_ERROR_BAD_PASSWORD);
p12dcx->errorValue = SEC_ERROR_PKCS12_CORRUPT_PFX_STRUCTURE;
goto loser;
}