From bfcd6dafbbb55b0c75a8731f86013201e9622969 Mon Sep 17 00:00:00 2001 From: frankmorgner Date: Thu, 3 Jun 2010 22:17:18 +0000 Subject: [PATCH] added error messages git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@128 96b47cad-a561-4643-ad3b-153ac7d7599c --- ccid/src/sm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ccid/src/sm.c b/ccid/src/sm.c index 4044d57..3e38f24 100644 --- a/ccid/src/sm.c +++ b/ccid/src/sm.c @@ -498,6 +498,7 @@ static int sm_decrypt(const struct sm_ctx *ctx, sc_card_t *card, if (r < 0) goto err; } else { + sc_error(card->ctx, "Cryptographic Checksum missing"); r = SC_ERROR_ASN1_OBJECT_NOT_FOUND; goto err; } @@ -514,8 +515,10 @@ static int sm_decrypt(const struct sm_ctx *ctx, sc_card_t *card, buf_len = r; r = no_padding(ctx->padding_indicator, data, buf_len); - if (r < 0) + if (r < 0) { + sc_error(card->ctx, "Could not remove padding"); goto err; + } if (apdu->resplen < r) { sc_error(card->ctx, "Response of SM APDU too long"); @@ -537,6 +540,7 @@ static int sm_decrypt(const struct sm_ctx *ctx, sc_card_t *card, apdu->sw1 = sw[0]; apdu->sw2 = sw[1]; } else { + sc_error(card->ctx, "Authenticated status bytes are missing"); r = SC_ERROR_ASN1_OBJECT_NOT_FOUND; goto err; }