Tweak sign of rend_token params for consistency

This commit is contained in:
Nick Mathewson 2014-02-13 15:24:09 -05:00
parent ecf61e924d
commit 949c9ae26b
3 changed files with 11 additions and 10 deletions

View File

@ -1354,21 +1354,22 @@ circuit_set_rend_token(or_circuit_t *circ, int is_rend_circ,
* Return NULL if no such circuit is found. * Return NULL if no such circuit is found.
*/ */
or_circuit_t * or_circuit_t *
circuit_get_rendezvous(const char *cookie) circuit_get_rendezvous(const uint8_t *cookie)
{ {
return circuit_get_by_rend_token_and_purpose( return circuit_get_by_rend_token_and_purpose(
CIRCUIT_PURPOSE_REND_POINT_WAITING, CIRCUIT_PURPOSE_REND_POINT_WAITING,
1, cookie); 1, (const char*)cookie);
} }
/** Return the circuit waiting for intro cells of the given digest. /** Return the circuit waiting for intro cells of the given digest.
* Return NULL if no such circuit is found. * Return NULL if no such circuit is found.
*/ */
or_circuit_t * 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( 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 /** Set the rendezvous cookie of <b>circ</b> to <b>cookie</b>. If another

View File

@ -47,8 +47,8 @@ origin_circuit_t *circuit_get_ready_rend_circ_by_rend_data(
const rend_data_t *rend_data); const rend_data_t *rend_data);
origin_circuit_t *circuit_get_next_by_pk_and_purpose(origin_circuit_t *start, origin_circuit_t *circuit_get_next_by_pk_and_purpose(origin_circuit_t *start,
const char *digest, uint8_t purpose); const char *digest, uint8_t purpose);
or_circuit_t *circuit_get_rendezvous(const char *cookie); or_circuit_t *circuit_get_rendezvous(const uint8_t *cookie);
or_circuit_t *circuit_get_intro_point(const char *digest); 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_rendezvous_cookie(or_circuit_t *circ, const uint8_t *cookie);
void circuit_set_intro_point_digest(or_circuit_t *circ, const uint8_t *digest); void circuit_set_intro_point_digest(or_circuit_t *circ, const uint8_t *digest);
origin_circuit_t *circuit_find_to_cannibalize(uint8_t purpose, origin_circuit_t *circuit_find_to_cannibalize(uint8_t purpose,

View File

@ -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. */ /* Close any other intro circuits with the same pk. */
c = NULL; 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", log_info(LD_REND, "Replacing old circuit for service %s",
safe_str(serviceid)); safe_str(serviceid));
circuit_mark_for_close(TO_CIRCUIT(c), END_CIRC_REASON_FINISHED); 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); (char*)request, REND_SERVICE_ID_LEN);
/* The first 20 bytes are all we look at: they have a hash of Bob's PK. */ /* 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) { if (!intro_circ) {
log_info(LD_REND, log_info(LD_REND,
"No intro circ found for INTRODUCE1 cell (%s) from circuit %u; " "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; goto err;
} }
if (circuit_get_rendezvous((char*)request)) { if (circuit_get_rendezvous(request)) {
log_warn(LD_PROTOCOL, log_warn(LD_PROTOCOL,
"Duplicate rendezvous cookie in ESTABLISH_RENDEZVOUS."); "Duplicate rendezvous cookie in ESTABLISH_RENDEZVOUS.");
goto err; 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.", "Got request for rendezvous from circuit %u to cookie %s.",
(unsigned)circ->p_circ_id, hexid); (unsigned)circ->p_circ_id, hexid);
rend_circ = circuit_get_rendezvous((char*)request); rend_circ = circuit_get_rendezvous(request);
if (!rend_circ) { if (!rend_circ) {
log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
"Rejecting RENDEZVOUS1 cell with unrecognized rendezvous cookie %s.", "Rejecting RENDEZVOUS1 cell with unrecognized rendezvous cookie %s.",