diff options
author | David Goulet <dgoulet@torproject.org> | 2017-07-21 17:48:18 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2017-08-24 13:03:28 -0400 |
commit | fca2f64e2f563c07e2d5467adc49914bc4545e36 (patch) | |
tree | 385863f5633c5b4f8f56b91c3877fa028ab0cf1b /src/or/hs_cell.c | |
parent | cb336a7062f87c5c306549a4f4a26eab66c5b825 (diff) | |
download | tor-fca2f64e2f563c07e2d5467adc49914bc4545e36.tar.gz tor-fca2f64e2f563c07e2d5467adc49914bc4545e36.zip |
prop224: Handle INTRODUCE_ACK cell
The client is now able to handle an INTRODUCE_ACK cell and do the appropriate
actions.
An intro point failure cache is missing and a way to close all intro point
that were launched in parallel. Some notes are in the comment for that.
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/hs_cell.c')
-rw-r--r-- | src/or/hs_cell.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/or/hs_cell.c b/src/or/hs_cell.c index 1f9df825f0..c5ea6e4db7 100644 --- a/src/or/hs_cell.c +++ b/src/or/hs_cell.c @@ -875,6 +875,18 @@ hs_cell_parse_introduce_ack(const uint8_t *payload, size_t payload_len) tor_assert(payload); + /* If it is a legacy IP, rend-spec.txt specifies that a ACK is 0 byte and a + * NACK is 1 byte. We can't use the legacy function for this so we have to + * do a special case. */ + if (payload_len <= 1) { + if (payload_len == 0) { + ret = HS_CELL_INTRO_ACK_SUCCESS; + } else { + ret = HS_CELL_INTRO_ACK_FAILURE; + } + goto end; + } + if (trn_cell_introduce_ack_parse(&cell, payload, payload_len) < 0) { log_info(LD_REND, "Invalid INTRODUCE_ACK cell. Unable to parse it."); goto end; |