mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-12 14:12:27 +02:00
multi: refactor SignDigestCompact into SignMessageCompact
To make it possible to use a remote lnrpc 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 lnrpc.SignMessage RPC to accept a digest instead of only the message which has security implications.
This commit is contained in:
@ -1522,7 +1522,7 @@ var (
|
||||
// SignMessage signs a message with the resident node's private key. The
|
||||
// returned signature string is zbase32 encoded and pubkey recoverable, meaning
|
||||
// that only the message digest and signature are needed for verification.
|
||||
func (r *rpcServer) SignMessage(ctx context.Context,
|
||||
func (r *rpcServer) SignMessage(_ context.Context,
|
||||
in *lnrpc.SignMessageRequest) (*lnrpc.SignMessageResponse, error) {
|
||||
|
||||
if in.Msg == nil {
|
||||
@ -1530,7 +1530,9 @@ func (r *rpcServer) SignMessage(ctx context.Context,
|
||||
}
|
||||
|
||||
in.Msg = append(signedMsgPrefix, in.Msg...)
|
||||
sigBytes, err := r.server.nodeSigner.SignCompact(in.Msg)
|
||||
sigBytes, err := r.server.nodeSigner.SignMessageCompact(
|
||||
in.Msg, !in.SingleHash,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user