Botan 3.9.0
Crypto and TLS for C&
|
#include <tls_session.h>
Public Member Functions | |
std::string | cipher_algo () const |
Ciphersuite | ciphersuite () const |
uint16_t | ciphersuite_code () const |
uint16_t | dtls_srtp_profile () const |
const std::optional< std::string > & | external_psk_identity () const |
std::string | kex_algo () const |
std::optional< std::string > | kex_parameters () const |
std::string | mac_algo () const |
const std::vector< X509_Certificate > & | peer_certs () const |
std::shared_ptr< const Public_Key > | peer_raw_public_key () const |
std::string | prf_algo () const |
bool | psk_used () const |
const Server_Information & | server_info () const |
const Session_ID & | session_id () const |
const std::optional< Session_Ticket > & | session_ticket () const |
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 |
bool | was_resumption () const |
Protected Attributes | |
uint16_t | m_ciphersuite = 0 |
Connection_Side | m_connection_side {} |
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 |
Friends | |
class | Client_Impl_12 |
class | Client_Impl_13 |
class | Server_Impl_12 |
class | Server_Impl_13 |
Summarizes the negotiated features after a TLS handshake. Applications may query those in Callbacks::tls_session_established().
Definition at line 249 of file tls_session.h.
|
inline |
|
inherited |
Get the ciphersuite info of the negotiated TLS session
Definition at line 86 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::Session::Session(), Botan::TLS::Session::Session(), Botan::TLS::Session::Session(), and Session_Base().
|
inlineinherited |
Get the ciphersuite code of the negotiated TLS session
Definition at line 180 of file tls_session.h.
References m_ciphersuite.
Referenced by Botan::TLS::Client_Hello_12::Client_Hello_12(), and Botan::TLS::Session::Session().
|
inlineinherited |
Get the negotiated DTLS-SRTP algorithm (RFC 5764)
Definition at line 195 of file tls_session.h.
References m_srtp_profile.
|
inline |
The negotiated identity of an externally provided preshared key used to establish this session. For TLS 1.3 this may be any of the externally provided PSKs offered by the client. PSK identities used as session tickets for TLS 1.3 session resumption won't be shown here.
Definition at line 271 of file tls_session.h.
|
inline |
Definition at line 292 of file tls_session.h.
|
inline |
Definition at line 294 of file tls_session.h.
|
inline |
|
inlineinherited |
Return the certificate chain of the peer (possibly empty)
Definition at line 212 of file tls_session.h.
References m_peer_certs.
Referenced by Botan::TLS::Session_Summary::Client_Impl_13, Botan::TLS::Session::Session(), Botan::TLS::Session::Session(), and Session_Base().
|
inlineinherited |
Return the raw public key of the peer (possibly empty)
Definition at line 217 of file tls_session.h.
References m_peer_raw_public_key.
Referenced by Botan::TLS::Session_Summary::Client_Impl_13, Botan::TLS::Session::Session(), Botan::TLS::Session::Session(), and Session_Base().
|
inline |
|
inline |
Indicates that the session was established using an externally provided PSK. Session resumptions in TLS 1.3 (while technically implemented using a PSK) are not considered here.
Definition at line 283 of file tls_session.h.
|
inlineinherited |
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 227 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 |
The Session_ID negotiated during the handshake. Note that this does not carry any meaning in TLS 1.3 and might even be empty.
Definition at line 256 of file tls_session.h.
|
inline |
The session ticket a TLS 1.2 server issued for this session. Note that this may be set in TLS 1.2 clients only. It is not the ticket used to establish this session.
Definition at line 263 of file tls_session.h.
|
inlineinherited |
Get which side of the connection we are/were acting as.
Definition at line 190 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(), and Botan::TLS::Session::Session().
|
inlineinherited |
Get the wall clock time this session began
Definition at line 170 of file tls_session.h.
References m_start_time.
Referenced by Botan::TLS::Session::Session(), Session_Base(), and Botan::TLS::Session_Manager_SQL::store().
|
inlineinherited |
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 201 of file tls_session.h.
References m_encrypt_then_mac.
Referenced by Botan::TLS::Client_Hello_12::Client_Hello_12().
|
inlineinherited |
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 207 of file tls_session.h.
References m_extended_master_secret.
|
inlineinherited |
Get the negotiated protocol version of the TLS session
Definition at line 175 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::Channel_Impl::request_downgrade_for_resumption(), Botan::TLS::Session::Session(), Botan::TLS::Session::Session(), Session_Base(), and Botan::TLS::Callbacks::tls_should_persist_resumption_information().
|
inline |
Indicates that the session was resumed from a previous handshake state.
Definition at line 290 of file tls_session.h.
Referenced by Client_Impl_13.
|
friend |
Definition at line 305 of file tls_session.h.
References Client_Impl_12.
Referenced by Client_Impl_12.
|
friend |
Definition at line 306 of file tls_session.h.
References Client_Impl_13, Botan::TLS::Session_Base::peer_certs(), Botan::TLS::Session_Base::peer_raw_public_key(), Botan::TLS::Session_Base::server_info(), Botan::TLS::Session_Base::Session_Base(), Botan::TLS::Session_Base::side(), and was_resumption().
Referenced by Client_Impl_13.
|
friend |
Definition at line 303 of file tls_session.h.
References Server_Impl_12.
Referenced by Server_Impl_12.
|
friend |
Definition at line 304 of file tls_session.h.
References Server_Impl_13.
Referenced by Server_Impl_13.
|
protectedinherited |
Definition at line 233 of file tls_session.h.
Referenced by ciphersuite(), ciphersuite_code(), Botan::TLS::Session::DER_encode(), Botan::TLS::Session::Session(), and Session_Base().
|
protectedinherited |
Definition at line 234 of file tls_session.h.
Referenced by Botan::TLS::Session::DER_encode(), Botan::TLS::Session::Session(), Session_Base(), and side().
|
protectedinherited |
Definition at line 238 of file tls_session.h.
Referenced by Botan::TLS::Session::DER_encode(), Botan::TLS::Session::Session(), Session_Base(), and supports_encrypt_then_mac().
|
protectedinherited |
Definition at line 237 of file tls_session.h.
Referenced by Botan::TLS::Session::DER_encode(), Botan::TLS::Session::Session(), Session_Base(), and supports_extended_master_secret().
|
protectedinherited |
Definition at line 240 of file tls_session.h.
Referenced by Botan::TLS::Session::DER_encode(), peer_certs(), Botan::TLS::Session::Session(), and Session_Base().
|
protectedinherited |
Definition at line 241 of file tls_session.h.
Referenced by Botan::TLS::Session::DER_encode(), peer_raw_public_key(), Botan::TLS::Session::Session(), and Session_Base().
|
protectedinherited |
Definition at line 242 of file tls_session.h.
Referenced by Botan::TLS::Session::DER_encode(), server_info(), Botan::TLS::Session::Session(), and Session_Base().
|
protectedinherited |
Definition at line 235 of file tls_session.h.
Referenced by Botan::TLS::Session::DER_encode(), dtls_srtp_profile(), Botan::TLS::Session::Session(), and Session_Base().
|
protectedinherited |
Definition at line 230 of file tls_session.h.
Referenced by Botan::TLS::Session::DER_encode(), Botan::TLS::Session::Session(), Session_Base(), and start_time().
|
protectedinherited |
Definition at line 232 of file tls_session.h.
Referenced by Botan::TLS::Session::DER_encode(), Botan::TLS::Session::Session(), Botan::TLS::Session::Session(), Session_Base(), and version().