From 8fdcfa3a45b995ae4195b7636d46dd392e22e170 Mon Sep 17 00:00:00 2001 From: frankmorgner Date: Wed, 8 Dec 2010 12:01:04 +0000 Subject: [PATCH] adapted to the latest changes of OpenPACE git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@369 96b47cad-a561-4643-ad3b-153ac7d7599c --- npa/src/pace.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/npa/src/pace.c b/npa/src/pace.c index 9bc287c..7f2b105 100644 --- a/npa/src/pace.c +++ b/npa/src/pace.c @@ -1091,6 +1091,15 @@ int EstablishPACEChannel(struct sm_ctx *oldpacectx, sc_card_t *card, goto err; } + pctx = PACE_CTX_new(); + if (!pctx || !PACE_init(pctx, &static_dp, info)) { + sc_error(card->ctx, "Could not initialize PACE parameters."); + ssl_error(card->ctx); + r = SC_ERROR_INTERNAL; + goto err; + } + pctx->tr_version = PACE_TR_VERSION_2_02; + r = pace_mse_set_at(oldpacectx, card, info->protocol, pace_input.pin_id, chat, &pace_output->mse_set_at_sw1, &pace_output->mse_set_at_sw2); if (r < 0) { @@ -1122,12 +1131,6 @@ int EstablishPACEChannel(struct sm_ctx *oldpacectx, sc_card_t *card, r = SC_ERROR_INTERNAL; goto err; } - pctx = PACE_CTX_new(); - if (!pctx || !PACE_CTX_init(pctx, info)) { - r = SC_ERROR_INTERNAL; - goto err; - } - pctx->tr_version = PACE_TR_VERSION_2_01; nonce = PACE_STEP2_dec_nonce(sec, enc_nonce, pctx);