diff --git a/virtualsmartcard/src/vpicc/virtualsmartcard/SmartcardSAM.py b/virtualsmartcard/src/vpicc/virtualsmartcard/SmartcardSAM.py index 30ceb75..325c993 100644 --- a/virtualsmartcard/src/vpicc/virtualsmartcard/SmartcardSAM.py +++ b/virtualsmartcard/src/vpicc/virtualsmartcard/SmartcardSAM.py @@ -591,10 +591,6 @@ class Security_Environment(object): for tlv in structure: tag, length, value = tlv - #Sanity checking - if not SM_Class.has_key(tag): - raise SwError(SW["ERR_SECMESSOBJECTSINCORRECT"]) - if tag % 2 == 1: #Include object in checksum calculation to_authenticate += inttostring(tag) + inttostring(length) + value @@ -621,6 +617,8 @@ class Security_Environment(object): ins = value[2:4] p1 = value[4:6] p2 = value[6:8] + else: + raise SwError(SW["ERR_SECMESSOBJECTSINCORRECT"]) #SM data objects for confidentiality if tag in (SM_Class["CRYPTOGRAM_PLAIN_TLV_INCLUDING_SM"],