diff options
author | George Kadianakis <desnacked@riseup.net> | 2016-11-02 11:38:45 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-12-14 15:18:40 -0500 |
commit | 12dfe56b1cf9ec9852f27b8d10f2dcfad354f416 (patch) | |
tree | 88236daae57710a01df10da19d5ecc69566d6564 /src/or/rendmid.c | |
parent | d7be1fd5197ad984d45c1d9a0a033a2b95a9fd9e (diff) | |
download | tor-12dfe56b1cf9ec9852f27b8d10f2dcfad354f416.tar.gz tor-12dfe56b1cf9ec9852f27b8d10f2dcfad354f416.zip |
prop224: Use new HS functions in old HS code.
This is needed to make old code unittestable.
Diffstat (limited to 'src/or/rendmid.c')
-rw-r--r-- | src/or/rendmid.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/or/rendmid.c b/src/or/rendmid.c index f3841abf64..3319a639b9 100644 --- a/src/or/rendmid.c +++ b/src/or/rendmid.c @@ -35,15 +35,14 @@ rend_mid_establish_intro_legacy(or_circuit_t *circ, const uint8_t *request, int reason = END_CIRC_REASON_INTERNAL; log_info(LD_REND, - "Received an ESTABLISH_INTRO request on circuit %u", + "Received a legacy ESTABLISH_INTRO request on circuit %u", (unsigned) circ->p_circ_id); - if (circ->base_.purpose != CIRCUIT_PURPOSE_OR || circ->base_.n_chan) { - log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, - "Rejecting ESTABLISH_INTRO on non-OR or non-edge circuit."); + if (!hs_intro_circuit_is_suitable(circ)) { reason = END_CIRC_REASON_TORPROTOCOL; goto err; } + if (request_len < 2+DIGEST_LEN) goto truncated; /* First 2 bytes: length of asn1-encoded key. */ @@ -105,9 +104,7 @@ rend_mid_establish_intro_legacy(or_circuit_t *circ, const uint8_t *request, } /* Acknowledge the request. */ - if (relay_send_command_from_edge(0, TO_CIRCUIT(circ), - RELAY_COMMAND_INTRO_ESTABLISHED, - "", 0, NULL)<0) { + if (hs_intro_send_intro_established_cell(circ) < 0) { log_info(LD_GENERAL, "Couldn't send INTRO_ESTABLISHED cell."); goto err_no_close; } |