summaryrefslogtreecommitdiff
path: root/otp2289/server.py
diff options
context:
space:
mode:
Diffstat (limited to 'otp2289/server.py')
-rw-r--r--otp2289/server.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/otp2289/server.py b/otp2289/server.py
index 7322727..d0c3e01 100644
--- a/otp2289/server.py
+++ b/otp2289/server.py
@@ -79,7 +79,7 @@ class OTPState:
79 self._hash_algo = OTPGenerator.validate_hash_algo(hash_algo) 79 self._hash_algo = OTPGenerator.validate_hash_algo(hash_algo)
80 self._step = OTPGenerator.validate_step(current_step) 80 self._step = OTPGenerator.validate_step(current_step)
81 except OTPGeneratorException as exp: 81 except OTPGeneratorException as exp:
82 raise OTPStateException(exp.args[0]) 82 raise OTPStateException(exp.args[0]) from None
83 self._current_digest = None 83 self._current_digest = None
84 if ot_hex is not None: 84 if ot_hex is not None:
85 self._current_digest = self.validate_hex(ot_hex) 85 self._current_digest = self.validate_hex(ot_hex)
@@ -166,7 +166,7 @@ class OTPState:
166 return OTPState.validate_hex(response) 166 return OTPState.validate_hex(response)
167 except OTPStateException: 167 except OTPStateException:
168 raise OTPInvalidResponse( 168 raise OTPInvalidResponse(
169 'The response is neither a valid token or hex') 169 'The response is neither a valid token or hex') from None
170 170
171 @staticmethod 171 @staticmethod
172 def validate_hex(ot_hex): 172 def validate_hex(ot_hex):
@@ -192,7 +192,7 @@ class OTPState:
192 try: 192 try:
193 return binascii.unhexlify(ot_hex) 193 return binascii.unhexlify(ot_hex)
194 except binascii.Error: 194 except binascii.Error:
195 raise OTPStateException('Invalid OT-hex') 195 raise OTPStateException('Invalid OT-hex') from None
196 196
197 def get_next_state(self): 197 def get_next_state(self):
198 """ 198 """