MCPcopy Create free account
hub / github.com/ElementsProject/lightning / init

Function init

tests/fuzz/connectd_handshake.h:72–101  ·  view source on GitHub ↗

The init function used by all fuzz-connectd-handshake-act* targets. */

Source from the content-addressed store, hash-verified

70
71/* The init function used by all fuzz-connectd-handshake-act* targets. */
72void init(int *argc, char ***argv)
73{
74 int devnull = open("/dev/null", O_WRONLY);
75 assert(devnull >= 0);
76 status_setup_sync(devnull);
77
78 /* Don't call this if we're in unit-test mode, as libfuzz.c does it */
79 if (!tmpctx)
80 common_setup("fuzzer");
81
82 /* These keys are copied from BOLT 8 test vectors, though we use them in
83 * a different setting.
84 *
85 * BOLT #8:
86 *
87 * name: transport-responder successful handshake
88 * ls.priv=2121212121212121212121212121212121212121212121212121212121212121
89 * ls.pub=028d7500dd4c12685d1f568b4c2b5048e8534b873319f3a8daa612b469132ec7f7
90 * e.priv=0x2222222222222222222222222222222222222222222222222222222222222222
91 * e.pub=0x02466d7fcae563e5cb09a0d1870bb580344804617879a14949cf22285f1bae3f27
92 */
93 init_priv = privkey(
94 "2121212121212121212121212121212121212121212121212121212121212121");
95 init_pub = pubkey("028d7500dd4c12685d1f568b4c2b5048e8534b873319f3a8daa6"
96 "12b469132ec7f7");
97 resp_priv = privkey(
98 "2222222222222222222222222222222222222222222222222222222222222222");
99 resp_pub = pubkey("02466d7fcae563e5cb09a0d1870bb580344804617879a14949cf"
100 "22285f1bae3f27");
101}
102
103/* This function should be called at the start of each fuzz iteration to reset
104 * globals to their initial values. */

Callers

nothing calls this directly

Calls 4

common_setupFunction · 0.85
privkeyFunction · 0.70
pubkeyFunction · 0.70
status_setup_syncFunction · 0.50

Tested by

no test coverage detected