8 #include <botan/tls_ciphersuite.h>
9 #include <botan/parsing.h>
10 #include <botan/block_cipher.h>
11 #include <botan/stream_cipher.h>
12 #include <botan/hash.h>
13 #include <botan/mac.h>
23 return (suite == 0x00FF || suite == 0x5600);
46 auto s = std::lower_bound(all_suites.begin(), all_suites.end(), suite);
48 if(s != all_suites.end() && s->ciphersuite_code() == suite)
58 bool have_hash(
const std::string& prf)
63 bool have_cipher(
const std::string& cipher)
71 bool Ciphersuite::is_usable()
const
79 #if !defined(BOTAN_HAS_TLS_CBC)
88 #if !defined(BOTAN_HAS_AEAD_CHACHA20_POLY1305)
95 BOTAN_ASSERT(cipher_and_mode.size() == 2,
"Expected format for AEAD algo");
96 if(!have_cipher(cipher_and_mode[0]))
99 const auto mode = cipher_and_mode[1];
101 #if !defined(BOTAN_HAS_AEAD_CCM)
102 if(mode ==
"CCM" || mode ==
"CCM-8")
106 #if !defined(BOTAN_HAS_AEAD_GCM)
111 #if !defined(BOTAN_HAS_AEAD_OCB)
112 if(mode ==
"OCB(12)" || mode ==
"OCB")
128 #if !defined(BOTAN_HAS_SRP6)
134 #if !defined(BOTAN_HAS_ECDH)
140 #if !defined(BOTAN_HAS_DIFFIE_HELLMAN)
146 #if !defined(BOTAN_HAS_CECPQ1)
153 #if !defined(BOTAN_HAS_DSA)
159 #if !defined(BOTAN_HAS_ECDSA)
165 #if !defined(BOTAN_HAS_RSA)
bool cbc_ciphersuite() const
bool psk_ciphersuite() const
std::string sig_algo() const
static bool is_scsv(uint16_t suite)
std::vector< std::string > split_on(const std::string &str, char delim)
#define BOTAN_ASSERT(expr, assertion_made)
static std::vector< std::string > providers(const std::string &algo_spec)
bool ecc_ciphersuite() const
std::string prf_algo() const
std::string kex_algo() const
static std::vector< std::string > providers(const std::string &algo_spec)
static std::vector< std::string > providers(const std::string &algo_spec)
static Ciphersuite by_id(uint16_t suite)
std::string mac_algo() const
std::string cipher_algo() const
static const std::vector< Ciphersuite > & all_known_ciphersuites()