We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9efe123 commit 148aaa7Copy full SHA for 148aaa7
devtools/onion.c
@@ -24,7 +24,9 @@ static void do_generate(int argc, char **argv)
24
memset(&assocdata, 'B', sizeof(assocdata));
25
26
for (int i = 0; i < num_hops; i++) {
27
- hex_decode(argv[1 + i], 66, privkeys[i], 33);
+ if (!hex_decode(argv[1 + i], 66, privkeys[i], 33)) {
28
+ errx(1, "Invalid private key hex '%s'", argv[1 + i]);
29
+ }
30
if (secp256k1_ec_pubkey_create(secp256k1_ctx, &path[i].pubkey,
31
privkeys[i]) != 1)
32
errx(1, "Could not decode pubkey");
@@ -76,7 +78,9 @@ static void do_decode(int argc, char **argv)
76
78
if (!read_all(STDIN_FILENO, hextemp, sizeof(hextemp)))
77
79
errx(1, "Reading in onion");
80
- hex_decode(hextemp, sizeof(hextemp), serialized, sizeof(serialized));
81
+ if (!hex_decode(hextemp, sizeof(hextemp), serialized, sizeof(serialized))) {
82
+ errx(1, "Invalid onion hex '%s'", hextemp);
83
84
85
msg = parse_onionpacket(ctx, serialized, sizeof(serialized));
86
0 commit comments