From 2c40f837c7812fce54c59fcc301dd5995f1200ef Mon Sep 17 00:00:00 2001 From: frankmorgner Date: Sun, 12 Feb 2012 20:55:00 +0000 Subject: [PATCH] removed manipulation of ef_card_security since this would require the complete public point instead of the compressed public point git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@716 96b47cad-a561-4643-ad3b-153ac7d7599c --- .../src/vpicc/virtualsmartcard/cards/nPA.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/virtualsmartcard/src/vpicc/virtualsmartcard/cards/nPA.py b/virtualsmartcard/src/vpicc/virtualsmartcard/cards/nPA.py index fe9b893..2f9805f 100644 --- a/virtualsmartcard/src/vpicc/virtualsmartcard/cards/nPA.py +++ b/virtualsmartcard/src/vpicc/virtualsmartcard/cards/nPA.py @@ -201,14 +201,19 @@ class nPA_SE(Security_Environment): pace.EAC_CTX_init_ca(self.eac_ctx, pace.id_CA_ECDH_AES_CBC_CMAC_128, 13, None, None) # we don't have a good CA key, so we simply generate an ephemeral one - pubkey = pace.buf2string(pace.TA_STEP3_generate_ephemeral_key(self.eac_ctx)) - if not pubkey: + comp_pubkey = pace.buf2string(pace.TA_STEP3_generate_ephemeral_key(self.eac_ctx)) + if not comp_pubkey: pace.print_ossl_err() raise SwError(SW["WARN_NOINFO63"]) - ef_card_security = self.mf.select('fid', 0x011d) - ef_card_security_data = ef_card_security.getenc('data') - ef_card_security_data = ef_card_security_data[:61+4+239+2+2] + pubkey + ef_card_security_data[61+4+239+2+2+len(pubkey):] - ef_card_security.setdec('data', ef_card_security_data) + #pubkey = pace.some_function_to_get_the_complete_public_point_for_ca_including_prefixed_04(self.eac_ctx) + #ef_card_security = self.mf.select('fid', 0x011d) + #ef_card_security_data = ef_card_security.getenc('data') + #ef_card_security_data = ef_card_security_data[:61+4+239+2+2-1] + pubkey + ef_card_security_data[61+4+239+2+2-1+len(pubkey):] + #ef_card_security.setdec('data', ef_card_security_data) + + nonce = pace.PACE_STEP1_enc_nonce(self.eac_ctx, self.sec) + print hexdump(nonce) + resp = nPA_SE.__pack_general_authenticate([[0x80, len(nonce), nonce]]) self.eac_step += 1