Support Signify-based signatures
http://www.openbsd.org/papers/bsdcan-signify.html
This commit is contained in:
@@ -98,6 +98,11 @@ class Trezor(interface.Device):
|
||||
return result
|
||||
|
||||
def sign(self, identity, blob):
|
||||
"""Sign given blob and return the signature (as bytes)."""
|
||||
sig, _ = self.sign_with_pubkey(identity, blob)
|
||||
return sig
|
||||
|
||||
def sign_with_pubkey(self, identity, blob):
|
||||
"""Sign given blob and return the signature (as bytes)."""
|
||||
curve_name = identity.get_curve_name(ecdh=False)
|
||||
log.debug('"%s" signing %r (%s) on %s',
|
||||
@@ -112,7 +117,7 @@ class Trezor(interface.Device):
|
||||
log.debug('result: %s', result)
|
||||
assert len(result.signature) == 65
|
||||
assert result.signature[:1] == b'\x00'
|
||||
return bytes(result.signature[1:])
|
||||
return bytes(result.signature[1:]), bytes(result.public_key)
|
||||
except self._defs.TrezorFailure as e:
|
||||
msg = '{} error: {}'.format(self, e)
|
||||
log.debug(msg, exc_info=True)
|
||||
|
||||
Reference in New Issue
Block a user