aboutsummaryrefslogtreecommitdiff
path: root/src/core/or/crypt_path.h
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2019-05-15 10:16:05 -0400
committerNick Mathewson <nickm@torproject.org>2019-05-22 11:47:20 -0400
commit3835a3acf57426f692a787e7729de929b40dc62e (patch)
tree0da7f393f3c78d7b1985d5575b047bdeb59ccb3c /src/core/or/crypt_path.h
parent44265dd6716887b997bb03d2db1641efd7ae9c19 (diff)
downloadtor-3835a3acf57426f692a787e7729de929b40dc62e.tar.gz
tor-3835a3acf57426f692a787e7729de929b40dc62e.zip
sendme: Properly record SENDMEs on both edges
Turns out that we were only recording the "b_digest" but to have bidirectionnal authenticated SENDMEs, we need to use the "f_digest" in the forward cell situation. Because of the cpath refactoring, this commit plays with the crypt_path_ and relay_crypto_t API a little bit in order to respect the abstractions. Previously, we would record the cell digest as the SENDME digest in the decrypt cell function but to avoid code duplication (both directions needs to record), we now do that right after iff the cell is recognized (at the edge). It is now done in circuit_receive_relay_cell() instead. We now also record the cell digest as the SENDME digest in both relay cell encryption functions since they are split depending on the direction. relay_encrypt_cell_outbound() and relay_encrypt_cell_inbound() need to consider recording the cell digest depending on their direction (f vs b digest). Fixes #30428 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/core/or/crypt_path.h')
-rw-r--r--src/core/or/crypt_path.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/or/crypt_path.h b/src/core/or/crypt_path.h
index 30c14b3dce..9850610ef7 100644
--- a/src/core/or/crypt_path.h
+++ b/src/core/or/crypt_path.h
@@ -27,6 +27,9 @@ cpath_crypt_cell(const crypt_path_t *cpath, uint8_t *payload, bool is_decrypt);
struct crypto_digest_t *
cpath_get_incoming_digest(const crypt_path_t *cpath);
+void cpath_sendme_record_cell_digest(crypt_path_t *cpath,
+ bool is_foward_digest);
+
void
cpath_set_cell_forward_digest(crypt_path_t *cpath, cell_t *cell);