switch (cp->state)
{
case CPATH_STATE_OPEN:
- relay_crypto_assert_ok(&cp->private->crypto);
+ relay_crypto_assert_ok(&cp->pvt_crypto);
/* fall through */
case CPATH_STATE_CLOSED:
/*XXXX Assert that there's no handshake_state either. */
{
tor_assert(cpath);
- return relay_crypto_init(&cpath->private->crypto, key_data, key_data_len,
+ return relay_crypto_init(&cpath->pvt_crypto, key_data, key_data_len,
reverse, is_hs_v3);
}
if (!victim)
return;
- relay_crypto_clear(&victim->private->crypto);
+ relay_crypto_clear(&victim->pvt_crypto);
onion_handshake_state_release(&victim->handshake_state);
crypto_dh_free(victim->rend_dh_handshake_state);
extend_info_free(victim->extend_info);
cpath_crypt_cell(const crypt_path_t *cpath, uint8_t *payload, bool is_decrypt)
{
if (is_decrypt) {
- relay_crypt_one_payload(cpath->private->crypto.b_crypto, payload);
+ relay_crypt_one_payload(cpath->pvt_crypto.b_crypto, payload);
} else {
- relay_crypt_one_payload(cpath->private->crypto.f_crypto, payload);
+ relay_crypt_one_payload(cpath->pvt_crypto.f_crypto, payload);
}
}
struct crypto_digest_t *
cpath_get_incoming_digest(const crypt_path_t *cpath)
{
- return cpath->private->crypto.b_digest;
+ return cpath->pvt_crypto.b_digest;
}
/** Set the right integrity digest on the outgoing <b>cell</b> based on the
void
cpath_set_cell_forward_digest(crypt_path_t *cpath, cell_t *cell)
{
- relay_set_digest(cpath->private->crypto.f_digest, cell);
+ relay_set_digest(cpath->pvt_crypto.f_digest, cell);
}
/************ other cpath functions ***************************/
log_warn(LD_BUG,"Circuit initialization failed");
return NULL;
}
- orcirc->crypto = tmp_cpath.private->crypto;
+ orcirc->crypto = tmp_cpath.pvt_crypto;
return orcirc;
}
/* Check the digest algo */
tt_int_op(
- crypto_digest_get_algorithm(or_circ->cpath->private->crypto.f_digest),
+ crypto_digest_get_algorithm(or_circ->cpath->pvt_crypto.f_digest),
OP_EQ, DIGEST_SHA1);
tt_int_op(
- crypto_digest_get_algorithm(or_circ->cpath->private->crypto.b_digest),
+ crypto_digest_get_algorithm(or_circ->cpath->pvt_crypto.b_digest),
OP_EQ, DIGEST_SHA1);
- tt_assert(or_circ->cpath->private->crypto.f_crypto);
- tt_assert(or_circ->cpath->private->crypto.b_crypto);
+ tt_assert(or_circ->cpath->pvt_crypto.f_crypto);
+ tt_assert(or_circ->cpath->pvt_crypto.b_crypto);
/* Ensure that circ purpose was changed */
tt_int_op(or_circ->base_.purpose, OP_EQ, CIRCUIT_PURPOSE_C_REND_JOINED);
/* Check that the crypt path has prop224 algorithm parameters */
tt_int_op(
- crypto_digest_get_algorithm(or_circ->cpath->private->crypto.f_digest),
+ crypto_digest_get_algorithm(or_circ->cpath->pvt_crypto.f_digest),
OP_EQ, DIGEST_SHA3_256);
tt_int_op(
- crypto_digest_get_algorithm(or_circ->cpath->private->crypto.b_digest),
+ crypto_digest_get_algorithm(or_circ->cpath->pvt_crypto.b_digest),
OP_EQ, DIGEST_SHA3_256);
- tt_assert(or_circ->cpath->private->crypto.f_crypto);
- tt_assert(or_circ->cpath->private->crypto.b_crypto);
+ tt_assert(or_circ->cpath->pvt_crypto.f_crypto);
+ tt_assert(or_circ->cpath->pvt_crypto.b_crypto);
/* Ensure that circ purpose was changed */
tt_int_op(or_circ->base_.purpose, OP_EQ, CIRCUIT_PURPOSE_C_REND_JOINED);
/* Check the digest algo */
tt_int_op(
- crypto_digest_get_algorithm(or_circ->cpath->private->crypto.f_digest),
+ crypto_digest_get_algorithm(or_circ->cpath->pvt_crypto.f_digest),
OP_EQ, DIGEST_SHA3_256);
tt_int_op(
- crypto_digest_get_algorithm(or_circ->cpath->private->crypto.b_digest),
+ crypto_digest_get_algorithm(or_circ->cpath->pvt_crypto.b_digest),
OP_EQ, DIGEST_SHA3_256);
- tt_assert(or_circ->cpath->private->crypto.f_crypto);
- tt_assert(or_circ->cpath->private->crypto.b_crypto);
+ tt_assert(or_circ->cpath->pvt_crypto.f_crypto);
+ tt_assert(or_circ->cpath->pvt_crypto.b_crypto);
/* Ensure that circ purpose was changed */
tt_int_op(or_circ->base_.purpose, OP_EQ, CIRCUIT_PURPOSE_S_REND_JOINED);
cs->origin_circ->base_.purpose = CIRCUIT_PURPOSE_C_GENERAL;
for (i=0; i<3; ++i) {
crypt_path_t *hop = tor_malloc_zero(sizeof(*hop));
- relay_crypto_init(&hop->private->crypto, KEY_MATERIAL[i],
+ relay_crypto_init(&hop->pvt_crypto, KEY_MATERIAL[i],
sizeof(KEY_MATERIAL[i]), 0, 0);
hop->state = CPATH_STATE_OPEN;
cpath_extend_linked_list(&cs->origin_circ->cpath, hop);