diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-09-22 11:22:11 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-11-03 08:40:11 -0400 |
commit | f156156d56ec61394eb814397c33557762870809 (patch) | |
tree | 62348be6bc50bb820c065af59b05a5b33f6c1369 /src/or/torcert.c | |
parent | b978494ed994cdca7e79ed2e7d256c631391c84d (diff) | |
download | tor-f156156d56ec61394eb814397c33557762870809.tar.gz tor-f156156d56ec61394eb814397c33557762870809.zip |
Audit use of tor_tls_cert_get_key().
This function is allowed to return NULL if the certified key isn't
RSA. But in a couple of places we were treating this as a bug or
internal error, and in one other place we weren't checking for it at
all!
Caught by Isis during code review for #15055. The serious bug was
only on the 15055 branch, thank goodness.
Diffstat (limited to 'src/or/torcert.c')
-rw-r--r-- | src/or/torcert.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/or/torcert.c b/src/or/torcert.c index d100298977..69f50aa970 100644 --- a/src/or/torcert.c +++ b/src/or/torcert.c @@ -559,6 +559,9 @@ or_handshake_certs_ed25519_ok(int severity, ERR("Missing RSA->Ed25519 crosscert"); } crypto_pk_t *rsa_id_key = tor_tls_cert_get_key(rsa_id_cert); + if (!rsa_id_key) { + ERR("RSA ID cert had no RSA key"); + } if (rsa_ed25519_crosscert_check(certs->ed_rsa_crosscert, certs->ed_rsa_crosscert_len, |