Skip to content

Commit

Permalink
Merge pull request #707 from SUNET/ylle_fix_hasher_info
Browse files Browse the repository at this point in the history
check for return type on info method
  • Loading branch information
johanlundberg authored Oct 8, 2024
2 parents fb88cd7 + fd5eec1 commit 41e5872
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/eduid/vccs/server/hasher.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ def unlock(self, password: str) -> None:
self._yhsm.unlock(unhexlify(password))

def info(self) -> str:
# pyhsm.base.YHSM.info() returns bytes(?)
ret: bytes = self._yhsm.info()
return ret.decode()
if isinstance(ret, bytes):
return ret.decode()
else:
return ret

async def hmac_sha1(self, key_handle: int | None, data: bytes) -> bytes:
"""
Expand Down

0 comments on commit 41e5872

Please sign in to comment.