summaryrefslogtreecommitdiff
path: root/src/or/relay_crypto.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-03-17 10:59:15 -0400
committerNick Mathewson <nickm@torproject.org>2018-03-17 10:59:15 -0400
commit5ecad6c95d5e8e9a0abe5c86b5f8f066cc7a8f1c (patch)
treef632c75c417674b2a307ffd8627286973cbe2b50 /src/or/relay_crypto.h
parent80955be6ecae7095d267981b39d10237aabc38a6 (diff)
downloadtor-5ecad6c95d5e8e9a0abe5c86b5f8f066cc7a8f1c.tar.gz
tor-5ecad6c95d5e8e9a0abe5c86b5f8f066cc7a8f1c.zip
Extract the cryptographic parts of crypt_path_t and or_circuit_t.
Additionally, this change extracts the functions that created and freed these elements. These structures had common "forward&reverse stream&digest" elements, but they were initialized and freed through cpath objects, and different parts of the code depended on them. Now all that code is extacted, and kept in relay_crypto.c
Diffstat (limited to 'src/or/relay_crypto.h')
-rw-r--r--src/or/relay_crypto.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/relay_crypto.h b/src/or/relay_crypto.h
index 8d09179417..66ae02cee9 100644
--- a/src/or/relay_crypto.h
+++ b/src/or/relay_crypto.h
@@ -12,6 +12,10 @@
#ifndef TOR_RELAY_CRYPTO_H
#define TOR_RELAY_CRYPTO_H
+int relay_crypto_init(relay_crypto_t *crypto,
+ const char *key_data, size_t key_data_len,
+ int reverse, int is_hs_v3);
+
int relay_decrypt_cell(circuit_t *circ, cell_t *cell,
cell_direction_t cell_direction,
crypt_path_t **layer_hint, char *recognized);
@@ -19,5 +23,9 @@ void relay_encrypt_cell_outbound(cell_t *cell, origin_circuit_t *or_circ,
crypt_path_t *layer_hint);
void relay_encrypt_cell_inbound(cell_t *cell, or_circuit_t *or_circ);
+void relay_crypto_clear(relay_crypto_t *crypto);
+
+void relay_crypto_assert_ok(const relay_crypto_t *crypto);
+
#endif /* !defined(TOR_RELAY_CRYPTO_H) */