aboutsummaryrefslogtreecommitdiff
path: root/src/or/onion.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-12-07 13:40:21 -0500
committerNick Mathewson <nickm@torproject.org>2013-01-03 11:29:48 -0500
commit839016ac791de98c02ad7eab50092deedde0ad55 (patch)
treea13d23119dc498e51f19cbb93e4492318c4ccf26 /src/or/onion.c
parent463e9378df7eaa07a895da34dc10d3c336760f09 (diff)
downloadtor-839016ac791de98c02ad7eab50092deedde0ad55.tar.gz
tor-839016ac791de98c02ad7eab50092deedde0ad55.zip
ntor: Don't fail fast server-side on an unrecognized KEYID(B)
Diffstat (limited to 'src/or/onion.c')
-rw-r--r--src/or/onion.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/or/onion.c b/src/or/onion.c
index 3f0b0b1e46..56bc9a3b8a 100644
--- a/src/or/onion.c
+++ b/src/or/onion.c
@@ -192,6 +192,8 @@ setup_server_onion_keys(server_onion_keys_t *keys)
dup_onion_keys(&keys->onion_key, &keys->last_onion_key);
#ifdef CURVE25519_ENABLED
keys->curve25519_key_map = construct_ntor_key_map();
+ keys->junk_keypair = tor_malloc_zero(sizeof(curve25519_keypair_t));
+ curve25519_keypair_generate(keys->junk_keypair, 0);
#endif
}
@@ -207,6 +209,7 @@ release_server_onion_keys(server_onion_keys_t *keys)
crypto_pk_free(keys->last_onion_key);
#ifdef CURVE25519_ENABLED
ntor_key_map_free(keys->curve25519_key_map);
+ tor_free(keys->junk_keypair);
#endif
memset(keys, 0, sizeof(server_onion_keys_t));
}
@@ -345,6 +348,7 @@ onion_skin_server_handshake(int type,
if (onion_skin_ntor_server_handshake(
onion_skin, keys->curve25519_key_map,
+ keys->junk_keypair,
keys->my_identity,
reply_out, keys_tmp, keys_tmp_len)<0) {
tor_free(keys_tmp);