479 Commits
Author SHA1 Message Date
Conner Fromknecht 740e8fd686 watchtower/blob/justice_kit_test: remove external nonce
The nonce is now passed in as the prefix to the
ciphertext, and is generated randomly in calls
to Encrypt.
2018-10-31 20:42:03 -07:00
Conner Fromknecht c5eba3b608 watchtower/blob/justice_kit: use randomized 192-bit nonce
This commit modifies the blob encryption scheme to
use chacha20-poly1305 with a randomized 192-bit nonce.
The previous approach used a deterministic nonce scheme,
which is being replaced to simplify the requirements of
a correct implementation.  As a result, each payload
gains an addtional 24-bytes prepended to the ciphertext.
2018-10-31 20:42:01 -07:00
Conner Fromknecht 2dd399ca52 watchtower/blob/justice_kit: return DER signatures
This commit fixes an issue with the witness stack
construction for to-local and to-remote inputs,
that would cause the justice kit to return
signatures as fixed-size, 64-byte signatures.
The correct behavior is to return DER-encoded
signatures so that they will properly verify on
the network, since the consensus rules won't
be able to understand the fixed-size variant.
2018-10-31 17:36:18 -07:00
Conner Fromknecht 2255ce17db watchtower/blob/justice_kit_test: add sweep addr tests
Adds vectors to the justice kit tests to
ensure variable length sweep addresses are
properly encoded/decoded.
2018-10-29 16:48:43 -07:00
Conner Fromknecht b7d811b3dd watchtower/blob/justice_kit: add variable length sweep addr
This commit fixes an oversight in the previous
design of the watchtower blob, by introducing
a length byte for sweep addresses. The previous
format supposed that addresses would be padded
to 42 bytes, but had no indication of the
address's actual length.

To rememdy this, we introduce a single byte
indicating the actual size of the address,
such that the padding can be removed upon
decoding.
2018-10-29 16:48:43 -07:00
Conner Fromknecht ae6f06155a watchtower/blob/justice_kit_test: use test.Run for sub tests 2018-10-29 16:34:31 -07:00
Conner Fromknecht 712e7f08f0 watchtower/server/server_test: add test vectors for server behavior 2018-10-24 20:18:22 -07:00
Conner Fromknecht db4c4488c5 watchtower/server/mock: create MockPeer for debug build 2018-10-24 20:18:22 -07:00
Conner Fromknecht 48643a1747 watchtower/server/interface: adds Server, Peer and DB 2018-10-24 20:18:22 -07:00
Conner Fromknecht a3e1bb15c5 watchtower/server/log: adds wt SRVR sublogger 2018-10-24 20:18:21 -07:00
Conner Fromknecht 73709530e3 watchtower/server/server: server skeleton 2018-10-24 20:18:21 -07:00
Conner Fromknecht fd6024c306 watchtower/wtdb/mock: adds MockDB for debug build 2018-10-24 20:18:21 -07:00
Conner Fromknecht 8b47a96459 watchtower/wtdb/session_state_update: adds session state 2018-10-24 20:18:21 -07:00
Conner Fromknecht 405838d29c watchtower/wtdb/session_info: adds SessionInfo 2018-10-24 20:18:21 -07:00
Conner Fromknecht e825a756f4 watchtower/wtdb/session_id: adds SessoinID, client pubkey 2018-10-24 20:18:21 -07:00
Conner Fromknecht bc86ccf212 watchtower/wtdb/breach_hint: adds BreachHint, txid prefix 2018-10-24 20:18:17 -07:00
Conner Fromknecht 8acd13a094 watchtower/wtwire/wtwire_test: adds quick tests wtwire msgs 2018-10-23 18:28:30 -07:00
Conner Fromknecht 42a4b373a6 watchtower/wtwire/state_update_reply: ack w/ highest seqnum or error 2018-10-23 18:28:28 -07:00
Conner Fromknecht fdd3ad3149 watchtower/wtwire/state_update: sends encrypted blobs 2018-10-23 18:28:27 -07:00
Conner Fromknecht 216c77e10e watchtower/wtwire/create_session_reply: accept/deny session init 2018-10-23 18:28:26 -07:00
Conner Fromknecht 71541bc94e watchtower/wtwire/create_session: propose new session 2018-10-23 18:28:25 -07:00
Conner Fromknecht 9ab620c7be watchtower/wtwire/error_code: add shared error codes 2018-10-23 18:28:23 -07:00
Conner Fromknecht 999466c860 watchtower/wtwire/error: add generic error message 2018-10-23 18:28:22 -07:00
Conner Fromknecht d171df5184 watchtower/wtwire/features: add watchtower feature bits 2018-10-23 18:28:20 -07:00
Conner Fromknecht 5ba95585e5 watchtower/wtwire/init: borrow LN init msg for WT init 2018-10-23 18:28:19 -07:00
Conner Fromknecht 49b2a3bdb5 watchtower/wtwire/message: define wtwire message interface 2018-10-23 18:28:18 -07:00
Conner Fromknecht 4325d9ec1e watchtower/wtwire/wtwire: add watchtower message codec 2018-10-23 18:23:08 -07:00
Conner Fromknecht 085e1f9ca8 watchtower/blob/justice_kit_test: add encrypt/decrypt test vectors 2018-07-24 19:55:07 -07:00
Conner Fromknecht 9749096403 watchtower/blob/justice_kit: adds v0 encoding and encryption 2018-07-24 19:55:07 -07:00