common/sphinx: add realm flag so we can avoid legacy parsing.

For messages, we use the onion but payload lengths 0 and 1 aren't special.
Create a flag to disable that logic.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2020-03-12 10:29:01 +10:30
committed by Christian Decker
parent b162a0e5e2
commit 24984ec680
7 changed files with 26 additions and 14 deletions

View File

@@ -128,7 +128,7 @@ static struct route_step *decode_with_privkey(const tal_t *ctx, const u8 *onion,
errx(1, "Error creating shared secret.");
step = process_onionpacket(ctx, &packet, &shared_secret, assocdata,
tal_bytelen(assocdata));
tal_bytelen(assocdata), true);
return step;
}
@@ -282,7 +282,7 @@ static void runtest(const char *filename)
errx(1, "Error serializing message.");
onion_payload_length(step->raw_payload,
tal_bytelen(step->raw_payload),
&valid, &type);
true, &valid, &type);
assert(valid);
printf(" Type: %d\n", type);
printf(" Payload: %s\n", tal_hex(ctx, step->raw_payload));