Botan
2.1.0
Crypto and TLS for C++11
|
#include <tls_policy.h>
Public Member Functions | |
virtual bool | acceptable_ciphersuite (const Ciphersuite &suite) const |
virtual bool | acceptable_protocol_version (Protocol_Version version) const |
bool | allow_dtls10 () const override |
bool | allow_dtls12 () const override |
bool | allow_insecure_renegotiation () const override |
bool | allow_server_initiated_renegotiation () const override |
bool | allow_tls10 () const override |
bool | allow_tls11 () const override |
bool | allow_tls12 () const override |
std::vector< std::string > | allowed_ciphers () const override |
bool | allowed_ecc_curve (const std::string &curve) const |
std::vector< std::string > | allowed_ecc_curves () const override |
std::vector< std::string > | allowed_key_exchange_methods () const override |
std::vector< std::string > | allowed_macs () const override |
std::vector< std::string > | allowed_signature_hashes () const override |
bool | allowed_signature_method (const std::string &sig_method) const |
std::vector< std::string > | allowed_signature_methods () const override |
virtual void | check_peer_key_acceptable (const Public_Key &public_key) const |
virtual std::string | choose_curve (const std::vector< std::string > &curve_names) const |
virtual std::vector< uint16_t > | ciphersuite_list (Protocol_Version version, bool have_srp) const |
virtual std::vector< uint8_t > | compression () const |
std::string | dh_group () const override |
virtual size_t | dtls_default_mtu () const |
virtual size_t | dtls_initial_timeout () const |
virtual size_t | dtls_maximum_timeout () const |
bool | hide_unknown_users () const override |
bool | include_time_in_hello_random () const override |
virtual Protocol_Version | latest_supported_version (bool datagram) const |
size_t | minimum_dh_group_size () const override |
virtual size_t | minimum_dsa_group_size () const |
size_t | minimum_ecdh_group_size () const override |
size_t | minimum_ecdsa_group_size () const override |
size_t | minimum_rsa_bits () const override |
size_t | minimum_signature_strength () const override |
bool | negotiate_encrypt_then_mac () const override |
virtual void | print (std::ostream &o) const |
virtual bool | require_cert_revocation_info () const |
bool | send_fallback_scsv (Protocol_Version version) const override |
bool | server_uses_own_ciphersuite_preferences () const override |
uint32_t | session_ticket_lifetime () const override |
void | set (const std::string &k, const std::string &v) |
std::vector< uint16_t > | srtp_profiles () const override |
Text_Policy (const std::string &s) | |
Text_Policy (std::istream &in) | |
std::string | to_string () const |
bool | use_ecc_point_compression () const override |
Definition at line 432 of file tls_policy.h.
|
inlineexplicit |
Definition at line 526 of file tls_policy.h.
References Botan::read_cfg().
|
inlineexplicit |
Definition at line 532 of file tls_policy.h.
|
virtualinherited |
Allows policy to reject any ciphersuites which are undesirable for whatever reason without having to reimplement ciphersuite_list
Definition at line 264 of file tls_policy.cpp.
Referenced by Botan::TLS::Policy::ciphersuite_list().
|
virtualinherited |
Definition at line 241 of file tls_policy.cpp.
References Botan::TLS::Policy::allow_dtls10(), Botan::TLS::Policy::allow_dtls12(), Botan::TLS::Policy::allow_tls10(), Botan::TLS::Policy::allow_tls11(), Botan::TLS::Policy::allow_tls12(), Botan::TLS::Protocol_Version::DTLS_V10, Botan::TLS::Protocol_Version::DTLS_V12, Botan::TLS::Protocol_Version::TLS_V10, Botan::TLS::Protocol_Version::TLS_V11, and Botan::TLS::Protocol_Version::TLS_V12.
Referenced by Botan::TLS::Client_Hello::Client_Hello().
|
inlineoverridevirtual |
Allow DTLS v1.0
Reimplemented from Botan::TLS::Policy.
Definition at line 466 of file tls_policy.h.
References Botan::TLS::Policy::allow_dtls10().
|
inlineoverridevirtual |
Allow DTLS v1.2
Reimplemented from Botan::TLS::Policy.
Definition at line 469 of file tls_policy.h.
References Botan::TLS::Policy::allow_dtls12().
|
inlineoverridevirtual |
Allow renegotiation even if the counterparty doesn't support the secure renegotiation extension.
Reimplemented from Botan::TLS::Policy.
Definition at line 472 of file tls_policy.h.
References Botan::TLS::Policy::allow_insecure_renegotiation().
|
inlineoverridevirtual |
Allow servers to initiate a new handshake
Reimplemented from Botan::TLS::Policy.
Definition at line 478 of file tls_policy.h.
References Botan::TLS::Policy::allow_server_initiated_renegotiation().
|
inlineoverridevirtual |
Allow TLS v1.0
Reimplemented from Botan::TLS::Policy.
Definition at line 457 of file tls_policy.h.
References Botan::TLS::Policy::allow_tls10().
|
inlineoverridevirtual |
Allow TLS v1.1
Reimplemented from Botan::TLS::Policy.
Definition at line 460 of file tls_policy.h.
References Botan::TLS::Policy::allow_tls11().
|
inlineoverridevirtual |
Allow TLS v1.2
Reimplemented from Botan::TLS::Policy.
Definition at line 463 of file tls_policy.h.
References Botan::TLS::Policy::allow_tls12().
|
inlineoverridevirtual |
Returns a list of ciphers we are willing to negotiate, in order of preference.
Reimplemented from Botan::TLS::Policy.
Definition at line 436 of file tls_policy.h.
References Botan::TLS::Policy::allowed_ciphers().
|
inherited |
Definition at line 111 of file tls_policy.cpp.
References Botan::TLS::Policy::allowed_ecc_curves(), and Botan::value_exists().
Referenced by Botan::TLS::Policy::ciphersuite_list(), and Botan::TLS::Client_Key_Exchange::Client_Key_Exchange().
|
inlineoverridevirtual |
Return list of ECC curves we are willing to use in order of preference
Reimplemented from Botan::TLS::Policy.
Definition at line 451 of file tls_policy.h.
References Botan::TLS::Policy::allowed_ecc_curves().
|
inlineoverridevirtual |
Returns a list of key exchange algorithms we are willing to use, in order of preference. Allowed values: DH, empty string (representing RSA using server certificate key)
Reimplemented from Botan::TLS::Policy.
Definition at line 445 of file tls_policy.h.
References Botan::TLS::Policy::allowed_key_exchange_methods().
|
inlineoverridevirtual |
Returns a list of MAC algorithms we are willing to use.
Reimplemented from Botan::TLS::Policy.
Definition at line 442 of file tls_policy.h.
References Botan::TLS::Policy::allowed_macs().
|
inlineoverridevirtual |
Returns a list of hash algorithms we are willing to use for signatures, in order of preference.
Reimplemented from Botan::TLS::Policy.
Definition at line 439 of file tls_policy.h.
References Botan::TLS::Policy::allowed_signature_hashes().
|
inherited |
Definition at line 91 of file tls_policy.cpp.
References Botan::TLS::Policy::allowed_signature_methods(), and Botan::value_exists().
Referenced by Botan::TLS::Handshake_State::parse_sig_format().
|
inlineoverridevirtual |
Returns a list of signature algorithms we are willing to use, in order of preference. Allowed values RSA and DSA.
Reimplemented from Botan::TLS::Policy.
Definition at line 448 of file tls_policy.h.
References Botan::TLS::Policy::allowed_signature_methods().
|
virtualinherited |
Throw an exception if you don't like the peer's key. Default impl checks the key size against minimum_rsa_bits, minimum_ecdsa_group_size, or minimum_ecdh_group_size depending on the key's type. Override if you'd like to perform some other kind of test on (or logging of) the peer's keys.
Definition at line 186 of file tls_policy.cpp.
References Botan::Public_Key::algo_name(), Botan::TLS::Alert::INSUFFICIENT_SECURITY, Botan::Public_Key::key_length(), Botan::TLS::Policy::minimum_dh_group_size(), Botan::TLS::Policy::minimum_dsa_group_size(), Botan::TLS::Policy::minimum_ecdh_group_size(), Botan::TLS::Policy::minimum_ecdsa_group_size(), Botan::TLS::Policy::minimum_rsa_bits(), and Botan::ASN1::to_string().
Referenced by Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), Botan::TLS::Certificate_Verify::verify(), and Botan::TLS::Server_Key_Exchange::verify().
|
virtualinherited |
Choose an elliptic curve to use
Definition at line 124 of file tls_policy.cpp.
References Botan::TLS::Policy::allowed_ecc_curves(), and Botan::value_exists().
Referenced by Botan::TLS::Server_Key_Exchange::Server_Key_Exchange().
|
virtualinherited |
Return allowed ciphersuites, in order of preference
Definition at line 369 of file tls_policy.cpp.
References Botan::TLS::Policy::acceptable_ciphersuite(), Botan::TLS::Ciphersuite::all_known_ciphersuites(), Botan::TLS::Policy::allowed_ciphers(), Botan::TLS::Policy::allowed_ecc_curve(), Botan::TLS::Policy::allowed_key_exchange_methods(), Botan::TLS::Policy::allowed_macs(), Botan::TLS::Policy::allowed_signature_methods(), Botan::TLS::Protocol_Version::supports_aead_modes(), and Botan::value_exists().
|
virtualinherited |
Returns a list of compression algorithms we are willing to use, in order of preference. Allowed values any value of Compression_Method.
Definition at line 226 of file tls_policy.cpp.
References Botan::TLS::NO_COMPRESSION.
|
inlineoverridevirtual |
Reimplemented from Botan::TLS::Policy.
Definition at line 487 of file tls_policy.h.
References Botan::TLS::Policy::dh_group().
|
virtualinherited |
Definition at line 285 of file tls_policy.cpp.
|
virtualinherited |
Definition at line 282 of file tls_policy.cpp.
|
virtualinherited |
Definition at line 283 of file tls_policy.cpp.
|
inlineoverridevirtual |
If this function returns false, unknown SRP/PSK identifiers will be rejected with an unknown_psk_identifier alert as soon as the non-existence is identified. Otherwise, a false identifier value will be used and the protocol allowed to proceed, causing the handshake to eventually fail without revealing that the username does not exist on this system.
Reimplemented from Botan::TLS::Policy.
Definition at line 505 of file tls_policy.h.
References Botan::TLS::Policy::hide_unknown_users().
|
inlineoverridevirtual |
The protocol dictates that the first 32 bits of the random field are the current time in seconds. However this allows client fingerprinting attacks. Set to false to disable, in which case random bytes will be used instead.
Reimplemented from Botan::TLS::Policy.
Definition at line 475 of file tls_policy.h.
References Botan::TLS::Policy::include_time_in_hello_random().
|
virtualinherited |
Returns the more recent protocol version we are willing to use, for either TLS or DTLS depending on datagram param. Shouldn't ever need to override this unless you want to allow a user to disable use of TLS v1.2 (which is not recommended)
Definition at line 256 of file tls_policy.cpp.
References Botan::TLS::Protocol_Version::latest_dtls_version(), and Botan::TLS::Protocol_Version::latest_tls_version().
Referenced by Botan::TLS::Policy::send_fallback_scsv().
|
inlineoverridevirtual |
Return the minimum DH group size we're willing to use Default is currently 1024 (insecure), should be 2048
Reimplemented from Botan::TLS::Policy.
Definition at line 496 of file tls_policy.h.
References Botan::TLS::Policy::minimum_dh_group_size().
|
virtualinherited |
Minimum DSA group size, default 2048 bits
Reimplemented in Botan::TLS::BSI_TR_02102_2.
Definition at line 180 of file tls_policy.cpp.
Referenced by Botan::TLS::Policy::check_peer_key_acceptable().
|
inlineoverridevirtual |
Return the minimum ECDH group size we're willing to use for key exchange
Default 255, allowing x25519 and larger x25519 is the smallest curve we will negotiate P-521 is the largest
Reimplemented from Botan::TLS::Policy.
Definition at line 490 of file tls_policy.h.
References Botan::TLS::Policy::minimum_ecdh_group_size().
|
inlineoverridevirtual |
For ECDSA authenticated ciphersuites, the smallest key size the client will accept. This policy is currently only enforced on the server by the client.
Reimplemented from Botan::TLS::Policy.
Definition at line 493 of file tls_policy.h.
References Botan::TLS::Policy::minimum_ecdsa_group_size().
|
inlineoverridevirtual |
Return the minimum bit size we're willing to accept for RSA key exchange or server signatures.
It does not place any requirements on the size of any RSA signature(s) which were used to check the server certificate. This is only concerned with the server's public key.
Default is 2048 which is smallest RSA key size still secure for medium term security.
Reimplemented from Botan::TLS::Policy.
Definition at line 499 of file tls_policy.h.
References Botan::TLS::Policy::minimum_rsa_bits().
|
inlineoverridevirtual |
The minimum signature strength we will accept Returning 80 allows RSA 1024 and SHA-1. Values larger than 80 disable SHA-1 support. Returning 110 allows RSA 2048. Return 128 to force ECC (P-256) or large (~3000 bit) RSA keys. Default is 110
Reimplemented from Botan::TLS::Policy.
Definition at line 502 of file tls_policy.h.
References Botan::TLS::Policy::minimum_signature_strength().
|
inlineoverridevirtual |
Indicates whether the encrypt-then-MAC extension should be negotiated (RFC 7366)
Reimplemented from Botan::TLS::Policy.
Definition at line 484 of file tls_policy.h.
References Botan::TLS::Policy::negotiate_encrypt_then_mac().
|
virtualinherited |
Convert this policy to a printable format.
o | stream to be printed to |
Definition at line 470 of file tls_policy.cpp.
References Botan::TLS::Policy::allow_dtls10(), Botan::TLS::Policy::allow_dtls12(), Botan::TLS::Policy::allow_insecure_renegotiation(), Botan::TLS::Policy::allow_server_initiated_renegotiation(), Botan::TLS::Policy::allow_tls10(), Botan::TLS::Policy::allow_tls11(), Botan::TLS::Policy::allow_tls12(), Botan::TLS::Policy::allowed_ciphers(), Botan::TLS::Policy::allowed_ecc_curves(), Botan::TLS::Policy::allowed_key_exchange_methods(), Botan::TLS::Policy::allowed_macs(), Botan::TLS::Policy::allowed_signature_hashes(), Botan::TLS::Policy::allowed_signature_methods(), Botan::TLS::Policy::dh_group(), Botan::TLS::Policy::hide_unknown_users(), Botan::TLS::Policy::include_time_in_hello_random(), Botan::TLS::Policy::minimum_dh_group_size(), Botan::TLS::Policy::minimum_ecdh_group_size(), Botan::TLS::Policy::minimum_rsa_bits(), Botan::TLS::Policy::minimum_signature_strength(), Botan::TLS::Policy::negotiate_encrypt_then_mac(), Botan::TLS::Policy::server_uses_own_ciphersuite_preferences(), and Botan::TLS::Policy::session_ticket_lifetime().
Referenced by Botan::TLS::Policy::to_string().
|
virtualinherited |
Return if cert revocation info (CRL/OCSP) is required If true, validation will fail unless a valid CRL or OCSP response was examined.
Definition at line 163 of file tls_policy.cpp.
Referenced by Botan::TLS::Callbacks::tls_verify_cert_chain().
|
inlineoverridevirtual |
When offering this version, should we send a fallback SCSV? Default returns true iff version is not the latest version the policy allows, exists to allow override in case of interop problems.
Reimplemented from Botan::TLS::Policy.
Definition at line 511 of file tls_policy.h.
References Botan::TLS::Policy::send_fallback_scsv().
|
inlineoverridevirtual |
Reimplemented from Botan::TLS::Policy.
Definition at line 481 of file tls_policy.h.
References Botan::TLS::Policy::server_uses_own_ciphersuite_preferences().
|
inlineoverridevirtual |
Return the allowed lifetime of a session ticket. If 0, session tickets do not expire until the session ticket key rolls over. Expired session tickets cannot be used to resume a session.
Reimplemented from Botan::TLS::Policy.
Definition at line 508 of file tls_policy.h.
References Botan::TLS::Policy::session_ticket_lifetime().
|
inline |
Definition at line 524 of file tls_policy.h.
|
inlineoverridevirtual |
If this returns a non-empty vector, and DTLS is negotiated, then we will also attempt to negotiate the SRTP extension from RFC 5764 using the returned values as the profile ids.
Reimplemented from Botan::TLS::Policy.
Definition at line 514 of file tls_policy.h.
References Botan::to_u32bit().
|
inherited |
Convert this policy to a printable format. Same as calling print
on a ostringstream and reading o.str()
Definition at line 498 of file tls_policy.cpp.
References Botan::TLS::Policy::print().
|
inlineoverridevirtual |
Request that ECC curve points are sent compressed
Reimplemented from Botan::TLS::Policy.
Definition at line 454 of file tls_policy.h.
References Botan::TLS::Policy::use_ecc_point_compression().