summaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@oath.com>2018-09-03 14:38:57 +0000
committerTor Brede Vekterli <vekterli@oath.com>2018-09-03 14:38:57 +0000
commitf44fc220cc84fad810b2082ea7706774de6edb82 (patch)
tree0250cb2a619f99dfd9ce8a89ffee11d61a80451d /vespalib
parent644ab717dead94f56f89d0fbf0d9a97efb56f6e4 (diff)
Explicit vespalib string namespace prefixing
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/vespa/vespalib/net/tls/impl/openssl_crypto_codec_impl.cpp2
-rw-r--r--vespalib/src/vespa/vespalib/net/tls/impl/openssl_tls_context_impl.cpp8
-rw-r--r--vespalib/src/vespa/vespalib/net/tls/transport_security_options.h18
3 files changed, 13 insertions, 15 deletions
diff --git a/vespalib/src/vespa/vespalib/net/tls/impl/openssl_crypto_codec_impl.cpp b/vespalib/src/vespa/vespalib/net/tls/impl/openssl_crypto_codec_impl.cpp
index 53d21e398ba..13e1be2ce34 100644
--- a/vespalib/src/vespa/vespalib/net/tls/impl/openssl_crypto_codec_impl.cpp
+++ b/vespalib/src/vespa/vespalib/net/tls/impl/openssl_crypto_codec_impl.cpp
@@ -7,8 +7,6 @@
#include <vector>
#include <memory>
#include <stdexcept>
-#include <string>
-#include <string_view>
#include <openssl/ssl.h>
#include <openssl/crypto.h>
#include <openssl/err.h>
diff --git a/vespalib/src/vespa/vespalib/net/tls/impl/openssl_tls_context_impl.cpp b/vespalib/src/vespa/vespalib/net/tls/impl/openssl_tls_context_impl.cpp
index 207180f3c96..c868f695b98 100644
--- a/vespalib/src/vespa/vespalib/net/tls/impl/openssl_tls_context_impl.cpp
+++ b/vespalib/src/vespa/vespalib/net/tls/impl/openssl_tls_context_impl.cpp
@@ -86,7 +86,7 @@ void ensure_openssl_initialized_once() {
(void) openssl_resources;
}
-BioPtr bio_from_string(stringref str) {
+BioPtr bio_from_string(vespalib::stringref str) {
LOG_ASSERT(str.size() <= INT_MAX);
BioPtr bio(::BIO_new_mem_buf(str.data(), static_cast<int>(str.size())));
if (!bio) {
@@ -159,7 +159,7 @@ OpenSslTlsContextImpl::~OpenSslTlsContextImpl() {
::SSL_CTX_free(_ctx);
}
-void OpenSslTlsContextImpl::add_certificate_authorities(stringref ca_pem) {
+void OpenSslTlsContextImpl::add_certificate_authorities(vespalib::stringref ca_pem) {
// TODO support empty CA set...? Ever useful?
auto bio = bio_from_string(ca_pem);
::X509_STORE* cert_store = ::SSL_CTX_get_cert_store(_ctx); // Internal pointer, not owned by us.
@@ -174,7 +174,7 @@ void OpenSslTlsContextImpl::add_certificate_authorities(stringref ca_pem) {
}
}
-void OpenSslTlsContextImpl::add_certificate_chain(stringref chain_pem) {
+void OpenSslTlsContextImpl::add_certificate_chain(vespalib::stringref chain_pem) {
::ERR_clear_error();
auto bio = bio_from_string(chain_pem);
// First certificate in the chain is the node's own (trusted) certificate.
@@ -202,7 +202,7 @@ void OpenSslTlsContextImpl::add_certificate_chain(stringref chain_pem) {
}
}
-void OpenSslTlsContextImpl::use_private_key(stringref key_pem) {
+void OpenSslTlsContextImpl::use_private_key(vespalib::stringref key_pem) {
auto bio = bio_from_string(key_pem);
EvpPkeyPtr key(::PEM_read_bio_PrivateKey(bio.get(), nullptr, nullptr, empty_passphrase()));
if (!key) {
diff --git a/vespalib/src/vespa/vespalib/net/tls/transport_security_options.h b/vespalib/src/vespa/vespalib/net/tls/transport_security_options.h
index 12fb34196b1..0a228388791 100644
--- a/vespalib/src/vespa/vespalib/net/tls/transport_security_options.h
+++ b/vespalib/src/vespa/vespalib/net/tls/transport_security_options.h
@@ -7,24 +7,24 @@
namespace vespalib::net::tls {
class TransportSecurityOptions {
- string _ca_certs_pem;
- string _cert_chain_pem;
- string _private_key_pem;
+ vespalib::string _ca_certs_pem;
+ vespalib::string _cert_chain_pem;
+ vespalib::string _private_key_pem;
public:
TransportSecurityOptions() = default;
- TransportSecurityOptions(string ca_certs_pem,
- string cert_chain_pem,
- string private_key_pem)
+ TransportSecurityOptions(vespalib::string ca_certs_pem,
+ vespalib::string cert_chain_pem,
+ vespalib::string private_key_pem)
: _ca_certs_pem(std::move(ca_certs_pem)),
_cert_chain_pem(std::move(cert_chain_pem)),
_private_key_pem(std::move(private_key_pem))
{}
~TransportSecurityOptions();
- const string& ca_certs_pem() const noexcept { return _ca_certs_pem; }
- const string& cert_chain_pem() const noexcept { return _cert_chain_pem; }
- const string& private_key_pem() const noexcept { return _private_key_pem; }
+ const vespalib::string& ca_certs_pem() const noexcept { return _ca_certs_pem; }
+ const vespalib::string& cert_chain_pem() const noexcept { return _cert_chain_pem; }
+ const vespalib::string& private_key_pem() const noexcept { return _private_key_pem; }
};
}