diff options
author | David Goulet <dgoulet@torproject.org> | 2017-02-24 09:48:14 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-02-24 11:36:36 -0500 |
commit | 4ed10e5053ebef31d5f922933f7236a6ab743bf9 (patch) | |
tree | 82518acf73b115ce9b5ab54c54c2ae830d4bd250 /src/test/test_hs_intropoint.c | |
parent | 823fb68a14b551fc1f40e904428b3e31732441c5 (diff) | |
download | tor-4ed10e5053ebef31d5f922933f7236a6ab743bf9.tar.gz tor-4ed10e5053ebef31d5f922933f7236a6ab743bf9.zip |
hs: Fix bad use of sizeof() when encoding ESTABLISH_INTRO legacy cell
When encoding a legacy ESTABLISH_INTRO cell, we were using the sizeof() on a
pointer instead of using the real size of the destination buffer leading to an
overflow passing an enormous value to the signing digest function.
Fortunately, that value was only used to make sure the destination buffer
length was big enough for the key size and in this case it always was because
of the overflow.
Fixes #21553
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/test/test_hs_intropoint.c')
-rw-r--r-- | src/test/test_hs_intropoint.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/test/test_hs_intropoint.c b/src/test/test_hs_intropoint.c index ea12aeb2da..b207cd4ce3 100644 --- a/src/test/test_hs_intropoint.c +++ b/src/test/test_hs_intropoint.c @@ -489,6 +489,7 @@ helper_establish_intro_v2(or_circuit_t *intro_circ) /* Use old circuit_key_material why not */ cell_len = encode_establish_intro_cell_legacy((char*)cell_body, + sizeof(cell_body), key1, (char *) circuit_key_material); tt_int_op(cell_len, >, 0); |