diff options
author | David Goulet <dgoulet@torproject.org> | 2016-08-29 15:28:58 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2016-10-31 16:03:28 -0400 |
commit | f22eb2730cccab44de579c64ba2386a94abef0fa (patch) | |
tree | 0c6b622bb1938a7c7481083fce38f70b4ce6b00b /src/trunnel/hs/cell_establish_intro.trunnel | |
parent | 0ba3444b4a9d408573a442b32be794a78b9250b5 (diff) | |
download | tor-f22eb2730cccab44de579c64ba2386a94abef0fa.tar.gz tor-f22eb2730cccab44de579c64ba2386a94abef0fa.zip |
prop224: Add ESTABLISH_INTRO and INTRO_ESTABLISHED trunnel definition
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/trunnel/hs/cell_establish_intro.trunnel')
-rw-r--r-- | src/trunnel/hs/cell_establish_intro.trunnel | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/trunnel/hs/cell_establish_intro.trunnel b/src/trunnel/hs/cell_establish_intro.trunnel new file mode 100644 index 0000000000..4f9e8f7e08 --- /dev/null +++ b/src/trunnel/hs/cell_establish_intro.trunnel @@ -0,0 +1,41 @@ +/* + * This contains the definition of the ESTABLISH_INTRO and INTRO_ESTABLISHED + * cell for onion service version 3 and onward. The following format is + * specified in proposal 224 section 3.1. + */ + +extern struct cell_extension; + +const TRUNNEL_SHA3_256_LEN = 32; + +/* ESTABLISH_INTRO payload. See details in section 3.1.1 */ +struct hs_cell_establish_intro { + /* Indicate the start of the handshake authentication data. */ + @ptr start_cell; + + /* Authentication key material. */ + u8 auth_key_type IN [0x00, 0x01, 0x02]; + u16 auth_key_len; + u8 auth_key[auth_key_len]; + + /* Extension(s). Reserved fields. */ + struct cell_extension extensions; + @ptr end_mac_fields; + + /* Handshake MAC. */ + u8 handshake_mac[TRUNNEL_SHA3_256_LEN]; + + /* Signature */ + u16 sig_len; + /* Indicate the end of the handshake authentication data. */ + @ptr end_sig_fields; + u8 sig[sig_len]; +}; + +/* INTRO_ESTABLISHED payload which is an acknowledge of the ESTABLISH_INTRO + * cell. For legacy node, this payload is empty so the following only applies + * to version >= 3. */ +struct hs_cell_intro_established { + /* Extension(s). Reserved fields. */ + struct cell_extension extensions; +}; |