aboutsummaryrefslogtreecommitdiff
path: root/src/or/onion.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-05-01 12:39:39 -0400
committerNick Mathewson <nickm@torproject.org>2014-05-01 12:39:39 -0400
commit7ad0cd209cae8b4382d5e9c405e995252f714964 (patch)
tree729971092d68b284f1b38744f5e2c1f28a11c13d /src/or/onion.c
parentc472ac4fb84a7977b53d2be051e8ddde15bba8f5 (diff)
parentde9de9e7dd2f34af04c76abf3f51c72dec4bdc93 (diff)
downloadtor-7ad0cd209cae8b4382d5e9c405e995252f714964.tar.gz
tor-7ad0cd209cae8b4382d5e9c405e995252f714964.zip
Merge remote-tracking branch 'public/bug9635'
Diffstat (limited to 'src/or/onion.c')
-rw-r--r--src/or/onion.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/or/onion.c b/src/or/onion.c
index 72571b7bd9..ae39f451f4 100644
--- a/src/or/onion.c
+++ b/src/or/onion.c
@@ -554,8 +554,10 @@ onion_skin_client_handshake(int type,
switch (type) {
case ONION_HANDSHAKE_TYPE_TAP:
- if (reply_len != TAP_ONIONSKIN_REPLY_LEN)
+ if (reply_len != TAP_ONIONSKIN_REPLY_LEN) {
+ log_warn(LD_CIRC, "TAP reply was not of the correct length.");
return -1;
+ }
if (onion_skin_TAP_client_handshake(handshake_state->u.tap,
(const char*)reply,
(char *)keys_out, keys_out_len) < 0)
@@ -565,8 +567,10 @@ onion_skin_client_handshake(int type,
return 0;
case ONION_HANDSHAKE_TYPE_FAST:
- if (reply_len != CREATED_FAST_LEN)
+ if (reply_len != CREATED_FAST_LEN) {
+ log_warn(LD_CIRC, "CREATED_FAST reply was not of the correct length.");
return -1;
+ }
if (fast_client_handshake(handshake_state->u.fast, reply,
keys_out, keys_out_len) < 0)
return -1;
@@ -575,8 +579,10 @@ onion_skin_client_handshake(int type,
return 0;
#ifdef CURVE25519_ENABLED
case ONION_HANDSHAKE_TYPE_NTOR:
- if (reply_len < NTOR_REPLY_LEN)
+ if (reply_len < NTOR_REPLY_LEN) {
+ log_warn(LD_CIRC, "ntor reply was not of the correct length.");
return -1;
+ }
{
size_t keys_tmp_len = keys_out_len + DIGEST_LEN;
uint8_t *keys_tmp = tor_malloc(keys_tmp_len);