From e99979fab1d5bc6cae24dd4c95e7476a8d49e90c Mon Sep 17 00:00:00 2001 From: Frank Morgner Date: Fri, 5 Oct 2012 10:58:17 +0200 Subject: [PATCH] debug the result from CA's general authenticate --- npa/src/npa.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/npa/src/npa.c b/npa/src/npa.c index 486a6c4..1ddef21 100644 --- a/npa/src/npa.c +++ b/npa/src/npa.c @@ -1889,6 +1889,10 @@ int perform_chip_authentication(struct sm_ctx *ctx, sc_card_t *card) goto err; } r = npa_gen_auth_ca(ctx, card, eph_pub_key, &nonce, &token); + if (r < 0) { + sc_debug(card->ctx, SC_LOG_DEBUG_VERBOSE, "(General Authenticate failed)."); + goto err; + } if (!CA_STEP4_compute_shared_secret(eacsmctx->ctx, picc_pubkey)) { @@ -1899,7 +1903,7 @@ int perform_chip_authentication(struct sm_ctx *ctx, sc_card_t *card) } - if (r < 0 || !CA_STEP6_derive_keys(eacsmctx->ctx, nonce, token)) { + if (!CA_STEP6_derive_keys(eacsmctx->ctx, nonce, token)) { sc_debug(card->ctx, SC_LOG_DEBUG_VERBOSE, "Could not derive keys."); ssl_error(card->ctx); r = SC_ERROR_INTERNAL;