Rusty Russell
8 years ago
6 changed files with 1129 additions and 2 deletions
@ -0,0 +1,57 @@ |
|||
#! /usr/bin/make
|
|||
|
|||
# Designed to be run one level up
|
|||
lightningd/handshake-wrongdir: |
|||
$(MAKE) -C .. lightningd/handshake-all |
|||
|
|||
default: lightningd/handshake-all |
|||
|
|||
lightningd/handshake-all: lightningd/lightningd_handshake |
|||
|
|||
# lightningd/handshake needs these:
|
|||
LIGHTNINGD_HANDSHAKE_HEADERS := \
|
|||
lightningd/handshake/gen_handshake_control_wire.h \
|
|||
lightningd/handshake/gen_handshake_status_wire.h |
|||
LIGHTNINGD_HANDSHAKE_SRC := lightningd/handshake/handshake.c \
|
|||
$(LIGHTNINGD_HANDSHAKE_HEADERS:.h=.c) |
|||
LIGHTNINGD_HANDSHAKE_OBJS := $(LIGHTNINGD_HANDSHAKE_SRC:.c=.o) |
|||
|
|||
# Control daemon uses this:
|
|||
LIGHTNINGD_HANDSHAKE_CONTROL_HEADERS := $(LIGHTNINGD_HANDSHAKE_HEADERS) |
|||
LIGHTNINGD_HANDSHAKE_CONTROL_SRC := $(LIGHTNINGD_HANDSHAKE_HEADERS:.h=.c) |
|||
LIGHTNINGD_HANDSHAKE_CONTROL_OBJS := $(LIGHTNINGD_HANDSHAKE_CONTROL_SRC:.c=.o) |
|||
|
|||
LIGHTNINGD_HANDSHAKE_GEN_SRC := $(filter lightningd/handshake/gen_%, $(LIGHTNINGD_HANDSHAKE_SRC) $(LIGHTNINGD_HANDSHAKE_CONTROL_SRC)) |
|||
|
|||
LIGHTNINGD_HANDSHAKE_SRC_NOGEN := $(filter-out lightningd/handshake/gen_%, $(LIGHTNINGD_HANDSHAKE_SRC)) |
|||
|
|||
$(LIGHTNINGD_HANDSHAKE_OBJS): $(CCAN_HEADERS) $(CORE_HEADERS) $(GEN_HEADERS) $(WIRE_HEADERS) $(BITCOIN_HEADERS) $(LIGHTNINGD_HANDSHAKE_HEADERS) $(LIGHTNINGD_HSM_CLIENT_HEADERS) $(LIBBASE58_HEADERS) |
|||
|
|||
lightningd/handshake/gen_handshake_control_wire.h: $(WIRE_GEN) lightningd/handshake/handshake_control_wire_csv |
|||
$(WIRE_GEN) --header $@ handshake_control_wire_type < lightningd/handshake/handshake_control_wire_csv > $@ |
|||
|
|||
lightningd/handshake/gen_handshake_control_wire.c: $(WIRE_GEN) lightningd/handshake/handshake_control_wire_csv |
|||
$(WIRE_GEN) ${@:.c=.h} handshake_control_wire_type < lightningd/handshake/handshake_control_wire_csv > $@ |
|||
|
|||
lightningd/handshake/gen_handshake_status_wire.h: $(WIRE_GEN) lightningd/handshake/handshake_status_wire_csv |
|||
$(WIRE_GEN) --header $@ handshake_status_wire_type < lightningd/handshake/handshake_status_wire_csv > $@ |
|||
|
|||
lightningd/handshake/gen_handshake_status_wire.c: $(WIRE_GEN) lightningd/handshake/handshake_status_wire_csv |
|||
$(WIRE_GEN) ${@:.c=.h} handshake_status_wire_type < lightningd/handshake/handshake_status_wire_csv > $@ |
|||
|
|||
LIGHTNINGD_HANDSHAKE_OBJS := $(LIGHTNINGD_HANDSHAKE_SRC:.c=.o) $(LIGHTNINGD_HANDSHAKE_GEN_SRC:.c=.o) |
|||
|
|||
lightningd/lightningd_handshake: $(LIGHTNINGD_LIB_OBJS) $(LIGHTNINGD_HANDSHAKE_OBJS) $(CORE_OBJS) $(WIRE_OBJS) $(BITCOIN_OBJS) $(CCAN_OBJS) $(LIGHTNINGD_HSM_CLIENT_OBJS) $(LIBBASE58_OBJS) libsecp256k1.a |
|||
$(CC) $(CFLAGS) -o $@ $^ $(LDLIBS) |
|||
|
|||
check-source: $(LIGHTNINGD_HANDSHAKE_SRC_NOGEN:%=check-src-include-order/%) |
|||
check-source-bolt: $(LIGHTNINGD_HANDSHAKE_SRC:%=bolt-check/%) $(LIGHTNINGD_HANDSHAKE_HEADERS:%=bolt-check/%) |
|||
|
|||
check-whitespace: $(LIGHTNINGD_HANDSHAKE_SRC_NOGEN:%=check-whitespace/%) $(LIGHTNINGD_HANDSHAKE_HEADERS_NOGEN:%=check-whitespace/%) |
|||
|
|||
clean: lightningd/handshake-clean |
|||
|
|||
lightningd/handshake-clean: |
|||
$(RM) $(LIGHTNINGD_HANDSHAKE_OBJS) gen_* |
|||
|
|||
-include lightningd/handshake/test/Makefile |
File diff suppressed because it is too large
@ -0,0 +1,12 @@ |
|||
#include <lightningd/cryptomsg.h> |
|||
handshake_responder_req,0 |
|||
handshake_responder_req,0,my_id,33 |
|||
handshake_responder_resp,1 |
|||
handshake_responder_resp,0,initiator_id,33 |
|||
handshake_responder_resp,33,cs,144,struct crypto_state |
|||
handshake_initiator_req,2 |
|||
handshake_initiator_req,0,my_id,33 |
|||
handshake_initiator_req,33,responder_id,33 |
|||
handshake_initiator_resp,3 |
|||
handshake_initiator_resp,0,cs,144,struct crypto_state |
|||
handshake_exit_req,4 |
@ -0,0 +1,31 @@ |
|||
bad_command,0x8000 |
|||
bad_fdpass,0x8001 |
|||
initr_act1_bad_ecdh_for_ss,0x8011 |
|||
initr_act1_write_failed,0x8012 |
|||
initr_act2_read_failed,0x8013 |
|||
initr_act2_bad_version,0x8014 |
|||
initr_act2_bad_pubkey,0x8015 |
|||
initr_act2_bad_ecdh_for_ss,0x8016 |
|||
initr_act2_bad_tag,0x8017 |
|||
initr_act3_bad_hsm_ecdh,0x8018 |
|||
initr_act3_write_failed,0x8019 |
|||
respr_act1_read_failed,0x801A |
|||
respr_act1_bad_version,0x801B |
|||
respr_act1_bad_pubkey,0x801C |
|||
respr_act1_bad_hsm_ecdh,0x801D |
|||
respr_act1_bad_tag,0x801E |
|||
respr_act2_bad_ecdh_for_ss,0x801F |
|||
respr_act2_write_failed,0x8020 |
|||
respr_act3_read_failed,0x8021 |
|||
respr_act3_bad_version,0x8022 |
|||
respr_act3_bad_ciphertext,0x8023 |
|||
respr_act3_bad_pubkey,0x8024 |
|||
respr_act3_bad_ecdh_for_ss,0x8025 |
|||
respr_act3_bad_tag,0x8026 |
|||
initr_act_one,1 |
|||
initr_act_two,2 |
|||
initr_act_three,3 |
|||
respr_act_one,4 |
|||
respr_act_two,5 |
|||
respr_act_three,6 |
|||
success,0 |
Loading…
Reference in new issue