diff options
author | Suphanat Chunhapanya <haxx.pop@gmail.com> | 2018-08-18 12:28:12 +0700 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2018-09-07 13:59:07 -0400 |
commit | b894b40e647b4839f33f3a57704cafe9e644230c (patch) | |
tree | 0b10a6be63bf596c425f696bf3ed447af27f238f /src/feature/hs/hs_service.h | |
parent | 94605f08fb89ea79409225362d2fa0f8a07435d7 (diff) | |
download | tor-b894b40e647b4839f33f3a57704cafe9e644230c.tar.gz tor-b894b40e647b4839f33f3a57704cafe9e644230c.zip |
hs-v3: Load all client auth keys to the service
This commit loads all client public keys from every file in
`authorized_clients/` directory.
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/feature/hs/hs_service.h')
-rw-r--r-- | src/feature/hs/hs_service.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/feature/hs/hs_service.h b/src/feature/hs/hs_service.h index 17c654ecf4..c64eb7763c 100644 --- a/src/feature/hs/hs_service.h +++ b/src/feature/hs/hs_service.h @@ -148,6 +148,12 @@ typedef struct hs_service_keys_t { unsigned int is_identify_key_offline : 1; } hs_service_keys_t; +/** Service side configuration of client authorization. */ +typedef struct hs_service_authorized_client_t { + /* The client auth public key used to encrypt the descriptor cookie. */ + curve25519_public_key_t client_pk; +} hs_service_authorized_client_t; + /* Service configuration. The following are set from the torrc options either * set by the configuration file or by the control port. Nothing else should * change those values. */ @@ -176,6 +182,13 @@ typedef struct hs_service_config_t { * HiddenServiceNumIntroductionPoints option. */ unsigned int num_intro_points; + /* True iff the client auth is enabled. */ + unsigned int is_client_auth_enabled : 1; + + /* List of hs_service_authorized_client_t's of clients that may access this + * service. Specified by HiddenServiceAuthorizeClient option. */ + smartlist_t *clients; + /* True iff we allow request made on unknown ports. Specified by * HiddenServiceAllowUnknownPorts option. */ unsigned int allow_unknown_ports : 1; @@ -356,6 +369,13 @@ STATIC void service_descriptor_free_(hs_service_descriptor_t *desc); #define service_descriptor_free(d) \ FREE_AND_NULL(hs_service_descriptor_t, \ service_descriptor_free_, (d)) + +STATIC void +service_authorized_client_free_(hs_service_authorized_client_t *client); +#define service_authorized_client_free(c) \ + FREE_AND_NULL(hs_service_authorized_client_t, \ + service_authorized_client_free_, (c)) + STATIC int write_address_to_file(const hs_service_t *service, const char *fname_); |