diff options
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r-- | src/or/circuitbuild.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 33a13515e1..b6cf1252f6 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -645,11 +645,14 @@ circuit_send_next_onion_skin(origin_circuit_t *circ) * new OR: we can be speedy and use CREATE_FAST to save an RSA operation * and a DH operation. */ cell_type = CELL_CREATE_FAST; + memset(payload, 0, sizeof(payload)); - crypto_rand((char*) circ->cpath->fast_handshake_state, - sizeof(circ->cpath->fast_handshake_state)); - memcpy(payload, circ->cpath->fast_handshake_state, - sizeof(circ->cpath->fast_handshake_state)); + if (fast_onionskin_create(&circ->cpath->fast_handshake_state, + (uint8_t *)payload) < 0) { + log_warn(LD_CIRC,"onion_skin_create FAST (first hop) failed."); + return - END_CIRC_REASON_INTERNAL; + } + note_request("cell: create fast", 1); } |