mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-24 22:58:50 +01:00
Negotiated circuit parameters must pass from worker.
This commit is contained in:
parent
baaabb503c
commit
a511718a30
2 changed files with 15 additions and 4 deletions
|
@ -312,6 +312,14 @@ onion_skin_server_handshake(int type,
|
||||||
* parameters we've just negotiated
|
* parameters we've just negotiated
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* NOTE! DANGER, DANGER, DANGER!
|
||||||
|
|
||||||
|
Remember that this function can be run in a worker thread, and so
|
||||||
|
therefore you can't access "global" state that isn't lock-protected.
|
||||||
|
|
||||||
|
CAVEAT HAXX0R!
|
||||||
|
*/
|
||||||
|
|
||||||
tor_free(client_msg);
|
tor_free(client_msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -158,6 +158,8 @@ typedef struct cpuworker_reply_t {
|
||||||
uint8_t keys[CPATH_KEY_MATERIAL_LEN];
|
uint8_t keys[CPATH_KEY_MATERIAL_LEN];
|
||||||
/** Input to use for authenticating introduce1 cells. */
|
/** Input to use for authenticating introduce1 cells. */
|
||||||
uint8_t rend_auth_material[DIGEST_LEN];
|
uint8_t rend_auth_material[DIGEST_LEN];
|
||||||
|
/** Negotiated circuit parameters. */
|
||||||
|
circuit_params_t circ_params;
|
||||||
} cpuworker_reply_t;
|
} cpuworker_reply_t;
|
||||||
|
|
||||||
typedef struct cpuworker_job_u_t {
|
typedef struct cpuworker_job_u_t {
|
||||||
|
@ -387,6 +389,10 @@ cpuworker_onion_handshake_replyfn(void *work_)
|
||||||
circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_INTERNAL);
|
circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_INTERNAL);
|
||||||
goto done_processing;
|
goto done_processing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* TODO! We need to use rpl.circ_params here to initialize the congestion
|
||||||
|
control parameters of the circuit. */
|
||||||
|
|
||||||
log_debug(LD_OR,"onionskin_answer succeeded. Yay.");
|
log_debug(LD_OR,"onionskin_answer succeeded. Yay.");
|
||||||
|
|
||||||
done_processing:
|
done_processing:
|
||||||
|
@ -416,7 +422,6 @@ cpuworker_onion_handshake_threadfn(void *state_, void *work_)
|
||||||
const create_cell_t *cc = &req.create_cell;
|
const create_cell_t *cc = &req.create_cell;
|
||||||
created_cell_t *cell_out = &rpl.created_cell;
|
created_cell_t *cell_out = &rpl.created_cell;
|
||||||
struct timeval tv_start = {0,0}, tv_end;
|
struct timeval tv_start = {0,0}, tv_end;
|
||||||
circuit_params_t params;
|
|
||||||
int n;
|
int n;
|
||||||
rpl.timed = req.timed;
|
rpl.timed = req.timed;
|
||||||
rpl.started_at = req.started_at;
|
rpl.started_at = req.started_at;
|
||||||
|
@ -430,7 +435,7 @@ cpuworker_onion_handshake_threadfn(void *state_, void *work_)
|
||||||
sizeof(cell_out->reply),
|
sizeof(cell_out->reply),
|
||||||
rpl.keys, CPATH_KEY_MATERIAL_LEN,
|
rpl.keys, CPATH_KEY_MATERIAL_LEN,
|
||||||
rpl.rend_auth_material,
|
rpl.rend_auth_material,
|
||||||
¶ms);
|
&rpl.circ_params);
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
/* failure */
|
/* failure */
|
||||||
log_debug(LD_OR,"onion_skin_server_handshake failed.");
|
log_debug(LD_OR,"onion_skin_server_handshake failed.");
|
||||||
|
@ -454,8 +459,6 @@ cpuworker_onion_handshake_threadfn(void *state_, void *work_)
|
||||||
rpl.success = 1;
|
rpl.success = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: pass the parameters back up so we can initialize the cc paremeters.
|
|
||||||
|
|
||||||
rpl.magic = CPUWORKER_REPLY_MAGIC;
|
rpl.magic = CPUWORKER_REPLY_MAGIC;
|
||||||
if (req.timed) {
|
if (req.timed) {
|
||||||
struct timeval tv_diff;
|
struct timeval tv_diff;
|
||||||
|
|
Loading…
Add table
Reference in a new issue