diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-08-21 19:20:37 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-08-21 19:20:37 -0400 |
commit | de66bd397c61d88228fa4c1d4b7e5b7f9c08a115 (patch) | |
tree | 5dc2c0842488062540b2a6114360a49fea0b573a /src/lib/tls | |
parent | 9bb0ac4bf107ca92bb62f419fd512f3d5989e70d (diff) | |
parent | f68aab83ba6ab61b010d4445b6c68a6cf780471a (diff) | |
download | tor-de66bd397c61d88228fa4c1d4b7e5b7f9c08a115.tar.gz tor-de66bd397c61d88228fa4c1d4b7e5b7f9c08a115.zip |
Merge branch 'maint-0.3.4'
Diffstat (limited to 'src/lib/tls')
-rw-r--r-- | src/lib/tls/tortls.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/tls/tortls.c b/src/lib/tls/tortls.c index 073cae02ba..7135820d2f 100644 --- a/src/lib/tls/tortls.c +++ b/src/lib/tls/tortls.c @@ -926,18 +926,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) |