[tor-commits] [tor/master] Remove tor_x509_get_cert_impl as unneeded.

nickm at torproject.org nickm at torproject.org
Wed Sep 5 00:47:14 UTC 2018


commit 02086a216f15fd8c45e603a8d9bab482f60753f4
Author: Nick Mathewson <nickm at torproject.org>
Date:   Thu Aug 23 13:05:38 2018 -0400

    Remove tor_x509_get_cert_impl as unneeded.
---
 src/lib/tls/tortls_openssl.c | 2 +-
 src/lib/tls/x509.c           | 8 --------
 src/lib/tls/x509_internal.h  | 2 --
 3 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/src/lib/tls/tortls_openssl.c b/src/lib/tls/tortls_openssl.c
index e455693df..d10e50a97 100644
--- a/src/lib/tls/tortls_openssl.c
+++ b/src/lib/tls/tortls_openssl.c
@@ -480,7 +480,7 @@ tor_tls_cert_matches_key,(const tor_tls_t *tls, const tor_x509_cert_t *cert))
   if (!peercert)
     return 0;
   link_key = X509_get_pubkey(peercert);
-  cert_key = X509_get_pubkey((X509 *)tor_x509_cert_get_impl(cert));
+  cert_key = X509_get_pubkey(cert->cert);
 
   result = link_key && cert_key && EVP_PKEY_cmp(cert_key, link_key) == 1;
 
diff --git a/src/lib/tls/x509.c b/src/lib/tls/x509.c
index d2270f910..cff1c1302 100644
--- a/src/lib/tls/x509.c
+++ b/src/lib/tls/x509.c
@@ -52,14 +52,6 @@ tor_tls_pick_certificate_lifetime(time_t now,
   *end_time_out = end_time;
 }
 
-/** Return the underlying implementation for <b>cert</b> */
-const tor_x509_cert_impl_t *
-tor_x509_cert_get_impl(const tor_x509_cert_t *cert)
-{
-  tor_assert(cert);
-  return cert->cert;
-}
-
 /** Return a set of digests for the public key in <b>cert</b>, or NULL if this
  * cert's public key is not one we know how to take the digest of. */
 const common_digests_t *
diff --git a/src/lib/tls/x509_internal.h b/src/lib/tls/x509_internal.h
index 4b49f1dec..0e186ec84 100644
--- a/src/lib/tls/x509_internal.h
+++ b/src/lib/tls/x509_internal.h
@@ -33,8 +33,6 @@ MOCK_DECL(tor_x509_cert_impl_t *, tor_tls_create_certificate,
                                                   unsigned int cert_lifetime));
 MOCK_DECL(tor_x509_cert_t *, tor_x509_cert_new,
           (tor_x509_cert_impl_t *x509_cert));
-const tor_x509_cert_impl_t *tor_x509_cert_get_impl(
-                                           const tor_x509_cert_t *cert);
 
 int tor_x509_check_cert_lifetime_internal(int severity,
                                           const tor_x509_cert_impl_t *cert,





More information about the tor-commits mailing list