aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/tls
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/tls')
-rw-r--r--src/lib/tls/msg_cert_req.cpp2
-rw-r--r--src/lib/tls/msg_cert_verify.cpp2
-rw-r--r--src/lib/tls/msg_server_hello.cpp4
-rw-r--r--src/lib/tls/tls_ciphersuite.h2
-rw-r--r--src/lib/tls/tls_extensions.cpp4
-rw-r--r--src/lib/tls/tls_extensions.h4
-rw-r--r--src/lib/tls/tls_handshake_state.cpp4
-rw-r--r--src/lib/tls/tls_policy.h6
8 files changed, 14 insertions, 14 deletions
diff --git a/src/lib/tls/msg_cert_req.cpp b/src/lib/tls/msg_cert_req.cpp
index aaaf754c8..4fd528148 100644
--- a/src/lib/tls/msg_cert_req.cpp
+++ b/src/lib/tls/msg_cert_req.cpp
@@ -89,7 +89,7 @@ Certificate_Req::Certificate_Req(const std::vector<byte>& buf,
{
const std::string cert_type_name = cert_type_code_to_name(cert_type_codes[i]);
- if(cert_type_name == "") // something we don't know
+ if(cert_type_name.empty()) // something we don't know
continue;
m_cert_key_types.push_back(cert_type_name);
diff --git a/src/lib/tls/msg_cert_verify.cpp b/src/lib/tls/msg_cert_verify.cpp
index 74565e29b..be6c8a069 100644
--- a/src/lib/tls/msg_cert_verify.cpp
+++ b/src/lib/tls/msg_cert_verify.cpp
@@ -59,7 +59,7 @@ std::vector<byte> Certificate_Verify::serialize() const
{
std::vector<byte> buf;
- if(m_hash_algo != "" && m_sig_algo != "")
+ if(!m_hash_algo.empty() && !m_sig_algo.empty())
{
buf.push_back(Signature_Algorithms::hash_algo_code(m_hash_algo));
buf.push_back(Signature_Algorithms::sig_algo_code(m_sig_algo));
diff --git a/src/lib/tls/msg_server_hello.cpp b/src/lib/tls/msg_server_hello.cpp
index 25d53b81b..8d61fb23c 100644
--- a/src/lib/tls/msg_server_hello.cpp
+++ b/src/lib/tls/msg_server_hello.cpp
@@ -50,7 +50,7 @@ Server_Hello::Server_Hello(Handshake_IO& io,
if(policy.negotiate_heartbeat_support() && client_hello.supports_heartbeats())
m_extensions.add(new Heartbeat_Support_Indicator(true));
- if(next_protocol != "" && client_hello.supports_alpn())
+ if(!next_protocol.empty() && client_hello.supports_alpn())
m_extensions.add(new Application_Layer_Protocol_Notification(next_protocol));
if(m_version.is_datagram_protocol())
@@ -108,7 +108,7 @@ Server_Hello::Server_Hello(Handshake_IO& io,
if(policy.negotiate_heartbeat_support() && client_hello.supports_heartbeats())
m_extensions.add(new Heartbeat_Support_Indicator(true));
- if(next_protocol != "" && client_hello.supports_alpn())
+ if(!next_protocol.empty() && client_hello.supports_alpn())
m_extensions.add(new Application_Layer_Protocol_Notification(next_protocol));
hash.update(io.send(*this));
diff --git a/src/lib/tls/tls_ciphersuite.h b/src/lib/tls/tls_ciphersuite.h
index 26faca11b..6dcf3dcc2 100644
--- a/src/lib/tls/tls_ciphersuite.h
+++ b/src/lib/tls/tls_ciphersuite.h
@@ -91,7 +91,7 @@ class BOTAN_DLL Ciphersuite
const std::string& prf_algo() const
{
- return (m_prf_algo != "") ? m_prf_algo : m_mac_algo;
+ return (!m_prf_algo.empty()) ? m_prf_algo : m_mac_algo;
}
/**
diff --git a/src/lib/tls/tls_extensions.cpp b/src/lib/tls/tls_extensions.cpp
index cedf390e6..3ca5be671 100644
--- a/src/lib/tls/tls_extensions.cpp
+++ b/src/lib/tls/tls_extensions.cpp
@@ -427,7 +427,7 @@ Supported_Elliptic_Curves::Supported_Elliptic_Curves(TLS_Data_Reader& reader,
const u16bit id = reader.get_u16bit();
const std::string name = curve_id_to_name(id);
- if(name != "")
+ if(!name.empty())
m_curves.push_back(name);
}
}
@@ -555,7 +555,7 @@ Signature_Algorithms::Signature_Algorithms(TLS_Data_Reader& reader,
len -= 2;
// If not something we know, ignore it completely
- if(hash_code == "" || sig_code == "")
+ if(hash_code.empty() || sig_code.empty())
continue;
m_supported_algos.push_back(std::make_pair(hash_code, sig_code));
diff --git a/src/lib/tls/tls_extensions.h b/src/lib/tls/tls_extensions.h
index d7d8ab380..8c28fab31 100644
--- a/src/lib/tls/tls_extensions.h
+++ b/src/lib/tls/tls_extensions.h
@@ -89,7 +89,7 @@ class Server_Name_Indicator : public Extension
std::vector<byte> serialize() const override;
- bool empty() const override { return sni_host_name == ""; }
+ bool empty() const override { return sni_host_name.empty(); }
private:
std::string sni_host_name;
};
@@ -115,7 +115,7 @@ class SRP_Identifier : public Extension
std::vector<byte> serialize() const override;
- bool empty() const override { return srp_identifier == ""; }
+ bool empty() const override { return srp_identifier.empty(); }
private:
std::string srp_identifier;
};
diff --git a/src/lib/tls/tls_handshake_state.cpp b/src/lib/tls/tls_handshake_state.cpp
index f885d3b08..b085e378a 100644
--- a/src/lib/tls/tls_handshake_state.cpp
+++ b/src/lib/tls/tls_handshake_state.cpp
@@ -462,7 +462,7 @@ Handshake_State::understand_sig_format(const Public_Key& key,
if(this->version().supports_negotiable_signature_algorithms())
{
- if(hash_algo == "")
+ if(hash_algo.empty())
throw Decoding_Error("Counterparty did not send hash/sig IDS");
if(sig_algo != algo_name)
@@ -470,7 +470,7 @@ Handshake_State::understand_sig_format(const Public_Key& key,
}
else
{
- if(hash_algo != "" || sig_algo != "")
+ if(!hash_algo.empty() || !sig_algo.empty())
throw Decoding_Error("Counterparty sent hash/sig IDs with old version");
}
diff --git a/src/lib/tls/tls_policy.h b/src/lib/tls/tls_policy.h
index 4d496cc7d..0d8ebc7a1 100644
--- a/src/lib/tls/tls_policy.h
+++ b/src/lib/tls/tls_policy.h
@@ -326,7 +326,7 @@ class BOTAN_DLL Text_Policy : public Policy
{
const std::string v = get_str(key);
- if(v == "")
+ if(v.empty())
return def;
return split_on(v, ' ');
@@ -336,7 +336,7 @@ class BOTAN_DLL Text_Policy : public Policy
{
const std::string v = get_str(key);
- if(v == "")
+ if(v.empty())
return def;
return to_u32bit(v);
@@ -346,7 +346,7 @@ class BOTAN_DLL Text_Policy : public Policy
{
const std::string v = get_str(key);
- if(v == "")
+ if(v.empty())
return def;
if(v == "true" || v == "True")