diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-08-21 19:16:40 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-08-21 19:16:40 -0400 |
commit | d52f406001082474c3decf04747bf6f742b82c96 (patch) | |
tree | 32103ceff5561ec7c8f757f4d8c7276ff10b234d /src/common | |
parent | c798957b5925b637896bf162f58aca806235c2a5 (diff) | |
parent | 85a87923440361bc5a3b82c6e874192ebe08b8d4 (diff) | |
download | tor-d52f406001082474c3decf04747bf6f742b82c96.tar.gz tor-d52f406001082474c3decf04747bf6f742b82c96.zip |
Merge branch 'maint-0.2.9' into maint-0.3.2
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/tortls.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/common/tortls.c b/src/common/tortls.c index e8c51879bd..03c0be1cd0 100644 --- a/src/common/tortls.c +++ b/src/common/tortls.c @@ -896,18 +896,20 @@ tor_tls_cert_get_key(tor_x509_cert_t *cert) MOCK_IMPL(int, tor_tls_cert_matches_key,(const tor_tls_t *tls, const tor_x509_cert_t *cert)) { - X509 *peercert = SSL_get_peer_certificate(tls->ssl); + tor_x509_cert_t *peer = tor_tls_get_peer_cert((tor_tls_t *)tls); + if (!peer) + return 0; + + X509 *peercert = peer->cert; EVP_PKEY *link_key = NULL, *cert_key = NULL; int result; - if (!peercert) - return 0; link_key = X509_get_pubkey(peercert); cert_key = X509_get_pubkey(cert->cert); result = link_key && cert_key && EVP_PKEY_cmp(cert_key, link_key) == 1; - X509_free(peercert); + tor_x509_cert_free(peer); if (link_key) EVP_PKEY_free(link_key); if (cert_key) |