aboutsummaryrefslogtreecommitdiff
path: root/src/or/onion.c
diff options
context:
space:
mode:
authorKarsten Loesing <karsten.loesing@gmx.net>2009-10-25 23:47:05 -0700
committerKarsten Loesing <karsten.loesing@gmx.net>2009-10-25 23:47:05 -0700
commitd2b4b49ff043df43c048b6f1f52a34dd5c4c0108 (patch)
tree6ef8d55c438685668bc0333171305761dcdfd02d /src/or/onion.c
parentfa23430496f2675c2dca5dbc0c6455c404c184fe (diff)
downloadtor-d2b4b49ff043df43c048b6f1f52a34dd5c4c0108.tar.gz
tor-d2b4b49ff043df43c048b6f1f52a34dd5c4c0108.zip
Reduce log level for someone else sending us weak DH keys.
See task 1114. The most plausible explanation for someone sending us weak DH keys is that they experiment with their Tor code or implement a new Tor client. Usually, we don't care about such events, especially not on warn level. If we really care about someone not following the Tor protocol, we can set ProtocolWarnings to 1.
Diffstat (limited to 'src/or/onion.c')
-rw-r--r--src/or/onion.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/or/onion.c b/src/or/onion.c
index b49a86aba3..58a51aedfe 100644
--- a/src/or/onion.c
+++ b/src/or/onion.c
@@ -253,8 +253,9 @@ onion_skin_server_handshake(const char *onion_skin, /*ONIONSKIN_CHALLENGE_LEN*/
key_material_len = DIGEST_LEN+key_out_len;
key_material = tor_malloc(key_material_len);
- len = crypto_dh_compute_secret(dh, challenge, DH_KEY_LEN,
- key_material, key_material_len);
+ len = crypto_dh_compute_secret(LOG_PROTOCOL_WARN, dh, challenge,
+ DH_KEY_LEN, key_material,
+ key_material_len);
if (len < 0) {
log_info(LD_GENERAL, "crypto_dh_compute_secret failed.");
goto err;
@@ -304,8 +305,9 @@ onion_skin_client_handshake(crypto_dh_env_t *handshake_state,
key_material_len = DIGEST_LEN + key_out_len;
key_material = tor_malloc(key_material_len);
- len = crypto_dh_compute_secret(handshake_state, handshake_reply, DH_KEY_LEN,
- key_material, key_material_len);
+ len = crypto_dh_compute_secret(LOG_PROTOCOL_WARN, handshake_state,
+ handshake_reply, DH_KEY_LEN, key_material,
+ key_material_len);
if (len < 0)
goto err;