mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-30 15:40:59 +02:00
multi: refactor SignDigest into SignMessage
To make it possible to use a remote signrpc server as a signer for our wallet, we need to change our main interface to sign the message instead of the message's digest. Otherwise we'd need to alter the signrpc.SignMessage RPC to accept a digest instead of only the message which has security implications.
This commit is contained in:
@@ -191,10 +191,10 @@ type SecretKeyRing interface {
|
||||
// DigestSignerRing is an interface that abstracts away basic low-level ECDSA
|
||||
// signing on keys within a key ring.
|
||||
type DigestSignerRing interface {
|
||||
// SignDigest signs the given SHA256 message digest with the private key
|
||||
// described in the key descriptor.
|
||||
SignDigest(keyDesc KeyDescriptor, digest [32]byte) (*btcec.Signature,
|
||||
error)
|
||||
// SignMessage signs the given message, single or double SHA256 hashing
|
||||
// it first, with the private key described in the key descriptor.
|
||||
SignMessage(keyDesc KeyDescriptor, message []byte,
|
||||
doubleHash bool) (*btcec.Signature, error)
|
||||
|
||||
// SignDigestCompact signs the given SHA256 message digest with the
|
||||
// private key described in the key descriptor and returns the signature
|
||||
@@ -209,9 +209,9 @@ type SingleKeyDigestSigner interface {
|
||||
// PubKey returns the public key of the wrapped private key.
|
||||
PubKey() *btcec.PublicKey
|
||||
|
||||
// SignDigest signs the given SHA256 message digest with the wrapped
|
||||
// private key.
|
||||
SignDigest(digest [32]byte) (*btcec.Signature, error)
|
||||
// SignMessage signs the given message, single or double SHA256 hashing
|
||||
// it first, with the wrapped private key.
|
||||
SignMessage(message []byte, doubleHash bool) (*btcec.Signature, error)
|
||||
|
||||
// SignDigestCompact signs the given SHA256 message digest with the
|
||||
// wrapped private key and returns the signature in the compact, public
|
||||
|
Reference in New Issue
Block a user