summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSuphanat Chunhapanya <haxx.pop@gmail.com>2018-09-07 21:29:44 +0700
committerDavid Goulet <dgoulet@torproject.org>2018-09-11 11:23:49 -0400
commit57c82b74b43132d34fffd6c03932555bfbf503e1 (patch)
tree1b443bd321e579374f3fab3338dee8228932fd38 /src
parente5601f14ed4384e8de1030d21cc7442df48adabe (diff)
downloadtor-57c82b74b43132d34fffd6c03932555bfbf503e1.tar.gz
tor-57c82b74b43132d34fffd6c03932555bfbf503e1.zip
hs-v3: Shuffle the list of authorized clients
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>
Diffstat (limited to 'src')
-rw-r--r--src/feature/hs/hs_service.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/feature/hs/hs_service.c b/src/feature/hs/hs_service.c
index 43e5626a57..15f3478596 100644
--- a/src/feature/hs/hs_service.c
+++ b/src/feature/hs/hs_service.c
@@ -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;
}