mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-17 14:14:22 +01:00
sign_recoverable can raise a ValueError, handling it.
This commit is contained in:
@@ -281,10 +281,15 @@ class Cryptographer:
|
||||
logger.error("The value passed as sk is not a private key (EllipticCurvePrivateKey)")
|
||||
return None
|
||||
|
||||
try:
|
||||
rsig_rid = sk.sign_recoverable(LN_MESSAGE_PREFIX + message, hasher=sha256d)
|
||||
sigrec = sigrec_encode(rsig_rid)
|
||||
zb32_sig = pyzbase32.encode_bytes(sigrec).decode()
|
||||
|
||||
except ValueError:
|
||||
logger.error("Couldn't sign the message")
|
||||
return None
|
||||
|
||||
return zb32_sig
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user