diff --git a/channeld/channeld.c b/channeld/channeld.c index c05a22015..63c81ddad 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -3218,8 +3218,6 @@ static void resume_splice_negotiation(struct peer *peer, struct wally_psbt *current_psbt = inflight->psbt; struct commitsig *their_commit; const struct witness **outws; - u8 der[73]; - size_t der_len; struct bitcoin_signature splice_sig; struct bitcoin_tx *bitcoin_tx; u32 splice_funding_index; @@ -3331,9 +3329,7 @@ static void resume_splice_negotiation(struct peer *peer, fmt_wally_psbt(tmpctx, current_psbt)); txsig_tlvs = tlv_txsigs_tlvs_new(tmpctx); - der_len = signature_to_der(der, &splice_sig); - txsig_tlvs->funding_outpoint_sig = tal_dup_arr(tmpctx, u8, der, - der_len, 0); + txsig_tlvs->shared_input_signature = &splice_sig.s; /* DTODO: is this finalize call required? */ psbt_finalize(current_psbt); @@ -3422,21 +3418,8 @@ static void resume_splice_negotiation(struct peer *peer, /* BOLT-a8b9f495cac28124c69cc5ee429f9ef2bacb9921 #2: * Both nodes: * - MUST sign the transaction using SIGHASH_ALL */ - their_sig->sighash_type = SIGHASH_ALL; - - if (!signature_from_der(their_txsigs_tlvs->funding_outpoint_sig, - tal_count(their_txsigs_tlvs->funding_outpoint_sig), - their_sig)) { - - tal_free(their_txsigs_tlvs); - peer_failed_warn(peer->pps, &peer->channel_id, - "Splicing bad tx_signatures %s", - tal_hex(msg, msg)); - } - if (peer->splicing) - peer->splicing->their_sig = tal_steal(peer->splicing, - their_sig); - tal_free(their_txsigs_tlvs); + their_sig.sighash_type = SIGHASH_ALL; + their_sig.s = *their_txsigs_tlvs->shared_input_signature; /* Set the commit_sig on the commitment tx psbt */ if (!psbt_input_set_signature(current_psbt, diff --git a/tests/fuzz/fuzz-wire-tx_signatures.c b/tests/fuzz/fuzz-wire-tx_signatures.c index 839f2c2a2..2b8e82e6f 100644 --- a/tests/fuzz/fuzz-wire-tx_signatures.c +++ b/tests/fuzz/fuzz-wire-tx_signatures.c @@ -58,8 +58,8 @@ static bool equal(const struct tx_signatures *x, const struct tx_signatures *y) return false; assert(x->tlvs && y->tlvs); - return tal_arr_eq(x->tlvs->funding_outpoint_sig, - y->tlvs->funding_outpoint_sig); + return tal_arr_eq(x->tlvs->shared_input_signature, + y->tlvs->shared_input_signature); } void run(const u8 *data, size_t size) diff --git a/wire/peer_wire.csv b/wire/peer_wire.csv index c7387c927..3061e5791 100644 --- a/wire/peer_wire.csv +++ b/wire/peer_wire.csv @@ -70,8 +70,8 @@ msgdata,tx_signatures,tlvs,txsigs_tlvs, subtype,witness subtypedata,witness,len,u16, subtypedata,witness,witness_data,byte,len -tlvtype,txsigs_tlvs,funding_outpoint_sig,0 -tlvdata,txsigs_tlvs,funding_outpoint_sig,sig,byte,... +tlvtype,txsigs_tlvs,shared_input_signature,0 +tlvdata,txsigs_tlvs,shared_input_signature,signature,signature, msgtype,tx_init_rbf,72 msgdata,tx_init_rbf,channel_id,channel_id, msgdata,tx_init_rbf,locktime,u32,