diff options
author | David Goulet <dgoulet@torproject.org> | 2019-03-07 11:20:23 -0500 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2019-04-29 12:17:57 -0400 |
commit | 504e05b02999afb6a58ebe4af5770ca8dc136233 (patch) | |
tree | f0cb451d4a2ab2f55e4a287178bce6b1b99e8836 /src/test/test_sendme.c | |
parent | cede93b2d83fb810ec8b2152882732ed0a7481dc (diff) | |
download | tor-504e05b02999afb6a58ebe4af5770ca8dc136233.tar.gz tor-504e05b02999afb6a58ebe4af5770ca8dc136233.zip |
prop289: Use a 20 bytes digest instead of 4
To achieve such, this commit also changes the trunnel declaration to use a
union instead of a seperate object for the v1 data.
A constant is added for the digest length so we can use it within the SENDME
code giving us a single reference.
Part of #26288
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/test/test_sendme.c')
-rw-r--r-- | src/test/test_sendme.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/test/test_sendme.c b/src/test/test_sendme.c index ad6aac6c0c..92f478df0e 100644 --- a/src/test/test_sendme.c +++ b/src/test/test_sendme.c @@ -156,12 +156,12 @@ test_v1_build_cell(void *arg) circ = TO_CIRCUIT(or_circ); cell_digest = crypto_digest_new(); - crypto_digest_add_bytes(cell_digest, "AAAA", 4); + crypto_digest_add_bytes(cell_digest, "AAAAAAAAAAAAAAAAAAAA", 20); tt_assert(cell_digest); - /* SENDME v1 payload is 7 bytes. See spec. */ + /* SENDME v1 payload is 3 bytes + 20 bytes digest. See spec. */ ret = build_cell_payload_v1(cell_digest, payload); - tt_int_op(ret, OP_EQ, 7); + tt_int_op(ret, OP_EQ, 23); /* Validation. */ |