diff options
author | David Goulet <dgoulet@torproject.org> | 2022-06-29 11:05:35 -0400 |
---|---|---|
committer | Micah Elizabeth Scott <beth@torproject.org> | 2023-05-10 07:37:11 -0700 |
commit | f0b63ca242a66cb5172e6b11a9f068ed348f601b (patch) | |
tree | 82405f47a4583ff9279818adea50cdaf96221f95 /src/feature/hs/hs_cell.h | |
parent | ca74530b40aa893196de2f6cdde9bcaeec4d03c2 (diff) | |
download | tor-f0b63ca242a66cb5172e6b11a9f068ed348f601b.tar.gz tor-f0b63ca242a66cb5172e6b11a9f068ed348f601b.zip |
hs: Move rendezvous circuit data structure
When parsing an INTRODUCE2 cell, we extract data in order to launch the
rendezvous circuit. This commit creates a data structure just for that
data so it can be used by future commits for prop327 in order to copy
that data over a priority queue instead of the whole intro data data
structure which contains pointers that could dissapear.
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/feature/hs/hs_cell.h')
-rw-r--r-- | src/feature/hs/hs_cell.h | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/feature/hs/hs_cell.h b/src/feature/hs/hs_cell.h index 2735401c05..61c0a94b20 100644 --- a/src/feature/hs/hs_cell.h +++ b/src/feature/hs/hs_cell.h @@ -47,6 +47,21 @@ typedef struct hs_cell_introduce1_data_t { const hs_pow_solution_t *pow_solution; } hs_cell_introduce1_data_t; +/** Introduction data needed to launch a rendezvous circuit. This is set after + * receiving an INTRODUCE2 valid cell. */ +typedef struct hs_cell_intro_rdv_data_t { + /** 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; + /** Congestion control parameters. */ + unsigned int cc_enabled : 1; +} hs_cell_intro_rdv_data_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 @@ -77,20 +92,12 @@ typedef struct hs_cell_introduce2_data_t { /*** Mutable Section: Set upon parsing INTRODUCE2 cell. ***/ - /** 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; + /** Data needed to launch a rendezvous circuit. */ + hs_cell_intro_rdv_data_t rdv_data; /** Replay cache of the introduction point. */ replaycache_t *replay_cache; /** Flow control negotiation parameters. */ protover_summary_flags_t pv; - /** Congestion control parameters. */ - unsigned int cc_enabled : 1; } hs_cell_introduce2_data_t; /* Build cell API. */ |