8 #include <botan/tls_ciphersuite.h> 9 #include <botan/exceptn.h> 10 #include <botan/parsing.h> 11 #include <botan/block_cipher.h> 12 #include <botan/stream_cipher.h> 13 #include <botan/hash.h> 22 switch(m_nonce_format)
37 throw Invalid_State(
"In Ciphersuite::nonce_bytes_from_handshake invalid enum value");
42 switch(m_nonce_format)
61 throw Invalid_State(
"In Ciphersuite::nonce_bytes_from_handshake invalid enum value");
67 return (suite == 0x00FF || suite == 0x5600);
110 auto s = std::lower_bound(all_suites.begin(), all_suites.end(), suite);
112 if(s != all_suites.end() && s->ciphersuite_code() == suite)
124 for(
auto suite : all_suites)
126 if(suite.to_string() ==
name)
135 bool have_hash(
const std::string& prf)
140 bool have_cipher(
const std::string& cipher)
148 bool Ciphersuite::is_usable()
const 156 #if !defined(BOTAN_HAS_TLS_CBC) 165 #if !defined(BOTAN_HAS_AEAD_CHACHA20_POLY1305) 172 BOTAN_ASSERT(cipher_and_mode.size() == 2,
"Expected format for AEAD algo");
173 if(!have_cipher(cipher_and_mode[0]))
176 const auto mode = cipher_and_mode[1];
178 #if !defined(BOTAN_HAS_AEAD_CCM) 179 if(mode ==
"CCM" || mode ==
"CCM-8")
183 #if !defined(BOTAN_HAS_AEAD_GCM) 188 #if !defined(BOTAN_HAS_AEAD_OCB) 189 if(mode ==
"OCB(12)" || mode ==
"OCB")
205 #if !defined(BOTAN_HAS_SRP6) 211 #if !defined(BOTAN_HAS_ECDH) 217 #if !defined(BOTAN_HAS_DIFFIE_HELLMAN) 223 #if !defined(BOTAN_HAS_CECPQ1) 230 #if !defined(BOTAN_HAS_DSA) 236 #if !defined(BOTAN_HAS_ECDSA) 242 #if !defined(BOTAN_HAS_RSA) std::string mac_algo() const
bool ecc_ciphersuite() const
size_t nonce_bytes_from_record(Protocol_Version version) const
bool usable_in_version(Protocol_Version version) const
std::string prf_algo() const
std::vector< std::string > split_on(const std::string &str, char delim)
Auth_Method auth_method() const
static bool is_scsv(uint16_t suite)
bool signature_used() const
Kex_Algo kex_method() const
bool psk_ciphersuite() const
#define BOTAN_ASSERT(expr, assertion_made)
static std::vector< std::string > providers(const std::string &algo_spec)
bool supports_explicit_cbc_ivs() const
size_t nonce_bytes_from_handshake() 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)
bool cbc_ciphersuite() const
bool supports_aead_modes() const
std::string cipher_algo() const
static const std::vector< Ciphersuite > & all_known_ciphersuites()
static Ciphersuite from_name(const std::string &name)