Botan 3.14.1
Crypto and TLS for C&
tls_policy.cpp
Go to the documentation of this file.
1/*
2* Policies for TLS
3* (C) 2004-2010,2012,2015,2016 Jack Lloyd
4* 2016 Christian Mainka
5* 2017 Harry Reimann, Rohde & Schwarz Cybersecurity
6* 2022 René Meusel, Hannes Rantzsch - neXenio GmbH
7*
8* Botan is released under the Simplified BSD License (see license.txt)
9*/
10
11#include <botan/tls_policy.h>
12
13#include <botan/pk_keys.h>
14#include <botan/tls_algos.h>
15#include <botan/tls_ciphersuite.h>
16#include <botan/tls_exceptn.h>
17#include <botan/tls_signature_scheme.h>
18#include <botan/internal/stl_util.h>
19#include <algorithm>
20#include <optional>
21#include <sstream>
22
23namespace Botan::TLS {
24
26 return false;
27}
28
29std::vector<Signature_Scheme> Policy::allowed_signature_schemes() const {
30 std::vector<Signature_Scheme> schemes;
31
33 const bool sig_allowed = allowed_signature_method(scheme.algorithm_name());
34 const bool hash_allowed = allowed_signature_hash(scheme.hash_function_name());
35
36 if(sig_allowed && hash_allowed) {
37 schemes.push_back(scheme);
38 }
39 }
40
41 return schemes;
42}
43
44std::vector<Signature_Scheme> Policy::acceptable_signature_schemes() const {
45 return this->allowed_signature_schemes();
46}
47
48std::optional<std::vector<Signature_Scheme>> Policy::acceptable_certificate_signature_schemes() const {
49 // the restrictions of ::acceptable_signature_schemes() shall apply
50 return std::nullopt;
51}
52
53std::vector<std::string> Policy::allowed_ciphers() const {
54 return {
55 //"AES-256/OCB(12)",
56 "AES-256/GCM",
57 "AES-128/GCM",
58 "ChaCha20Poly1305",
59 //"AES-256/CCM",
60 //"AES-128/CCM",
61 //"AES-256/CCM(8)",
62 //"AES-128/CCM(8)",
63 //"Camellia-256/GCM",
64 //"Camellia-128/GCM",
65 //"ARIA-256/GCM",
66 //"ARIA-128/GCM",
67 //"AES-256",
68 //"AES-128",
69 //"3DES",
70 };
71}
72
73std::vector<std::string> Policy::allowed_signature_hashes() const {
74 return {
75 "SHA-512",
76 "SHA-384",
77 "SHA-256",
78 };
79}
80
81std::vector<std::string> Policy::allowed_macs() const {
82 /*
83 SHA-256 is preferred because the Lucky13 countermeasure works
84 somewhat better for SHA-256 vs SHA-384:
85 https://github.com/randombit/botan/pull/675
86 */
87 return {
88 "AEAD",
89 "SHA-256",
90 "SHA-384",
91 "SHA-1",
92 };
93}
94
95std::vector<std::string> Policy::allowed_key_exchange_methods() const {
96 return {
97 //"ECDHE_PSK",
98 //"PSK",
99 "ECDH",
100 //"DH",
101 //"RSA",
102 };
103}
104
105std::vector<std::string> Policy::allowed_signature_methods() const {
106 return {
107 "ECDSA", "RSA",
108 //"IMPLICIT",
109 };
110}
111
112bool Policy::allowed_signature_method(std::string_view sig_method) const {
113 return value_exists(allowed_signature_methods(), sig_method);
114}
115
116bool Policy::allowed_signature_hash(std::string_view sig_hash) const {
117 return value_exists(allowed_signature_hashes(), sig_hash);
118}
119
121 return false;
122}
123
124Group_Params Policy::choose_key_exchange_group(const std::vector<Group_Params>& supported_by_peer,
125 const std::vector<Group_Params>& offered_by_peer) const {
126 if(supported_by_peer.empty()) {
127 return Group_Params::NONE;
128 }
129
130 const auto our_groups = key_exchange_groups();
131
132 // First check if the peer sent a PQ share of a group we also support
133 for(auto share : offered_by_peer) {
134 if(share.is_post_quantum() && value_exists(our_groups, share)) {
135 return share;
136 }
137 }
138
139 // Then check if the peer offered a PQ algo we also support
140 for(auto share : supported_by_peer) {
141 if(share.is_post_quantum() && value_exists(our_groups, share)) {
142 return share;
143 }
144 }
145
146 // Prefer groups that were offered by the peer for the sake of saving
147 // an additional round trip. For TLS 1.2, this won't be used.
148 for(auto g : offered_by_peer) {
149 if(value_exists(our_groups, g)) {
150 return g;
151 }
152 }
153
154 // If no pre-offered groups fit our supported set, we prioritize our
155 // own preference.
156 for(auto g : our_groups) {
157 if(value_exists(supported_by_peer, g)) {
158 return g;
159 }
160 }
161
162 return Group_Params::NONE;
163}
164
166 /*
167 * Return the first listed or just default to 2048
168 */
169 for(auto g : key_exchange_groups()) {
170 if(g.is_dh_named_group()) {
171 return g;
172 }
173 }
174
175 return Group_Params::FFDHE_2048;
176}
177
178std::vector<Group_Params> Policy::key_exchange_groups() const {
179 std::vector<Group_Params> groups = {
180 Group_Params::X25519,
181 Group_Params::SECP256R1,
182
186
187 Group_Params::X448,
188 Group_Params::SECP384R1,
189 Group_Params::SECP521R1,
190
191 Group_Params::BRAINPOOL256R1,
192 Group_Params::BRAINPOOL256R1TLS13,
193 Group_Params::BRAINPOOL384R1,
194 Group_Params::BRAINPOOL384R1TLS13,
195 Group_Params::BRAINPOOL512R1,
196 Group_Params::BRAINPOOL512R1TLS13,
197 };
198
199 // Some groups may have been disabled in the build
200 std::erase_if(groups, [](Group_Params group) { return !group.is_available(); });
201
202 return groups;
203}
204
205std::vector<Group_Params> Policy::key_exchange_groups_to_offer() const {
206 std::vector<Group_Params> groups_to_offer;
207
208 const auto supported_groups = key_exchange_groups();
209 BOTAN_ASSERT(!supported_groups.empty(), "Policy allows at least one key exchange group");
210
211 /*
212 * Initially prefer sending a key share only of the first pure-ECC
213 * group, since these shares are small and PQ support is still not
214 * that widespread.
215 */
216 for(const auto group : key_exchange_groups()) {
217 if(group.is_pure_ecc_group()) {
218 groups_to_offer.push_back(group);
219 break;
220 }
221 }
222
223 /*
224 * If for some reason no pure ECC groups are enabled then simply
225 * send a share of whatever the policy's top preference is.
226 */
227 if(groups_to_offer.empty()) {
228 groups_to_offer.push_back(supported_groups.front());
229 }
230
231 return groups_to_offer;
232}
233
235 return 2048;
236}
237
239 return 8192;
240}
241
243 // Here we are at the mercy of whatever the CA signed, but most certs should be 256 bit by now
244 return 256;
245}
246
248 // x25519 is smallest curve currently supported for TLS key exchange
249 return 255;
250}
251
253 return 110;
254}
255
257 return true;
258}
259
261 /* Default assumption is all end-entity certificates should
262 be at least 2048 bits these days.
263
264 If you are connecting to arbitrary servers on the Internet
265 (ie as a web browser or SMTP client) you'll probably have to reduce this
266 to 1024 bits, or perhaps even lower.
267 */
268 return 2048;
269}
270
271void Policy::check_peer_key_acceptable(const Public_Key& public_key) const {
272 const std::string algo_name = public_key.algo_name();
273
274 const size_t keylength = public_key.key_length();
275 size_t expected_keylength = 0;
276
277 if(algo_name == "RSA") {
278 expected_keylength = minimum_rsa_bits();
279 } else if(algo_name == "DH") {
280 expected_keylength = minimum_dh_group_size();
281 } else if(algo_name == "ECDH" || algo_name == "X25519" || algo_name == "X448") {
282 expected_keylength = minimum_ecdh_group_size();
283 } else if(algo_name == "ECDSA") {
284 expected_keylength = minimum_ecdsa_group_size();
285 }
286 // else some other algo, so leave expected_keylength as zero and the check is a no-op
287
288 if(keylength < expected_keylength) {
289 throw TLS_Exception(Alert::InsufficientSecurity,
290 "Peer sent " + std::to_string(keylength) + " bit " + algo_name +
291 " key"
292 ", policy requires at least " +
293 std::to_string(expected_keylength));
294 }
295}
296
298 return 1;
299}
300
301std::chrono::seconds Policy::session_ticket_lifetime() const {
302 return std::chrono::days(1);
303}
304
306 return false;
307}
308
310 return 1;
311}
312
314#if defined(BOTAN_HAS_TLS_13)
315 if(version == Protocol_Version::TLS_V13 && allow_tls13()) {
316 return true;
317 }
318#endif
319
320#if defined(BOTAN_HAS_TLS_12)
321 if(version == Protocol_Version::TLS_V12 && allow_tls12()) {
322 return true;
323 }
324
325 if(version == Protocol_Version::DTLS_V12 && allow_dtls12()) {
326 return true;
327 }
328#endif
329
330 BOTAN_UNUSED(version);
331 return false;
332}
333
335 if(datagram) {
336 if(acceptable_protocol_version(Protocol_Version::DTLS_V12)) {
337 return Protocol_Version::DTLS_V12;
338 }
339 } else {
340 if(acceptable_protocol_version(Protocol_Version::TLS_V13)) {
341 return Protocol_Version::TLS_V13;
342 }
343 if(acceptable_protocol_version(Protocol_Version::TLS_V12)) {
344 return Protocol_Version::TLS_V12;
345 }
346 }
347
348 throw Invalid_State("Policy forbids all available TLS version");
349}
350
351bool Policy::acceptable_ciphersuite(const Ciphersuite& ciphersuite) const {
352 return value_exists(allowed_ciphers(), ciphersuite.cipher_algo()) &&
353 value_exists(allowed_macs(), ciphersuite.mac_algo());
354}
355
357 return false;
358}
359
361 return false;
362}
363
365 return false;
366}
367
369#if defined(BOTAN_HAS_TLS_12)
370 return true;
371#else
372 return false;
373#endif
374}
375
377#if defined(BOTAN_HAS_TLS_13)
378 return true;
379#else
380 return false;
381#endif
382}
383
385#if defined(BOTAN_HAS_TLS_12)
386 return true;
387#else
388 return false;
389#endif
390}
391
393 return true;
394}
395
397 return false;
398}
399
401 return true;
402}
403
405 return true;
406}
407
409 return true;
410}
411
412std::optional<uint16_t> Policy::record_size_limit() const {
413 return std::nullopt;
414}
415
416size_t Policy::record_padding_bytes(size_t plaintext_bytes) const {
417 BOTAN_UNUSED(plaintext_bytes);
418 return 0;
419}
420
422 return true;
423}
424
426 return true;
427}
428
430 return true;
431}
432
434 return true;
435}
436
438 return true;
439}
440
442 return false;
443}
444
448
450 return false;
451}
452
453std::vector<Certificate_Type> Policy::accepted_client_certificate_types() const {
454 return {Certificate_Type::X509};
455}
456
457std::vector<Certificate_Type> Policy::accepted_server_certificate_types() const {
458 return {Certificate_Type::X509};
459}
460
462 return false;
463}
464
466 /*
467 RFC 9147 Section 11 "Security Considerations":
468
469 The primary additional security consideration raised by DTLS is that of
470 denial of service by excessive resource consumption. DTLS includes a
471 cookie exchange designed to protect against denial of service. [...]
472 In particular, DTLS servers that do not use the cookie exchange may be
473 used as attack amplifiers even if they themselves are not experiencing
474 DoS. Therefore, DTLS servers SHOULD use the cookie exchange unless there
475 is good reason to believe that amplification is not a threat in their
476 environment.
477 */
478 return true;
479}
480
482 return 65536;
483}
484
486 return 65536;
487}
488
490 return 1000;
491}
492
494 /* RFC 8446 Section 5.5
495 * For AES-GCM, up to 2^24.5 full-size records (about 24 million) may be encrypted on
496 * a given connection while keeping a safety margin of approximately 2^-57 for
497 * Authenticated Encryption (AE) security.
498 *
499 * However RFC 9001 (QUIC) Section 6.6
500 * For [GCM suites], the confidentiality limit is 2^23 encrypted packets [...]
501 *
502 * Here we take the lower value as the default.
503 */
504 return uint64_t(1) << 23;
505}
506
508 return 10;
509}
510
511// 1 second initial timeout, 60 second max - see RFC 6347 sec 4.2.4.1
513 return 1 * 1000;
514}
515
517 return 60 * 1000;
518}
519
520// Generous next to the one or two a legitimate cookie-secret rotation can
521// produce, while still bounding a forged stream.
522std::optional<size_t> Policy::dtls_maximum_hello_verify_requests() const {
523 return 4;
524}
525
526std::optional<size_t> Policy::max_useless_records() const {
527 // Matches the limit of OpenSSL and BoringSSL on consecutive empty records
528 return 32;
529}
530
531std::optional<size_t> Policy::dtls_maximum_retransmissions() const {
532 // Matches BoringSSL's DTLS1_MAX_TIMEOUTS.
533 //
534 // With the default schedule of a 1 second initial timeout and 60
535 // second maximum, this gives up after roughly 8 minutes
536 // (1+2+4+8+16+32+7*60 s).
537
538 return 12;
539}
540
542 // default MTU is IPv6 min MTU minus UDP/IP headers
543 return 1280 - 40 - 8;
544}
545
546std::vector<uint16_t> Policy::srtp_profiles() const {
547 return std::vector<uint16_t>();
548}
549
550namespace {
551
552class Ciphersuite_Preference_Ordering final {
553 public:
554 Ciphersuite_Preference_Ordering(const std::vector<std::string>& ciphers,
555 const std::vector<std::string>& macs,
556 const std::vector<std::string>& kex,
557 const std::vector<std::string>& sigs) :
558 m_ciphers(ciphers), m_macs(macs), m_kex(kex), m_sigs(sigs) {}
559
560 bool operator()(const Ciphersuite& a, const Ciphersuite& b) const {
561 if(a.kex_method() != b.kex_method()) {
562 for(const auto& i : m_kex) {
563 if(a.kex_algo() == i) {
564 return true;
565 }
566 if(b.kex_algo() == i) {
567 return false;
568 }
569 }
570 }
571
572 if(a.cipher_algo() != b.cipher_algo()) {
573 for(const auto& m_cipher : m_ciphers) {
574 if(a.cipher_algo() == m_cipher) {
575 return true;
576 }
577 if(b.cipher_algo() == m_cipher) {
578 return false;
579 }
580 }
581 }
582
583 if(a.cipher_keylen() != b.cipher_keylen()) {
584 if(a.cipher_keylen() < b.cipher_keylen()) {
585 return false;
586 }
587 if(a.cipher_keylen() > b.cipher_keylen()) {
588 return true;
589 }
590 }
591
592 if(a.auth_method() != b.auth_method()) {
593 for(const auto& m_sig : m_sigs) {
594 if(a.sig_algo() == m_sig) {
595 return true;
596 }
597 if(b.sig_algo() == m_sig) {
598 return false;
599 }
600 }
601 }
602
603 if(a.mac_algo() != b.mac_algo()) {
604 for(const auto& m_mac : m_macs) {
605 if(a.mac_algo() == m_mac) {
606 return true;
607 }
608 if(b.mac_algo() == m_mac) {
609 return false;
610 }
611 }
612 }
613
614 return false; // equal (?!?)
615 }
616
617 private:
618 std::vector<std::string> m_ciphers, m_macs, m_kex, m_sigs;
619};
620
621} // namespace
622
623std::vector<uint16_t> Policy::ciphersuite_list(Protocol_Version version) const {
624 const std::vector<std::string> ciphers = allowed_ciphers();
625 const std::vector<std::string> macs = allowed_macs();
626 const std::vector<std::string> kex = allowed_key_exchange_methods();
627 const std::vector<std::string> sigs = allowed_signature_methods();
628
629 std::vector<Ciphersuite> ciphersuites;
630
631 for(auto&& suite : Ciphersuite::all_known_ciphersuites()) {
632 // Can we use it?
633 if(!suite.valid()) {
634 continue;
635 }
636
637 // Can we use it in this version?
638 if(!suite.usable_in_version(version)) {
639 continue;
640 }
641
642 // Is it acceptable to the policy?
643 if(!this->acceptable_ciphersuite(suite)) {
644 continue;
645 }
646
647 if(!value_exists(ciphers, suite.cipher_algo())) {
648 continue; // unsupported cipher
649 }
650
651 // Our non EtM TLS-CBC decryption step still has a residual Lucky13 timing
652 // channel. The leak is minor but for DTLS, which allows repeated
653 // observations, that is likely more than enough to allow plaintext
654 // recovery. Refuse CBC suites in DTLS.
655 if(version.is_datagram_protocol() && suite.cbc_ciphersuite()) {
656 continue;
657 }
658
659 // In DTLS, prohibit any potentially brute-forceable MACs
660 //
661 // DTLS allows repeated attempts without a connection teardown, and we
662 // don't currently offer any facility for an application to respond to
663 // a flood of invalid packets.
664 if(version.is_datagram_protocol() && suite.uses_short_authentication_tag()) {
665 continue;
666 }
667
668 // these checks are irrelevant for TLS 1.3
669 // TODO: consider making a method for this logic
670 if(version.is_pre_tls_13()) {
671 if(!value_exists(kex, suite.kex_algo())) {
672 continue; // unsupported key exchange
673 }
674
675 if(!value_exists(macs, suite.mac_algo())) {
676 continue; // unsupported MAC algo
677 }
678
679 if(!value_exists(sigs, suite.sig_algo())) {
680 // allow if it's an empty sig algo and we want to use PSK
681 if(suite.auth_method() != Auth_Method::IMPLICIT || !suite.psk_ciphersuite()) {
682 continue;
683 }
684 }
685 }
686
687 // OK, consider it
688 ciphersuites.push_back(suite);
689 }
690
691 if(ciphersuites.empty()) {
692 throw Invalid_State("Policy does not allow any available cipher suite");
693 }
694
695 const Ciphersuite_Preference_Ordering order(ciphers, macs, kex, sigs);
696 std::sort(ciphersuites.begin(), ciphersuites.end(), order);
697
698 std::vector<uint16_t> ciphersuite_codes;
699 ciphersuite_codes.reserve(ciphersuites.size());
700 for(const auto& i : ciphersuites) {
701 ciphersuite_codes.push_back(i.ciphersuite_code());
702 }
703 return ciphersuite_codes;
704}
705
706namespace {
707
708void print_vec(std::ostream& o, const char* key, const std::vector<std::string>& v) {
709 o << key << " = ";
710 for(size_t i = 0; i != v.size(); ++i) {
711 o << v[i];
712 if(i != v.size() - 1) {
713 o << ' ';
714 }
715 }
716 o << '\n';
717}
718
719void print_vec(std::ostream& o, const char* key, const std::vector<Group_Params>& params) {
720 // first filter out any groups we don't have a name for:
721 std::vector<std::string> names;
722 for(const auto p : params) {
723 if(auto name = p.to_string()) {
724 names.push_back(name.value());
725 }
726 }
727
728 o << key << " = ";
729
730 for(size_t i = 0; i != names.size(); ++i) {
731 o << names[i];
732 if(i != names.size() - 1) {
733 o << " ";
734 }
735 }
736 o << "\n";
737}
738
739void print_vec(std::ostream& o, const char* key, const std::vector<Certificate_Type>& types) {
740 o << key << " = ";
741 for(size_t i = 0; i != types.size(); ++i) {
742 o << certificate_type_to_string(types[i]);
743 if(i != types.size() - 1) {
744 o << ' ';
745 }
746 }
747 o << '\n';
748}
749
750void print_vec(std::ostream& o, const char* key, const std::vector<Signature_Scheme>& schemes) {
751 o << key << " = ";
752 for(size_t i = 0; i != schemes.size(); ++i) {
753 o << schemes[i].to_string();
754 if(i != schemes.size() - 1) {
755 o << ' ';
756 }
757 }
758 o << '\n';
759}
760
761void print_bool(std::ostream& o, const char* key, bool b) {
762 o << key << " = " << (b ? "true" : "false") << '\n';
763}
764
765} // namespace
766
767void Policy::print(std::ostream& o) const {
768 print_bool(o, "allow_tls12", allow_tls12());
769 print_bool(o, "allow_tls13", allow_tls13());
770 print_bool(o, "allow_dtls12", allow_dtls12());
771 print_bool(o, "allow_ssl_key_log_file", allow_ssl_key_log_file());
772 print_vec(o, "ciphers", allowed_ciphers());
773 print_vec(o, "macs", allowed_macs());
774 print_vec(o, "signature_hashes", allowed_signature_hashes());
775 print_vec(o, "signature_methods", allowed_signature_methods());
776 print_vec(o, "signature_schemes", allowed_signature_schemes());
777 print_vec(o, "acceptable_signature_schemes", acceptable_signature_schemes());
778 print_vec(o, "key_exchange_methods", allowed_key_exchange_methods());
779 print_vec(o, "key_exchange_groups", key_exchange_groups());
780 const auto groups_to_offer = key_exchange_groups_to_offer();
781 if(groups_to_offer.empty()) {
782 print_vec(o, "key_exchange_groups_to_offer", {std::string("none")});
783 } else {
784 print_vec(o, "key_exchange_groups_to_offer", groups_to_offer);
785 }
786 print_bool(o, "allow_insecure_renegotiation", allow_insecure_renegotiation());
787 print_bool(o, "include_time_in_hello_random", include_time_in_hello_random());
788 print_bool(o, "allow_server_initiated_renegotiation", allow_server_initiated_renegotiation());
789 print_bool(o, "hide_unknown_users", hide_unknown_users());
790 print_bool(o, "server_uses_own_ciphersuite_preferences", server_uses_own_ciphersuite_preferences());
791 print_bool(o, "negotiate_encrypt_then_mac", negotiate_encrypt_then_mac());
792 print_bool(o, "require_extended_master_secret", require_extended_master_secret());
793 print_bool(o, "support_cert_status_message", support_cert_status_message());
794 print_bool(o, "tls_13_middlebox_compatibility_mode", tls_13_middlebox_compatibility_mode());
795 print_vec(o, "accepted_client_certificate_types", accepted_client_certificate_types());
796 print_vec(o, "accepted_server_certificate_types", accepted_server_certificate_types());
797 print_bool(o, "hash_hello_random", hash_hello_random());
798 if(record_size_limit().has_value()) {
799 o << "record_size_limit = " << record_size_limit().value() << '\n';
800 }
801 o << "maximum_session_tickets_per_client_hello = " << maximum_session_tickets_per_client_hello() << '\n';
802 o << "session_ticket_lifetime = " << session_ticket_lifetime().count() << '\n';
803 print_bool(o, "reuse_session_tickets", reuse_session_tickets());
804 o << "new_session_tickets_upon_handshake_success = " << new_session_tickets_upon_handshake_success() << '\n';
805 o << "minimum_dh_group_size = " << minimum_dh_group_size() << '\n';
806 o << "minimum_ecdh_group_size = " << minimum_ecdh_group_size() << '\n';
807 o << "minimum_rsa_bits = " << minimum_rsa_bits() << '\n';
808 o << "minimum_signature_strength = " << minimum_signature_strength() << '\n';
809}
810
811std::string Policy::to_string() const {
812 std::ostringstream oss;
813 this->print(oss);
814 return oss.str();
815}
816
817std::vector<std::string> Strict_Policy::allowed_ciphers() const {
818 return {"AES-256/GCM", "AES-128/GCM", "ChaCha20Poly1305"};
819}
820
821std::vector<std::string> Strict_Policy::allowed_signature_hashes() const {
822 return {"SHA-512", "SHA-384"};
823}
824
825std::vector<std::string> Strict_Policy::allowed_macs() const {
826 return {"AEAD"};
827}
828
829std::vector<std::string> Strict_Policy::allowed_key_exchange_methods() const {
830 return {"ECDH"};
831}
832
833} // namespace Botan::TLS
#define BOTAN_UNUSED
Definition assert.h:151
#define BOTAN_ASSERT(expr, assertion_made)
Definition assert.h:69
virtual std::string algo_name() const =0
virtual size_t key_length() const =0
static const std::vector< Ciphersuite > & all_known_ciphersuites()
std::string mac_algo() const
std::string cipher_algo() const
virtual bool include_time_in_hello_random() const
virtual void check_peer_key_acceptable(const Public_Key &public_key) const
virtual bool abort_connection_on_undesired_renegotiation() const
virtual size_t maximum_dh_group_size() const
virtual size_t dtls_maximum_timeout() const
virtual size_t minimum_ecdh_group_size() const
virtual size_t maximum_handshake_message_size() const
virtual size_t record_padding_bytes(size_t plaintext_bytes) const
virtual size_t dtls_default_mtu() const
virtual std::optional< size_t > max_useless_records() const
virtual bool allow_tls12() const
virtual std::vector< Signature_Scheme > allowed_signature_schemes() const
std::string to_string() const
virtual bool reuse_session_tickets() const
virtual std::vector< uint16_t > ciphersuite_list(Protocol_Version version) const
virtual std::vector< Certificate_Type > accepted_server_certificate_types() const
virtual std::vector< Certificate_Type > accepted_client_certificate_types() const
bool allowed_signature_method(std::string_view sig_method) const
virtual bool require_client_certificate_authentication() const
virtual std::vector< Group_Params > key_exchange_groups() const
virtual size_t new_session_tickets_upon_handshake_success() const
virtual uint64_t records_per_traffic_key() const
virtual std::vector< Group_Params > key_exchange_groups_to_offer() const
bool allowed_signature_hash(std::string_view hash) const
virtual size_t minimum_rsa_bits() const
virtual std::optional< size_t > dtls_maximum_hello_verify_requests() const
virtual bool tls_13_middlebox_compatibility_mode() const
virtual bool only_resume_with_exact_version() const
virtual bool allow_client_initiated_renegotiation() const
virtual std::optional< size_t > dtls_maximum_retransmissions() const
virtual bool allow_ssl_key_log_file() const
virtual bool allow_dtls_epoch0_restart() const
virtual bool request_client_certificate_authentication() const
virtual bool require_cert_revocation_info() const
virtual bool negotiate_encrypt_then_mac() const
virtual bool require_extended_master_secret() const
virtual bool server_uses_own_ciphersuite_preferences() const
virtual Protocol_Version latest_supported_version(bool datagram) const
virtual bool acceptable_protocol_version(Protocol_Version version) const
virtual std::vector< uint16_t > srtp_profiles() const
virtual bool support_cert_status_message() const
virtual bool acceptable_ciphersuite(const Ciphersuite &suite) const
virtual std::vector< std::string > allowed_macs() const
virtual bool hide_unknown_users() const
virtual std::optional< std::vector< Signature_Scheme > > acceptable_certificate_signature_schemes() const
virtual bool hash_hello_random() const
virtual bool allow_tls13() const
virtual std::vector< std::string > allowed_key_exchange_methods() const
virtual size_t dtls_initial_timeout() const
virtual size_t maximum_session_tickets_per_connection() const
virtual size_t maximum_session_tickets_per_client_hello() const
virtual std::vector< Signature_Scheme > acceptable_signature_schemes() const
virtual bool use_ecc_point_compression() const
virtual bool allow_dtls12() const
virtual size_t minimum_dh_group_size() const
virtual bool allow_insecure_renegotiation() const
virtual std::optional< uint16_t > record_size_limit() const
virtual std::vector< std::string > allowed_ciphers() const
virtual std::chrono::seconds session_ticket_lifetime() const
virtual size_t minimum_signature_strength() const
virtual uint64_t minimum_key_update_interval_ms() const
virtual Group_Params default_dh_group() const
virtual bool dtls_server_require_cookie_exchange() const
virtual size_t maximum_certificate_chain_size() const
virtual std::vector< std::string > allowed_signature_methods() const
virtual size_t minimum_ecdsa_group_size() const
virtual Group_Params choose_key_exchange_group(const std::vector< Group_Params > &supported_by_peer, const std::vector< Group_Params > &offered_by_peer) const
virtual bool allow_resumption_for_renegotiation() const
virtual std::vector< std::string > allowed_signature_hashes() const
virtual bool allow_server_initiated_renegotiation() const
virtual void print(std::ostream &o) const
static const std::vector< Signature_Scheme > & all_available_schemes()
std::vector< std::string > allowed_macs() const override
std::vector< std::string > allowed_ciphers() const override
std::vector< std::string > allowed_key_exchange_methods() const override
std::vector< std::string > allowed_signature_hashes() const override
const char * name
Definition ffi_tls.h:59
std::string certificate_type_to_string(Certificate_Type type)
bool value_exists(const std::vector< T > &vec, const V &val)
Definition stl_util.h:44