aboutsummaryrefslogtreecommitdiff
path: root/src/or/command.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-12-04 21:27:07 -0500
committerNick Mathewson <nickm@torproject.org>2013-01-03 11:29:46 -0500
commitf58d4dfcd61aec7ea1900873ca08ecc31d7a7ef7 (patch)
tree12e9b9fbcbbaf319638926575b913daaea05f7e9 /src/or/command.c
parent5fa1c7484cba293e6467acbca06a4143ce9da68d (diff)
downloadtor-f58d4dfcd61aec7ea1900873ca08ecc31d7a7ef7.tar
tor-f58d4dfcd61aec7ea1900873ca08ecc31d7a7ef7.tar.gz
Massive refactoring of the various handshake types
The three handshake types are now accessed from a unified interface; their state is abstracted from the rest of the cpath state, and so on.
Diffstat (limited to 'src/or/command.c')
-rw-r--r--src/or/command.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/or/command.c b/src/or/command.c
index 2718ec92b..a33a9b182 100644
--- a/src/or/command.c
+++ b/src/or/command.c
@@ -30,6 +30,7 @@
#include "hibernate.h"
#include "nodelist.h"
//#include "onion.h"
+#include "onion_tap.h"
#include "onion_fast.h"
#include "relay.h"
#include "router.h"
@@ -254,8 +255,8 @@ command_process_create_cell(cell_t *cell, channel_t *chan)
circ->base_.purpose = CIRCUIT_PURPOSE_OR;
circuit_set_state(TO_CIRCUIT(circ), CIRCUIT_STATE_ONIONSKIN_PENDING);
if (cell->command == CELL_CREATE) {
- char *onionskin = tor_malloc(ONIONSKIN_CHALLENGE_LEN);
- memcpy(onionskin, cell->payload, ONIONSKIN_CHALLENGE_LEN);
+ char *onionskin = tor_malloc(TAP_ONIONSKIN_CHALLENGE_LEN);
+ memcpy(onionskin, cell->payload, TAP_ONIONSKIN_CHALLENGE_LEN);
/* hand it off to the cpuworkers, and then return. */
if (assign_onionskin_to_cpuworker(NULL, circ, onionskin) < 0) {
@@ -282,7 +283,8 @@ command_process_create_cell(cell_t *cell, channel_t *chan)
circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_INTERNAL);
return;
}
- if (onionskin_answer(circ, CELL_CREATED_FAST, reply, keys)<0) {
+ if (onionskin_answer(circ, CELL_CREATED_FAST, reply, sizeof(reply),
+ keys)<0) {
log_warn(LD_OR,"Failed to reply to CREATE_FAST cell. Closing.");
circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_INTERNAL);
return;
@@ -340,7 +342,7 @@ command_process_created_cell(cell_t *cell, channel_t *chan)
log_debug(LD_OR,
"Converting created cell to extended relay cell, sending.");
relay_send_command_from_edge(0, circ, RELAY_COMMAND_EXTENDED,
- (char*)cell->payload, ONIONSKIN_REPLY_LEN,
+ (char*)cell->payload, TAP_ONIONSKIN_REPLY_LEN,
NULL);
}
}