aboutsummaryrefslogtreecommitdiff
path: root/src/trunnel/hs/cell_introduce1.trunnel
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2016-08-29 15:31:38 -0400
committerNick Mathewson <nickm@torproject.org>2016-10-31 16:24:30 -0400
commit0fa671843e16f8e64c869726dc2cf3ffb206042a (patch)
tree5c19b66ebb94113e301a26054cf5cb1a255d4636 /src/trunnel/hs/cell_introduce1.trunnel
parentf22eb2730cccab44de579c64ba2386a94abef0fa (diff)
downloadtor-0fa671843e16f8e64c869726dc2cf3ffb206042a.tar.gz
tor-0fa671843e16f8e64c869726dc2cf3ffb206042a.zip
prop224: Add INTRODUCE1 and INTRODUCE_ACK trunnel definition
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/trunnel/hs/cell_introduce1.trunnel')
-rw-r--r--src/trunnel/hs/cell_introduce1.trunnel60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/trunnel/hs/cell_introduce1.trunnel b/src/trunnel/hs/cell_introduce1.trunnel
new file mode 100644
index 0000000000..f7776879cd
--- /dev/null
+++ b/src/trunnel/hs/cell_introduce1.trunnel
@@ -0,0 +1,60 @@
+/*
+ * This contains the definition of the INTRODUCE1 and INTRODUCE_ACK cell for
+ * onion service version 3 and onward. The following format is specified in
+ * proposal 224 section 3.2.
+ */
+
+/* From cell_common.trunnel. */
+extern struct cell_extension;
+/* From ed25519_cert.trunnel. */
+extern struct link_specifier;
+
+const TRUNNEL_SHA1_LEN = 20;
+const TRUNNEL_REND_COOKIE_LEN = 20;
+
+/* INTRODUCE1 payload. See details in section 3.2.1. */
+struct hs_cell_introduce1 {
+ /* Always zeroed. MUST be checked explicitely by the caller. */
+ u8 legacy_key_id[TRUNNEL_SHA1_LEN];
+
+ /* 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;
+
+ /* Variable length, up to the end of cell. */
+ u8 encrypted[];
+};
+
+/* INTRODUCE_ACK payload. See details in section 3.2.2. */
+struct hs_cell_introduce_ack {
+ /* Status of introduction. */
+ u16 status IN [0x0000, 0x0001, 0x0002];
+
+ /* Extension(s). Reserved fields. */
+ struct cell_extension extensions;
+};
+
+/* Encrypted section of the INTRODUCE1/INTRODUCE2 cell. */
+struct hs_cell_introduce_encrypted {
+ /* Rendezvous cookie. */
+ u8 rend_cookie[TRUNNEL_REND_COOKIE_LEN];
+
+ /* Extension(s). Reserved fields. */
+ struct cell_extension extensions;
+
+ /* Onion key material. */
+ u8 onion_key_type IN [0x01];
+ u16 onion_key_len;
+ u8 onion_key[onion_key_len];
+
+ /* Link specifiers(s) */
+ u8 nspec;
+ struct link_specifier nspecs[nspec];
+
+ /* Optional padding. This might be empty or not. */
+ u8 pad[];
+};