From c6f61aa3ebe98a1d32f39e3076a1885d069ed4e0 Mon Sep 17 00:00:00 2001 From: Frank Morgner Date: Wed, 21 Nov 2012 17:42:40 +0100 Subject: [PATCH] adapted to changes of OpenPACE Now works with OpenPACE 5182c69ee9dfe4ad7787d4f513d467d81a1f27ed --- npa/src/npa.c | 13 +++---------- .../src/vpicc/virtualsmartcard/cards/nPA.py | 2 +- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/npa/src/npa.c b/npa/src/npa.c index fd9a64e..fee1f4f 100644 --- a/npa/src/npa.c +++ b/npa/src/npa.c @@ -1660,8 +1660,7 @@ int perform_terminal_authentication(struct sm_ctx *ctx, sc_card_t *card, } - if (!EAC_CTX_init_ta(eacsmctx->ctx, privkey, privkey_len, cert, cert_len, - NULL, 0)) { + if (!EAC_CTX_init_ta(eacsmctx->ctx, privkey, privkey_len, cert, cert_len)) { sc_debug(card->ctx, SC_LOG_DEBUG_VERBOSE, "Could not initialize TA."); ssl_error(card->ctx); r = SC_ERROR_INTERNAL; @@ -2336,14 +2335,8 @@ npa_sm_pre_transmit(sc_card_t *card, const struct sm_ctx *ctx, if (msesetat->key_reference1 && msesetat->key_reference1->data && msesetat->key_reference1->length) { - if (!EAC_CTX_init_ta(eacsmctx->ctx, NULL, 0, NULL, 0, - msesetat->key_reference1->data, - msesetat->key_reference1->length)) { - sc_debug(card->ctx, SC_LOG_DEBUG_VERBOSE, "Could not initialize TA.\n"); - ssl_error(card->ctx); - r = SC_ERROR_INTERNAL; - goto err; - } + /* do nothing. The trust anchor matching this CAR will be + * looked up when the certificate chain is imported */ } } } else if (apdu->ins == 0x82 && apdu->p1 == 0x00 && apdu->p2 == 0x00) { diff --git a/virtualsmartcard/src/vpicc/virtualsmartcard/cards/nPA.py b/virtualsmartcard/src/vpicc/virtualsmartcard/cards/nPA.py index 93602e0..b8ce442 100644 --- a/virtualsmartcard/src/vpicc/virtualsmartcard/cards/nPA.py +++ b/virtualsmartcard/src/vpicc/virtualsmartcard/cards/nPA.py @@ -306,7 +306,7 @@ class nPA_SE(Security_Environment): result.append([0x87, len(self.car), self.car]) if (self.disable_checks): pace.TA_disable_checks(self.eac_ctx) - if not pace.EAC_CTX_init_ta(self.eac_ctx, None, self.cvca, self.car): + if not pace.EAC_CTX_init_ta(self.eac_ctx, None, self.cvca): pace.print_ossl_err() raise SwError(SW["WARN_NOINFO63"])