summaryrefslogtreecommitdiff
path: root/src/or/hs_cell.h
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2017-03-07 14:57:14 -0500
committerNick Mathewson <nickm@torproject.org>2017-08-08 20:29:33 -0400
commit5e710368b3e9a19862422d4bd43f2c1d8d0ceba8 (patch)
treec8ee8438e0f710cd75c92da07b8845bffd0e932f /src/or/hs_cell.h
parentfaadbafba37932455ee60e02053e2e1300b63f33 (diff)
downloadtor-5e710368b3e9a19862422d4bd43f2c1d8d0ceba8.tar.gz
tor-5e710368b3e9a19862422d4bd43f2c1d8d0ceba8.zip
prop224: Handle service INTRODUCE2 cell
At this commit, launching rendezvous circuit is not implemented, only a placeholder. Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/hs_cell.h')
-rw-r--r--src/or/hs_cell.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/or/hs_cell.h b/src/or/hs_cell.h
index 8e34028896..901ff81aae 100644
--- a/src/or/hs_cell.h
+++ b/src/or/hs_cell.h
@@ -9,14 +9,53 @@
#ifndef TOR_HS_CELL_H
#define TOR_HS_CELL_H
+#include "or.h"
#include "hs_service.h"
+/* Onion key type found in the INTRODUCE1 cell. */
+typedef enum {
+ HS_CELL_ONION_KEY_TYPE_NTOR = 1,
+} hs_cell_onion_key_type_t;
+
+/* This data structure contains data that we need to parse an INTRODUCE2 cell
+ * which is used by the INTRODUCE2 cell parsing function. On a successful
+ * parsing, the onion_pk and rendezvous_cookie will be populated with the
+ * computed key material from the cell data. */
+typedef struct hs_cell_introduce2_data_t {
+ /*** Immutable Section. ***/
+
+ /* Introduction point authentication public key. */
+ const ed25519_public_key_t *auth_pk;
+ /* Introduction point encryption keypair for the ntor handshake. */
+ const curve25519_keypair_t *enc_kp;
+ /* Subcredentials of the service. */
+ const uint8_t *subcredential;
+ /* Payload of the received encoded cell. */
+ const uint8_t *payload;
+ /* Size of the payload of the received encoded cell. */
+ size_t payload_len;
+
+ /*** Muttable Section. ***/
+
+ /* Onion public key computed using the INTRODUCE2 encrypted section. */
+ curve25519_public_key_t onion_pk;
+ /* Rendezvous cookie taken from the INTRODUCE2 encrypted section. */
+ uint8_t rendezvous_cookie[REND_COOKIE_LEN];
+ /* Client public key from the INTRODUCE2 encrypted section. */
+ curve25519_public_key_t client_pk;
+ /* Link specifiers of the rendezvous point. Contains link_specifier_t. */
+ smartlist_t *link_specifiers;
+} hs_cell_introduce2_data_t;
+
ssize_t hs_cell_build_establish_intro(const char *circ_nonce,
const hs_service_intro_point_t *ip,
uint8_t *cell_out);
ssize_t hs_cell_parse_intro_established(const uint8_t *payload,
size_t payload_len);
+ssize_t hs_cell_parse_introduce2(hs_cell_introduce2_data_t *data,
+ const origin_circuit_t *circ,
+ const hs_service_t *service);
#endif /* TOR_HS_CELL_H */