Skip to content

Commit 82a984a

Browse files
committed
Previously-authentication fields in contexts can be reused
We recently switched to `ReceiveAuthKey`-based blinded path authentication, removing various fields used to authenticate blinded paths from contexts. In doing so, we left a comment arguing that such fields should not have their TLV IDs reused, however there's no reason for that restriction. If we reuse old blinded paths with those fields set they'll fail the new authentication checks anyway, so the fields should never end up being seen in blinded paths we'd accept. This simply updates the comments.
1 parent d82af8c commit 82a984a

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

lightning/src/blinded_path/message.rs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -543,27 +543,20 @@ impl_writeable_tlv_based_enum!(MessageContext,
543543
{3, DNSResolver} => (),
544544
);
545545

546-
// NOTE:
547-
// Several TLV fields (`nonce`, `hmac`, etc.) were removed in LDK v0.2
548-
// following the introduction of `ReceiveAuthKey`-based authentication for
549-
// inbound `BlindedMessagePath`s. These fields are now commented out and
550-
// their `type` values must not be reused unless support for LDK v0.2
551-
// and earlier is fully dropped.
552-
//
553-
// For context-specific removals, see the commented-out fields within each enum variant.
546+
// Note: Several TLV fields (`nonce`, `hmac`, etc.) were removed in LDK v0.2 following the
547+
// introduction of `ReceiveAuthKey`-based authentication for inbound `BlindedMessagePath`s. Because
548+
// we do not support receiving to those contexts anymore (they will fail the `ReceiveAuthKey`-based
549+
// authentication checks), we can reuse those fields here.
554550
impl_writeable_tlv_based_enum!(OffersContext,
555551
(0, InvoiceRequest) => {
556552
(0, nonce, required),
557553
},
558554
(1, OutboundPayment) => {
559555
(0, payment_id, required),
560556
(1, nonce, required),
561-
// Removed: (2, hmac, option)
562557
},
563558
(2, InboundPayment) => {
564559
(0, payment_hash, required),
565-
// Removed: (1, nonce, required),
566-
// Removed: (2, hmac, required)
567560
},
568561
(3, StaticInvoiceRequested) => {
569562
(0, recipient_id, required),
@@ -575,12 +568,8 @@ impl_writeable_tlv_based_enum!(OffersContext,
575568
impl_writeable_tlv_based_enum!(AsyncPaymentsContext,
576569
(0, OutboundPayment) => {
577570
(0, payment_id, required),
578-
// Removed: (2, nonce, required),
579-
// Removed: (4, hmac, required),
580571
},
581572
(1, InboundPayment) => {
582-
// Removed: (0, nonce, required),
583-
// Removed: (2, hmac, required),
584573
(4, path_absolute_expiry, required),
585574
},
586575
(2, OfferPaths) => {

0 commit comments

Comments
 (0)