summaryrefslogtreecommitdiff
path: root/src/or/connection_or.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-05-21 13:43:34 -0400
committerNick Mathewson <nickm@torproject.org>2016-11-03 08:37:21 -0400
commite23389841c7797615b09ee6457e841b4ed13ea75 (patch)
tree5303cc276c4888567b883f3fec70209a2b5de2fa /src/or/connection_or.c
parent4ef42e7c529a95b69d3e830e115e5d0453d38dfb (diff)
downloadtor-e23389841c7797615b09ee6457e841b4ed13ea75.tar.gz
tor-e23389841c7797615b09ee6457e841b4ed13ea75.zip
Migrate certificates into a sub-structure of or_handshake_state
This will help us do cert-checking in the background in the future, perhaps.
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r--src/or/connection_or.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index ed91595504..5a9c597772 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -1764,6 +1764,7 @@ connection_init_or_handshake_state(or_connection_t *conn, int started_here)
s->started_here = started_here ? 1 : 0;
s->digest_sent_data = 1;
s->digest_received_data = 1;
+ s->certs = or_handshake_certs_new();
return 0;
}
@@ -1775,8 +1776,7 @@ or_handshake_state_free(or_handshake_state_t *state)
return;
crypto_digest_free(state->digest_sent);
crypto_digest_free(state->digest_received);
- tor_x509_cert_free(state->auth_cert);
- tor_x509_cert_free(state->id_cert);
+ or_handshake_certs_free(state->certs);
memwipe(state, 0xBE, sizeof(or_handshake_state_t));
tor_free(state);
}
@@ -2356,7 +2356,7 @@ connection_or_compute_authenticate_cell_body(or_connection_t *conn,
goto err;
my_digests = tor_x509_cert_get_id_digests(id_cert);
their_digests =
- tor_x509_cert_get_id_digests(conn->handshake_state->id_cert);
+ tor_x509_cert_get_id_digests(conn->handshake_state->certs->id_cert);
tor_assert(my_digests);
tor_assert(their_digests);
my_id = (uint8_t*)my_digests->d[DIGEST_SHA256];
@@ -2374,10 +2374,10 @@ connection_or_compute_authenticate_cell_body(or_connection_t *conn,
if (is_ed) {
const ed25519_public_key_t *my_ed_id, *their_ed_id;
- if (!conn->handshake_state->ed_id_sign_cert)
+ if (!conn->handshake_state->certs->ed_id_sign_cert)
goto err;
my_ed_id = get_master_identity_key();
- their_ed_id = &conn->handshake_state->ed_id_sign_cert->signing_key;
+ their_ed_id = &conn->handshake_state->certs->ed_id_sign_cert->signing_key;
const uint8_t *cid_ed = (server ? their_ed_id : my_ed_id)->pubkey;
const uint8_t *sid_ed = (server ? my_ed_id : their_ed_id)->pubkey;