Skip to content

Commit aaf4f27

Browse files
committed
signer: allow passing nil keyLocator to DeriveSharedKey
Previously if the `keyLocaltor` argument was unset `DeriveSharedKey` would crash.
1 parent fe0bdd6 commit aaf4f27

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

signer_client.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,10 +533,13 @@ func (s *signerClient) DeriveSharedKey(ctx context.Context,
533533

534534
rpcIn := &signrpc.SharedKeyRequest{
535535
EphemeralPubkey: ephemeralPubKey.SerializeCompressed(),
536-
KeyLoc: &signrpc.KeyLocator{
536+
}
537+
538+
if keyLocator != nil {
539+
rpcIn.KeyLoc = &signrpc.KeyLocator{
537540
KeyFamily: int32(keyLocator.Family),
538541
KeyIndex: int32(keyLocator.Index),
539-
},
542+
}
540543
}
541544

542545
rpcCtx = s.signerMac.WithMacaroonAuth(rpcCtx)

0 commit comments

Comments
 (0)