summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-05-13 22:11:39 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-05-13 22:11:39 (GMT)
commite8ce0b8e97466e9fa849da6a8c0a4df77fbd0ddd (patch)
treed8599da048c74482def31335d1a881656db188cf /Swiften/TLS/OpenSSL
parent27d7cb1c99a55bfb45658b4f20f901926e526cae (diff)
downloadswift-contrib-e8ce0b8e97466e9fa849da6a8c0a4df77fbd0ddd.zip
swift-contrib-e8ce0b8e97466e9fa849da6a8c0a4df77fbd0ddd.tar.bz2
Removed some explicit new's.
Diffstat (limited to 'Swiften/TLS/OpenSSL')
-rw-r--r--Swiften/TLS/OpenSSL/OpenSSLContext.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Swiften/TLS/OpenSSL/OpenSSLContext.cpp b/Swiften/TLS/OpenSSL/OpenSSLContext.cpp
index edd1503..97094bf 100644
--- a/Swiften/TLS/OpenSSL/OpenSSLContext.cpp
+++ b/Swiften/TLS/OpenSSL/OpenSSLContext.cpp
@@ -13,6 +13,7 @@
#include <vector>
#include <openssl/err.h>
#include <openssl/pkcs12.h>
+#include <boost/smart_ptr/make_shared.hpp>
#if defined(SWIFTEN_PLATFORM_MACOSX) && OPENSSL_VERSION_NUMBER < 0x00908000
#include <Security/Security.h>
@@ -226,7 +227,7 @@ bool OpenSSLContext::setClientCertificate(const PKCS12Certificate& certificate)
Certificate::ref OpenSSLContext::getPeerCertificate() const {
boost::shared_ptr<X509> x509Cert(SSL_get_peer_certificate(handle_), X509_free);
if (x509Cert) {
- return Certificate::ref(new OpenSSLCertificate(x509Cert));
+ return boost::make_shared<OpenSSLCertificate>(x509Cert);
}
else {
return Certificate::ref();
@@ -236,7 +237,7 @@ Certificate::ref OpenSSLContext::getPeerCertificate() const {
boost::shared_ptr<CertificateVerificationError> OpenSSLContext::getPeerCertificateVerificationError() const {
int verifyResult = SSL_get_verify_result(handle_);
if (verifyResult != X509_V_OK) {
- return boost::shared_ptr<CertificateVerificationError>(new CertificateVerificationError(getVerificationErrorTypeForResult(verifyResult)));
+ return boost::make_shared<CertificateVerificationError>(getVerificationErrorTypeForResult(verifyResult));
}
else {
return boost::shared_ptr<CertificateVerificationError>();