[27753] in CVS-changelog-for-Kerberos-V5

home help back first fref pref prev next nref lref last post

krb5 commit: When DEBUG=1, log why we fail to log in to a token

daemon@ATHENA.MIT.EDU (Greg Hudson)
Mon May 13 02:01:01 2013

Date: Mon, 13 May 2013 02:00:06 -0400
From: Greg Hudson <ghudson@mit.edu>
Message-Id: <201305130600.r4D606bV011051@drugstore.mit.edu>
To: cvs-krb5@mit.edu
Reply-To: krbdev@mit.edu
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu

https://github.com/krb5/krb5/commit/333d3acefc8ca386fa006dd7aa5fdacb48d5b088
commit 333d3acefc8ca386fa006dd7aa5fdacb48d5b088
Author: Nalin Dahyabhai <nalin@dahyabhai.net>
Date:   Wed Apr 24 13:52:23 2013 -0400

    When DEBUG=1, log why we fail to log in to a token
    
    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.

 src/plugins/preauth/pkinit/pkinit_crypto_nss.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/plugins/preauth/pkinit/pkinit_crypto_nss.c b/src/plugins/preauth/pkinit/pkinit_crypto_nss.c
index f9e9b97..b1f0473 100644
--- a/src/plugins/preauth/pkinit/pkinit_crypto_nss.c
+++ b/src/plugins/preauth/pkinit/pkinit_crypto_nss.c
@@ -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;
         }
     }
@@ -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;
         }
     }
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5

home help back first fref pref prev next nref lref last post