From bc6822351a6f797a82abc7ea09e80f3051d0f2e1 Mon Sep 17 00:00:00 2001 From: frankmorgner Date: Mon, 23 Jan 2012 10:41:12 +0000 Subject: [PATCH] fixed calculation of bertlv coded data for authentication git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@687 96b47cad-a561-4643-ad3b-153ac7d7599c --- virtualsmartcard/src/vpicc/virtualsmartcard/SEutils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/virtualsmartcard/src/vpicc/virtualsmartcard/SEutils.py b/virtualsmartcard/src/vpicc/virtualsmartcard/SEutils.py index 3fbaea9..4c20f96 100644 --- a/virtualsmartcard/src/vpicc/virtualsmartcard/SEutils.py +++ b/virtualsmartcard/src/vpicc/virtualsmartcard/SEutils.py @@ -290,7 +290,7 @@ class Security_Environment(object): tag, length, value = tlv if tag % 2 == 1: #Include object in checksum calculation - to_authenticate += inttostring(tag) + inttostring(length) + value + to_authenticate += bertlv_pack([[tag, length, value]]) #SM data objects for encapsulating plain values if tag in (SM_Class["PLAIN_VALUE_NO_TLV"], @@ -392,8 +392,9 @@ class Security_Environment(object): p2 = CAPDU.p2 if le == None: le = CAPDU.le - if expected != "": - raise SwError(SW["ERR_SECMESSOBJECTSMISSING"]) + # FIXME + #if expected != "": + #raise SwError(SW["ERR_SECMESSOBJECTSMISSING"]) c = C_APDU(cla=cla, ins=ins, p1=p1, p2=p2, le=le, data="".join(return_data)) return c