summaryrefslogtreecommitdiff
path: root/src/feature
diff options
context:
space:
mode:
Diffstat (limited to 'src/feature')
-rw-r--r--src/feature/hs/hs_circuit.c3
-rw-r--r--src/feature/rend/rendclient.c5
-rw-r--r--src/feature/rend/rendservice.c3
3 files changed, 7 insertions, 4 deletions
diff --git a/src/feature/hs/hs_circuit.c b/src/feature/hs/hs_circuit.c
index 7d17aff72f..a6e86c5ab3 100644
--- a/src/feature/hs/hs_circuit.c
+++ b/src/feature/hs/hs_circuit.c
@@ -87,7 +87,8 @@ create_rend_cpath(const uint8_t *ntor_key_seed, size_t seed_len,
}
/* Setup the cpath */
- cpath = crypt_path_new();
+ cpath = tor_malloc_zero(sizeof(crypt_path_t));
+ cpath->magic = CRYPT_PATH_MAGIC;
if (cpath_init_circuit_crypto(cpath, (char*)keys, sizeof(keys),
is_service_side, 1) < 0) {
diff --git a/src/feature/rend/rendclient.c b/src/feature/rend/rendclient.c
index c6e9dde878..f84d221b1a 100644
--- a/src/feature/rend/rendclient.c
+++ b/src/feature/rend/rendclient.c
@@ -16,7 +16,6 @@
#include "core/or/circuituse.h"
#include "core/or/connection_edge.h"
#include "core/or/relay.h"
-#include "core/or/crypt_path.h"
#include "feature/client/circpathbias.h"
#include "feature/control/control_events.h"
#include "feature/dirclient/dirclient.h"
@@ -195,7 +194,9 @@ rend_client_send_introduction(origin_circuit_t *introcirc,
/* Initialize the pending_final_cpath and start the DH handshake. */
cpath = rendcirc->build_state->pending_final_cpath;
if (!cpath) {
- cpath = rendcirc->build_state->pending_final_cpath = crypt_path_new();
+ cpath = rendcirc->build_state->pending_final_cpath =
+ tor_malloc_zero(sizeof(crypt_path_t));
+ cpath->magic = CRYPT_PATH_MAGIC;
if (!(cpath->rend_dh_handshake_state = crypto_dh_new(DH_TYPE_REND))) {
log_warn(LD_BUG, "Internal error: couldn't allocate DH.");
status = -2;
diff --git a/src/feature/rend/rendservice.c b/src/feature/rend/rendservice.c
index 0ecd0e6ff6..98c7253bcc 100644
--- a/src/feature/rend/rendservice.c
+++ b/src/feature/rend/rendservice.c
@@ -2158,7 +2158,8 @@ rend_service_receive_introduction(origin_circuit_t *circuit,
launched->build_state->service_pending_final_cpath_ref->refcount = 1;
launched->build_state->service_pending_final_cpath_ref->cpath = cpath =
- crypt_path_new();
+ tor_malloc_zero(sizeof(crypt_path_t));
+ cpath->magic = CRYPT_PATH_MAGIC;
launched->build_state->expiry_time = now + MAX_REND_TIMEOUT;
cpath->rend_dh_handshake_state = dh;