summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormcgreer%netscape.com <devnull@localhost>2001-02-22 23:35:17 +0000
committermcgreer%netscape.com <devnull@localhost>2001-02-22 23:35:17 +0000
commit34b2c4361e9c6637343121ca29744bbf433f9f86 (patch)
tree1ba076854c966e2d4f787aa3fc7d094318842521
parent3f9f0d1086c04fa2151904f803464080667f983b (diff)
downloadnss-hg-34b2c4361e9c6637343121ca29744bbf433f9f86.tar.gz
fix for #63982, -o not using file password
-rw-r--r--security/nss/cmd/pk12util/pk12util.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/security/nss/cmd/pk12util/pk12util.c b/security/nss/cmd/pk12util/pk12util.c
index 1e3f1b003..5ae08c509 100644
--- a/security/nss/cmd/pk12util/pk12util.c
+++ b/security/nss/cmd/pk12util/pk12util.c
@@ -686,6 +686,18 @@ P12U_ExportPKCS12Object(char *nn, char *outfile,
return;
}
+ if (!cert->slot) {
+ fprintf(stderr, "%s: cert does not have a slot.\n", progName);
+ pk12uErrno = PK12UERR_FINDCERTBYNN;
+ goto loser;
+ }
+ if (P12U_InitSlot(cert->slot, slotPw) != SECSuccess) {
+ fprintf(stderr, "%s: Failed to authenticate to \"%s\".\n",
+ progName, PK11_GetSlotName(cert->slot));
+ pk12uErrno = PK12UERR_PK11GETSLOT;
+ goto loser;
+ }
+
/* Password to use for PKCS12 file. */
pwitem = P12U_GetP12FilePassword(PR_TRUE, p12FilePw);
if(!pwitem) {