diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-02-02 16:31:32 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-02-02 16:31:32 -0500 |
commit | d03e1da232ada2e0d3a3de3dbf6885caec74e4e0 (patch) | |
tree | cd3fc872abd2f7fa80af365887a0ea87564199b8 /src/or/onion_fast.c | |
parent | 3b96bf68315083f83a5f807ccf6f41feafeeb445 (diff) | |
parent | 41ba4f5627326e1745f0eea143f038677170c596 (diff) | |
download | tor-d03e1da232ada2e0d3a3de3dbf6885caec74e4e0.tar.gz tor-d03e1da232ada2e0d3a3de3dbf6885caec74e4e0.zip |
Merge remote-tracking branch 'public/bug9635_warnings_025'
Conflicts:
src/test/test.c
Diffstat (limited to 'src/or/onion_fast.c')
-rw-r--r-- | src/or/onion_fast.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/or/onion_fast.c b/src/or/onion_fast.c index a52a11357c..7584112570 100644 --- a/src/or/onion_fast.c +++ b/src/or/onion_fast.c @@ -92,7 +92,8 @@ int fast_client_handshake(const fast_handshake_state_t *handshake_state, const uint8_t *handshake_reply_out,/*DIGEST_LEN*2 bytes*/ uint8_t *key_out, - size_t key_out_len) + size_t key_out_len, + const char **msg_out) { uint8_t tmp[DIGEST_LEN+DIGEST_LEN]; uint8_t *out; @@ -104,13 +105,14 @@ fast_client_handshake(const fast_handshake_state_t *handshake_state, out_len = key_out_len+DIGEST_LEN; out = tor_malloc(out_len); if (crypto_expand_key_material_TAP(tmp, sizeof(tmp), out, out_len)) { - log_warn(LD_CIRC, "Failed to expand key material"); + if (msg_out) + *msg_out = "Failed to expand key material"; goto done; } if (tor_memneq(out, handshake_reply_out+DIGEST_LEN, DIGEST_LEN)) { /* H(K) does *not* match. Something fishy. */ - log_warn(LD_PROTOCOL,"Digest DOES NOT MATCH on fast handshake. " - "Bug or attack."); + if (msg_out) + *msg_out = "Digest DOES NOT MATCH on fast handshake. Bug or attack."; goto done; } memcpy(key_out, out+DIGEST_LEN, key_out_len); |