From ad94d43fc50525e8814b6e99f78d4b9635fa80ca Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 4 Sep 2018 12:59:47 -0400 Subject: Port test_tortls_verify to not depend on openssl internals --- src/lib/tls/x509_openssl.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/lib/tls/x509_openssl.c') diff --git a/src/lib/tls/x509_openssl.c b/src/lib/tls/x509_openssl.c index f315b88f36..dd74e84418 100644 --- a/src/lib/tls/x509_openssl.c +++ b/src/lib/tls/x509_openssl.c @@ -206,6 +206,15 @@ tor_x509_cert_impl_free_(tor_x509_cert_impl_t *cert) X509_free(cert); } +tor_x509_cert_impl_t * +tor_x509_cert_impl_dup_(tor_x509_cert_impl_t *cert) +{ + if (cert) + return X509_dup(cert); + else + return NULL; +} + /** Set *encoded_out and *size_out to cert's encoded DER * representation and length, respectively. */ void @@ -219,15 +228,6 @@ tor_x509_cert_get_der(const tor_x509_cert_t *cert, *size_out = cert->encoded_len; } -/** Return a new copy of cert. */ -tor_x509_cert_t * -tor_x509_cert_dup(const tor_x509_cert_t *cert) -{ - tor_assert(cert); - X509 *x509 = cert->cert; - return tor_x509_cert_new(X509_dup(x509)); -} - /** Read a DER-encoded X509 cert, of length exactly certificate_len, * from a certificate. Return a newly allocated tor_x509_cert_t on * success and NULL on failure. */ -- cgit v1.2.3-54-g00ecf