diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-12-05 23:44:27 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-01-03 11:29:47 -0500 |
commit | 115e8fe9a5342d9f04e14d155d11e8c88f551c84 (patch) | |
tree | c5ed2d447515999b8190453c9a0868f4c3ee3581 /src/or/command.c | |
parent | 6c69b16c93bd7156dcda246128b96209616c3ead (diff) | |
download | tor-115e8fe9a5342d9f04e14d155d11e8c88f551c84.tar.gz tor-115e8fe9a5342d9f04e14d155d11e8c88f551c84.zip |
Use created_cell_format where appropriate
Diffstat (limited to 'src/or/command.c')
-rw-r--r-- | src/or/command.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/or/command.c b/src/or/command.c index c77e2ec8b0..773d19cb5d 100644 --- a/src/or/command.c +++ b/src/or/command.c @@ -274,19 +274,21 @@ command_process_create_cell(cell_t *cell, channel_t *chan) /* This is a CREATE_FAST cell; we can handle it immediately without using * a CPU worker. */ uint8_t keys[CPATH_KEY_MATERIAL_LEN]; - uint8_t reply[MAX_ONIONSKIN_REPLY_LEN]; uint8_t rend_circ_nonce[DIGEST_LEN]; int len; + created_cell_t created_cell; /* Make sure we never try to use the OR connection on which we * received this cell to satisfy an EXTEND request, */ channel_mark_client(chan); + memset(&created_cell, 0, sizeof(created_cell)); len = onion_skin_server_handshake(ONION_HANDSHAKE_TYPE_FAST, create_cell->onionskin, create_cell->handshake_len, NULL, - reply, keys, CPATH_KEY_MATERIAL_LEN, + created_cell.reply, + keys, CPATH_KEY_MATERIAL_LEN, rend_circ_nonce); tor_free(create_cell); if (len < 0) { @@ -295,7 +297,10 @@ command_process_create_cell(cell_t *cell, channel_t *chan) tor_free(create_cell); return; } - if (onionskin_answer(circ, CELL_CREATED_FAST, (const char *)reply, len, + created_cell.cell_type = CELL_CREATED_FAST; + created_cell.handshake_len = len; + + if (onionskin_answer(circ, &created_cell, (const char *)keys, rend_circ_nonce)<0) { log_warn(LD_OR,"Failed to reply to CREATE_FAST cell. Closing."); circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_INTERNAL); |