diff options
author | George Kadianakis <desnacked@riseup.net> | 2016-11-02 11:37:50 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-12-14 15:18:36 -0500 |
commit | d7be1fd5197ad984d45c1d9a0a033a2b95a9fd9e (patch) | |
tree | a1e1c05d80e686cc3e5edb5c61550262da69fcc7 /src/or/hs_intropoint.h | |
parent | c4c90d56b543887ee9bee6553725151b09891d8e (diff) | |
download | tor-d7be1fd5197ad984d45c1d9a0a033a2b95a9fd9e.tar.gz tor-d7be1fd5197ad984d45c1d9a0a033a2b95a9fd9e.zip |
prop224: Introduce the new introduction point code.
(pun not intended)
Now our code supports both legacy and prop224 ESTABLISH_INTRO cells :)
hs_intro_received_establish_intro() is the new entry point.
Diffstat (limited to 'src/or/hs_intropoint.h')
-rw-r--r-- | src/or/hs_intropoint.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/or/hs_intropoint.h b/src/or/hs_intropoint.h new file mode 100644 index 0000000000..651e2dcc0f --- /dev/null +++ b/src/or/hs_intropoint.h @@ -0,0 +1,40 @@ +/* Copyright (c) 2016, The Tor Project, Inc. */ +/* See LICENSE for licensing information */ + +/** + * \file hs_intropoint.h + * \brief Header file for hs_intropoint.c. + **/ + +#ifndef TOR_HS_INTRO_H +#define TOR_HS_INTRO_H + +/* Authentication key type in an ESTABLISH_INTRO cell. */ +enum hs_intro_auth_key_type { + HS_INTRO_AUTH_KEY_TYPE_LEGACY0 = 0x00, + HS_INTRO_AUTH_KEY_TYPE_LEGACY1 = 0x01, + HS_INTRO_AUTH_KEY_TYPE_ED25519 = 0x02, +}; + +int hs_intro_received_establish_intro(or_circuit_t *circ, const uint8_t *request, + size_t request_len); + +MOCK_DECL(int, hs_intro_send_intro_established_cell,(or_circuit_t *circ)); + +/* also used by rendservice.c */ +int hs_intro_circuit_is_suitable(const or_circuit_t *circ); + +#ifdef HS_INTROPOINT_PRIVATE + +STATIC int +verify_establish_intro_cell(const hs_cell_establish_intro_t *out, + const char *circuit_key_material, + size_t circuit_key_material_len); + +STATIC void +get_auth_key_from_establish_intro_cell(ed25519_public_key_t *auth_key_out, + const hs_cell_establish_intro_t *cell); + +#endif /* HS_INTROPOINT_PRIVATE */ + +#endif /* TOR_HS_INTRO_H */ |