Skip to content

Commit

Permalink
When DEBUG=1, log why we fail to log in to a token
Browse files Browse the repository at this point in the history
Use PORT_ErrorToName() to let us print an error name instead of an error
code in a couple of debug messages, since in practice we just end up
looking up the code in <secerr.h> anyway.
  • Loading branch information
nalind authored and greghudson committed May 10, 2013
1 parent 88fe4c4 commit 333d3ac
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/plugins/preauth/pkinit/pkinit_crypto_nss.c
Original file line number Diff line number Diff line change
Expand Up @@ -1911,8 +1911,9 @@ cert_load_ca_certs_from_slot(krb5_context context,
__FUNCTION__, PK11_GetTokenName(slot));
if (PK11_Authenticate(slot, PR_TRUE,
crypto_pwcb_prep(id, context)) != SECSuccess) {
pkiDebug("%s: error logging into \"%s\", skipping\n",
__FUNCTION__, PK11_GetTokenName(slot));
pkiDebug("%s: error logging into \"%s\": %s, skipping\n",
__FUNCTION__, PK11_GetTokenName(slot),
PORT_ErrorToName(PORT_GetError()));
return SECFailure;
}
}
Expand Down Expand Up @@ -1983,8 +1984,9 @@ cert_load_certs_with_keys_from_slot(krb5_context context,
if (PK11_Authenticate(slot, PR_TRUE,
crypto_pwcb_prep(id_cryptoctx,
context)) != SECSuccess) {
pkiDebug("%s: error logging into \"%s\", skipping\n",
__FUNCTION__, PK11_GetTokenName(slot));
pkiDebug("%s: error logging into \"%s\": %s, skipping\n",
__FUNCTION__, PK11_GetTokenName(slot),
PORT_ErrorToName(PORT_GetError()));
return ENOMEM;
}
}
Expand Down

0 comments on commit 333d3ac

Please sign in to comment.