30 static std::optional<Ciphersuite>
by_id(uint16_t suite);
37 static std::optional<Ciphersuite>
from_name(std::string_view name);
42 static bool is_scsv(uint16_t suite);
57 std::string
to_string()
const {
return (m_iana_id ==
nullptr) ?
"unknown cipher suite" : m_iana_id; }
67 bool psk_ciphersuite()
const;
72 bool ecc_ciphersuite()
const;
77 bool cbc_ciphersuite()
const;
82 bool null_ciphersuite()
const;
87 bool aead_ciphersuite()
const;
93 bool uses_short_authentication_tag()
const;
95 bool signature_used()
const;
103 bool is_certificate_required()
const;
127 std::string
mac_algo()
const {
return m_mac_algo; }
136 size_t nonce_bytes_from_handshake()
const;
147 bool valid()
const {
return m_usable; }
156 static bool is_known_usable(uint16_t code);
162 const char* cipher_algo,
163 size_t cipher_keylen,
164 const char* mac_algo,
168 m_ciphersuite_code(ciphersuite_code),
170 m_auth_method(auth_method),
171 m_kex_algo(kex_algo),
172 m_prf_algo(prf_algo),
173 m_nonce_format(nonce_format),
174 m_cipher_algo(cipher_algo),
175 m_mac_algo(mac_algo),
176 m_cipher_keylen(cipher_keylen),
177 m_mac_keylen(mac_keylen),
178 m_usable(is_known_usable(ciphersuite_code)) {}
180 uint16_t m_ciphersuite_code = 0;
186 const char* m_iana_id;
188 Auth_Method m_auth_method;
191 Nonce_Format m_nonce_format;
193 const char* m_cipher_algo;
194 const char* m_mac_algo;
196 size_t m_cipher_keylen;
199 bool m_usable =
false;