From f9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Thu, 21 Nov 2013 22:16:57 +0100 Subject: Boost/C++11 shared pointers. --- .../cert/openssl/X509Certificate_OpenSSL.cpp | 32 +++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/security/cert/openssl/X509Certificate_OpenSSL.cpp') diff --git a/src/security/cert/openssl/X509Certificate_OpenSSL.cpp b/src/security/cert/openssl/X509Certificate_OpenSSL.cpp index 8c18583b..8c7174a0 100644 --- a/src/security/cert/openssl/X509Certificate_OpenSSL.cpp +++ b/src/security/cert/openssl/X509Certificate_OpenSSL.cpp @@ -158,17 +158,17 @@ void* X509Certificate_OpenSSL::getInternalData() // static -ref X509Certificate_OpenSSL::importInternal(X509* cert) +shared_ptr X509Certificate_OpenSSL::importInternal(X509* cert) { if (cert) - return vmime::create (reinterpret_cast (cert)); + return make_shared (reinterpret_cast (cert)); - return NULL; + return null; } // static -ref X509Certificate::import(utility::inputStream& is) +shared_ptr X509Certificate::import(utility::inputStream& is) { byteArray bytes; utility::stream::value_type chunk[4096]; @@ -184,17 +184,17 @@ ref X509Certificate::import(utility::inputStream& is) // static -ref X509Certificate::import +shared_ptr X509Certificate::import (const byte_t* data, const size_t length) { - ref cert = vmime::create (); + shared_ptr cert = make_shared (); BIO* membio = BIO_new_mem_buf(const_cast (data), length); if (!PEM_read_bio_X509(membio, &(cert->m_data->cert), 0, 0)) { BIO_vfree(membio); - return NULL; + return null; } BIO_vfree(membio); @@ -270,10 +270,10 @@ const byteArray X509Certificate_OpenSSL::getSerialNumber() const } -bool X509Certificate_OpenSSL::checkIssuer(ref cert_) const +bool X509Certificate_OpenSSL::checkIssuer(shared_ptr cert_) const { - ref cert = - cert_.dynamicCast (); + shared_ptr cert = + dynamicCast (cert_); // Get issuer for this cert BIO *out; @@ -297,10 +297,10 @@ bool X509Certificate_OpenSSL::checkIssuer(ref cert_) con } -bool X509Certificate_OpenSSL::verify(ref caCert_) const +bool X509Certificate_OpenSSL::verify(shared_ptr caCert_) const { - ref caCert = - caCert_.dynamicCast (); + shared_ptr caCert = + dynamicCast (caCert_); bool verified = false; @@ -550,10 +550,10 @@ int X509Certificate_OpenSSL::getVersion() const } -bool X509Certificate_OpenSSL::equals(ref other) const +bool X509Certificate_OpenSSL::equals(shared_ptr other) const { - ref otherX509 = - other.dynamicCast (); + shared_ptr otherX509 = + dynamicCast (other); if (!otherX509) return false; -- cgit v1.2.3