raise a SW error on failed decryption

This commit is contained in:
Frank Morgner
2013-07-09 07:10:18 +02:00
parent a082227347
commit 8c1694f5b4

View File

@@ -337,7 +337,10 @@ class SAM(object):
Parse a command APDU protected by Secure Messaging and return the
unprotected command APDU
"""
return self.current_SE.parse_SM_CAPDU(CAPDU, header_authentication)
try:
return self.current_SE.parse_SM_CAPDU(CAPDU, header_authentication)
except:
raise SwError(SW["ERR_SECMESSOBJECTSINCORRECT"])
def protect_result(self, sw, unprotected_result):
"""