Removed duplicate method
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@485 96b47cad-a561-4643-ad3b-153ac7d7599c
This commit is contained in:
@@ -87,6 +87,7 @@ class ControlReferenceTemplate:
|
|||||||
else:
|
else:
|
||||||
self.algorithm = ALGO_MAPPING[data]
|
self.algorithm = ALGO_MAPPING[data]
|
||||||
self.__replace_tag(0x80, data)
|
self.__replace_tag(0x80, data)
|
||||||
|
return SW["NORMAL"], ""
|
||||||
|
|
||||||
def __set_key(self, tag, value):
|
def __set_key(self, tag, value):
|
||||||
if tag == 0x81:
|
if tag == 0x81:
|
||||||
|
|||||||
@@ -446,27 +446,6 @@ class Security_Environment(object):
|
|||||||
self.internal_auth = False
|
self.internal_auth = False
|
||||||
self.externel_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):
|
class Secure_Messaging(object):
|
||||||
|
|
||||||
def __init__(self, MF, SAM, SE=None):
|
def __init__(self, MF, SAM, SE=None):
|
||||||
@@ -483,13 +462,12 @@ class Secure_Messaging(object):
|
|||||||
def manage_security_environment(self, p1, p2, data):
|
def manage_security_environment(self, p1, p2, data):
|
||||||
"""
|
"""
|
||||||
This method is used to store, restore or erase Security Environments
|
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
|
P1 specifies the operation to perform, p2 is either the SEID for the
|
||||||
referred SE or the tag of a control reference template
|
referred SE or the tag of a control reference template
|
||||||
"""
|
|
||||||
|
|
||||||
""" P1:
|
P1:
|
||||||
b8 b7 b6 b5 b4 b3 b2 b1 Meaning
|
b8 b7 b6 b5 b4 b3 b2 b1 Meaning
|
||||||
- - - 1 - - - - Secure messaging in command data field
|
- - - 1 - - - - Secure messaging in command data field
|
||||||
- - 1 - - - - - Secure messaging in response data field
|
- - 1 - - - - - Secure messaging in response data field
|
||||||
- 1 - - - - - - Computation, decipherment, internal
|
- 1 - - - - - - Computation, decipherment, internal
|
||||||
@@ -527,6 +505,8 @@ class Secure_Messaging(object):
|
|||||||
else:
|
else:
|
||||||
raise SwError(SW["ERR_INCORRECTP1P2"])
|
raise SwError(SW["ERR_INCORRECTP1P2"])
|
||||||
|
|
||||||
|
return SW["NORMAL"], ""
|
||||||
|
|
||||||
def __set_SE(self, p2, data):
|
def __set_SE(self, p2, data):
|
||||||
"""
|
"""
|
||||||
Manipulate the current Security Environment. P2 is the tag of a
|
Manipulate the current Security Environment. P2 is the tag of a
|
||||||
|
|||||||
Reference in New Issue
Block a user