From 414903481ca37c9ebc0f71e2e040f673c2897c24 Mon Sep 17 00:00:00 2001 From: oepen Date: Mon, 8 Aug 2011 12:43:57 +0000 Subject: [PATCH] Removed duplicate method git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@485 96b47cad-a561-4643-ad3b-153ac7d7599c --- .../src/vpicc/virtualsmartcard/SEutils.py | 1 + .../vpicc/virtualsmartcard/SmartcardSAM.py | 30 ++++--------------- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/virtualsmartcard/src/vpicc/virtualsmartcard/SEutils.py b/virtualsmartcard/src/vpicc/virtualsmartcard/SEutils.py index 376fe9a..95ff36c 100644 --- a/virtualsmartcard/src/vpicc/virtualsmartcard/SEutils.py +++ b/virtualsmartcard/src/vpicc/virtualsmartcard/SEutils.py @@ -87,6 +87,7 @@ class ControlReferenceTemplate: else: self.algorithm = ALGO_MAPPING[data] self.__replace_tag(0x80, data) + return SW["NORMAL"], "" def __set_key(self, tag, value): if tag == 0x81: diff --git a/virtualsmartcard/src/vpicc/virtualsmartcard/SmartcardSAM.py b/virtualsmartcard/src/vpicc/virtualsmartcard/SmartcardSAM.py index 3e7e2a0..48dd9fb 100644 --- a/virtualsmartcard/src/vpicc/virtualsmartcard/SmartcardSAM.py +++ b/virtualsmartcard/src/vpicc/virtualsmartcard/SmartcardSAM.py @@ -446,27 +446,6 @@ class Security_Environment(object): self.internal_auth = False self.externel_auth = False - def mse(self, config): - """ - Manage Security Environment - """ - structure = TLVutils.unpack(config) - for tag, length, value in structure: - if tag == CRT_TEMPLATE["AT"]: - self.at.parse_SE_config(config) - elif tag == CRT_TEMPLATE["CCT"]: - self.cct.parse_SE_config(config) - elif tag == CRT_TEMPLATE["KAT"]: - self.kat.parse_SE_config(config) - elif tag == CRT_TEMPLATE["CT"]: - self.ct.parse_SE_config(config) - elif tag == CRT_TEMPLATE["DST"]: - self.dst.parse_SE_config(config) - else: - raise SwError(SW["ERR_REFNOTUSABLE"]) - - return SW["NORMAL"], "" - class Secure_Messaging(object): def __init__(self, MF, SAM, SE=None): @@ -483,13 +462,12 @@ class Secure_Messaging(object): def manage_security_environment(self, p1, p2, data): """ This method is used to store, restore or erase Security Environments - or to manipualte the various parameters of the current SE. + or to manipulate the various parameters of the current SE. P1 specifies the operation to perform, p2 is either the SEID for the referred SE or the tag of a control reference template - """ - """ P1: - b8 b7 b6 b5 b4 b3 b2 b1 Meaning + P1: + b8 b7 b6 b5 b4 b3 b2 b1 Meaning - - - 1 - - - - Secure messaging in command data field - - 1 - - - - - Secure messaging in response data field - 1 - - - - - - Computation, decipherment, internal @@ -526,6 +504,8 @@ class Secure_Messaging(object): self.__erase_SE(p2) else: raise SwError(SW["ERR_INCORRECTP1P2"]) + + return SW["NORMAL"], "" def __set_SE(self, p2, data): """