summaryrefslogtreecommitdiff
path: root/src/or/command.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-10-23 13:30:33 -0400
committerNick Mathewson <nickm@torproject.org>2011-10-23 13:31:09 -0400
commit9d355bf47983019ab6b3f20d0c8c5870961b016f (patch)
tree56dd9b78c76b8153d8b2d11ab389933039de92e0 /src/or/command.c
parent87a93917c3f6aed650c7db2d6670b15f894cff56 (diff)
downloadtor-9d355bf47983019ab6b3f20d0c8c5870961b016f.tar.gz
tor-9d355bf47983019ab6b3f20d0c8c5870961b016f.zip
Double-check that we really can get RSA keys from ID/Auth certs
Addresses issue 4287; issue not in any released Tor.
Diffstat (limited to 'src/or/command.c')
-rw-r--r--src/or/command.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/or/command.c b/src/or/command.c
index 49c9880e31..c4cc3a933f 100644
--- a/src/or/command.c
+++ b/src/or/command.c
@@ -989,6 +989,8 @@ command_process_cert_cell(var_cell_t *cell, or_connection_t *conn)
ERR("Couldn't compute digests for key in ID cert");
identity_rcvd = tor_tls_cert_get_key(id_cert);
+ if (!identity_rcvd)
+ ERR("Internal error: Couldn't get RSA key from ID cert.");
memcpy(conn->handshake_state->authenticated_peer_id,
id_digests->d[DIGEST_SHA1], DIGEST_LEN);
connection_or_set_circid_type(conn, identity_rcvd);
@@ -1183,6 +1185,8 @@ command_process_authenticate_cell(var_cell_t *cell, or_connection_t *conn)
size_t keysize;
int signed_len;
+ if (!pk)
+ ERR("Internal error: couldn't get RSA key from AUTH cert.");
crypto_digest256(d, (char*)auth, V3_AUTH_BODY_LEN, DIGEST_SHA256);
keysize = crypto_pk_keysize(pk);