aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/tls
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2022-02-06 14:10:32 -0500
committerJack Lloyd <[email protected]>2022-02-06 14:10:32 -0500
commitbf15164d8e48eb2d60b43ad2a599ffe504739286 (patch)
treeb909ba6e5eb8f0edad1761557661f0b42140878b /src/lib/tls
parent25682391a043c35ee19f4ac3863b6e73d1d80e0f (diff)
Use C++17's concat namespace feature
Diffstat (limited to 'src/lib/tls')
-rw-r--r--src/lib/tls/msg_cert_req.cpp6
-rw-r--r--src/lib/tls/msg_cert_status.cpp6
-rw-r--r--src/lib/tls/msg_cert_verify.cpp6
-rw-r--r--src/lib/tls/msg_certificate.cpp6
-rw-r--r--src/lib/tls/msg_client_hello.cpp6
-rw-r--r--src/lib/tls/msg_client_kex.cpp6
-rw-r--r--src/lib/tls/msg_finished.cpp6
-rw-r--r--src/lib/tls/msg_hello_verify.cpp6
-rw-r--r--src/lib/tls/msg_server_hello.cpp6
-rw-r--r--src/lib/tls/msg_server_kex.cpp6
-rw-r--r--src/lib/tls/msg_session_ticket.cpp6
-rw-r--r--src/lib/tls/sessions_sql/tls_session_manager_sql.cpp6
-rw-r--r--src/lib/tls/tls_alert.cpp6
-rw-r--r--src/lib/tls/tls_algos.cpp6
-rw-r--r--src/lib/tls/tls_cbc/tls_cbc.cpp6
-rw-r--r--src/lib/tls/tls_channel.cpp6
-rw-r--r--src/lib/tls/tls_ciphersuite.cpp6
-rw-r--r--src/lib/tls/tls_client.cpp6
-rw-r--r--src/lib/tls/tls_extensions.cpp6
-rw-r--r--src/lib/tls/tls_handshake_hash.cpp6
-rw-r--r--src/lib/tls/tls_handshake_io.cpp5
-rw-r--r--src/lib/tls/tls_handshake_state.cpp6
-rw-r--r--src/lib/tls/tls_policy.cpp6
-rw-r--r--src/lib/tls/tls_record.cpp6
-rw-r--r--src/lib/tls/tls_server.cpp6
-rw-r--r--src/lib/tls/tls_session.cpp6
-rw-r--r--src/lib/tls/tls_session_key.cpp6
-rw-r--r--src/lib/tls/tls_session_manager_memory.cpp6
-rw-r--r--src/lib/tls/tls_text_policy.cpp6
-rw-r--r--src/lib/tls/tls_version.cpp6
30 files changed, 30 insertions, 149 deletions
diff --git a/src/lib/tls/msg_cert_req.cpp b/src/lib/tls/msg_cert_req.cpp
index dc009651a..d23b700fd 100644
--- a/src/lib/tls/msg_cert_req.cpp
+++ b/src/lib/tls/msg_cert_req.cpp
@@ -13,9 +13,7 @@
#include <botan/der_enc.h>
#include <botan/ber_dec.h>
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
namespace {
@@ -142,5 +140,3 @@ std::vector<uint8_t> Certificate_Req::serialize() const
}
}
-
-}
diff --git a/src/lib/tls/msg_cert_status.cpp b/src/lib/tls/msg_cert_status.cpp
index 4fafd10ad..2ae66f9b8 100644
--- a/src/lib/tls/msg_cert_status.cpp
+++ b/src/lib/tls/msg_cert_status.cpp
@@ -13,9 +13,7 @@
#include <botan/der_enc.h>
#include <botan/ber_dec.h>
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
Certificate_Status::Certificate_Status(const std::vector<uint8_t>& buf)
{
@@ -67,5 +65,3 @@ std::vector<uint8_t> Certificate_Status::serialize() const
}
}
-
-}
diff --git a/src/lib/tls/msg_cert_verify.cpp b/src/lib/tls/msg_cert_verify.cpp
index 3bc5bd76f..94a13e88f 100644
--- a/src/lib/tls/msg_cert_verify.cpp
+++ b/src/lib/tls/msg_cert_verify.cpp
@@ -12,9 +12,7 @@
#include <botan/internal/tls_handshake_io.h>
#include <botan/internal/tls_handshake_state.h>
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
/*
* Create a new Certificate Verify message
@@ -101,5 +99,3 @@ bool Certificate_Verify::verify(const X509_Certificate& cert,
}
}
-
-}
diff --git a/src/lib/tls/msg_certificate.cpp b/src/lib/tls/msg_certificate.cpp
index db6f2ce9e..f520c0d5f 100644
--- a/src/lib/tls/msg_certificate.cpp
+++ b/src/lib/tls/msg_certificate.cpp
@@ -15,9 +15,7 @@
#include <botan/internal/loadstor.h>
#include <botan/data_src.h>
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
/**
* Create a new Certificate message
@@ -105,5 +103,3 @@ std::vector<uint8_t> Certificate::serialize() const
}
}
-
-}
diff --git a/src/lib/tls/msg_client_hello.cpp b/src/lib/tls/msg_client_hello.cpp
index bbc75a7de..448d441c3 100644
--- a/src/lib/tls/msg_client_hello.cpp
+++ b/src/lib/tls/msg_client_hello.cpp
@@ -21,9 +21,7 @@
#include <botan/internal/stl_util.h>
#include <chrono>
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
enum {
TLS_EMPTY_RENEGOTIATION_INFO_SCSV = 0x00FF,
@@ -424,5 +422,3 @@ std::vector<uint16_t> Client_Hello::srtp_profiles() const
}
-
-}
diff --git a/src/lib/tls/msg_client_kex.cpp b/src/lib/tls/msg_client_kex.cpp
index f768e48b6..7b0f13285 100644
--- a/src/lib/tls/msg_client_kex.cpp
+++ b/src/lib/tls/msg_client_kex.cpp
@@ -23,9 +23,7 @@
#include <botan/cecpq1.h>
#endif
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
/*
* Create a new Client Key Exchange message
@@ -354,5 +352,3 @@ Client_Key_Exchange::Client_Key_Exchange(const std::vector<uint8_t>& contents,
}
}
-
-}
diff --git a/src/lib/tls/msg_finished.cpp b/src/lib/tls/msg_finished.cpp
index 65cfa607f..a55d3030a 100644
--- a/src/lib/tls/msg_finished.cpp
+++ b/src/lib/tls/msg_finished.cpp
@@ -10,9 +10,7 @@
#include <botan/internal/tls_handshake_io.h>
#include <botan/internal/tls_handshake_state.h>
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
namespace {
@@ -87,5 +85,3 @@ bool Finished::verify(const Handshake_State& state,
}
}
-
-}
diff --git a/src/lib/tls/msg_hello_verify.cpp b/src/lib/tls/msg_hello_verify.cpp
index 3e9360cc7..6e2352db0 100644
--- a/src/lib/tls/msg_hello_verify.cpp
+++ b/src/lib/tls/msg_hello_verify.cpp
@@ -8,9 +8,7 @@
#include <botan/tls_messages.h>
#include <botan/mac.h>
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
Hello_Verify_Request::Hello_Verify_Request(const std::vector<uint8_t>& buf)
{
@@ -64,5 +62,3 @@ std::vector<uint8_t> Hello_Verify_Request::serialize() const
}
}
-
-}
diff --git a/src/lib/tls/msg_server_hello.cpp b/src/lib/tls/msg_server_hello.cpp
index a6e9c600e..80b512de6 100644
--- a/src/lib/tls/msg_server_hello.cpp
+++ b/src/lib/tls/msg_server_hello.cpp
@@ -16,9 +16,7 @@
#include <botan/internal/tls_handshake_hash.h>
#include <botan/internal/stl_util.h>
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
namespace {
@@ -235,5 +233,3 @@ std::vector<uint8_t> Server_Hello_Done::serialize() const
}
}
-
-}
diff --git a/src/lib/tls/msg_server_kex.cpp b/src/lib/tls/msg_server_kex.cpp
index bf3b2da8b..064e1e965 100644
--- a/src/lib/tls/msg_server_kex.cpp
+++ b/src/lib/tls/msg_server_kex.cpp
@@ -26,9 +26,7 @@
#include <botan/cecpq1.h>
#endif
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
/**
* Create a new Server Key Exchange message
@@ -283,5 +281,3 @@ const Private_Key& Server_Key_Exchange::server_kex_key() const
}
}
-
-}
diff --git a/src/lib/tls/msg_session_ticket.cpp b/src/lib/tls/msg_session_ticket.cpp
index f545d360f..c2f5a24e4 100644
--- a/src/lib/tls/msg_session_ticket.cpp
+++ b/src/lib/tls/msg_session_ticket.cpp
@@ -11,9 +11,7 @@
#include <botan/internal/tls_handshake_hash.h>
#include <botan/internal/loadstor.h>
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
New_Session_Ticket::New_Session_Ticket(Handshake_IO& io,
Handshake_Hash& hash,
@@ -52,5 +50,3 @@ std::vector<uint8_t> New_Session_Ticket::serialize() const
}
}
-
-}
diff --git a/src/lib/tls/sessions_sql/tls_session_manager_sql.cpp b/src/lib/tls/sessions_sql/tls_session_manager_sql.cpp
index 48c34db56..3fb60bcaa 100644
--- a/src/lib/tls/sessions_sql/tls_session_manager_sql.cpp
+++ b/src/lib/tls/sessions_sql/tls_session_manager_sql.cpp
@@ -13,9 +13,7 @@
#include <botan/internal/loadstor.h>
#include <chrono>
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
Session_Manager_SQL::Session_Manager_SQL(std::shared_ptr<SQL_Database> db,
const std::string& passphrase,
@@ -217,5 +215,3 @@ void Session_Manager_SQL::prune_session_cache()
}
}
-
-}
diff --git a/src/lib/tls/tls_alert.cpp b/src/lib/tls/tls_alert.cpp
index 60c9c4b98..a947d7d5e 100644
--- a/src/lib/tls/tls_alert.cpp
+++ b/src/lib/tls/tls_alert.cpp
@@ -8,9 +8,7 @@
#include <botan/tls_alert.h>
#include <botan/tls_exceptn.h>
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
Alert::Alert(const secure_vector<uint8_t>& buf)
{
@@ -122,5 +120,3 @@ std::string Alert::type_string() const
}
}
-
-}
diff --git a/src/lib/tls/tls_algos.cpp b/src/lib/tls/tls_algos.cpp
index 0414523d8..c76549206 100644
--- a/src/lib/tls/tls_algos.cpp
+++ b/src/lib/tls/tls_algos.cpp
@@ -7,9 +7,7 @@
#include <botan/tls_algos.h>
#include <botan/exceptn.h>
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
std::string kdf_algo_to_string(KDF_Algo algo)
{
@@ -352,5 +350,3 @@ std::string padding_string_for_scheme(Signature_Scheme scheme)
}
}
-
-}
diff --git a/src/lib/tls/tls_cbc/tls_cbc.cpp b/src/lib/tls/tls_cbc/tls_cbc.cpp
index a516e74dd..e8754c5a4 100644
--- a/src/lib/tls/tls_cbc/tls_cbc.cpp
+++ b/src/lib/tls/tls_cbc/tls_cbc.cpp
@@ -17,9 +17,7 @@
#include <botan/tls_alert.h>
#include <botan/tls_exceptn.h>
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
/*
* TLS_CBC_HMAC_AEAD_Mode Constructor
@@ -496,5 +494,3 @@ void TLS_CBC_HMAC_AEAD_Decryption::finish(secure_vector<uint8_t>& buffer, size_t
}
}
-
-}
diff --git a/src/lib/tls/tls_channel.cpp b/src/lib/tls/tls_channel.cpp
index c96ee8916..860ec72f1 100644
--- a/src/lib/tls/tls_channel.cpp
+++ b/src/lib/tls/tls_channel.cpp
@@ -16,9 +16,7 @@
#include <botan/internal/stl_util.h>
#include <botan/internal/loadstor.h>
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
size_t TLS::Channel::IO_BUF_DEFAULT_SIZE = 10*1024;
@@ -725,5 +723,3 @@ SymmetricKey Channel::key_material_export(const std::string& label,
}
}
-
-}
diff --git a/src/lib/tls/tls_ciphersuite.cpp b/src/lib/tls/tls_ciphersuite.cpp
index 0a6426a1d..3af6c1f67 100644
--- a/src/lib/tls/tls_ciphersuite.cpp
+++ b/src/lib/tls/tls_ciphersuite.cpp
@@ -13,9 +13,7 @@
#include <botan/hash.h>
#include <algorithm>
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
size_t Ciphersuite::nonce_bytes_from_handshake() const
{
@@ -221,5 +219,3 @@ bool Ciphersuite::is_usable() const
}
-}
-
diff --git a/src/lib/tls/tls_client.cpp b/src/lib/tls/tls_client.cpp
index fa3ee3e1c..e55f0aeaf 100644
--- a/src/lib/tls/tls_client.cpp
+++ b/src/lib/tls/tls_client.cpp
@@ -14,9 +14,7 @@
#include <iterator>
#include <sstream>
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
namespace {
@@ -733,5 +731,3 @@ void Client::process_handshake_msg(const Handshake_State* active_state,
}
}
-
-}
diff --git a/src/lib/tls/tls_extensions.cpp b/src/lib/tls/tls_extensions.cpp
index 77ae608ae..ba5ea73f1 100644
--- a/src/lib/tls/tls_extensions.cpp
+++ b/src/lib/tls/tls_extensions.cpp
@@ -11,9 +11,7 @@
#include <botan/tls_exceptn.h>
#include <botan/tls_policy.h>
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
namespace {
@@ -617,5 +615,3 @@ bool Supported_Versions::supports(Protocol_Version version) const
}
}
-
-}
diff --git a/src/lib/tls/tls_handshake_hash.cpp b/src/lib/tls/tls_handshake_hash.cpp
index 7dd675f69..a5538c5b2 100644
--- a/src/lib/tls/tls_handshake_hash.cpp
+++ b/src/lib/tls/tls_handshake_hash.cpp
@@ -8,9 +8,7 @@
#include <botan/internal/tls_handshake_hash.h>
#include <botan/hash.h>
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
/**
* Return a TLS Handshake Hash
@@ -27,5 +25,3 @@ secure_vector<uint8_t> Handshake_Hash::final(const std::string& mac_algo) const
}
}
-
-}
diff --git a/src/lib/tls/tls_handshake_io.cpp b/src/lib/tls/tls_handshake_io.cpp
index e5ef9738d..867f8f9a6 100644
--- a/src/lib/tls/tls_handshake_io.cpp
+++ b/src/lib/tls/tls_handshake_io.cpp
@@ -13,9 +13,7 @@
#include <botan/internal/loadstor.h>
#include <chrono>
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
namespace {
@@ -482,4 +480,3 @@ std::vector<uint8_t> Datagram_Handshake_IO::send_message(uint16_t msg_seq,
}
}
-}
diff --git a/src/lib/tls/tls_handshake_state.cpp b/src/lib/tls/tls_handshake_state.cpp
index 0f4c4a378..56c3b1b21 100644
--- a/src/lib/tls/tls_handshake_state.cpp
+++ b/src/lib/tls/tls_handshake_state.cpp
@@ -12,9 +12,7 @@
#include <botan/kdf.h>
#include <sstream>
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
std::string Handshake_Message::type_string() const
{
@@ -519,5 +517,3 @@ Handshake_State::parse_sig_format(const Public_Key& key,
}
}
-
-}
diff --git a/src/lib/tls/tls_policy.cpp b/src/lib/tls/tls_policy.cpp
index eea1eb871..82d892ea6 100644
--- a/src/lib/tls/tls_policy.cpp
+++ b/src/lib/tls/tls_policy.cpp
@@ -15,9 +15,7 @@
#include <botan/pk_keys.h>
#include <sstream>
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
std::vector<Signature_Scheme> Policy::allowed_signature_schemes() const
{
@@ -560,5 +558,3 @@ bool Strict_Policy::allow_tls12() const { return true; }
bool Strict_Policy::allow_dtls12() const { return true; }
}
-
-}
diff --git a/src/lib/tls/tls_record.cpp b/src/lib/tls/tls_record.cpp
index ffe91afe8..3dde0caa4 100644
--- a/src/lib/tls/tls_record.cpp
+++ b/src/lib/tls/tls_record.cpp
@@ -21,9 +21,7 @@
#include <botan/internal/tls_cbc.h>
#endif
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
Connection_Cipher_State::Connection_Cipher_State(Protocol_Version version,
Connection_Side side,
@@ -575,5 +573,3 @@ Record_Header read_record(bool is_datagram,
}
}
-
-}
diff --git a/src/lib/tls/tls_server.cpp b/src/lib/tls/tls_server.cpp
index fb56126b0..1ca53f2ec 100644
--- a/src/lib/tls/tls_server.cpp
+++ b/src/lib/tls/tls_server.cpp
@@ -12,9 +12,7 @@
#include <botan/internal/stl_util.h>
#include <botan/tls_magic.h>
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
class Server_Handshake_State final : public Handshake_State
{
@@ -945,5 +943,3 @@ void Server::session_create(Server_Handshake_State& pending_state,
pending_state.server_hello_done(new Server_Hello_Done(pending_state.handshake_io(), pending_state.hash()));
}
}
-
-}
diff --git a/src/lib/tls/tls_session.cpp b/src/lib/tls/tls_session.cpp
index 92f73dc0a..9dd6c7f8f 100644
--- a/src/lib/tls/tls_session.cpp
+++ b/src/lib/tls/tls_session.cpp
@@ -15,9 +15,7 @@
#include <botan/mac.h>
#include <botan/rng.h>
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
Session::Session(const std::vector<uint8_t>& session_identifier,
const secure_vector<uint8_t>& master_secret,
@@ -314,5 +312,3 @@ Session Session::decrypt(const uint8_t in[], size_t in_len, const SymmetricKey&
}
}
-
-}
diff --git a/src/lib/tls/tls_session_key.cpp b/src/lib/tls/tls_session_key.cpp
index 2a52d0be9..659cc1e56 100644
--- a/src/lib/tls/tls_session_key.cpp
+++ b/src/lib/tls/tls_session_key.cpp
@@ -10,9 +10,7 @@
#include <botan/tls_messages.h>
#include <botan/kdf.h>
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
/**
* Session_Keys Constructor
@@ -96,5 +94,3 @@ Session_Keys::Session_Keys(const Handshake_State* state,
}
}
-
-}
diff --git a/src/lib/tls/tls_session_manager_memory.cpp b/src/lib/tls/tls_session_manager_memory.cpp
index 600eb440a..39dcead4b 100644
--- a/src/lib/tls/tls_session_manager_memory.cpp
+++ b/src/lib/tls/tls_session_manager_memory.cpp
@@ -10,9 +10,7 @@
#include <botan/rng.h>
#include <chrono>
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
Session_Manager_In_Memory::Session_Manager_In_Memory(
RandomNumberGenerator& rng,
@@ -128,5 +126,3 @@ void Session_Manager_In_Memory::save(const Session& session)
}
}
-
-}
diff --git a/src/lib/tls/tls_text_policy.cpp b/src/lib/tls/tls_text_policy.cpp
index 2be8c369b..998dc5b2b 100644
--- a/src/lib/tls/tls_text_policy.cpp
+++ b/src/lib/tls/tls_text_policy.cpp
@@ -11,9 +11,7 @@
#include <botan/internal/parsing.h>
#include <sstream>
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
std::vector<std::string> Text_Policy::allowed_ciphers() const
{
@@ -300,5 +298,3 @@ bool Text_Policy::set_value(const std::string& key, const std::string& val, bool
}
}
-
-}
diff --git a/src/lib/tls/tls_version.cpp b/src/lib/tls/tls_version.cpp
index 40a9a83cf..fe6dd2629 100644
--- a/src/lib/tls/tls_version.cpp
+++ b/src/lib/tls/tls_version.cpp
@@ -8,9 +8,7 @@
#include <botan/tls_version.h>
#include <botan/tls_exceptn.h>
-namespace Botan {
-
-namespace TLS {
+namespace Botan::TLS {
std::string Protocol_Version::to_string() const
{
@@ -55,5 +53,3 @@ bool Protocol_Version::known_version() const
}
}
-
-}