|
@@ -939,8 +939,12 @@ command_process_cert_cell(var_cell_t *cell, or_connection_t *conn)
|
|
|
|
|
|
conn->handshake_state->authenticated = 1;
|
|
|
{
|
|
|
- crypto_pk_env_t *identity_rcvd = tor_tls_cert_get_key(id_cert);
|
|
|
const digests_t *id_digests = tor_cert_get_id_digests(id_cert);
|
|
|
+ crypto_pk_env_t *identity_rcvd;
|
|
|
+ if (!id_digests)
|
|
|
+ ERR("Couldn't compute digests for key in ID cert");
|
|
|
+
|
|
|
+ identity_rcvd = tor_tls_cert_get_key(id_cert);
|
|
|
memcpy(conn->handshake_state->authenticated_peer_id,
|
|
|
id_digests->d[DIGEST_SHA1], DIGEST_LEN);
|
|
|
connection_or_set_circid_type(conn, identity_rcvd);
|
|
@@ -1172,6 +1176,9 @@ command_process_authenticate_cell(var_cell_t *cell, or_connection_t *conn)
|
|
|
const digests_t *id_digests =
|
|
|
tor_cert_get_id_digests(conn->handshake_state->id_cert);
|
|
|
|
|
|
+ /* This must exist; we checked key type when reading the cert. */
|
|
|
+ tor_assert(id_digests);
|
|
|
+
|
|
|
memcpy(conn->handshake_state->authenticated_peer_id,
|
|
|
id_digests->d[DIGEST_SHA1], DIGEST_LEN);
|
|
|
|