|
Botan 3.13.0
Crypto and TLS for C&
|
#include <tls_client_impl_12.h>
Public Member Functions | |
| std::string | application_protocol () const override |
| Client_Impl_12 (const std::shared_ptr< Callbacks > &callbacks, const std::shared_ptr< Session_Manager > &session_manager, const std::shared_ptr< Credentials_Manager > &creds, const std::shared_ptr< const Policy > &policy, const std::shared_ptr< RandomNumberGenerator > &rng, Server_Information server_info=Server_Information(), bool datagram=false, const std::vector< std::string > &next_protocols={}, size_t reserved_io_buffer_size=TLS::Channel::IO_BUF_DEFAULT_SIZE) | |
| void | close () |
| std::optional< std::string > | external_psk_identity () const override |
| size_t | from_peer (std::span< const uint8_t > data) override |
| bool | is_active () const override |
| bool | is_closed () const override |
| bool | is_closed_for_reading () const override |
| bool | is_closed_for_writing () const override |
| bool | is_handshake_complete () const override |
| SymmetricKey | key_material_export (std::string_view label, std::string_view context, size_t length) const override |
| virtual bool | new_session_ticket_supported () const |
| std::optional< std::chrono::milliseconds > | next_retransmission_timeout () const override |
| std::vector< X509_Certificate > | peer_cert_chain () const override |
| std::shared_ptr< const Public_Key > | peer_raw_public_key () const override |
| void | renegotiate (bool force_full_renegotiation=false) override |
| bool | secure_renegotiation_supported () const override |
| void | send_alert (const Alert &alert) override |
| void | send_fatal_alert (Alert::Type type) |
| virtual size_t | send_new_session_tickets (const size_t) |
| void | send_warning_alert (Alert::Type type) |
| bool | timeout_check () override |
| void | to_peer (std::span< const uint8_t > data) override |
| void | update_traffic_keys (bool request_peer_update=false) override |
Protected Member Functions | |
| void | activate_session () |
| const std::optional< Active_Connection_State_12 > & | active_state () const |
| Callbacks & | callbacks () const |
| void | change_cipher_spec_reader (Connection_Side side) |
| void | change_cipher_spec_writer (Connection_Side side) |
| Handshake_State & | create_handshake_state (Protocol_Version version, bool epoch0_restart=false) |
| bool | expects_downgrade () const |
| void | inspect_handshake_message (const Handshake_Message &msg) |
| bool | is_downgrading () const |
| void | note_resumption_handle (std::optional< Session_Handle > handle) |
| const Policy & | policy () const |
| void | reset_active_association_state () |
| RandomNumberGenerator & | rng () |
| void | secure_renegotiation_check (const Client_Hello_12 *client_hello) |
| void | secure_renegotiation_check (const Server_Hello_12 *server_hello) |
| std::vector< uint8_t > | secure_renegotiation_data_for_client_hello () const |
| std::vector< uint8_t > | secure_renegotiation_data_for_server_hello () const |
| Session_Manager & | session_manager () |
SSL/TLS Client 1.2 implementation
Definition at line 23 of file tls_client_impl_12.h.
|
explicit |
Set up a new TLS client session
| callbacks | contains a set of callback function references required by the TLS client. |
| session_manager | manages session state |
| creds | manages application/user credentials |
| policy | specifies other connection policy information |
| rng | a random number generator |
| server_info | is identifying information about the TLS server |
| datagram | specifies whether to use TLS 1.2 or DTLS 1.2 |
| next_protocols | specifies protocols to advertise with ALPN |
| reserved_io_buffer_size | This many bytes of memory will be preallocated for the read and write buffers. Smaller values just mean reallocations and copies are more likely. |
Definition at line 103 of file tls_client_impl_12.cpp.
References BOTAN_ASSERT_NONNULL, Botan::TLS::Channel_Impl_12::callbacks(), Botan::TLS::Channel_Impl_12::Channel_Impl_12(), Botan::TLS::Channel_Impl_12::create_handshake_state(), Botan::TLS::Channel_Impl_12::policy(), Botan::TLS::Channel_Impl_12::rng(), and Botan::TLS::Channel_Impl_12::session_manager().
|
protectedinherited |
Definition at line 484 of file tls_channel_impl_12.cpp.
References Botan::TLS::Channel_Impl::application_protocol(), BOTAN_ASSERT_NONNULL, callbacks(), Botan::map_remove_if(), and Botan::TLS::Callbacks::tls_session_activated().
|
inlineprotectedinherited |
Definition at line 154 of file tls_channel_impl_12.h.
|
inlineoverridevirtual |
Implements Botan::TLS::Channel_Impl.
Definition at line 68 of file tls_client_impl_12.h.
|
inlineprotectedinherited |
Definition at line 186 of file tls_channel_impl_12.h.
Referenced by activate_session(), change_cipher_spec_reader(), Channel_Impl_12(), Botan::TLS::Client_Impl_12::Client_Impl_12(), create_handshake_state(), key_material_export(), and Botan::TLS::Server_Impl_12::Server_Impl_12().
|
protectedinherited |
Definition at line 401 of file tls_channel_impl_12.cpp.
References BOTAN_ASSERT, callbacks(), Botan::TLS::Client, Botan::TLS::Server, and Botan::TLS::Callbacks::tls_current_monotonic_clock_ms().
|
protectedinherited |
Definition at line 438 of file tls_channel_impl_12.cpp.
References BOTAN_ASSERT.
|
inlineinherited |
Send a close notification alert
Definition at line 80 of file tls_channel_impl.h.
References send_warning_alert().
|
protectedinherited |
Definition at line 240 of file tls_channel_impl_12.cpp.
References callbacks(), Botan::TLS::Policy::dtls_default_mtu(), Botan::TLS::Policy::dtls_initial_timeout(), Botan::TLS::Policy::dtls_maximum_retransmissions(), Botan::TLS::Policy::dtls_maximum_timeout(), Botan::TLS::Protocol_Version::is_datagram_protocol(), new_handshake_state(), policy(), Botan::TLS::Callbacks::tls_current_monotonic_clock_ms(), and Botan::TLS::Protocol_Version::to_string().
Referenced by Botan::TLS::Client_Impl_12::Client_Impl_12(), and renegotiate().
|
inlineprotectedinherited |
Definition at line 290 of file tls_channel_impl.h.
Referenced by Botan::TLS::Client_Impl_13::Client_Impl_13(), and Botan::TLS::Channel_Impl_13::from_peer().
|
overridevirtualinherited |
Implements Botan::TLS::Channel_Impl.
Definition at line 230 of file tls_channel_impl_12.cpp.
|
overridevirtualinherited |
Inject TLS traffic received from counterparty
Implements Botan::TLS::Channel_Impl.
Definition at line 523 of file tls_channel_impl_12.cpp.
References Botan::TLS::Alert, Botan::TLS::Policy::allow_dtls_epoch0_restart(), Botan::TLS::ApplicationData, BOTAN_ASSERT, BOTAN_ASSERT_IMPLICATION, Botan::TLS::ChangeCipherSpec, Botan::TLS::ClientHello, Botan::TLS::Record_Header::epoch(), Botan::TLS::Handshake, Botan::TLS::Invalid, Botan::TLS::Protocol_Version::major_version(), Botan::TLS::MAX_PLAINTEXT_SIZE, Botan::TLS::Record_Header::needed(), policy(), Botan::TLS::read_record(), Botan::TLS::Channel_Impl::send_fatal_alert(), Botan::TLS::Record_Header::sequence(), Botan::TLS::Record_Header::type(), Botan::TLS::TLS_Exception::type(), and Botan::TLS::Record_Header::version().
|
protectedinherited |
|
overridevirtualinherited |
Implements Botan::TLS::Channel_Impl.
Definition at line 468 of file tls_channel_impl_12.cpp.
References is_closed(), and is_handshake_complete().
Referenced by to_peer().
|
overridevirtualinherited |
Implements Botan::TLS::Channel_Impl.
Definition at line 480 of file tls_channel_impl_12.cpp.
Referenced by is_active(), is_closed_for_reading(), is_closed_for_writing(), and send_alert().
|
inlineoverridevirtualinherited |
Implements Botan::TLS::Channel_Impl.
Definition at line 98 of file tls_channel_impl_12.h.
References is_closed().
|
inlineoverridevirtualinherited |
Implements Botan::TLS::Channel_Impl.
Definition at line 100 of file tls_channel_impl_12.h.
References is_closed().
|
inlineprotectedinherited |
Indicates whether a downgrade to TLS 1.2 or lower is in progress
Definition at line 282 of file tls_channel_impl.h.
Referenced by Botan::TLS::Channel_Impl_13::from_peer(), Botan::TLS::Channel_Impl_13::key_material_export(), and Botan::TLS::Channel_Impl_13::update_traffic_keys().
|
overridevirtualinherited |
Implements Botan::TLS::Channel_Impl.
Definition at line 464 of file tls_channel_impl_12.cpp.
Referenced by is_active().
|
overridevirtualinherited |
Key material export (RFC 5705)
| label | a disambiguating label string |
| context | a per-association context value |
| length | the length of the desired key in bytes |
Implements Botan::TLS::Channel_Impl.
Definition at line 1022 of file tls_channel_impl_12.cpp.
References Botan::as_span_of_bytes(), BOTAN_ASSERT_NOMSG, callbacks(), Botan::concat(), Botan::store_be(), and Botan::TLS::Callbacks::tls12_protocol_specific_kdf().
|
inlinevirtualinherited |
Reimplemented in Botan::TLS::Server_Impl_13.
Definition at line 146 of file tls_channel_impl.h.
|
overridevirtualinherited |
Reimplemented from Botan::TLS::Channel_Impl.
Definition at line 472 of file tls_channel_impl_12.cpp.
|
protectedinherited |
Record the resumption handle this connection was established or resumed under, so that a fatal alert can invalidate it. The ServerHello session ID does not identify a ticket-backed session.
Definition at line 127 of file tls_channel_impl_12.cpp.
|
overridevirtualinherited |
Implements Botan::TLS::Channel_Impl.
Definition at line 223 of file tls_channel_impl_12.cpp.
|
inlineoverridevirtualinherited |
Note: Raw public key for authentication (RFC7250) is currently not implemented for TLS 1.2.
Implements Botan::TLS::Channel_Impl.
Definition at line 113 of file tls_channel_impl_12.h.
|
inlineprotectedinherited |
Definition at line 184 of file tls_channel_impl_12.h.
Referenced by Channel_Impl_12(), Botan::TLS::Client_Impl_12::Client_Impl_12(), create_handshake_state(), from_peer(), renegotiate(), and Botan::TLS::Server_Impl_12::Server_Impl_12().
|
overridevirtualinherited |
Attempt to renegotiate the session
| force_full_renegotiation | if true, require a full renegotiation, otherwise allow session resumption |
Implements Botan::TLS::Channel_Impl.
Definition at line 373 of file tls_channel_impl_12.cpp.
References Botan::TLS::Policy::allow_resumption_for_renegotiation(), create_handshake_state(), initiate_handshake(), and policy().
|
protectedinherited |
Definition at line 169 of file tls_channel_impl_12.cpp.
References BOTAN_ASSERT_NOMSG.
|
inlineprotectedinherited |
Definition at line 180 of file tls_channel_impl_12.h.
Referenced by Channel_Impl_12(), Botan::TLS::Client_Impl_12::Client_Impl_12(), and Botan::TLS::Server_Impl_12::Server_Impl_12().
|
protectedinherited |
Definition at line 957 of file tls_channel_impl_12.cpp.
References BOTAN_ASSERT_NONNULL, Botan::CT::is_equal(), Botan::TLS::Client_Hello_12::renegotiation_info(), Botan::TLS::Client_Hello_12::secure_renegotiation(), and secure_renegotiation_data_for_client_hello().
|
protectedinherited |
Definition at line 975 of file tls_channel_impl_12.cpp.
References BOTAN_ASSERT_NONNULL, Botan::CT::is_equal(), Botan::TLS::Server_Hello_12::renegotiation_info(), Botan::TLS::Server_Hello_12::secure_renegotiation(), and secure_renegotiation_data_for_server_hello().
|
protectedinherited |
Definition at line 993 of file tls_channel_impl_12.cpp.
Referenced by secure_renegotiation_check().
|
protectedinherited |
Definition at line 1000 of file tls_channel_impl_12.cpp.
References Botan::concat().
Referenced by secure_renegotiation_check().
|
overridevirtualinherited |
Implements Botan::TLS::Channel_Impl.
Definition at line 1008 of file tls_channel_impl_12.cpp.
|
overridevirtualinherited |
Send a TLS alert message. If the alert is fatal, the internal state (keys, etc) will be reset.
| alert | the Alert to send |
Implements Botan::TLS::Channel_Impl.
Definition at line 908 of file tls_channel_impl_12.cpp.
References Botan::TLS::Alert, is_closed(), Botan::TLS::Alert::is_fatal(), Botan::TLS::Alert::is_valid(), Botan::TLS::Alert::serialize(), and Botan::TLS::Alert::type().
|
inlineinherited |
Send a fatal alert
Definition at line 75 of file tls_channel_impl.h.
References Botan::TLS::Alert, and send_alert().
Referenced by Botan::TLS::Channel_Impl_12::from_peer(), and Botan::TLS::Channel_Impl_13::from_peer().
|
inlinevirtualinherited |
Send tickets new session tickets to the peer. This is only supported on TLS 1.3 servers.
If the server's Session_Manager does not accept the generated Session objects, the server implementation won't be able to send new tickets. Additionally, anything but TLS 1.3 servers will return 0 (because they don't support sending such session tickets).
Reimplemented in Botan::TLS::Server_Impl_13.
Definition at line 159 of file tls_channel_impl.h.
|
inlineinherited |
Send a warning alert
Definition at line 70 of file tls_channel_impl.h.
References Botan::TLS::Alert, and send_alert().
Referenced by close().
|
inlineprotectedinherited |
Definition at line 182 of file tls_channel_impl_12.h.
Referenced by Channel_Impl_12(), Botan::TLS::Client_Impl_12::Client_Impl_12(), and Botan::TLS::Server_Impl_12::Server_Impl_12().
|
overridevirtualinherited |
Perform a handshake timeout check. This does nothing unless this is a DTLS channel with a handshake in progress.
Implements Botan::TLS::Channel_Impl.
Definition at line 358 of file tls_channel_impl_12.cpp.
|
overridevirtualinherited |
Inject plaintext intended for counterparty Throws an exception if is_active() is false
Implements Botan::TLS::Channel_Impl.
Definition at line 900 of file tls_channel_impl_12.cpp.
References Botan::TLS::ApplicationData, and is_active().
|
overridevirtualinherited |
Attempt to update the session's traffic key material Note that this is possible with a TLS 1.3 channel, only.
| request_peer_update | if true, require a reciprocal key update |
Implements Botan::TLS::Channel_Impl.
Definition at line 397 of file tls_channel_impl_12.cpp.