From de1378f78022e9a4d67c8fa03f51d39e2692e07f Mon Sep 17 00:00:00 2001 From: Frank Morgner Date: Wed, 21 Nov 2012 19:26:09 +0100 Subject: [PATCH] always declare extended length capabilities allows usage of an unpatched version of OpenPACE. libnpa now works with the nPA using the default card driver. --- npa/src/npa.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/npa/src/npa.c b/npa/src/npa.c index 08eb16b..73f06e6 100644 --- a/npa/src/npa.c +++ b/npa/src/npa.c @@ -1252,9 +1252,16 @@ int EstablishPACEChannel(struct sm_ctx *oldnpactx, sc_card_t *card, goto err; } } + bin_log(card->ctx, SC_LOG_DEBUG_NORMAL, "EF.CardAccess", pace_output->ef_cardaccess, pace_output->ef_cardaccess_length); + /* XXX Card capabilities should be determined by the OpenSC card driver. We + * set it here to be able to use the nPA without patching OpenSC. By + * now we have read the EF.CardAccess so the assumption to have an nPA + * seems valid. */ + card->caps |= SC_CARD_CAP_APDU_EXT; + eac_ctx = EAC_CTX_new(); if (!eac_ctx || !EAC_CTX_init_ef_cardaccess(pace_output->ef_cardaccess,