]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Add missing keysend preimage check on inbound onion read.
authorValentine Wallace <vwallace@protonmail.com>
Tue, 12 Dec 2023 23:42:38 +0000 (18:42 -0500)
committerValentine Wallace <vwallace@protonmail.com>
Tue, 12 Dec 2023 23:42:38 +0000 (18:42 -0500)
lightning/src/ln/msgs.rs

index 6c4a324a906c7a09051d35b6a286246ee3272a16..689058c7e4a14ea7e52f73c794d1127581181650 100644 (file)
@@ -2362,7 +2362,9 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, &NS)> for InboundOnionPayload w
                }
 
                if let Some(blinding_point) = intro_node_blinding_point.or(update_add_blinding_point) {
-                       if short_id.is_some() || payment_data.is_some() || payment_metadata.is_some() {
+                       if short_id.is_some() || payment_data.is_some() || payment_metadata.is_some() ||
+                               keysend_preimage.is_some()
+                       {
                                return Err(DecodeError::InvalidValue)
                        }
                        let enc_tlvs = encrypted_tlvs_opt.ok_or(DecodeError::InvalidValue)?.0;