common: rename current onion message structures to obs2_.

Yes, we changed the spec again.  Hopefully for the last time!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2021-11-30 13:36:04 +10:30
parent b74848f6f6
commit 1ec6346f3d
24 changed files with 200 additions and 200 deletions

View File

@@ -2320,7 +2320,7 @@ static void peer_in(struct peer *peer, const u8 *msg)
case WIRE_PING: case WIRE_PING:
case WIRE_WARNING: case WIRE_WARNING:
case WIRE_ERROR: case WIRE_ERROR:
case WIRE_ONION_MESSAGE: case WIRE_OBS2_ONION_MESSAGE:
abort(); abort();
} }

View File

@@ -61,7 +61,7 @@ static bool blind_node(const struct privkey *blinding,
static u8 *enctlv_from_encmsg(const tal_t *ctx, static u8 *enctlv_from_encmsg(const tal_t *ctx,
const struct privkey *blinding, const struct privkey *blinding,
const struct pubkey *node, const struct pubkey *node,
const struct tlv_encmsg_tlvs *encmsg, const struct tlv_obs2_encmsg_tlvs *encmsg,
struct privkey *next_blinding, struct privkey *next_blinding,
struct pubkey *node_alias) struct pubkey *node_alias)
{ {
@@ -89,7 +89,7 @@ static u8 *enctlv_from_encmsg(const tal_t *ctx,
/* Marshall */ /* Marshall */
ret = tal_arr(ctx, u8, 0); ret = tal_arr(ctx, u8, 0);
towire_encmsg_tlvs(&ret, encmsg); towire_obs2_encmsg_tlvs(&ret, encmsg);
SUPERVERBOSE("\t\"encmsg_hex\": \"%s\",\n", tal_hex(tmpctx, ret)); SUPERVERBOSE("\t\"encmsg_hex\": \"%s\",\n", tal_hex(tmpctx, ret));
/* /*
@@ -136,7 +136,7 @@ bool unblind_onion(const struct pubkey *blinding,
hmac.data) == 1; hmac.data) == 1;
} }
static struct tlv_encmsg_tlvs *decrypt_encmsg(const tal_t *ctx, static struct tlv_obs2_encmsg_tlvs *decrypt_encmsg(const tal_t *ctx,
const struct pubkey *blinding, const struct pubkey *blinding,
const struct secret *ss, const struct secret *ss,
const u8 *enctlv) const u8 *enctlv)
@@ -145,7 +145,7 @@ static struct tlv_encmsg_tlvs *decrypt_encmsg(const tal_t *ctx,
u8 *dec; u8 *dec;
const u8 *cursor; const u8 *cursor;
size_t maxlen; size_t maxlen;
struct tlv_encmsg_tlvs *encmsg; struct tlv_obs2_encmsg_tlvs *encmsg;
/* All-zero npub */ /* All-zero npub */
static const unsigned char npub[crypto_aead_chacha20poly1305_ietf_NPUBBYTES]; static const unsigned char npub[crypto_aead_chacha20poly1305_ietf_NPUBBYTES];
@@ -179,21 +179,21 @@ static struct tlv_encmsg_tlvs *decrypt_encmsg(const tal_t *ctx,
* - if the `enctlv` is not a valid TLV... * - if the `enctlv` is not a valid TLV...
* - MUST drop the message. * - MUST drop the message.
*/ */
encmsg = tlv_encmsg_tlvs_new(ctx); encmsg = tlv_obs2_encmsg_tlvs_new(ctx);
if (!fromwire_encmsg_tlvs(&cursor, &maxlen, encmsg) if (!fromwire_obs2_encmsg_tlvs(&cursor, &maxlen, encmsg)
|| !tlv_fields_valid(encmsg->fields, NULL, NULL)) || !tlv_fields_valid(encmsg->fields, NULL, NULL))
return tal_free(encmsg); return tal_free(encmsg);
return encmsg; return encmsg;
} }
bool decrypt_enctlv(const struct pubkey *blinding, bool decrypt_obs2_enctlv(const struct pubkey *blinding,
const struct secret *ss, const struct secret *ss,
const u8 *enctlv, const u8 *enctlv,
struct pubkey *next_node, struct pubkey *next_node,
struct pubkey *next_blinding) struct pubkey *next_blinding)
{ {
struct tlv_encmsg_tlvs *encmsg; struct tlv_obs2_encmsg_tlvs *encmsg;
encmsg = decrypt_encmsg(tmpctx, blinding, ss, enctlv); encmsg = decrypt_encmsg(tmpctx, blinding, ss, enctlv);
if (!encmsg) if (!encmsg)
@@ -244,7 +244,7 @@ bool decrypt_enctlv(const struct pubkey *blinding,
return true; return true;
} }
bool decrypt_final_enctlv(const tal_t *ctx, bool decrypt_obs2_final_enctlv(const tal_t *ctx,
const struct pubkey *blinding, const struct pubkey *blinding,
const struct secret *ss, const struct secret *ss,
const u8 *enctlv, const u8 *enctlv,
@@ -252,7 +252,7 @@ bool decrypt_final_enctlv(const tal_t *ctx,
struct pubkey *alias, struct pubkey *alias,
struct secret **self_id) struct secret **self_id)
{ {
struct tlv_encmsg_tlvs *encmsg; struct tlv_obs2_encmsg_tlvs *encmsg;
struct secret node_id_blinding; struct secret node_id_blinding;
/* Repeat the tweak to get the alias it was using for us */ /* Repeat the tweak to get the alias it was using for us */
@@ -276,7 +276,7 @@ bool decrypt_final_enctlv(const tal_t *ctx,
return true; return true;
} }
u8 *create_enctlv(const tal_t *ctx, u8 *create_obs2_enctlv(const tal_t *ctx,
const struct privkey *blinding, const struct privkey *blinding,
const struct pubkey *node, const struct pubkey *node,
const struct pubkey *next_node, const struct pubkey *next_node,
@@ -285,7 +285,7 @@ u8 *create_enctlv(const tal_t *ctx,
struct privkey *next_blinding, struct privkey *next_blinding,
struct pubkey *node_alias) struct pubkey *node_alias)
{ {
struct tlv_encmsg_tlvs *encmsg = tlv_encmsg_tlvs_new(tmpctx); struct tlv_obs2_encmsg_tlvs *encmsg = tlv_obs2_encmsg_tlvs_new(tmpctx);
if (padlen) if (padlen)
encmsg->padding = tal_arrz(encmsg, u8, padlen); encmsg->padding = tal_arrz(encmsg, u8, padlen);
encmsg->next_node_id = cast_const(struct pubkey *, next_node); encmsg->next_node_id = cast_const(struct pubkey *, next_node);
@@ -295,14 +295,14 @@ u8 *create_enctlv(const tal_t *ctx,
next_blinding, node_alias); next_blinding, node_alias);
} }
u8 *create_final_enctlv(const tal_t *ctx, u8 *create_obs2_final_enctlv(const tal_t *ctx,
const struct privkey *blinding, const struct privkey *blinding,
const struct pubkey *final_node, const struct pubkey *final_node,
size_t padlen, size_t padlen,
const struct secret *self_id, const struct secret *self_id,
struct pubkey *node_alias) struct pubkey *node_alias)
{ {
struct tlv_encmsg_tlvs *encmsg = tlv_encmsg_tlvs_new(tmpctx); struct tlv_obs2_encmsg_tlvs *encmsg = tlv_obs2_encmsg_tlvs_new(tmpctx);
struct privkey unused_next_blinding; struct privkey unused_next_blinding;
if (padlen) if (padlen)

View File

@@ -23,7 +23,7 @@ struct secret;
* *
* Returns the enctlv blob, or NULL if the secret is invalid. * Returns the enctlv blob, or NULL if the secret is invalid.
*/ */
u8 *create_enctlv(const tal_t *ctx, u8 *create_obs2_enctlv(const tal_t *ctx,
const struct privkey *blinding, const struct privkey *blinding,
const struct pubkey *node, const struct pubkey *node,
const struct pubkey *next_node, const struct pubkey *next_node,
@@ -44,7 +44,7 @@ u8 *create_enctlv(const tal_t *ctx,
* *
* If it fails, it means one of the privkeys is bad. * If it fails, it means one of the privkeys is bad.
*/ */
u8 *create_final_enctlv(const tal_t *ctx, u8 *create_obs2_final_enctlv(const tal_t *ctx,
const struct privkey *blinding, const struct privkey *blinding,
const struct pubkey *final_node, const struct pubkey *final_node,
size_t padlen, size_t padlen,
@@ -77,7 +77,7 @@ bool unblind_onion(const struct pubkey *blinding,
* *
* Returns false if decryption failed or encmsg was malformed. * Returns false if decryption failed or encmsg was malformed.
*/ */
bool decrypt_enctlv(const struct pubkey *blinding, bool decrypt_obs2_enctlv(const struct pubkey *blinding,
const struct secret *ss, const struct secret *ss,
const u8 *enctlv, const u8 *enctlv,
struct pubkey *next_node, struct pubkey *next_node,
@@ -96,7 +96,7 @@ bool decrypt_enctlv(const struct pubkey *blinding,
* *
* Returns false if decryption failed or encmsg was malformed. * Returns false if decryption failed or encmsg was malformed.
*/ */
bool decrypt_final_enctlv(const tal_t *ctx, bool decrypt_obs2_final_enctlv(const tal_t *ctx,
const struct pubkey *blinding, const struct pubkey *blinding,
const struct secret *ss, const struct secret *ss,
const u8 *enctlv, const u8 *enctlv,

View File

@@ -141,15 +141,15 @@ struct wally_psbt *json_to_psbt(const tal_t *ctx, const char *buffer,
return psbt_from_b64(ctx, buffer + tok->start, tok->end - tok->start); return psbt_from_b64(ctx, buffer + tok->start, tok->end - tok->start);
} }
struct tlv_onionmsg_payload_reply_path * struct tlv_obs2_onionmsg_payload_reply_path *
json_to_reply_path(const tal_t *ctx, const char *buffer, const jsmntok_t *tok) json_to_obs2_reply_path(const tal_t *ctx, const char *buffer, const jsmntok_t *tok)
{ {
struct tlv_onionmsg_payload_reply_path *rpath; struct tlv_obs2_onionmsg_payload_reply_path *rpath;
const jsmntok_t *hops, *t; const jsmntok_t *hops, *t;
size_t i; size_t i;
const char *err; const char *err;
rpath = tal(ctx, struct tlv_onionmsg_payload_reply_path); rpath = tal(ctx, struct tlv_obs2_onionmsg_payload_reply_path);
err = json_scan(tmpctx, buffer, tok, "{blinding:%,first_node_id:%}", err = json_scan(tmpctx, buffer, tok, "{blinding:%,first_node_id:%}",
JSON_SCAN(json_to_pubkey, &rpath->blinding), JSON_SCAN(json_to_pubkey, &rpath->blinding),
JSON_SCAN(json_to_pubkey, &rpath->first_node_id), JSON_SCAN(json_to_pubkey, &rpath->first_node_id),

View File

@@ -80,8 +80,8 @@ bool split_tok(const char *buffer, const jsmntok_t *tok,
jsmntok_t *b); jsmntok_t *b);
/* Extract reply path from this JSON */ /* Extract reply path from this JSON */
struct tlv_onionmsg_payload_reply_path * struct tlv_obs2_onionmsg_payload_reply_path *
json_to_reply_path(const tal_t *ctx, const char *buffer, const jsmntok_t *tok); json_to_obs2_reply_path(const tal_t *ctx, const char *buffer, const jsmntok_t *tok);
/* Helpers for outputting JSON results */ /* Helpers for outputting JSON results */

View File

@@ -84,7 +84,7 @@ static void test_decrypt(const struct pubkey *blinding,
mykey = me; mykey = me;
assert(unblind_onion(blinding, test_ecdh, &dummy, &ss)); assert(unblind_onion(blinding, test_ecdh, &dummy, &ss));
assert(decrypt_enctlv(blinding, &ss, enctlv, &next_node, &next_blinding)); assert(decrypt_obs2_enctlv(blinding, &ss, enctlv, &next_node, &next_blinding));
pubkey_from_privkey(expected_next_blinding_priv, &expected_next_blinding); pubkey_from_privkey(expected_next_blinding_priv, &expected_next_blinding);
assert(pubkey_eq(&next_blinding, &expected_next_blinding)); assert(pubkey_eq(&next_blinding, &expected_next_blinding));
@@ -106,7 +106,7 @@ static void test_final_decrypt(const struct pubkey *blinding,
mykey = me; mykey = me;
pubkey_from_privkey(me, &my_pubkey); pubkey_from_privkey(me, &my_pubkey);
assert(unblind_onion(blinding, test_ecdh, &dummy, &ss)); assert(unblind_onion(blinding, test_ecdh, &dummy, &ss));
assert(decrypt_final_enctlv(tmpctx, blinding, &ss, enctlv, &my_pubkey, assert(decrypt_obs2_final_enctlv(tmpctx, blinding, &ss, enctlv, &my_pubkey,
&alias, &self_id)); &alias, &self_id));
assert(pubkey_eq(&alias, expected_alias)); assert(pubkey_eq(&alias, expected_alias));
@@ -150,7 +150,7 @@ int main(int argc, char *argv[])
"\t},\n", "\t},\n",
type_to_string(tmpctx, struct pubkey, &bob_id)); type_to_string(tmpctx, struct pubkey, &bob_id));
enctlv = create_enctlv(tmpctx, &blinding, &alice_id, &bob_id, enctlv = create_obs2_enctlv(tmpctx, &blinding, &alice_id, &bob_id,
0, NULL, &blinding, &alias); 0, NULL, &blinding, &alias);
printf("\t\"enctlv_hex\": \"%s\"\n" printf("\t\"enctlv_hex\": \"%s\"\n"
"},\n", "},\n",
@@ -180,7 +180,7 @@ int main(int argc, char *argv[])
type_to_string(tmpctx, struct pubkey, &carol_id), type_to_string(tmpctx, struct pubkey, &carol_id),
type_to_string(tmpctx, struct privkey, &override_blinding)); type_to_string(tmpctx, struct privkey, &override_blinding));
enctlv = create_enctlv(tmpctx, &blinding, &bob_id, &carol_id, enctlv = create_obs2_enctlv(tmpctx, &blinding, &bob_id, &carol_id,
0, &override_blinding_pub, &blinding, &alias); 0, &override_blinding_pub, &blinding, &alias);
printf("\t\"enctlv_hex\": \"%s\"\n" printf("\t\"enctlv_hex\": \"%s\"\n"
"},\n", "},\n",
@@ -209,7 +209,7 @@ int main(int argc, char *argv[])
type_to_string(tmpctx, struct pubkey, &dave_id), type_to_string(tmpctx, struct pubkey, &dave_id),
tal_hex(tmpctx, tal_arrz(tmpctx, u8, 35))); tal_hex(tmpctx, tal_arrz(tmpctx, u8, 35)));
enctlv = create_enctlv(tmpctx, &blinding, &carol_id, &dave_id, enctlv = create_obs2_enctlv(tmpctx, &blinding, &carol_id, &dave_id,
35, NULL, &blinding, &alias); 35, NULL, &blinding, &alias);
printf("\t\"enctlv_hex\": \"%s\"\n" printf("\t\"enctlv_hex\": \"%s\"\n"
"}]\n", "}]\n",
@@ -220,7 +220,7 @@ int main(int argc, char *argv[])
/* FIXME: Add this to the test vectors! */ /* FIXME: Add this to the test vectors! */
fclose(stdout); fclose(stdout);
memset(&self_id, 0x77, sizeof(self_id)); memset(&self_id, 0x77, sizeof(self_id));
enctlv = create_final_enctlv(tmpctx, &blinding, &dave_id, enctlv = create_obs2_final_enctlv(tmpctx, &blinding, &dave_id,
0, &self_id, &alias); 0, &self_id, &alias);
pubkey_from_privkey(&blinding, &blinding_pub); pubkey_from_privkey(&blinding, &blinding_pub);

View File

@@ -138,17 +138,17 @@ int main(int argc, char **argv)
u8 *p; u8 *p;
u8 buf[BIGSIZE_MAX_LEN]; u8 buf[BIGSIZE_MAX_LEN];
const unsigned char npub[crypto_aead_chacha20poly1305_ietf_NPUBBYTES] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; const unsigned char npub[crypto_aead_chacha20poly1305_ietf_NPUBBYTES] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
struct tlv_onionmsg_payload *outer; struct tlv_obs2_onionmsg_payload *outer;
struct tlv_encmsg_tlvs *inner; struct tlv_obs2_encmsg_tlvs *inner;
int ret; int ret;
/* Inner is encrypted */ /* Inner is encrypted */
inner = tlv_encmsg_tlvs_new(tmpctx); inner = tlv_obs2_encmsg_tlvs_new(tmpctx);
inner->next_node_id = tal_dup(inner, struct pubkey, &nodes[i+1]); inner->next_node_id = tal_dup(inner, struct pubkey, &nodes[i+1]);
p = tal_arr(tmpctx, u8, 0); p = tal_arr(tmpctx, u8, 0);
towire_encmsg_tlvs(&p, inner); towire_obs2_encmsg_tlvs(&p, inner);
outer = tlv_onionmsg_payload_new(tmpctx); outer = tlv_obs2_onionmsg_payload_new(tmpctx);
outer->enctlv = tal_arr(outer, u8, tal_count(p) outer->enctlv = tal_arr(outer, u8, tal_count(p)
+ crypto_aead_chacha20poly1305_ietf_ABYTES); + crypto_aead_chacha20poly1305_ietf_ABYTES);
ret = crypto_aead_chacha20poly1305_ietf_encrypt(outer->enctlv, NULL, ret = crypto_aead_chacha20poly1305_ietf_encrypt(outer->enctlv, NULL,
@@ -160,7 +160,7 @@ int main(int argc, char **argv)
assert(ret == 0); assert(ret == 0);
p = tal_arr(tmpctx, u8, 0); p = tal_arr(tmpctx, u8, 0);
towire_onionmsg_payload(&p, outer); towire_obs2_onionmsg_payload(&p, outer);
ret = bigsize_put(buf, tal_bytelen(p)); ret = bigsize_put(buf, tal_bytelen(p));
if (simpleout) { if (simpleout) {
@@ -194,7 +194,7 @@ int main(int argc, char **argv)
struct secret hmac, rho; struct secret hmac, rho;
struct route_step *rs; struct route_step *rs;
const u8 *cursor; const u8 *cursor;
struct tlv_onionmsg_payload *outer; struct tlv_obs2_onionmsg_payload *outer;
size_t max, len; size_t max, len;
struct pubkey res; struct pubkey res;
struct sha256 h; struct sha256 h;
@@ -257,8 +257,8 @@ int main(int argc, char **argv)
/* Always true since we're non-legacy */ /* Always true since we're non-legacy */
assert(len == max); assert(len == max);
outer = tlv_onionmsg_payload_new(tmpctx); outer = tlv_obs2_onionmsg_payload_new(tmpctx);
if (!fromwire_onionmsg_payload(&cursor, &max, outer)) if (!fromwire_obs2_onionmsg_payload(&cursor, &max, outer))
errx(1, "Invalid payload %s", errx(1, "Invalid payload %s",
tal_hex(tmpctx, rs->raw_payload)); tal_hex(tmpctx, rs->raw_payload));

View File

@@ -350,15 +350,15 @@ static bool handle_local_channel_announcement(struct daemon *daemon,
return true; return true;
} }
/* Peer sends onion msg. */ /* Peer sends obsolete onion msg. */
static u8 *handle_onion_message(struct peer *peer, const u8 *msg) static u8 *handle_obs2_onion_message(struct peer *peer, const u8 *msg)
{ {
enum onion_wire badreason; enum onion_wire badreason;
struct onionpacket *op; struct onionpacket *op;
struct pubkey blinding, ephemeral; struct pubkey blinding, ephemeral;
struct route_step *rs; struct route_step *rs;
u8 *onion; u8 *onion;
struct tlv_onionmsg_payload *om; struct tlv_obs2_onionmsg_payload *om;
struct secret ss, onion_ss; struct secret ss, onion_ss;
const u8 *cursor; const u8 *cursor;
size_t max, maxlen; size_t max, maxlen;
@@ -369,7 +369,7 @@ static u8 *handle_onion_message(struct peer *peer, const u8 *msg)
return NULL; return NULL;
/* FIXME: ratelimit! */ /* FIXME: ratelimit! */
if (!fromwire_onion_message(msg, msg, &blinding, &onion)) if (!fromwire_obs2_onion_message(msg, msg, &blinding, &onion))
return towire_warningfmt(peer, NULL, "Bad onion_message"); return towire_warningfmt(peer, NULL, "Bad onion_message");
/* We unwrap the onion now. */ /* We unwrap the onion now. */
@@ -411,8 +411,8 @@ static u8 *handle_onion_message(struct peer *peer, const u8 *msg)
return NULL; return NULL;
} }
om = tlv_onionmsg_payload_new(msg); om = tlv_obs2_onionmsg_payload_new(msg);
if (!fromwire_onionmsg_payload(&cursor, &maxlen, om)) { if (!fromwire_obs2_onionmsg_payload(&cursor, &maxlen, om)) {
status_peer_debug(&peer->id, "onion msg: invalid onionmsg_payload %s", status_peer_debug(&peer->id, "onion msg: invalid onionmsg_payload %s",
tal_hex(tmpctx, rs->raw_payload)); tal_hex(tmpctx, rs->raw_payload));
return NULL; return NULL;
@@ -433,7 +433,7 @@ static u8 *handle_onion_message(struct peer *peer, const u8 *msg)
if (!om->enctlv) { if (!om->enctlv) {
alias = me; alias = me;
self_id = NULL; self_id = NULL;
} else if (!decrypt_final_enctlv(tmpctx, &blinding, &ss, } else if (!decrypt_obs2_final_enctlv(tmpctx, &blinding, &ss,
om->enctlv, &me, &alias, om->enctlv, &me, &alias,
&self_id)) { &self_id)) {
status_peer_debug(&peer->id, status_peer_debug(&peer->id,
@@ -469,7 +469,7 @@ static u8 *handle_onion_message(struct peer *peer, const u8 *msg)
struct node_id next_node_id; struct node_id next_node_id;
/* This fails as expected if no enctlv. */ /* This fails as expected if no enctlv. */
if (!decrypt_enctlv(&blinding, &ss, om->enctlv, &next_node, if (!decrypt_obs2_enctlv(&blinding, &ss, om->enctlv, &next_node,
&next_blinding)) { &next_blinding)) {
status_peer_debug(&peer->id, status_peer_debug(&peer->id,
"onion msg: invalid enctlv %s", "onion msg: invalid enctlv %s",
@@ -490,7 +490,7 @@ static u8 *handle_onion_message(struct peer *peer, const u8 *msg)
return NULL; return NULL;
} }
queue_peer_msg(next_peer, queue_peer_msg(next_peer,
take(towire_onion_message(NULL, take(towire_obs2_onion_message(NULL,
&next_blinding, &next_blinding,
serialize_onionpacket(tmpctx, rs->next)))); serialize_onionpacket(tmpctx, rs->next))));
} }
@@ -514,7 +514,7 @@ static struct io_plan *onionmsg_req(struct io_conn *conn, struct daemon *daemon,
peer = find_peer(daemon, &id); peer = find_peer(daemon, &id);
if (peer) { if (peer) {
queue_peer_msg(peer, queue_peer_msg(peer,
take(towire_onion_message(NULL, take(towire_obs2_onion_message(NULL,
&blinding, onionmsg))); &blinding, onionmsg)));
} }
return daemon_conn_read_next(conn, daemon->master); return daemon_conn_read_next(conn, daemon->master);
@@ -553,8 +553,8 @@ static struct io_plan *peer_msg_in(struct io_conn *conn,
case WIRE_REPLY_SHORT_CHANNEL_IDS_END: case WIRE_REPLY_SHORT_CHANNEL_IDS_END:
err = handle_reply_short_channel_ids_end(peer, msg); err = handle_reply_short_channel_ids_end(peer, msg);
goto handled_relay; goto handled_relay;
case WIRE_ONION_MESSAGE: case WIRE_OBS2_ONION_MESSAGE:
err = handle_onion_message(peer, msg); err = handle_obs2_onion_message(peer, msg);
goto handled_relay; goto handled_relay;
/* These are non-gossip messages (!is_msg_for_gossipd()) */ /* These are non-gossip messages (!is_msg_for_gossipd()) */

View File

@@ -84,7 +84,7 @@ msgdata,gossipd_got_onionmsg_to_us,reply_path,onionmsg_path,reply_path_len
msgdata,gossipd_got_onionmsg_to_us,rawmsg_len,u16, msgdata,gossipd_got_onionmsg_to_us,rawmsg_len,u16,
msgdata,gossipd_got_onionmsg_to_us,rawmsg,u8,rawmsg_len msgdata,gossipd_got_onionmsg_to_us,rawmsg,u8,rawmsg_len
# Lightningd tells us to send a onion message. # Lightningd tells us to send an onion message.
msgtype,gossipd_send_onionmsg,3041 msgtype,gossipd_send_onionmsg,3041
msgdata,gossipd_send_onionmsg,id,node_id, msgdata,gossipd_send_onionmsg,id,node_id,
msgdata,gossipd_send_onionmsg,onion_len,u16, msgdata,gossipd_send_onionmsg,onion_len,u16,
1 #include <common/cryptomsg.h>
84 msgdata,gossipd_new_lease_rates,rates,lease_rates,
85
86
87
88
89
90

View File

@@ -21,7 +21,7 @@ struct onion_message_hook_payload {
struct pubkey *reply_first_node; struct pubkey *reply_first_node;
struct pubkey *our_alias; struct pubkey *our_alias;
struct tlv_onionmsg_payload *om; struct tlv_obs2_onionmsg_payload *om;
}; };
static void json_add_blindedpath(struct json_stream *stream, static void json_add_blindedpath(struct json_stream *stream,
@@ -116,7 +116,7 @@ void handle_onionmsg_to_us(struct lightningd *ld, const u8 *msg)
const u8 *subptr; const u8 *subptr;
payload = tal(ld, struct onion_message_hook_payload); payload = tal(ld, struct onion_message_hook_payload);
payload->om = tlv_onionmsg_payload_new(payload); payload->om = tlv_obs2_onionmsg_payload_new(payload);
payload->our_alias = tal(payload, struct pubkey); payload->our_alias = tal(payload, struct pubkey);
if (!fromwire_gossipd_got_onionmsg_to_us(payload, msg, if (!fromwire_gossipd_got_onionmsg_to_us(payload, msg,
@@ -138,7 +138,7 @@ void handle_onionmsg_to_us(struct lightningd *ld, const u8 *msg)
submsglen = tal_bytelen(submsg); submsglen = tal_bytelen(submsg);
subptr = submsg; subptr = submsg;
if (!fromwire_onionmsg_payload(&subptr, if (!fromwire_obs2_onionmsg_payload(&subptr,
&submsglen, payload->om)) { &submsglen, payload->om)) {
tal_free(payload); tal_free(payload);
log_broken(ld->log, "bad got_onionmsg_tous om: %s", log_broken(ld->log, "bad got_onionmsg_tous om: %s",
@@ -327,7 +327,7 @@ static struct command_result *json_blindedpath(struct command *cmd,
for (size_t i = 0; i < nhops - 1; i++) { for (size_t i = 0; i < nhops - 1; i++) {
path[i] = tal(path, struct onionmsg_path); path[i] = tal(path, struct onionmsg_path);
path[i]->enctlv = create_enctlv(path[i], path[i]->enctlv = create_obs2_enctlv(path[i],
&blinding_iter, &blinding_iter,
&ids[i], &ids[i],
&ids[i+1], &ids[i+1],
@@ -340,7 +340,7 @@ static struct command_result *json_blindedpath(struct command *cmd,
/* FIXME: Add padding! */ /* FIXME: Add padding! */
path[nhops-1] = tal(path, struct onionmsg_path); path[nhops-1] = tal(path, struct onionmsg_path);
path[nhops-1]->enctlv = create_final_enctlv(path[nhops-1], path[nhops-1]->enctlv = create_obs2_final_enctlv(path[nhops-1],
&blinding_iter, &blinding_iter,
&ids[nhops-1], &ids[nhops-1],
/* FIXME: Pad? */ /* FIXME: Pad? */

View File

@@ -1285,7 +1285,7 @@ static u8 *opening_negotiate_msg(const tal_t *ctx, struct state *state)
case WIRE_CHANNEL_REESTABLISH: case WIRE_CHANNEL_REESTABLISH:
case WIRE_ANNOUNCEMENT_SIGNATURES: case WIRE_ANNOUNCEMENT_SIGNATURES:
case WIRE_GOSSIP_TIMESTAMP_FILTER: case WIRE_GOSSIP_TIMESTAMP_FILTER:
case WIRE_ONION_MESSAGE: case WIRE_OBS2_ONION_MESSAGE:
case WIRE_ACCEPT_CHANNEL2: case WIRE_ACCEPT_CHANNEL2:
case WIRE_TX_ADD_INPUT: case WIRE_TX_ADD_INPUT:
case WIRE_TX_REMOVE_INPUT: case WIRE_TX_REMOVE_INPUT:
@@ -1631,7 +1631,7 @@ static bool run_tx_interactive(struct state *state,
case WIRE_CHANNEL_REESTABLISH: case WIRE_CHANNEL_REESTABLISH:
case WIRE_ANNOUNCEMENT_SIGNATURES: case WIRE_ANNOUNCEMENT_SIGNATURES:
case WIRE_GOSSIP_TIMESTAMP_FILTER: case WIRE_GOSSIP_TIMESTAMP_FILTER:
case WIRE_ONION_MESSAGE: case WIRE_OBS2_ONION_MESSAGE:
case WIRE_TX_SIGNATURES: case WIRE_TX_SIGNATURES:
case WIRE_OPEN_CHANNEL2: case WIRE_OPEN_CHANNEL2:
case WIRE_ACCEPT_CHANNEL2: case WIRE_ACCEPT_CHANNEL2:
@@ -3684,7 +3684,7 @@ static u8 *handle_peer_in(struct state *state)
case WIRE_CHANNEL_REESTABLISH: case WIRE_CHANNEL_REESTABLISH:
case WIRE_ANNOUNCEMENT_SIGNATURES: case WIRE_ANNOUNCEMENT_SIGNATURES:
case WIRE_GOSSIP_TIMESTAMP_FILTER: case WIRE_GOSSIP_TIMESTAMP_FILTER:
case WIRE_ONION_MESSAGE: case WIRE_OBS2_ONION_MESSAGE:
case WIRE_ACCEPT_CHANNEL2: case WIRE_ACCEPT_CHANNEL2:
case WIRE_TX_ADD_INPUT: case WIRE_TX_ADD_INPUT:
case WIRE_TX_REMOVE_INPUT: case WIRE_TX_REMOVE_INPUT:

View File

@@ -639,14 +639,14 @@ struct sending {
static struct command_result * static struct command_result *
send_modern_message(struct command *cmd, send_modern_message(struct command *cmd,
struct tlv_onionmsg_payload_reply_path *reply_path, struct tlv_obs2_onionmsg_payload_reply_path *reply_path,
struct sending *sending) struct sending *sending)
{ {
struct sent *sent = sending->sent; struct sent *sent = sending->sent;
struct privkey blinding_iter; struct privkey blinding_iter;
struct pubkey fwd_blinding, *node_alias; struct pubkey fwd_blinding, *node_alias;
size_t nhops = tal_count(sent->path); size_t nhops = tal_count(sent->path);
struct tlv_onionmsg_payload **payloads; struct tlv_obs2_onionmsg_payload **payloads;
struct out_req *req; struct out_req *req;
/* Now create enctlvs for *forward* path. */ /* Now create enctlvs for *forward* path. */
@@ -658,12 +658,12 @@ send_modern_message(struct command *cmd,
&blinding_iter)); &blinding_iter));
/* We overallocate: this node (0) doesn't have payload or alias */ /* We overallocate: this node (0) doesn't have payload or alias */
payloads = tal_arr(cmd, struct tlv_onionmsg_payload *, nhops); payloads = tal_arr(cmd, struct tlv_obs2_onionmsg_payload *, nhops);
node_alias = tal_arr(cmd, struct pubkey, nhops); node_alias = tal_arr(cmd, struct pubkey, nhops);
for (size_t i = 1; i < nhops - 1; i++) { for (size_t i = 1; i < nhops - 1; i++) {
payloads[i] = tlv_onionmsg_payload_new(payloads); payloads[i] = tlv_obs2_onionmsg_payload_new(payloads);
payloads[i]->enctlv = create_enctlv(payloads[i], payloads[i]->enctlv = create_obs2_enctlv(payloads[i],
&blinding_iter, &blinding_iter,
&sent->path[i], &sent->path[i],
&sent->path[i+1], &sent->path[i+1],
@@ -674,10 +674,10 @@ send_modern_message(struct command *cmd,
&node_alias[i]); &node_alias[i]);
} }
/* Final payload contains the actual data. */ /* Final payload contains the actual data. */
payloads[nhops-1] = tlv_onionmsg_payload_new(payloads); payloads[nhops-1] = tlv_obs2_onionmsg_payload_new(payloads);
/* We don't include enctlv in final, but it gives us final alias */ /* We don't include enctlv in final, but it gives us final alias */
if (!create_final_enctlv(tmpctx, &blinding_iter, &sent->path[nhops-1], if (!create_obs2_final_enctlv(tmpctx, &blinding_iter, &sent->path[nhops-1],
/* FIXME: Pad? */ 0, /* FIXME: Pad? */ 0,
NULL, NULL,
&node_alias[nhops-1])) { &node_alias[nhops-1])) {
@@ -709,7 +709,7 @@ send_modern_message(struct command *cmd,
json_object_start(req->js, NULL); json_object_start(req->js, NULL);
json_add_pubkey(req->js, "id", &node_alias[i]); json_add_pubkey(req->js, "id", &node_alias[i]);
tlv = tal_arr(tmpctx, u8, 0); tlv = tal_arr(tmpctx, u8, 0);
towire_onionmsg_payload(&tlv, payloads[i]); towire_obs2_onionmsg_payload(&tlv, payloads[i]);
json_add_hex_talarr(req->js, "tlv", tlv); json_add_hex_talarr(req->js, "tlv", tlv);
json_object_end(req->js); json_object_end(req->js);
} }
@@ -724,9 +724,9 @@ static struct command_result *use_reply_path(struct command *cmd,
const jsmntok_t *result, const jsmntok_t *result,
struct sending *sending) struct sending *sending)
{ {
struct tlv_onionmsg_payload_reply_path *rpath; struct tlv_obs2_onionmsg_payload_reply_path *rpath;
rpath = json_to_reply_path(cmd, buf, rpath = json_to_obs2_reply_path(cmd, buf,
json_get_member(buf, result, "blindedpath")); json_get_member(buf, result, "blindedpath"));
if (!rpath) if (!rpath)
plugin_err(cmd->plugin, plugin_err(cmd->plugin,

View File

@@ -43,7 +43,7 @@ static struct command_result *sendonionmessage_error(struct command *cmd,
/* FIXME: replyfield string interface is to accomodate obsolete API */ /* FIXME: replyfield string interface is to accomodate obsolete API */
struct command_result * struct command_result *
send_onion_reply(struct command *cmd, send_onion_reply(struct command *cmd,
struct tlv_onionmsg_payload_reply_path *reply_path, struct tlv_obs2_onionmsg_payload_reply_path *reply_path,
const char *replyfield, const char *replyfield,
const u8 *replydata) const u8 *replydata)
{ {
@@ -57,13 +57,13 @@ send_onion_reply(struct command *cmd,
json_add_pubkey(req->js, "blinding", &reply_path->blinding); json_add_pubkey(req->js, "blinding", &reply_path->blinding);
json_array_start(req->js, "hops"); json_array_start(req->js, "hops");
for (size_t i = 0; i < nhops; i++) { for (size_t i = 0; i < nhops; i++) {
struct tlv_onionmsg_payload *omp; struct tlv_obs2_onionmsg_payload *omp;
u8 *tlv; u8 *tlv;
json_object_start(req->js, NULL); json_object_start(req->js, NULL);
json_add_pubkey(req->js, "id", &reply_path->path[i]->node_id); json_add_pubkey(req->js, "id", &reply_path->path[i]->node_id);
omp = tlv_onionmsg_payload_new(tmpctx); omp = tlv_obs2_onionmsg_payload_new(tmpctx);
omp->enctlv = reply_path->path[i]->enctlv; omp->enctlv = reply_path->path[i]->enctlv;
/* Put payload in last hop. */ /* Put payload in last hop. */
@@ -76,7 +76,7 @@ send_onion_reply(struct command *cmd,
} }
} }
tlv = tal_arr(tmpctx, u8, 0); tlv = tal_arr(tmpctx, u8, 0);
towire_onionmsg_payload(&tlv, omp); towire_obs2_onionmsg_payload(&tlv, omp);
json_add_hex_talarr(req->js, "tlv", tlv); json_add_hex_talarr(req->js, "tlv", tlv);
json_object_end(req->js); json_object_end(req->js);
} }
@@ -89,7 +89,7 @@ static struct command_result *onion_message_modern_call(struct command *cmd,
const jsmntok_t *params) const jsmntok_t *params)
{ {
const jsmntok_t *om, *replytok, *invreqtok, *invtok; const jsmntok_t *om, *replytok, *invreqtok, *invtok;
struct tlv_onionmsg_payload_reply_path *reply_path; struct tlv_obs2_onionmsg_payload_reply_path *reply_path;
if (!offers_enabled) if (!offers_enabled)
return command_hook_success(cmd); return command_hook_success(cmd);
@@ -97,7 +97,7 @@ static struct command_result *onion_message_modern_call(struct command *cmd,
om = json_get_member(buf, params, "onion_message"); om = json_get_member(buf, params, "onion_message");
replytok = json_get_member(buf, om, "reply_blindedpath"); replytok = json_get_member(buf, om, "reply_blindedpath");
if (replytok) { if (replytok) {
reply_path = json_to_reply_path(cmd, buf, replytok); reply_path = json_to_obs2_reply_path(cmd, buf, replytok);
if (!reply_path) if (!reply_path)
plugin_err(cmd->plugin, "Invalid reply path %.*s?", plugin_err(cmd->plugin, "Invalid reply path %.*s?",
json_tok_full_len(replytok), json_tok_full_len(replytok),

View File

@@ -9,7 +9,7 @@ struct command;
/* Helper to send a reply */ /* Helper to send a reply */
struct command_result *WARN_UNUSED_RESULT struct command_result *WARN_UNUSED_RESULT
send_onion_reply(struct command *cmd, send_onion_reply(struct command *cmd,
struct tlv_onionmsg_payload_reply_path *reply_path, struct tlv_obs2_onionmsg_payload_reply_path *reply_path,
const char *replyfield, const char *replyfield,
const u8 *replydata); const u8 *replydata);
#endif /* LIGHTNING_PLUGINS_OFFERS_H */ #endif /* LIGHTNING_PLUGINS_OFFERS_H */

View File

@@ -11,7 +11,7 @@ struct inv {
struct tlv_invoice *inv; struct tlv_invoice *inv;
/* May be NULL */ /* May be NULL */
struct tlv_onionmsg_payload_reply_path *reply_path; struct tlv_obs2_onionmsg_payload_reply_path *reply_path;
/* The offer, once we've looked it up. */ /* The offer, once we've looked it up. */
struct tlv_offer *offer; struct tlv_offer *offer;
@@ -313,7 +313,7 @@ static struct command_result *listoffers_error(struct command *cmd,
struct command_result *handle_invoice(struct command *cmd, struct command_result *handle_invoice(struct command *cmd,
const u8 *invbin, const u8 *invbin,
struct tlv_onionmsg_payload_reply_path *reply_path STEALS) struct tlv_obs2_onionmsg_payload_reply_path *reply_path STEALS)
{ {
size_t len = tal_count(invbin); size_t len = tal_count(invbin);
struct inv *inv = tal(cmd, struct inv); struct inv *inv = tal(cmd, struct inv);

View File

@@ -6,5 +6,5 @@
/* We got an onionmessage with an invoice! reply_path could be NULL. */ /* We got an onionmessage with an invoice! reply_path could be NULL. */
struct command_result *handle_invoice(struct command *cmd, struct command_result *handle_invoice(struct command *cmd,
const u8 *invbin, const u8 *invbin,
struct tlv_onionmsg_payload_reply_path *reply_path STEALS); struct tlv_obs2_onionmsg_payload_reply_path *reply_path STEALS);
#endif /* LIGHTNING_PLUGINS_OFFERS_INV_HOOK_H */ #endif /* LIGHTNING_PLUGINS_OFFERS_INV_HOOK_H */

View File

@@ -15,7 +15,7 @@
/* We need to keep the reply path around so we can reply with invoice */ /* We need to keep the reply path around so we can reply with invoice */
struct invreq { struct invreq {
struct tlv_invoice_request *invreq; struct tlv_invoice_request *invreq;
struct tlv_onionmsg_payload_reply_path *reply_path; struct tlv_obs2_onionmsg_payload_reply_path *reply_path;
/* The offer, once we've looked it up. */ /* The offer, once we've looked it up. */
struct tlv_offer *offer; struct tlv_offer *offer;
@@ -830,7 +830,7 @@ static struct command_result *handle_offerless_request(struct command *cmd,
struct command_result *handle_invoice_request(struct command *cmd, struct command_result *handle_invoice_request(struct command *cmd,
const u8 *invreqbin, const u8 *invreqbin,
struct tlv_onionmsg_payload_reply_path *reply_path) struct tlv_obs2_onionmsg_payload_reply_path *reply_path)
{ {
size_t len = tal_count(invreqbin); size_t len = tal_count(invreqbin);
struct invreq *ir = tal(cmd, struct invreq); struct invreq *ir = tal(cmd, struct invreq);

View File

@@ -8,5 +8,5 @@ extern u32 cltv_final;
/* We got an onionmessage with an invreq! */ /* We got an onionmessage with an invreq! */
struct command_result *handle_invoice_request(struct command *cmd, struct command_result *handle_invoice_request(struct command *cmd,
const u8 *invreqbin, const u8 *invreqbin,
struct tlv_onionmsg_payload_reply_path *reply_path STEALS); struct tlv_obs2_onionmsg_payload_reply_path *reply_path STEALS);
#endif /* LIGHTNING_PLUGINS_OFFERS_INVREQ_HOOK_H */ #endif /* LIGHTNING_PLUGINS_OFFERS_INVREQ_HOOK_H */

View File

@@ -4,26 +4,26 @@
tlvtype,tlv_payload,payment_data,8 tlvtype,tlv_payload,payment_data,8
tlvdata,tlv_payload,payment_data,payment_secret,byte,32 tlvdata,tlv_payload,payment_data,payment_secret,byte,32
tlvdata,tlv_payload,payment_data,total_msat,tu64, tlvdata,tlv_payload,payment_data,total_msat,tu64,
+tlvtype,onionmsg_payload,reply_path,2 +tlvtype,obs2_onionmsg_payload,reply_path,2
+tlvdata,onionmsg_payload,reply_path,first_node_id,point, +tlvdata,obs2_onionmsg_payload,reply_path,first_node_id,point,
+tlvdata,onionmsg_payload,reply_path,blinding,point, +tlvdata,obs2_onionmsg_payload,reply_path,blinding,point,
+tlvdata,onionmsg_payload,reply_path,path,onionmsg_path,... +tlvdata,obs2_onionmsg_payload,reply_path,path,onionmsg_path,...
+tlvtype,onionmsg_payload,enctlv,10 +tlvtype,obs2_onionmsg_payload,enctlv,10
+tlvdata,onionmsg_payload,enctlv,enctlv,byte,... +tlvdata,obs2_onionmsg_payload,enctlv,enctlv,byte,...
+tlvtype,onionmsg_payload,invoice_request,64 +tlvtype,obs2_onionmsg_payload,invoice_request,64
+tlvdata,onionmsg_payload,invoice_request,invoice_request,byte,... +tlvdata,obs2_onionmsg_payload,invoice_request,invoice_request,byte,...
+tlvtype,onionmsg_payload,invoice,66 +tlvtype,obs2_onionmsg_payload,invoice,66
+tlvdata,onionmsg_payload,invoice,invoice,byte,... +tlvdata,obs2_onionmsg_payload,invoice,invoice,byte,...
+tlvtype,onionmsg_payload,invoice_error,68 +tlvtype,obs2_onionmsg_payload,invoice_error,68
+tlvdata,onionmsg_payload,invoice_error,invoice_error,byte,... +tlvdata,obs2_onionmsg_payload,invoice_error,invoice_error,byte,...
+tlvtype,encmsg_tlvs,padding,1 +tlvtype,obs2_encmsg_tlvs,padding,1
+tlvdata,encmsg_tlvs,padding,pad,byte,... +tlvdata,obs2_encmsg_tlvs,padding,pad,byte,...
+tlvtype,encmsg_tlvs,next_node_id,4 +tlvtype,obs2_encmsg_tlvs,next_node_id,4
+tlvdata,encmsg_tlvs,next_node_id,node_id,point, +tlvdata,obs2_encmsg_tlvs,next_node_id,node_id,point,
+tlvtype,encmsg_tlvs,next_blinding,12 +tlvtype,obs2_encmsg_tlvs,next_blinding,12
+tlvdata,encmsg_tlvs,next_blinding,blinding,point, +tlvdata,obs2_encmsg_tlvs,next_blinding,blinding,point,
+tlvtype,encmsg_tlvs,self_id,14 +tlvtype,obs2_encmsg_tlvs,self_id,14
+tlvdata,encmsg_tlvs,self_id,data,byte,... +tlvdata,obs2_encmsg_tlvs,self_id,data,byte,...
+subtype,onionmsg_path +subtype,onionmsg_path
+subtypedata,onionmsg_path,node_id,point, +subtypedata,onionmsg_path,node_id,point,
+subtypedata,onionmsg_path,enclen,u16, +subtypedata,onionmsg_path,enclen,u16,

View File

@@ -8,6 +8,6 @@
+tlvdata,tlv_payload,enctlv,enctlv,byte,... +tlvdata,tlv_payload,enctlv,enctlv,byte,...
+tlvtype,tlv_payload,blinding_seed,12 +tlvtype,tlv_payload,blinding_seed,12
+tlvdata,tlv_payload,blinding_seed,blinding_seed,pubkey, +tlvdata,tlv_payload,blinding_seed,blinding_seed,pubkey,
tlvtype,onionmsg_payload,reply_path,2 tlvtype,obs2_onionmsg_payload,reply_path,2
tlvdata,onionmsg_payload,reply_path,first_node_id,point, tlvdata,obs2_onionmsg_payload,reply_path,first_node_id,point,
tlvdata,onionmsg_payload,reply_path,blinding,point, tlvdata,obs2_onionmsg_payload,reply_path,blinding,point,

View File

@@ -4,7 +4,7 @@
msgdata,gossip_timestamp_filter,chain_hash,chain_hash, msgdata,gossip_timestamp_filter,chain_hash,chain_hash,
msgdata,gossip_timestamp_filter,first_timestamp,u32, msgdata,gossip_timestamp_filter,first_timestamp,u32,
msgdata,gossip_timestamp_filter,timestamp_range,u32, msgdata,gossip_timestamp_filter,timestamp_range,u32,
+msgtype,onion_message,387,option_onion_messages +msgtype,obs2_onion_message,387,option_onion_messages
+msgdata,onion_message,blinding,point, +msgdata,obs2_onion_message,blinding,point,
+msgdata,onion_message,len,u16, +msgdata,obs2_onion_message,len,u16,
+msgdata,onion_message,onionmsg,byte,len +msgdata,obs2_onion_message,onionmsg,byte,len

View File

@@ -8,26 +8,26 @@ tlvdata,tlv_payload,short_channel_id,short_channel_id,short_channel_id,
tlvtype,tlv_payload,payment_data,8 tlvtype,tlv_payload,payment_data,8
tlvdata,tlv_payload,payment_data,payment_secret,byte,32 tlvdata,tlv_payload,payment_data,payment_secret,byte,32
tlvdata,tlv_payload,payment_data,total_msat,tu64, tlvdata,tlv_payload,payment_data,total_msat,tu64,
tlvtype,onionmsg_payload,reply_path,2 tlvtype,obs2_onionmsg_payload,reply_path,2
tlvdata,onionmsg_payload,reply_path,first_node_id,point, tlvdata,obs2_onionmsg_payload,reply_path,first_node_id,point,
tlvdata,onionmsg_payload,reply_path,blinding,point, tlvdata,obs2_onionmsg_payload,reply_path,blinding,point,
tlvdata,onionmsg_payload,reply_path,path,onionmsg_path,... tlvdata,obs2_onionmsg_payload,reply_path,path,onionmsg_path,...
tlvtype,onionmsg_payload,enctlv,10 tlvtype,obs2_onionmsg_payload,enctlv,10
tlvdata,onionmsg_payload,enctlv,enctlv,byte,... tlvdata,obs2_onionmsg_payload,enctlv,enctlv,byte,...
tlvtype,onionmsg_payload,invoice_request,64 tlvtype,obs2_onionmsg_payload,invoice_request,64
tlvdata,onionmsg_payload,invoice_request,invoice_request,byte,... tlvdata,obs2_onionmsg_payload,invoice_request,invoice_request,byte,...
tlvtype,onionmsg_payload,invoice,66 tlvtype,obs2_onionmsg_payload,invoice,66
tlvdata,onionmsg_payload,invoice,invoice,byte,... tlvdata,obs2_onionmsg_payload,invoice,invoice,byte,...
tlvtype,onionmsg_payload,invoice_error,68 tlvtype,obs2_onionmsg_payload,invoice_error,68
tlvdata,onionmsg_payload,invoice_error,invoice_error,byte,... tlvdata,obs2_onionmsg_payload,invoice_error,invoice_error,byte,...
tlvtype,encmsg_tlvs,padding,1 tlvtype,obs2_encmsg_tlvs,padding,1
tlvdata,encmsg_tlvs,padding,pad,byte,... tlvdata,obs2_encmsg_tlvs,padding,pad,byte,...
tlvtype,encmsg_tlvs,next_node_id,4 tlvtype,obs2_encmsg_tlvs,next_node_id,4
tlvdata,encmsg_tlvs,next_node_id,node_id,point, tlvdata,obs2_encmsg_tlvs,next_node_id,node_id,point,
tlvtype,encmsg_tlvs,next_blinding,12 tlvtype,obs2_encmsg_tlvs,next_blinding,12
tlvdata,encmsg_tlvs,next_blinding,blinding,point, tlvdata,obs2_encmsg_tlvs,next_blinding,blinding,point,
tlvtype,encmsg_tlvs,self_id,14 tlvtype,obs2_encmsg_tlvs,self_id,14
tlvdata,encmsg_tlvs,self_id,data,byte,... tlvdata,obs2_encmsg_tlvs,self_id,data,byte,...
subtype,onionmsg_path subtype,onionmsg_path
subtypedata,onionmsg_path,node_id,point, subtypedata,onionmsg_path,node_id,point,
subtypedata,onionmsg_path,enclen,u16, subtypedata,onionmsg_path,enclen,u16,
1 #include <wire/onion_defs.h>
8 tlvtype,tlv_payload,payment_data,8
9 tlvdata,tlv_payload,payment_data,payment_secret,byte,32
10 tlvdata,tlv_payload,payment_data,total_msat,tu64,
11 tlvtype,onionmsg_payload,reply_path,2 tlvtype,obs2_onionmsg_payload,reply_path,2
12 tlvdata,onionmsg_payload,reply_path,first_node_id,point, tlvdata,obs2_onionmsg_payload,reply_path,first_node_id,point,
13 tlvdata,onionmsg_payload,reply_path,blinding,point, tlvdata,obs2_onionmsg_payload,reply_path,blinding,point,
14 tlvdata,onionmsg_payload,reply_path,path,onionmsg_path,... tlvdata,obs2_onionmsg_payload,reply_path,path,onionmsg_path,...
15 tlvtype,onionmsg_payload,enctlv,10 tlvtype,obs2_onionmsg_payload,enctlv,10
16 tlvdata,onionmsg_payload,enctlv,enctlv,byte,... tlvdata,obs2_onionmsg_payload,enctlv,enctlv,byte,...
17 tlvtype,onionmsg_payload,invoice_request,64 tlvtype,obs2_onionmsg_payload,invoice_request,64
18 tlvdata,onionmsg_payload,invoice_request,invoice_request,byte,... tlvdata,obs2_onionmsg_payload,invoice_request,invoice_request,byte,...
19 tlvtype,onionmsg_payload,invoice,66 tlvtype,obs2_onionmsg_payload,invoice,66
20 tlvdata,onionmsg_payload,invoice,invoice,byte,... tlvdata,obs2_onionmsg_payload,invoice,invoice,byte,...
21 tlvtype,onionmsg_payload,invoice_error,68 tlvtype,obs2_onionmsg_payload,invoice_error,68
22 tlvdata,onionmsg_payload,invoice_error,invoice_error,byte,... tlvdata,obs2_onionmsg_payload,invoice_error,invoice_error,byte,...
23 tlvtype,encmsg_tlvs,padding,1 tlvtype,obs2_encmsg_tlvs,padding,1
24 tlvdata,encmsg_tlvs,padding,pad,byte,... tlvdata,obs2_encmsg_tlvs,padding,pad,byte,...
25 tlvtype,encmsg_tlvs,next_node_id,4 tlvtype,obs2_encmsg_tlvs,next_node_id,4
26 tlvdata,encmsg_tlvs,next_node_id,node_id,point, tlvdata,obs2_encmsg_tlvs,next_node_id,node_id,point,
27 tlvtype,encmsg_tlvs,next_blinding,12 tlvtype,obs2_encmsg_tlvs,next_blinding,12
28 tlvdata,encmsg_tlvs,next_blinding,blinding,point, tlvdata,obs2_encmsg_tlvs,next_blinding,blinding,point,
29 tlvtype,encmsg_tlvs,self_id,14 tlvtype,obs2_encmsg_tlvs,self_id,14
30 tlvdata,encmsg_tlvs,self_id,data,byte,... tlvdata,obs2_encmsg_tlvs,self_id,data,byte,...
31 subtype,onionmsg_path
32 subtypedata,onionmsg_path,node_id,point,
33 subtypedata,onionmsg_path,enclen,u16,

View File

@@ -33,7 +33,7 @@ static bool unknown_type(enum peer_wire t)
case WIRE_QUERY_CHANNEL_RANGE: case WIRE_QUERY_CHANNEL_RANGE:
case WIRE_REPLY_CHANNEL_RANGE: case WIRE_REPLY_CHANNEL_RANGE:
case WIRE_GOSSIP_TIMESTAMP_FILTER: case WIRE_GOSSIP_TIMESTAMP_FILTER:
case WIRE_ONION_MESSAGE: case WIRE_OBS2_ONION_MESSAGE:
case WIRE_TX_ADD_INPUT: case WIRE_TX_ADD_INPUT:
case WIRE_TX_REMOVE_INPUT: case WIRE_TX_REMOVE_INPUT:
case WIRE_TX_ADD_OUTPUT: case WIRE_TX_ADD_OUTPUT:
@@ -62,7 +62,7 @@ bool is_msg_for_gossipd(const u8 *cursor)
case WIRE_REPLY_SHORT_CHANNEL_IDS_END: case WIRE_REPLY_SHORT_CHANNEL_IDS_END:
case WIRE_QUERY_CHANNEL_RANGE: case WIRE_QUERY_CHANNEL_RANGE:
case WIRE_REPLY_CHANNEL_RANGE: case WIRE_REPLY_CHANNEL_RANGE:
case WIRE_ONION_MESSAGE: case WIRE_OBS2_ONION_MESSAGE:
return true; return true;
case WIRE_WARNING: case WIRE_WARNING:
case WIRE_INIT: case WIRE_INIT:

View File

@@ -328,7 +328,7 @@ msgtype,gossip_timestamp_filter,265,gossip_queries
msgdata,gossip_timestamp_filter,chain_hash,chain_hash, msgdata,gossip_timestamp_filter,chain_hash,chain_hash,
msgdata,gossip_timestamp_filter,first_timestamp,u32, msgdata,gossip_timestamp_filter,first_timestamp,u32,
msgdata,gossip_timestamp_filter,timestamp_range,u32, msgdata,gossip_timestamp_filter,timestamp_range,u32,
msgtype,onion_message,387,option_onion_messages msgtype,obs2_onion_message,387,option_onion_messages
msgdata,onion_message,blinding,point, msgdata,obs2_onion_message,blinding,point,
msgdata,onion_message,len,u16, msgdata,obs2_onion_message,len,u16,
msgdata,onion_message,onionmsg,byte,len msgdata,obs2_onion_message,onionmsg,byte,len
1 msgtype,init,16
328 msgdata,gossip_timestamp_filter,chain_hash,chain_hash,
329 msgdata,gossip_timestamp_filter,first_timestamp,u32,
330 msgdata,gossip_timestamp_filter,timestamp_range,u32,
331 msgtype,onion_message,387,option_onion_messages msgtype,obs2_onion_message,387,option_onion_messages
332 msgdata,onion_message,blinding,point, msgdata,obs2_onion_message,blinding,point,
333 msgdata,onion_message,len,u16, msgdata,obs2_onion_message,len,u16,
334 msgdata,onion_message,onionmsg,byte,len msgdata,obs2_onion_message,onionmsg,byte,len