|
@@ -11,6 +11,7 @@
|
|
|
#include "channel.h"
|
|
|
#include "connection_edge.h"
|
|
|
#include "connection_or.h"
|
|
|
+#include "config.h"
|
|
|
#include "onion.h"
|
|
|
#include "onion_tap.h"
|
|
|
#include "onion_fast.h"
|
|
@@ -698,6 +699,7 @@ test_cfmt_extend_cells(void *arg)
|
|
|
tt_int_op(61681, OP_EQ, ec.orport_ipv4.port);
|
|
|
tt_str_op("2002::f0:c51e", OP_EQ, fmt_addr(&ec.orport_ipv6.addr));
|
|
|
tt_int_op(4370, OP_EQ, ec.orport_ipv6.port);
|
|
|
+ tt_assert(ed25519_public_key_is_zero(&ec.ed_pubkey));
|
|
|
tt_mem_op(ec.node_id,OP_EQ, "anthropomorphization", 20);
|
|
|
tt_int_op(cc->cell_type, OP_EQ, CELL_CREATE2);
|
|
|
tt_int_op(cc->handshake_type, OP_EQ, 0x105);
|
|
@@ -717,6 +719,37 @@ test_cfmt_extend_cells(void *arg)
|
|
|
tt_mem_op(p2+1+8+22+4,OP_EQ, b, 99+20);
|
|
|
tt_int_op(0, OP_EQ, create_cell_format_relayed(&cell, cc));
|
|
|
|
|
|
+
|
|
|
+ memcpy(ec.ed_pubkey.pubkey,
|
|
|
+ "brownshoesdontmakeit/brownshoesd", 32);
|
|
|
+
|
|
|
+
|
|
|
+ get_options_mutable()->ExtendByEd25519ID = 0;
|
|
|
+ tt_int_op(0, OP_EQ, extend_cell_format(&p2_cmd, &p2_len, p2, &ec));
|
|
|
+ tt_int_op(p2_len, OP_EQ, 89+99-34-20);
|
|
|
+ test_memeq_hex(p2,
|
|
|
+ "02000612F40001F0F1"
|
|
|
+ "0214616e7468726f706f6d6f727068697a6174696f6e"
|
|
|
+ "01050063");
|
|
|
+
|
|
|
+
|
|
|
+ get_options_mutable()->ExtendByEd25519ID = 1;
|
|
|
+ tt_int_op(0, OP_EQ, extend_cell_format(&p2_cmd, &p2_len, p2, &ec));
|
|
|
+ tt_int_op(p2_len, OP_EQ, 89+99-34-20 + 34);
|
|
|
+ test_memeq_hex(p2,
|
|
|
+ "03000612F40001F0F1"
|
|
|
+ "0214616e7468726f706f6d6f727068697a6174696f6e"
|
|
|
+
|
|
|
+ "0320" "62726f776e73686f6573646f6e746d616b656"
|
|
|
+ "9742f62726f776e73686f657364"
|
|
|
+ "01050063");
|
|
|
+
|
|
|
+ memset(&ec, 0, sizeof(ec));
|
|
|
+ tt_int_op(0, OP_EQ, extend_cell_parse(&ec, RELAY_COMMAND_EXTEND2,
|
|
|
+ p2, p2_len));
|
|
|
+ tt_mem_op("brownshoesdontmakeit/brownshoesd", OP_EQ,
|
|
|
+ ec.ed_pubkey.pubkey, 32);
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -1257,7 +1290,7 @@ struct testcase_t cell_format_tests[] = {
|
|
|
TEST(connected_cells, 0),
|
|
|
TEST(create_cells, 0),
|
|
|
TEST(created_cells, 0),
|
|
|
- TEST(extend_cells, 0),
|
|
|
+ TEST(extend_cells, TT_FORK),
|
|
|
TEST(extended_cells, 0),
|
|
|
TEST(resolved_cells, 0),
|
|
|
TEST(is_destroy, 0),
|