diff options
Diffstat (limited to 'Swiften/TLS')
-rw-r--r-- | Swiften/TLS/OpenSSL/OpenSSLContext.cpp | 2 | ||||
-rw-r--r-- | Swiften/TLS/PKCS12Certificate.h | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/Swiften/TLS/OpenSSL/OpenSSLContext.cpp b/Swiften/TLS/OpenSSL/OpenSSLContext.cpp index 8d3970e..220e7f9 100644 --- a/Swiften/TLS/OpenSSL/OpenSSLContext.cpp +++ b/Swiften/TLS/OpenSSL/OpenSSLContext.cpp @@ -203,7 +203,7 @@ bool OpenSSLContext::setClientCertificate(const PKCS12Certificate& certificate) X509 *certPtr = 0; EVP_PKEY* privateKeyPtr = 0; STACK_OF(X509)* caCertsPtr = 0; - int result = PKCS12_parse(pkcs12.get(), certificate.getPassword().c_str(), &privateKeyPtr, &certPtr, &caCertsPtr); + int result = PKCS12_parse(pkcs12.get(), reinterpret_cast<const char*>(vecptr(certificate.getPassword())), &privateKeyPtr, &certPtr, &caCertsPtr); if (result != 1) { return false; } diff --git a/Swiften/TLS/PKCS12Certificate.h b/Swiften/TLS/PKCS12Certificate.h index d4cb367..c0e01d0 100644 --- a/Swiften/TLS/PKCS12Certificate.h +++ b/Swiften/TLS/PKCS12Certificate.h @@ -6,14 +6,14 @@ #pragma once -#include <Swiften/Base/ByteArray.h> +#include <Swiften/Base/SafeByteArray.h> namespace Swift { class PKCS12Certificate { public: PKCS12Certificate() {} - PKCS12Certificate(const std::string& filename, const std::string& password) : password_(password) { + PKCS12Certificate(const std::string& filename, const SafeByteArray& password) : password_(password) { readByteArrayFromFile(data_, filename); } @@ -29,12 +29,12 @@ namespace Swift { data_ = data; } - const std::string& getPassword() const { + const SafeByteArray& getPassword() const { return password_; } private: ByteArray data_; - std::string password_; + SafeByteArray password_; }; } |