diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-02-13 15:24:09 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-02-13 15:24:09 -0500 |
commit | 949c9ae26b4a77baea077e7e1834bdd7264cdb37 (patch) | |
tree | b3588be459ff61abb40b449f4d607480ce28bfc1 /src/or | |
parent | ecf61e924d5807420aaeee8620dc83f3b952d77f (diff) | |
download | tor-949c9ae26b4a77baea077e7e1834bdd7264cdb37.tar.gz tor-949c9ae26b4a77baea077e7e1834bdd7264cdb37.zip |
Tweak sign of rend_token params for consistency
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/circuitlist.c | 9 | ||||
-rw-r--r-- | src/or/circuitlist.h | 4 | ||||
-rw-r--r-- | src/or/rendmid.c | 8 |
3 files changed, 11 insertions, 10 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c index 04cfcbf0c0..0d41b51c75 100644 --- a/src/or/circuitlist.c +++ b/src/or/circuitlist.c @@ -1354,21 +1354,22 @@ circuit_set_rend_token(or_circuit_t *circ, int is_rend_circ, * Return NULL if no such circuit is found. */ or_circuit_t * -circuit_get_rendezvous(const char *cookie) +circuit_get_rendezvous(const uint8_t *cookie) { return circuit_get_by_rend_token_and_purpose( CIRCUIT_PURPOSE_REND_POINT_WAITING, - 1, cookie); + 1, (const char*)cookie); } /** Return the circuit waiting for intro cells of the given digest. * Return NULL if no such circuit is found. */ or_circuit_t * -circuit_get_intro_point(const char *digest) +circuit_get_intro_point(const uint8_t *digest) { return circuit_get_by_rend_token_and_purpose( - CIRCUIT_PURPOSE_INTRO_POINT, 0, digest); + CIRCUIT_PURPOSE_INTRO_POINT, 0, + (const char *)digest); } /** Set the rendezvous cookie of <b>circ</b> to <b>cookie</b>. If another diff --git a/src/or/circuitlist.h b/src/or/circuitlist.h index f9b95da085..4a916eaec8 100644 --- a/src/or/circuitlist.h +++ b/src/or/circuitlist.h @@ -47,8 +47,8 @@ origin_circuit_t *circuit_get_ready_rend_circ_by_rend_data( const rend_data_t *rend_data); origin_circuit_t *circuit_get_next_by_pk_and_purpose(origin_circuit_t *start, const char *digest, uint8_t purpose); -or_circuit_t *circuit_get_rendezvous(const char *cookie); -or_circuit_t *circuit_get_intro_point(const char *digest); +or_circuit_t *circuit_get_rendezvous(const uint8_t *cookie); +or_circuit_t *circuit_get_intro_point(const uint8_t *digest); void circuit_set_rendezvous_cookie(or_circuit_t *circ, const uint8_t *cookie); void circuit_set_intro_point_digest(or_circuit_t *circ, const uint8_t *digest); origin_circuit_t *circuit_find_to_cannibalize(uint8_t purpose, diff --git a/src/or/rendmid.c b/src/or/rendmid.c index 8090bf2d8e..4f4790b07d 100644 --- a/src/or/rendmid.c +++ b/src/or/rendmid.c @@ -94,7 +94,7 @@ rend_mid_establish_intro(or_circuit_t *circ, const uint8_t *request, /* Close any other intro circuits with the same pk. */ c = NULL; - while ((c = circuit_get_intro_point(pk_digest))) { + while ((c = circuit_get_intro_point((const uint8_t *)pk_digest))) { log_info(LD_REND, "Replacing old circuit for service %s", safe_str(serviceid)); circuit_mark_for_close(TO_CIRCUIT(c), END_CIRC_REASON_FINISHED); @@ -165,7 +165,7 @@ rend_mid_introduce(or_circuit_t *circ, const uint8_t *request, (char*)request, REND_SERVICE_ID_LEN); /* The first 20 bytes are all we look at: they have a hash of Bob's PK. */ - intro_circ = circuit_get_intro_point((char*)request); + intro_circ = circuit_get_intro_point((const uint8_t*)request); if (!intro_circ) { log_info(LD_REND, "No intro circ found for INTRODUCE1 cell (%s) from circuit %u; " @@ -235,7 +235,7 @@ rend_mid_establish_rendezvous(or_circuit_t *circ, const uint8_t *request, goto err; } - if (circuit_get_rendezvous((char*)request)) { + if (circuit_get_rendezvous(request)) { log_warn(LD_PROTOCOL, "Duplicate rendezvous cookie in ESTABLISH_RENDEZVOUS."); goto err; @@ -299,7 +299,7 @@ rend_mid_rendezvous(or_circuit_t *circ, const uint8_t *request, "Got request for rendezvous from circuit %u to cookie %s.", (unsigned)circ->p_circ_id, hexid); - rend_circ = circuit_get_rendezvous((char*)request); + rend_circ = circuit_get_rendezvous(request); if (!rend_circ) { log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, "Rejecting RENDEZVOUS1 cell with unrecognized rendezvous cookie %s.", |