|
Botan 3.14.1
Crypto and TLS for C&
|
#include <tls_session.h>
Public Member Functions | |
| Ciphersuite | ciphersuite () const |
| uint16_t | ciphersuite_code () const |
| uint16_t | dtls_srtp_profile () const |
| Session_Base & | operator= (const Session_Base &other) |
| Session_Base & | operator= (Session_Base &&other) noexcept |
| const std::vector< X509_Certificate > & | peer_certs () const |
| std::optional< Certificate_Type > | peer_credential_type () const |
| std::shared_ptr< const Public_Key > | peer_raw_public_key () const |
| const Server_Information & | server_info () const |
| Session_Base (const Session_Base &other) | |
| Session_Base (Session_Base &&other) noexcept | |
| Session_Base (std::chrono::system_clock::time_point start_time, Protocol_Version version, uint16_t ciphersuite, Connection_Side connection_side, uint16_t srtp_profile, bool extended_master_secret, bool encrypt_then_mac, const std::vector< X509_Certificate > &peer_certs, std::shared_ptr< const Public_Key > peer_raw_public_key, Server_Information server_info) | |
| Connection_Side | side () const |
| std::chrono::system_clock::time_point | start_time () const |
| bool | supports_encrypt_then_mac () const |
| bool | supports_extended_master_secret () const |
| Protocol_Version | version () const |
| ~Session_Base () | |
Protected Member Functions | |
| Session_Base () | |
Protected Attributes | |
| uint16_t | m_ciphersuite = 0 |
| Connection_Side | m_connection_side = Connection_Side::Client |
| bool | m_encrypt_then_mac = false |
| bool | m_extended_master_secret = false |
| std::vector< X509_Certificate > | m_peer_certs |
| std::shared_ptr< const Public_Key > | m_peer_raw_public_key |
| Server_Information | m_server_info |
| uint16_t | m_srtp_profile = 0 |
| std::chrono::system_clock::time_point | m_start_time |
| Protocol_Version | m_version |
Represents basic information about a session that can be both persisted for resumption and presented to the application as a summary of a specific just-established TLS session.
Definition at line 41 of file tls_session.h.
| Botan::TLS::Session_Base::Session_Base | ( | std::chrono::system_clock::time_point | start_time, |
| Protocol_Version | version, | ||
| uint16_t | ciphersuite, | ||
| Connection_Side | connection_side, | ||
| uint16_t | srtp_profile, | ||
| bool | extended_master_secret, | ||
| bool | encrypt_then_mac, | ||
| const std::vector< X509_Certificate > & | peer_certs, | ||
| std::shared_ptr< const Public_Key > | peer_raw_public_key, | ||
| Server_Information | server_info ) |
Definition at line 102 of file tls_session.cpp.
References ciphersuite(), m_ciphersuite, m_connection_side, m_encrypt_then_mac, m_extended_master_secret, m_peer_certs, m_peer_raw_public_key, m_server_info, m_srtp_profile, m_start_time, m_version, peer_certs(), peer_raw_public_key(), server_info(), start_time(), and version().
Referenced by Botan::TLS::Session_Summary::Client_Impl_13, operator=(), operator=(), Botan::TLS::Session::Session(), Botan::TLS::Session::Session(), Session_Base(), and Session_Base().
|
default |
References Session_Base().
|
defaultnoexcept |
References Session_Base().
|
default |
|
protecteddefault |
| Ciphersuite Botan::TLS::Session_Base::ciphersuite | ( | ) | const |
Get the ciphersuite info of the negotiated TLS session
Definition at line 123 of file tls_session.cpp.
References Botan::TLS::Ciphersuite::by_id(), and m_ciphersuite.
Referenced by Botan::TLS::Session_Summary::cipher_algo(), Botan::TLS::Session_Summary::mac_algo(), Botan::TLS::Session_Summary::prf_algo(), Botan::TLS::Server_Hello_12::Server_Hello_12(), Botan::TLS::Session::Session(), Botan::TLS::Session::Session(), and Session_Base().
|
inline |
Get the ciphersuite code of the negotiated TLS session
Definition at line 79 of file tls_session.h.
References m_ciphersuite.
Referenced by Botan::TLS::Session::Session().
|
inline |
Get the negotiated DTLS-SRTP algorithm (RFC 5764)
Definition at line 94 of file tls_session.h.
References m_srtp_profile.
Referenced by Botan::TLS::Client_Hello_12::Client_Hello_12(), and Botan::TLS::Server_Hello_12::Server_Hello_12().
|
default |
References Session_Base().
|
defaultnoexcept |
References Session_Base().
|
inline |
Return the certificate chain of the peer (possibly empty)
Definition at line 111 of file tls_session.h.
References m_peer_certs.
Referenced by Botan::TLS::Session_Summary::Client_Impl_13, Botan::TLS::Session::Session(), and Session_Base().
|
inline |
Return the type of credential used by the peer, or std::nullopt if the peer did not authenticate itself
Definition at line 122 of file tls_session.h.
References m_peer_certs, m_peer_raw_public_key, Botan::TLS::RawPublicKey, and Botan::TLS::X509.
|
inline |
Return the raw public key of the peer (possibly empty)
Definition at line 116 of file tls_session.h.
References m_peer_raw_public_key.
Referenced by Botan::TLS::Session_Summary::Client_Impl_13, Botan::TLS::Session::Session(), and Session_Base().
|
inline |
Get information about the TLS server
Returns information that identifies the server side of the connection. This is useful for the client in that it identifies what was originally passed to the constructor. For the server, it includes the name the client specified in the server name indicator extension.
Definition at line 142 of file tls_session.h.
References m_server_info.
Referenced by Botan::TLS::Client_Hello_12::Client_Hello_12(), Botan::TLS::Session_Summary::Client_Impl_13, Botan::TLS::Session::Session(), Botan::TLS::Session::Session(), Session_Base(), and Botan::TLS::Session_Manager_SQL::store().
|
inline |
Get which side of the connection we are/were acting as.
Definition at line 89 of file tls_session.h.
References m_connection_side.
Referenced by Botan::TLS::Session_Summary::Client_Impl_13, Botan::TLS::Session_Manager::establish(), Botan::TLS::Session_Manager_Stateless::establish(), Botan::TLS::Session::Session(), Botan::TLS::Session::Session(), and Botan::TLS::Session_Manager_SQL::store().
|
inline |
Get the wall clock time this session began
Definition at line 69 of file tls_session.h.
References m_start_time.
Referenced by Botan::TLS::Session_Manager_In_Memory::find_some(), Botan::TLS::Session::Session(), Session_Base(), and Botan::TLS::Session_Manager_SQL::store().
|
inline |
Returns true if a TLS 1.2 session negotiated "encrypt then MAC"; TLS 1.3 sessions will always return false as they always use an AEAD.
Definition at line 100 of file tls_session.h.
References m_encrypt_then_mac.
Referenced by Botan::TLS::Client_Hello_12::Client_Hello_12(), and Botan::TLS::Server_Hello_12::Server_Hello_12().
|
inline |
Returns true if a TLS 1.2 session negotiated "extended master secret"; TLS 1.3 sessions will always return true (see RFC 8446 Appendix D).
Definition at line 106 of file tls_session.h.
References m_extended_master_secret.
|
inline |
Get the negotiated protocol version of the TLS session
Definition at line 74 of file tls_session.h.
References m_version.
Referenced by Botan::TLS::Client_Hello_12::Client_Hello_12(), Botan::TLS::Session_Manager_Hybrid::establish(), Botan::TLS::Session::Session(), Botan::TLS::Session::Session(), Session_Base(), and Botan::TLS::Callbacks::tls_should_persist_resumption_information().
|
protected |
Definition at line 148 of file tls_session.h.
Referenced by ciphersuite(), ciphersuite_code(), Botan::TLS::Session::DER_encode(), Botan::TLS::Session::Session(), and Session_Base().
|
protected |
Definition at line 149 of file tls_session.h.
Referenced by Botan::TLS::Session::DER_encode(), Botan::TLS::Session::Session(), Session_Base(), and side().
|
protected |
Definition at line 153 of file tls_session.h.
Referenced by Botan::TLS::Session::DER_encode(), Botan::TLS::Session::Session(), Session_Base(), and supports_encrypt_then_mac().
|
protected |
Definition at line 152 of file tls_session.h.
Referenced by Botan::TLS::Session::DER_encode(), Botan::TLS::Session::Session(), Session_Base(), and supports_extended_master_secret().
|
protected |
Definition at line 155 of file tls_session.h.
Referenced by Botan::TLS::Session::DER_encode(), peer_certs(), peer_credential_type(), Botan::TLS::Session::Session(), and Session_Base().
|
protected |
Definition at line 156 of file tls_session.h.
Referenced by Botan::TLS::Session::DER_encode(), peer_credential_type(), peer_raw_public_key(), Botan::TLS::Session::Session(), and Session_Base().
|
protected |
Definition at line 157 of file tls_session.h.
Referenced by Botan::TLS::Session::DER_encode(), server_info(), Botan::TLS::Session::Session(), and Session_Base().
|
protected |
Definition at line 150 of file tls_session.h.
Referenced by Botan::TLS::Session::DER_encode(), dtls_srtp_profile(), Botan::TLS::Session::Session(), and Session_Base().
|
protected |
Definition at line 145 of file tls_session.h.
Referenced by Botan::TLS::Session::DER_encode(), Botan::TLS::Session::Session(), Session_Base(), and start_time().
|
protected |
Definition at line 147 of file tls_session.h.
Referenced by Botan::TLS::Session::DER_encode(), Botan::TLS::Session::Session(), Session_Base(), and version().