lightningd: update to BOLT 7d3ef5a6b20eb84982ea2bfc029497082adf20d8 "Allow unset onion_hash in invalid_onion_blinding (#1093)"

Explicitly allow all-zero in the onion_hash: we didn't do anything except log if it was unexpected anyway.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2023-09-12 13:53:19 +09:30
parent 6a2632d50b
commit 68a6084bab
2 changed files with 7 additions and 3 deletions

View File

@ -23,7 +23,7 @@ CCANDIR := ccan
# Where we keep the BOLT RFCs
BOLTDIR := ../bolts/
DEFAULT_BOLTVERSION := 7f53a3e46ed59f19463447d5fa63b3e484c708a5
DEFAULT_BOLTVERSION := 7d3ef5a6b20eb84982ea2bfc029497082adf20d8
# Can be overridden on cmdline.
BOLTVERSION := $(DEFAULT_BOLTVERSION)

View File

@ -1,5 +1,6 @@
#include "config.h"
#include <ccan/cast/cast.h>
#include <ccan/mem/mem.h>
#include <ccan/tal/str/str.h>
#include <channeld/channeld_wiregen.h>
#include <common/blinding.h>
@ -1571,16 +1572,19 @@ static bool peer_failed_our_htlc(struct channel *channel,
/* BOLT #2:
*
* - if the `sha256_of_onion` in `update_fail_malformed_htlc`
* doesn't match the onion it sent:
* doesn't match the onion it sent and is not all zero:
* - MAY retry or choose an alternate error response.
*/
sha256(&our_sha256_of_onion, hout->onion_routing_packet,
sizeof(hout->onion_routing_packet));
if (!sha256_eq(failed->sha256_of_onion, &our_sha256_of_onion))
if (!sha256_eq(failed->sha256_of_onion, &our_sha256_of_onion)
&& !memeqzero(failed->sha256_of_onion,
sizeof(failed->sha256_of_onion))) {
log_unusual(channel->log,
"update_fail_malformed_htlc for bad onion"
" for htlc with id %"PRIu64".",
hout->key.id);
}
/* BOLT #2:
*