diff options
author | David Goulet <dgoulet@torproject.org> | 2021-05-04 10:37:26 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2021-05-04 10:37:26 -0400 |
commit | cf6e72b7020c47ba20677dc19602663723bd8491 (patch) | |
tree | bf74b64be9a0d1798b07184703b1c565ba5a3e91 /src/test/test_hs_service.c | |
parent | f0260c4cea6da784369e8d47f0b4bf01863c5af5 (diff) | |
download | tor-cf6e72b7020c47ba20677dc19602663723bd8491.tar.gz tor-cf6e72b7020c47ba20677dc19602663723bd8491.zip |
hs: Fix ADD_ONION with client authorization
Turns out that passing client authorization keys to ADD_ONION for v3 was
not working because we were not setting the "is_client_auth_enabled"
flag to true once the clients were configured. This lead to the
descriptor being encoded without the clients.
This patch removes that flag and instead adds an inline function that
can be used to check if a given service has client authorization
enabled.
This will be much less error prone of needing to keep in sync the client
list and a flag instead.
Fixes #40378
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/test/test_hs_service.c')
-rw-r--r-- | src/test/test_hs_service.c | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/src/test/test_hs_service.c b/src/test/test_hs_service.c index e754eac108..33a3f279c6 100644 --- a/src/test/test_hs_service.c +++ b/src/test/test_hs_service.c @@ -341,7 +341,6 @@ helper_create_service_with_clients(int num_clients) int i; hs_service_t *service = helper_create_service(); tt_assert(service); - service->config.is_client_auth_enabled = 1; service->config.clients = smartlist_new(); for (i = 0; i < num_clients; i++) { @@ -425,9 +424,6 @@ test_load_keys(void *arg) tt_int_op(hs_address_is_valid(addr), OP_EQ, 1); tt_str_op(addr, OP_EQ, s->onion_address); - /* Check that the is_client_auth_enabled is not set. */ - tt_assert(!s->config.is_client_auth_enabled); - done: tor_free(hsdir_v3); hs_free_all(); @@ -577,9 +573,6 @@ test_load_keys_with_client_auth(void *arg) tt_int_op(smartlist_len(service->config.clients), OP_EQ, smartlist_len(pubkey_b32_list)); - /* Test that the is_client_auth_enabled flag is set. */ - tt_assert(service->config.is_client_auth_enabled); - /* Test that the keys in clients are correct. */ SMARTLIST_FOREACH_BEGIN(pubkey_b32_list, char *, pubkey_b32) { |