summaryrefslogtreecommitdiff
path: root/python/genkat_aead.py
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@airbus.com>2019-03-14 16:30:27 +0100
committerKévin Le Gouguec <kevin.legouguec@airbus.com>2019-03-21 14:49:15 +0100
commita7abd1a33ca68e2e2db59332b612db69ffb31496 (patch)
tree4be62ec7b31c8ae636454e3c67c0fd41a747e453 /python/genkat_aead.py
parent417ac09668ea124245dbac0084608d9c396f5a76 (diff)
downloadlilliput-ae-implem-a7abd1a33ca68e2e2db59332b612db69ffb31496.tar.xz
[implem-python] Gestion de l'échec de déchiffrement dans genkat_aead
Ce serait mieux si l'API renvoyait une exception… Un jour.
Diffstat (limited to 'python/genkat_aead.py')
-rwxr-xr-xpython/genkat_aead.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/genkat_aead.py b/python/genkat_aead.py
index 6d7ca51..5bce05f 100755
--- a/python/genkat_aead.py
+++ b/python/genkat_aead.py
@@ -28,8 +28,8 @@ class DecryptionError(Exception):
def __str__(self):
return '({s.mode} / {s.keylen}) Expected {exp}; got {act}'.format(
s=self,
- exp=bstr(self.expected),
- act=bstr(self.actual)
+ exp=bstr(self.expected) if self.expected is not None else 'NONE',
+ act=bstr(self.actual) if self.actual is not None else 'NONE'
)