aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-06-14 19:32:01 +0000
committerlloyd <[email protected]>2012-06-14 19:32:01 +0000
commitb3d3feb177ffdc6bb25ec7d46293635877fe80d0 (patch)
tree5cc29ea5810c30095afa59e090f02874fc1c00e7 /src
parent8227a598cbbd35f3eced99ae2e437df0826769f9 (diff)
Profiling with valgrind shows that the 2**16 iteration for finding
ciphersuites was actually a substantial hit on handshakes. Add a new function TLS::Ciphersuite::all_known_ciphersuites which will do this once and cache it for future use.
Diffstat (limited to 'src')
-rw-r--r--src/tls/c_kex.cpp1
-rw-r--r--src/tls/tls_ciphersuite.cpp28
-rw-r--r--src/tls/tls_ciphersuite.h10
-rw-r--r--src/tls/tls_policy.cpp22
-rw-r--r--src/tls/tls_suite_info.cpp194
5 files changed, 139 insertions, 116 deletions
diff --git a/src/tls/c_kex.cpp b/src/tls/c_kex.cpp
index 2981cbaed..a173b18ad 100644
--- a/src/tls/c_kex.cpp
+++ b/src/tls/c_kex.cpp
@@ -323,7 +323,6 @@ Client_Key_Exchange::Client_Key_Exchange(const std::vector<byte>& contents,
throw TLS_Exception(Alert::UNKNOWN_PSK_IDENTITY,
"No PSK for identifier " + psk_identity);
}
-
}
if(kex_algo == "PSK")
diff --git a/src/tls/tls_ciphersuite.cpp b/src/tls/tls_ciphersuite.cpp
index 5c92e1eba..3a1a9fefd 100644
--- a/src/tls/tls_ciphersuite.cpp
+++ b/src/tls/tls_ciphersuite.cpp
@@ -14,8 +14,16 @@ namespace Botan {
namespace TLS {
-Ciphersuite Ciphersuite::by_name(const std::string& name)
+namespace {
+
+/*
+* This way all work happens at the constuctor call, and we can
+* rely on that happening only once in C++11.
+*/
+std::vector<Ciphersuite> gather_known_ciphersuites()
{
+ std::vector<Ciphersuite> ciphersuites;
+
for(size_t i = 0; i != 65536; ++i)
{
Ciphersuite suite = Ciphersuite::by_id(i);
@@ -23,6 +31,24 @@ Ciphersuite Ciphersuite::by_name(const std::string& name)
if(!suite.valid())
continue; // not a ciphersuite we know, skip
+ ciphersuites.push_back(suite);
+ }
+
+ return ciphersuites;
+ }
+
+}
+
+const std::vector<Ciphersuite>& Ciphersuite::all_known_ciphersuites()
+ {
+ static std::vector<Ciphersuite> all_ciphersuites(gather_known_ciphersuites());
+ return all_ciphersuites;
+ }
+
+Ciphersuite Ciphersuite::by_name(const std::string& name)
+ {
+ for(auto suite : all_known_ciphersuites())
+ {
if(suite.to_string() == name)
return suite;
}
diff --git a/src/tls/tls_ciphersuite.h b/src/tls/tls_ciphersuite.h
index dcb4b6a6f..346c34f0b 100644
--- a/src/tls/tls_ciphersuite.h
+++ b/src/tls/tls_ciphersuite.h
@@ -10,6 +10,7 @@
#include <botan/types.h>
#include <string>
+#include <vector>
namespace Botan {
@@ -28,11 +29,15 @@ class BOTAN_DLL Ciphersuite
static Ciphersuite by_name(const std::string& name);
+ static const std::vector<Ciphersuite>& all_known_ciphersuites();
+
/**
* Formats the ciphersuite back to an RFC-style ciphersuite string
*/
std::string to_string() const;
+ u16bit ciphersuite_code() const { return m_ciphersuite_code; }
+
bool psk_ciphersuite() const;
bool ecc_ciphersuite() const;
@@ -48,11 +53,13 @@ class BOTAN_DLL Ciphersuite
Ciphersuite() : m_cipher_keylen(0) {}
- Ciphersuite(const std::string& sig_algo,
+ Ciphersuite(u16bit ciphersuite_code,
+ const std::string& sig_algo,
const std::string& kex_algo,
const std::string& mac_algo,
const std::string& cipher_algo,
size_t cipher_algo_keylen) :
+ m_ciphersuite_code(ciphersuite_code),
m_sig_algo(sig_algo),
m_kex_algo(kex_algo),
m_mac_algo(mac_algo),
@@ -62,6 +69,7 @@ class BOTAN_DLL Ciphersuite
}
private:
+ u16bit m_ciphersuite_code;
std::string m_sig_algo, m_kex_algo, m_mac_algo, m_cipher_algo;
size_t m_cipher_keylen;
};
diff --git a/src/tls/tls_policy.cpp b/src/tls/tls_policy.cpp
index e56539a34..dabf3fc81 100644
--- a/src/tls/tls_policy.cpp
+++ b/src/tls/tls_policy.cpp
@@ -10,6 +10,7 @@
#include <botan/tls_magic.h>
#include <botan/tls_exceptn.h>
#include <botan/internal/stl_util.h>
+#include <set>
namespace Botan {
@@ -207,16 +208,10 @@ std::vector<u16bit> ciphersuite_list(const Policy& policy,
Ciphersuite_Preference_Ordering order(ciphers, hashes, kex, sigs);
- std::map<Ciphersuite, u16bit, Ciphersuite_Preference_Ordering>
- ciphersuites(order);
+ std::set<Ciphersuite, Ciphersuite_Preference_Ordering> ciphersuites(order);
- for(size_t i = 0; i != 65536; ++i)
+ for(auto suite : Ciphersuite::all_known_ciphersuites())
{
- Ciphersuite suite = Ciphersuite::by_id(i);
-
- if(!suite.valid())
- continue; // not a ciphersuite we know, skip
-
if(!have_srp && suite.kex_algo() == "SRP_SHA")
continue;
@@ -237,17 +232,12 @@ std::vector<u16bit> ciphersuite_list(const Policy& policy,
}
// OK, allow it:
- ciphersuites[suite] = i;
+ ciphersuites.insert(suite);
}
std::vector<u16bit> ciphersuite_codes;
-
- for(std::map<Ciphersuite, u16bit, Ciphersuite_Preference_Ordering>::iterator i = ciphersuites.begin();
- i != ciphersuites.end(); ++i)
- {
- ciphersuite_codes.push_back(i->second);
- }
-
+ for(auto i : ciphersuites)
+ ciphersuite_codes.push_back(i.ciphersuite_code());
return ciphersuite_codes;
}
diff --git a/src/tls/tls_suite_info.cpp b/src/tls/tls_suite_info.cpp
index 997bda428..b281e89d3 100644
--- a/src/tls/tls_suite_info.cpp
+++ b/src/tls/tls_suite_info.cpp
@@ -18,295 +18,295 @@ Ciphersuite Ciphersuite::by_id(u16bit suite)
switch(suite)
{
case 0x0013: // DHE_DSS_WITH_3DES_EDE_CBC_SHA
- return Ciphersuite("DSA", "DH", "SHA-1", "3DES", 24);
+ return Ciphersuite(0x0013, "DSA", "DH", "SHA-1", "3DES", 24);
case 0x0032: // DHE_DSS_WITH_AES_128_CBC_SHA
- return Ciphersuite("DSA", "DH", "SHA-1", "AES-128", 16);
+ return Ciphersuite(0x0032, "DSA", "DH", "SHA-1", "AES-128", 16);
case 0x0040: // DHE_DSS_WITH_AES_128_CBC_SHA256
- return Ciphersuite("DSA", "DH", "SHA-256", "AES-128", 16);
+ return Ciphersuite(0x0040, "DSA", "DH", "SHA-256", "AES-128", 16);
case 0x0038: // DHE_DSS_WITH_AES_256_CBC_SHA
- return Ciphersuite("DSA", "DH", "SHA-1", "AES-256", 32);
+ return Ciphersuite(0x0038, "DSA", "DH", "SHA-1", "AES-256", 32);
case 0x006A: // DHE_DSS_WITH_AES_256_CBC_SHA256
- return Ciphersuite("DSA", "DH", "SHA-256", "AES-256", 32);
+ return Ciphersuite(0x006A, "DSA", "DH", "SHA-256", "AES-256", 32);
case 0x0044: // DHE_DSS_WITH_CAMELLIA_128_CBC_SHA
- return Ciphersuite("DSA", "DH", "SHA-1", "Camellia-128", 16);
+ return Ciphersuite(0x0044, "DSA", "DH", "SHA-1", "Camellia-128", 16);
case 0x00BD: // DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256
- return Ciphersuite("DSA", "DH", "SHA-256", "Camellia-128", 16);
+ return Ciphersuite(0x00BD, "DSA", "DH", "SHA-256", "Camellia-128", 16);
case 0x0087: // DHE_DSS_WITH_CAMELLIA_256_CBC_SHA
- return Ciphersuite("DSA", "DH", "SHA-1", "Camellia-256", 32);
+ return Ciphersuite(0x0087, "DSA", "DH", "SHA-1", "Camellia-256", 32);
case 0x00C3: // DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256
- return Ciphersuite("DSA", "DH", "SHA-256", "Camellia-256", 32);
+ return Ciphersuite(0x00C3, "DSA", "DH", "SHA-256", "Camellia-256", 32);
case 0x0066: // DHE_DSS_WITH_RC4_128_SHA
- return Ciphersuite("DSA", "DH", "SHA-1", "ARC4", 16);
+ return Ciphersuite(0x0066, "DSA", "DH", "SHA-1", "ARC4", 16);
case 0x0099: // DHE_DSS_WITH_SEED_CBC_SHA
- return Ciphersuite("DSA", "DH", "SHA-1", "SEED", 16);
+ return Ciphersuite(0x0099, "DSA", "DH", "SHA-1", "SEED", 16);
case 0x008F: // DHE_PSK_WITH_3DES_EDE_CBC_SHA
- return Ciphersuite("", "DHE_PSK", "SHA-1", "3DES", 24);
+ return Ciphersuite(0x008F, "", "DHE_PSK", "SHA-1", "3DES", 24);
case 0x0090: // DHE_PSK_WITH_AES_128_CBC_SHA
- return Ciphersuite("", "DHE_PSK", "SHA-1", "AES-128", 16);
+ return Ciphersuite(0x0090, "", "DHE_PSK", "SHA-1", "AES-128", 16);
case 0x00B2: // DHE_PSK_WITH_AES_128_CBC_SHA256
- return Ciphersuite("", "DHE_PSK", "SHA-256", "AES-128", 16);
+ return Ciphersuite(0x00B2, "", "DHE_PSK", "SHA-256", "AES-128", 16);
case 0x0091: // DHE_PSK_WITH_AES_256_CBC_SHA
- return Ciphersuite("", "DHE_PSK", "SHA-1", "AES-256", 32);
+ return Ciphersuite(0x0091, "", "DHE_PSK", "SHA-1", "AES-256", 32);
case 0x00B3: // DHE_PSK_WITH_AES_256_CBC_SHA384
- return Ciphersuite("", "DHE_PSK", "SHA-384", "AES-256", 32);
+ return Ciphersuite(0x00B3, "", "DHE_PSK", "SHA-384", "AES-256", 32);
case 0xC096: // DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
- return Ciphersuite("", "DHE_PSK", "SHA-256", "Camellia-128", 16);
+ return Ciphersuite(0xC096, "", "DHE_PSK", "SHA-256", "Camellia-128", 16);
case 0xC097: // DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
- return Ciphersuite("", "DHE_PSK", "SHA-384", "Camellia-256", 32);
+ return Ciphersuite(0xC097, "", "DHE_PSK", "SHA-384", "Camellia-256", 32);
case 0x008E: // DHE_PSK_WITH_RC4_128_SHA
- return Ciphersuite("", "DHE_PSK", "SHA-1", "ARC4", 16);
+ return Ciphersuite(0x008E, "", "DHE_PSK", "SHA-1", "ARC4", 16);
case 0x0016: // DHE_RSA_WITH_3DES_EDE_CBC_SHA
- return Ciphersuite("RSA", "DH", "SHA-1", "3DES", 24);
+ return Ciphersuite(0x0016, "RSA", "DH", "SHA-1", "3DES", 24);
case 0x0033: // DHE_RSA_WITH_AES_128_CBC_SHA
- return Ciphersuite("RSA", "DH", "SHA-1", "AES-128", 16);
+ return Ciphersuite(0x0033, "RSA", "DH", "SHA-1", "AES-128", 16);
case 0x0067: // DHE_RSA_WITH_AES_128_CBC_SHA256
- return Ciphersuite("RSA", "DH", "SHA-256", "AES-128", 16);
+ return Ciphersuite(0x0067, "RSA", "DH", "SHA-256", "AES-128", 16);
case 0x0039: // DHE_RSA_WITH_AES_256_CBC_SHA
- return Ciphersuite("RSA", "DH", "SHA-1", "AES-256", 32);
+ return Ciphersuite(0x0039, "RSA", "DH", "SHA-1", "AES-256", 32);
case 0x006B: // DHE_RSA_WITH_AES_256_CBC_SHA256
- return Ciphersuite("RSA", "DH", "SHA-256", "AES-256", 32);
+ return Ciphersuite(0x006B, "RSA", "DH", "SHA-256", "AES-256", 32);
case 0x0045: // DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
- return Ciphersuite("RSA", "DH", "SHA-1", "Camellia-128", 16);
+ return Ciphersuite(0x0045, "RSA", "DH", "SHA-1", "Camellia-128", 16);
case 0x00BE: // DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
- return Ciphersuite("RSA", "DH", "SHA-256", "Camellia-128", 16);
+ return Ciphersuite(0x00BE, "RSA", "DH", "SHA-256", "Camellia-128", 16);
case 0x0088: // DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
- return Ciphersuite("RSA", "DH", "SHA-1", "Camellia-256", 32);
+ return Ciphersuite(0x0088, "RSA", "DH", "SHA-1", "Camellia-256", 32);
case 0x00C4: // DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
- return Ciphersuite("RSA", "DH", "SHA-256", "Camellia-256", 32);
+ return Ciphersuite(0x00C4, "RSA", "DH", "SHA-256", "Camellia-256", 32);
case 0x009A: // DHE_RSA_WITH_SEED_CBC_SHA
- return Ciphersuite("RSA", "DH", "SHA-1", "SEED", 16);
+ return Ciphersuite(0x009A, "RSA", "DH", "SHA-1", "SEED", 16);
case 0x001B: // DH_anon_WITH_3DES_EDE_CBC_SHA
- return Ciphersuite("", "DH", "SHA-1", "3DES", 24);
+ return Ciphersuite(0x001B, "", "DH", "SHA-1", "3DES", 24);
case 0x0034: // DH_anon_WITH_AES_128_CBC_SHA
- return Ciphersuite("", "DH", "SHA-1", "AES-128", 16);
+ return Ciphersuite(0x0034, "", "DH", "SHA-1", "AES-128", 16);
case 0x006C: // DH_anon_WITH_AES_128_CBC_SHA256
- return Ciphersuite("", "DH", "SHA-256", "AES-128", 16);
+ return Ciphersuite(0x006C, "", "DH", "SHA-256", "AES-128", 16);
case 0x003A: // DH_anon_WITH_AES_256_CBC_SHA
- return Ciphersuite("", "DH", "SHA-1", "AES-256", 32);
+ return Ciphersuite(0x003A, "", "DH", "SHA-1", "AES-256", 32);
case 0x006D: // DH_anon_WITH_AES_256_CBC_SHA256
- return Ciphersuite("", "DH", "SHA-256", "AES-256", 32);
+ return Ciphersuite(0x006D, "", "DH", "SHA-256", "AES-256", 32);
case 0x0046: // DH_anon_WITH_CAMELLIA_128_CBC_SHA
- return Ciphersuite("", "DH", "SHA-1", "Camellia-128", 16);
+ return Ciphersuite(0x0046, "", "DH", "SHA-1", "Camellia-128", 16);
case 0x00BF: // DH_anon_WITH_CAMELLIA_128_CBC_SHA256
- return Ciphersuite("", "DH", "SHA-256", "Camellia-128", 16);
+ return Ciphersuite(0x00BF, "", "DH", "SHA-256", "Camellia-128", 16);
case 0x0089: // DH_anon_WITH_CAMELLIA_256_CBC_SHA
- return Ciphersuite("", "DH", "SHA-1", "Camellia-256", 32);
+ return Ciphersuite(0x0089, "", "DH", "SHA-1", "Camellia-256", 32);
case 0x00C5: // DH_anon_WITH_CAMELLIA_256_CBC_SHA256
- return Ciphersuite("", "DH", "SHA-256", "Camellia-256", 32);
+ return Ciphersuite(0x00C5, "", "DH", "SHA-256", "Camellia-256", 32);
case 0x0018: // DH_anon_WITH_RC4_128_MD5
- return Ciphersuite("", "DH", "MD5", "ARC4", 16);
+ return Ciphersuite(0x0018, "", "DH", "MD5", "ARC4", 16);
case 0x009B: // DH_anon_WITH_SEED_CBC_SHA
- return Ciphersuite("", "DH", "SHA-1", "SEED", 16);
+ return Ciphersuite(0x009B, "", "DH", "SHA-1", "SEED", 16);
case 0xC008: // ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
- return Ciphersuite("ECDSA", "ECDH", "SHA-1", "3DES", 24);
+ return Ciphersuite(0xC008, "ECDSA", "ECDH", "SHA-1", "3DES", 24);
case 0xC009: // ECDHE_ECDSA_WITH_AES_128_CBC_SHA
- return Ciphersuite("ECDSA", "ECDH", "SHA-1", "AES-128", 16);
+ return Ciphersuite(0xC009, "ECDSA", "ECDH", "SHA-1", "AES-128", 16);
case 0xC023: // ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
- return Ciphersuite("ECDSA", "ECDH", "SHA-256", "AES-128", 16);
+ return Ciphersuite(0xC023, "ECDSA", "ECDH", "SHA-256", "AES-128", 16);
case 0xC00A: // ECDHE_ECDSA_WITH_AES_256_CBC_SHA
- return Ciphersuite("ECDSA", "ECDH", "SHA-1", "AES-256", 32);
+ return Ciphersuite(0xC00A, "ECDSA", "ECDH", "SHA-1", "AES-256", 32);
case 0xC024: // ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
- return Ciphersuite("ECDSA", "ECDH", "SHA-384", "AES-256", 32);
+ return Ciphersuite(0xC024, "ECDSA", "ECDH", "SHA-384", "AES-256", 32);
case 0xC072: // ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
- return Ciphersuite("ECDSA", "ECDH", "SHA-256", "Camellia-128", 16);
+ return Ciphersuite(0xC072, "ECDSA", "ECDH", "SHA-256", "Camellia-128", 16);
case 0xC073: // ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
- return Ciphersuite("ECDSA", "ECDH", "SHA-384", "Camellia-256", 32);
+ return Ciphersuite(0xC073, "ECDSA", "ECDH", "SHA-384", "Camellia-256", 32);
case 0xC007: // ECDHE_ECDSA_WITH_RC4_128_SHA
- return Ciphersuite("ECDSA", "ECDH", "SHA-1", "ARC4", 16);
+ return Ciphersuite(0xC007, "ECDSA", "ECDH", "SHA-1", "ARC4", 16);
case 0xC034: // ECDHE_PSK_WITH_3DES_EDE_CBC_SHA
- return Ciphersuite("", "ECDHE_PSK", "SHA-1", "3DES", 24);
+ return Ciphersuite(0xC034, "", "ECDHE_PSK", "SHA-1", "3DES", 24);
case 0xC035: // ECDHE_PSK_WITH_AES_128_CBC_SHA
- return Ciphersuite("", "ECDHE_PSK", "SHA-1", "AES-128", 16);
+ return Ciphersuite(0xC035, "", "ECDHE_PSK", "SHA-1", "AES-128", 16);
case 0xC037: // ECDHE_PSK_WITH_AES_128_CBC_SHA256
- return Ciphersuite("", "ECDHE_PSK", "SHA-256", "AES-128", 16);
+ return Ciphersuite(0xC037, "", "ECDHE_PSK", "SHA-256", "AES-128", 16);
case 0xC036: // ECDHE_PSK_WITH_AES_256_CBC_SHA
- return Ciphersuite("", "ECDHE_PSK", "SHA-1", "AES-256", 32);
+ return Ciphersuite(0xC036, "", "ECDHE_PSK", "SHA-1", "AES-256", 32);
case 0xC038: // ECDHE_PSK_WITH_AES_256_CBC_SHA384
- return Ciphersuite("", "ECDHE_PSK", "SHA-384", "AES-256", 32);
+ return Ciphersuite(0xC038, "", "ECDHE_PSK", "SHA-384", "AES-256", 32);
case 0xC09A: // ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
- return Ciphersuite("", "ECDHE_PSK", "SHA-256", "Camellia-128", 16);
+ return Ciphersuite(0xC09A, "", "ECDHE_PSK", "SHA-256", "Camellia-128", 16);
case 0xC09B: // ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
- return Ciphersuite("", "ECDHE_PSK", "SHA-384", "Camellia-256", 32);
+ return Ciphersuite(0xC09B, "", "ECDHE_PSK", "SHA-384", "Camellia-256", 32);
case 0xC033: // ECDHE_PSK_WITH_RC4_128_SHA
- return Ciphersuite("", "ECDHE_PSK", "SHA-1", "ARC4", 16);
+ return Ciphersuite(0xC033, "", "ECDHE_PSK", "SHA-1", "ARC4", 16);
case 0xC012: // ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
- return Ciphersuite("RSA", "ECDH", "SHA-1", "3DES", 24);
+ return Ciphersuite(0xC012, "RSA", "ECDH", "SHA-1", "3DES", 24);
case 0xC013: // ECDHE_RSA_WITH_AES_128_CBC_SHA
- return Ciphersuite("RSA", "ECDH", "SHA-1", "AES-128", 16);
+ return Ciphersuite(0xC013, "RSA", "ECDH", "SHA-1", "AES-128", 16);
case 0xC027: // ECDHE_RSA_WITH_AES_128_CBC_SHA256
- return Ciphersuite("RSA", "ECDH", "SHA-256", "AES-128", 16);
+ return Ciphersuite(0xC027, "RSA", "ECDH", "SHA-256", "AES-128", 16);
case 0xC014: // ECDHE_RSA_WITH_AES_256_CBC_SHA
- return Ciphersuite("RSA", "ECDH", "SHA-1", "AES-256", 32);
+ return Ciphersuite(0xC014, "RSA", "ECDH", "SHA-1", "AES-256", 32);
case 0xC028: // ECDHE_RSA_WITH_AES_256_CBC_SHA384
- return Ciphersuite("RSA", "ECDH", "SHA-384", "AES-256", 32);
+ return Ciphersuite(0xC028, "RSA", "ECDH", "SHA-384", "AES-256", 32);
case 0xC076: // ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
- return Ciphersuite("RSA", "ECDH", "SHA-256", "Camellia-128", 16);
+ return Ciphersuite(0xC076, "RSA", "ECDH", "SHA-256", "Camellia-128", 16);
case 0xC077: // ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
- return Ciphersuite("RSA", "ECDH", "SHA-384", "Camellia-256", 32);
+ return Ciphersuite(0xC077, "RSA", "ECDH", "SHA-384", "Camellia-256", 32);
case 0xC011: // ECDHE_RSA_WITH_RC4_128_SHA
- return Ciphersuite("RSA", "ECDH", "SHA-1", "ARC4", 16);
+ return Ciphersuite(0xC011, "RSA", "ECDH", "SHA-1", "ARC4", 16);
case 0xC017: // ECDH_anon_WITH_3DES_EDE_CBC_SHA
- return Ciphersuite("", "ECDH", "SHA-1", "3DES", 24);
+ return Ciphersuite(0xC017, "", "ECDH", "SHA-1", "3DES", 24);
case 0xC018: // ECDH_anon_WITH_AES_128_CBC_SHA
- return Ciphersuite("", "ECDH", "SHA-1", "AES-128", 16);
+ return Ciphersuite(0xC018, "", "ECDH", "SHA-1", "AES-128", 16);
case 0xC019: // ECDH_anon_WITH_AES_256_CBC_SHA
- return Ciphersuite("", "ECDH", "SHA-1", "AES-256", 32);
+ return Ciphersuite(0xC019, "", "ECDH", "SHA-1", "AES-256", 32);
case 0xC016: // ECDH_anon_WITH_RC4_128_SHA
- return Ciphersuite("", "ECDH", "SHA-1", "ARC4", 16);
+ return Ciphersuite(0xC016, "", "ECDH", "SHA-1", "ARC4", 16);
case 0x008B: // PSK_WITH_3DES_EDE_CBC_SHA
- return Ciphersuite("", "PSK", "SHA-1", "3DES", 24);
+ return Ciphersuite(0x008B, "", "PSK", "SHA-1", "3DES", 24);
case 0x008C: // PSK_WITH_AES_128_CBC_SHA
- return Ciphersuite("", "PSK", "SHA-1", "AES-128", 16);
+ return Ciphersuite(0x008C, "", "PSK", "SHA-1", "AES-128", 16);
case 0x00AE: // PSK_WITH_AES_128_CBC_SHA256
- return Ciphersuite("", "PSK", "SHA-256", "AES-128", 16);
+ return Ciphersuite(0x00AE, "", "PSK", "SHA-256", "AES-128", 16);
case 0x008D: // PSK_WITH_AES_256_CBC_SHA
- return Ciphersuite("", "PSK", "SHA-1", "AES-256", 32);
+ return Ciphersuite(0x008D, "", "PSK", "SHA-1", "AES-256", 32);
case 0x00AF: // PSK_WITH_AES_256_CBC_SHA384
- return Ciphersuite("", "PSK", "SHA-384", "AES-256", 32);
+ return Ciphersuite(0x00AF, "", "PSK", "SHA-384", "AES-256", 32);
case 0xC094: // PSK_WITH_CAMELLIA_128_CBC_SHA256
- return Ciphersuite("", "PSK", "SHA-256", "Camellia-128", 16);
+ return Ciphersuite(0xC094, "", "PSK", "SHA-256", "Camellia-128", 16);
case 0xC095: // PSK_WITH_CAMELLIA_256_CBC_SHA384
- return Ciphersuite("", "PSK", "SHA-384", "Camellia-256", 32);
+ return Ciphersuite(0xC095, "", "PSK", "SHA-384", "Camellia-256", 32);
case 0x008A: // PSK_WITH_RC4_128_SHA
- return Ciphersuite("", "PSK", "SHA-1", "ARC4", 16);
+ return Ciphersuite(0x008A, "", "PSK", "SHA-1", "ARC4", 16);
case 0x000A: // RSA_WITH_3DES_EDE_CBC_SHA
- return Ciphersuite("RSA", "RSA", "SHA-1", "3DES", 24);
+ return Ciphersuite(0x000A, "RSA", "RSA", "SHA-1", "3DES", 24);
case 0x002F: // RSA_WITH_AES_128_CBC_SHA
- return Ciphersuite("RSA", "RSA", "SHA-1", "AES-128", 16);
+ return Ciphersuite(0x002F, "RSA", "RSA", "SHA-1", "AES-128", 16);
case 0x003C: // RSA_WITH_AES_128_CBC_SHA256
- return Ciphersuite("RSA", "RSA", "SHA-256", "AES-128", 16);
+ return Ciphersuite(0x003C, "RSA", "RSA", "SHA-256", "AES-128", 16);
case 0x0035: // RSA_WITH_AES_256_CBC_SHA
- return Ciphersuite("RSA", "RSA", "SHA-1", "AES-256", 32);
+ return Ciphersuite(0x0035, "RSA", "RSA", "SHA-1", "AES-256", 32);
case 0x003D: // RSA_WITH_AES_256_CBC_SHA256
- return Ciphersuite("RSA", "RSA", "SHA-256", "AES-256", 32);
+ return Ciphersuite(0x003D, "RSA", "RSA", "SHA-256", "AES-256", 32);
case 0x0041: // RSA_WITH_CAMELLIA_128_CBC_SHA
- return Ciphersuite("RSA", "RSA", "SHA-1", "Camellia-128", 16);
+ return Ciphersuite(0x0041, "RSA", "RSA", "SHA-1", "Camellia-128", 16);
case 0x00BA: // RSA_WITH_CAMELLIA_128_CBC_SHA256
- return Ciphersuite("RSA", "RSA", "SHA-256", "Camellia-128", 16);
+ return Ciphersuite(0x00BA, "RSA", "RSA", "SHA-256", "Camellia-128", 16);
case 0x0084: // RSA_WITH_CAMELLIA_256_CBC_SHA
- return Ciphersuite("RSA", "RSA", "SHA-1", "Camellia-256", 32);
+ return Ciphersuite(0x0084, "RSA", "RSA", "SHA-1", "Camellia-256", 32);
case 0x00C0: // RSA_WITH_CAMELLIA_256_CBC_SHA256
- return Ciphersuite("RSA", "RSA", "SHA-256", "Camellia-256", 32);
+ return Ciphersuite(0x00C0, "RSA", "RSA", "SHA-256", "Camellia-256", 32);
case 0x0004: // RSA_WITH_RC4_128_MD5
- return Ciphersuite("RSA", "RSA", "MD5", "ARC4", 16);
+ return Ciphersuite(0x0004, "RSA", "RSA", "MD5", "ARC4", 16);
case 0x0005: // RSA_WITH_RC4_128_SHA
- return Ciphersuite("RSA", "RSA", "SHA-1", "ARC4", 16);
+ return Ciphersuite(0x0005, "RSA", "RSA", "SHA-1", "ARC4", 16);
case 0x0096: // RSA_WITH_SEED_CBC_SHA
- return Ciphersuite("RSA", "RSA", "SHA-1", "SEED", 16);
+ return Ciphersuite(0x0096, "RSA", "RSA", "SHA-1", "SEED", 16);
case 0xC01C: // SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA
- return Ciphersuite("DSA", "SRP_SHA", "SHA-1", "3DES", 24);
+ return Ciphersuite(0xC01C, "DSA", "SRP_SHA", "SHA-1", "3DES", 24);
case 0xC01F: // SRP_SHA_DSS_WITH_AES_128_CBC_SHA
- return Ciphersuite("DSA", "SRP_SHA", "SHA-1", "AES-128", 16);
+ return Ciphersuite(0xC01F, "DSA", "SRP_SHA", "SHA-1", "AES-128", 16);
case 0xC022: // SRP_SHA_DSS_WITH_AES_256_CBC_SHA
- return Ciphersuite("DSA", "SRP_SHA", "SHA-1", "AES-256", 32);
+ return Ciphersuite(0xC022, "DSA", "SRP_SHA", "SHA-1", "AES-256", 32);
case 0xC01B: // SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA
- return Ciphersuite("RSA", "SRP_SHA", "SHA-1", "3DES", 24);
+ return Ciphersuite(0xC01B, "RSA", "SRP_SHA", "SHA-1", "3DES", 24);
case 0xC01E: // SRP_SHA_RSA_WITH_AES_128_CBC_SHA
- return Ciphersuite("RSA", "SRP_SHA", "SHA-1", "AES-128", 16);
+ return Ciphersuite(0xC01E, "RSA", "SRP_SHA", "SHA-1", "AES-128", 16);
case 0xC021: // SRP_SHA_RSA_WITH_AES_256_CBC_SHA
- return Ciphersuite("RSA", "SRP_SHA", "SHA-1", "AES-256", 32);
+ return Ciphersuite(0xC021, "RSA", "SRP_SHA", "SHA-1", "AES-256", 32);
case 0xC01A: // SRP_SHA_WITH_3DES_EDE_CBC_SHA
- return Ciphersuite("", "SRP_SHA", "SHA-1", "3DES", 24);
+ return Ciphersuite(0xC01A, "", "SRP_SHA", "SHA-1", "3DES", 24);
case 0xC01D: // SRP_SHA_WITH_AES_128_CBC_SHA
- return Ciphersuite("", "SRP_SHA", "SHA-1", "AES-128", 16);
+ return Ciphersuite(0xC01D, "", "SRP_SHA", "SHA-1", "AES-128", 16);
case 0xC020: // SRP_SHA_WITH_AES_256_CBC_SHA
- return Ciphersuite("", "SRP_SHA", "SHA-1", "AES-256", 32);
+ return Ciphersuite(0xC020, "", "SRP_SHA", "SHA-1", "AES-256", 32);
}
return Ciphersuite(); // some unknown ciphersuite