summaryrefslogtreecommitdiff
path: root/src/or/hs_service.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2017-07-13 08:51:14 -0400
committerDavid Goulet <dgoulet@torproject.org>2017-07-13 16:50:09 -0400
commit5d64ceb12defdc7db8402088fb2946c35274636a (patch)
treec89ac5b35065c96f874789b88c120b4484df31e9 /src/or/hs_service.c
parent3eeebd1b0ca43bc2523fb39349078277a40d4116 (diff)
downloadtor-5d64ceb12defdc7db8402088fb2946c35274636a.tar.gz
tor-5d64ceb12defdc7db8402088fb2946c35274636a.zip
prop224: Move service version into config object
It makes more sense to have the version in the configuration object of the service because it is afterall a torrc option (HiddenServiceVersion). Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/hs_service.c')
-rw-r--r--src/or/hs_service.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/or/hs_service.c b/src/or/hs_service.c
index 97d3288d17..d8b87d1f2c 100644
--- a/src/or/hs_service.c
+++ b/src/or/hs_service.c
@@ -250,7 +250,7 @@ close_service_circuits(hs_service_t *service)
tor_assert(service);
/* Only support for version >= 3. */
- if (BUG(service->version < HS_VERSION_THREE)) {
+ if (BUG(service->config.version < HS_VERSION_THREE)) {
return;
}
/* Close intro points. */
@@ -492,8 +492,9 @@ load_service_keys(hs_service_t *service)
ed25519_keypair_free(kp);
/* Build onion address from the newly loaded keys. */
- tor_assert(service->version <= UINT8_MAX);
- hs_build_address(&service->keys.identity_pk, (uint8_t) service->version,
+ tor_assert(service->config.version <= UINT8_MAX);
+ hs_build_address(&service->keys.identity_pk,
+ (uint8_t) service->config.version,
service->onion_address);
/* Write onion address to hostname file. */
@@ -572,7 +573,7 @@ hs_service_new(const or_options_t *options)
/* Set default configuration value. */
set_service_default_config(&service->config, options);
/* Set the default service version. */
- service->version = HS_SERVICE_DEFAULT_VERSION;
+ service->config.version = HS_SERVICE_DEFAULT_VERSION;
return service;
}