[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Merge branch 'bug30916_035' into bug30916_041



commit 4bbefc2aac2d3770817200700e2a384d966bffe2
Merge: 70bcff601 2da4d64a6
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Wed Sep 18 11:19:41 2019 -0400

    Merge branch 'bug30916_035' into bug30916_041

 changes/bug30916           |  4 ++++
 src/feature/relay/router.c | 18 ++++++++----------
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --cc src/feature/relay/router.c
index 25bb1835c,1dbaf2ed6..e2ba51a5b
--- a/src/feature/relay/router.c
+++ b/src/feature/relay/router.c
@@@ -284,19 -278,17 +284,17 @@@ construct_ntor_key_map(void
  {
    di_digest256_map_t *m = NULL;
  
-   if (!fast_mem_is_zero((const char*)
-                        curve25519_onion_key.pubkey.public_key,
-                        CURVE25519_PUBKEY_LEN)) {
-     dimap_add_entry(&m,
-                     curve25519_onion_key.pubkey.public_key,
+   const uint8_t *cur_pk = curve25519_onion_key.pubkey.public_key;
+   const uint8_t *last_pk = last_curve25519_onion_key.pubkey.public_key;
+ 
 -  if (!tor_mem_is_zero((const char *)cur_pk, CURVE25519_PUBKEY_LEN)) {
++  if (!fast_mem_is_zero((const char *)cur_pk, CURVE25519_PUBKEY_LEN)) {
+     dimap_add_entry(&m, cur_pk,
                      tor_memdup(&curve25519_onion_key,
                                 sizeof(curve25519_keypair_t)));
    }
-   if (!fast_mem_is_zero((const char*)
-                           last_curve25519_onion_key.pubkey.public_key,
-                        CURVE25519_PUBKEY_LEN)) {
-     dimap_add_entry(&m,
-                     last_curve25519_onion_key.pubkey.public_key,
 -  if (!tor_mem_is_zero((const char*)last_pk, CURVE25519_PUBKEY_LEN) &&
++  if (!fast_mem_is_zero((const char*)last_pk, CURVE25519_PUBKEY_LEN) &&
+       tor_memneq(cur_pk, last_pk, CURVE25519_PUBKEY_LEN)) {
+     dimap_add_entry(&m, last_pk,
                      tor_memdup(&last_curve25519_onion_key,
                                 sizeof(curve25519_keypair_t)));
    }



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits