]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
hs-v3: Shuffle the list of authorized clients
authorSuphanat Chunhapanya <haxx.pop@gmail.com>
Fri, 7 Sep 2018 14:29:44 +0000 (21:29 +0700)
committerDavid Goulet <dgoulet@torproject.org>
Tue, 11 Sep 2018 15:23:49 +0000 (11:23 -0400)
This commit makes it that the authorized clients in the descriptor are in
random order instead of ordered by how they were read on disk.

Fixes #27545

Signed-off-by: David Goulet <dgoulet@torproject.org>
src/feature/hs/hs_service.c

index 43e5626a57f2b03ccdfb25c46a0be4d830791c27..15f34785962bff96cc00ce6983fdac165a978cbe 100644 (file)
@@ -18,6 +18,7 @@
 #include "lib/crypt_ops/crypto_rand.h"
 #include "lib/crypt_ops/crypto_util.h"
 #include "lib/crypt_ops/crypto_ope.h"
+#include "lib/crypt_ops/crypto_rand.h"
 #include "feature/dircache/directory.h"
 #include "core/mainloop/main.h"
 #include "feature/nodelist/networkstatus.h"
@@ -1800,6 +1801,10 @@ build_service_desc_superencrypted(const hs_service_t *service,
     smartlist_add(superencrypted->clients, desc_client);
   }
 
+  /* Shuffle the list to prevent the client know the position in the
+   * config. */
+  smartlist_shuffle(superencrypted->clients);
+
   return 0;
 }