client: reject malformed server public keys

Loop-in and loop-out responses carry compressed server public keys that are copied into fixed-size fields and later used for HTLC construction. Validate the length and parse each compressed key before storing it, and validate the MuSig2 loop-in receiver internal key as well.

This turns short or unparsable server keys into explicit errors instead of silently zero-padding short responses or accepting an invalid internal key. Update root test mocks to return size-correct MuSig2 signing data under the stricter checks.
This commit is contained in:
Slyghtning 2026-05-27 12:27:27 +02:00
parent 605e72a261
commit cc0392af3f
No known key found for this signature in database
GPG key ID: F82D456EA023C9BF
4 changed files with 80 additions and 16 deletions

View file

@ -67,7 +67,7 @@ func mockMuSig2SignSweep(ctx context.Context,
prevoutMap map[wire.OutPoint]*wire.TxOut) (
[]byte, []byte, error) {
return nil, nil, nil
return mockMuSig2SigningData()
}
func newSwapClient(t *testing.T, config *clientConfig) *Client {