Skip to content

Commit

Permalink
bug 136806, don't authenticate to friendly slots when adding certs
Browse files Browse the repository at this point in the history
  • Loading branch information
ian.mcgreer%sun.com committed Apr 12, 2002
1 parent 4f3224e commit 9061f89
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions security/nss/cmd/certutil/certutil.c
Expand Up @@ -340,10 +340,12 @@ AddCert(PK11SlotInfo *slot, CERTCertDBHandle *handle, char *name, char *trusts,
if ( emailcert )
CERT_SaveSMimeProfile(tempCert, NULL, NULL);
#else
rv = PK11_Authenticate(slot, PR_TRUE, pwdata);
if (rv != SECSuccess) {
SECU_PrintError(progName, "could authenticate to token or database");
GEN_BREAK(SECFailure);
if (!PK11_IsFriendly(slot)) {
rv = PK11_Authenticate(slot, PR_TRUE, pwdata);
if (rv != SECSuccess) {
SECU_PrintError(progName, "could authenticate to token or database");
GEN_BREAK(SECFailure);
}
}

rv = PK11_ImportCert(slot, cert, CK_INVALID_HANDLE, name, PR_FALSE);
Expand Down

0 comments on commit 9061f89

Please sign in to comment.