mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-11 05:33:47 +01:00
Tweak sign of rend_token params for consistency
This commit is contained in:
parent
ecf61e924d
commit
949c9ae26b
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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.",
|
||||
|
Loading…
Reference in New Issue
Block a user