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;
89 bool signature_used()
const;
97 bool is_certificate_required()
const;
121 std::string
mac_algo()
const {
return m_mac_algo; }
130 size_t nonce_bytes_from_handshake()
const;
141 bool valid()
const {
return m_usable; }
150 static bool is_known_usable(uint16_t code);
156 const char* cipher_algo,
157 size_t cipher_keylen,
158 const char* mac_algo,
162 m_ciphersuite_code(ciphersuite_code),
164 m_auth_method(auth_method),
165 m_kex_algo(kex_algo),
166 m_prf_algo(prf_algo),
167 m_nonce_format(nonce_format),
168 m_cipher_algo(cipher_algo),
169 m_mac_algo(mac_algo),
170 m_cipher_keylen(cipher_keylen),
171 m_mac_keylen(mac_keylen),
172 m_usable(is_known_usable(ciphersuite_code)) {}
174 uint16_t m_ciphersuite_code = 0;
180 const char* m_iana_id;
182 Auth_Method m_auth_method;
185 Nonce_Format m_nonce_format;
187 const char* m_cipher_algo;
188 const char* m_mac_algo;
190 size_t m_cipher_keylen;
193 bool m_usable =
false;