summaryrefslogtreecommitdiff
path: root/src/or/rendservice.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@ev0ke.net>2015-04-27 15:08:31 -0400
committerNick Mathewson <nickm@torproject.org>2015-04-30 12:35:21 -0400
commit9a364026d314bfe76410318849e179dbd2e0b34d (patch)
treee4d0878e3475baf06a9ca23e7af8cda39b2c6226 /src/or/rendservice.c
parente6a581f126bac80d1d0c61ae026d81076f03b77b (diff)
downloadtor-9a364026d314bfe76410318849e179dbd2e0b34d.tar.gz
tor-9a364026d314bfe76410318849e179dbd2e0b34d.zip
Use rend_data_client/service_create() in code
Every callsite that use to allocate a rend_data_t object now use the rend_data_client/service_create() function. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Diffstat (limited to 'src/or/rendservice.c')
-rw-r--r--src/or/rendservice.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index f257f6e89f..eb94202ed8 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -1735,13 +1735,11 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
hexcookie, serviceid);
tor_assert(launched->build_state);
/* Fill in the circuit's state. */
- launched->rend_data = tor_malloc_zero(sizeof(rend_data_t));
- memcpy(launched->rend_data->rend_pk_digest,
- circuit->rend_data->rend_pk_digest,
- DIGEST_LEN);
- memcpy(launched->rend_data->rend_cookie, parsed_req->rc, REND_COOKIE_LEN);
- strlcpy(launched->rend_data->onion_address, service->service_id,
- sizeof(launched->rend_data->onion_address));
+
+ launched->rend_data =
+ rend_data_service_create(service->service_id,
+ circuit->rend_data->rend_pk_digest,
+ parsed_req->rc, service->auth_type);
launched->build_state->service_pending_final_cpath_ref =
tor_malloc_zero(sizeof(crypt_path_reference_t));
@@ -2713,10 +2711,9 @@ rend_service_launch_establish_intro(rend_service_t *service,
intro->extend_info = extend_info_dup(launched->build_state->chosen_exit);
}
- launched->rend_data = tor_malloc_zero(sizeof(rend_data_t));
- strlcpy(launched->rend_data->onion_address, service->service_id,
- sizeof(launched->rend_data->onion_address));
- memcpy(launched->rend_data->rend_pk_digest, service->pk_digest, DIGEST_LEN);
+ launched->rend_data = rend_data_service_create(service->service_id,
+ service->pk_digest, NULL,
+ service->auth_type);
launched->intro_key = crypto_pk_dup_key(intro->intro_key);
if (launched->base_.state == CIRCUIT_STATE_OPEN)
rend_service_intro_has_opened(launched);