From dc3164422ae4c5d54769aee294ceda4a2ead46db Mon Sep 17 00:00:00 2001 From: frankmorgner Date: Wed, 14 Sep 2011 14:24:30 +0000 Subject: [PATCH] added ugly hack to support changing the eID-PIN with AusweisApp git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@529 96b47cad-a561-4643-ad3b-153ac7d7599c --- ccid/src/ccid.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ccid/src/ccid.c b/ccid/src/ccid.c index 27e1039..6e74987 100644 --- a/ccid/src/ccid.c +++ b/ccid/src/ccid.c @@ -1394,6 +1394,27 @@ perform_PC_to_RDR_Secure(const __u8 *in, size_t inlen, __u8** out, size_t *outle break; case SC_APDU_CASE_2_SHORT: apdu.cse = SC_APDU_CASE_4_SHORT; +#ifdef BUERGERCLIENT_WORKAROUND +#ifdef WITH_PACE + /* This is an ugly hack to support the current AusweisApp. + * + * AusweisApp predefines a case 2 apdu, that includes a Le. + * Unfortunately the nPA does only accept Reset Retry Counter + * without secured Le (Le is not specified by BSI TR-03110, p. + * 80). + * In addition AusweisApp predefines a short apdu, which is + * also incompatible with nPA. It accepts only extended length + * APDUs. + * + * Therefor we drop the Le and switch to extended length. + */ + + /* Note that this is only an approximation to find out if we + * have a nPA */ + if (sctx.active) + apdu.cse = SC_APDU_CASE_3_EXT; +#endif +#endif break; case SC_APDU_CASE_2_EXT: apdu.cse = SC_APDU_CASE_4_EXT;