Botan  2.4.0
Crypto and TLS for C++11
Public Member Functions | List of all members
Botan::TLS::Handshake_State Class Reference

#include <tls_handshake_state.h>

Inherited by Botan::TLS::Server_Handshake_State.

Public Member Functions

Callbackscallbacks () const
 
void cert_req (Certificate_Req *cert_req)
 
const Certificate_Reqcert_req () const
 
std::pair< std::string, Signature_Formatchoose_sig_format (const Private_Key &key, std::string &hash_algo, std::string &sig_algo, bool for_client_auth, const Policy &policy) const
 
const Ciphersuiteciphersuite () const
 
void client_certs (Certificate *client_certs)
 
const Certificateclient_certs () const
 
void client_finished (Finished *client_finished)
 
const Finishedclient_finished () const
 
void client_hello (Client_Hello *client_hello)
 
const Client_Helloclient_hello () const
 
void client_kex (Client_Key_Exchange *client_kex)
 
const Client_Key_Exchangeclient_kex () const
 
void client_verify (Certificate_Verify *client_verify)
 
const Certificate_Verifyclient_verify () const
 
void compute_session_keys ()
 
void compute_session_keys (const secure_vector< uint8_t > &resume_master_secret)
 
void confirm_transition_to (Handshake_Type msg_type)
 
std::pair< Handshake_Type, std::vector< uint8_t > > get_next_handshake_msg ()
 
Handshake_IOhandshake_io ()
 
 Handshake_State (Handshake_IO *io, Callbacks &callbacks)
 
 Handshake_State (const Handshake_State &)=delete
 
Handshake_Hashhash ()
 
const Handshake_Hashhash () const
 
void hello_verify_request (const Hello_Verify_Request &hello_verify)
 
void new_session_ticket (New_Session_Ticket *new_session_ticket)
 
const New_Session_Ticketnew_session_ticket () const
 
void note_message (const Handshake_Message &msg)
 
Handshake_Stateoperator= (const Handshake_State &)=delete
 
std::pair< std::string, Signature_Formatparse_sig_format (const Public_Key &key, const std::string &hash_algo, const std::string &sig_algo, bool for_client_auth, const Policy &policy) const
 
KDFprotocol_specific_prf () const
 
bool received_handshake_msg (Handshake_Type msg_type) const
 
void server_cert_status (Certificate_Status *server_cert_status)
 
const Certificate_Statusserver_cert_status () const
 
void server_certs (Certificate *server_certs)
 
const Certificateserver_certs () const
 
void server_finished (Finished *server_finished)
 
const Finishedserver_finished () const
 
void server_hello (Server_Hello *server_hello)
 
const Server_Helloserver_hello () const
 
void server_hello_done (Server_Hello_Done *server_hello_done)
 
const Server_Hello_Doneserver_hello_done () const
 
void server_kex (Server_Key_Exchange *server_kex)
 
const Server_Key_Exchangeserver_kex () const
 
const Session_Keyssession_keys () const
 
std::vector< uint8_t > session_ticket () const
 
void set_expected_next (Handshake_Type msg_type)
 
void set_version (const Protocol_Version &version)
 
std::string srp_identifier () const
 
Protocol_Version version () const
 
virtual ~Handshake_State ()=default
 

Detailed Description

SSL/TLS Handshake State

Definition at line 49 of file tls_handshake_state.h.

Constructor & Destructor Documentation

◆ Handshake_State() [1/2]

Botan::TLS::Handshake_State::Handshake_State ( Handshake_IO io,
Callbacks callbacks 
)

Definition at line 182 of file tls_handshake_state.cpp.

182  :
183  m_callbacks(cb),
184  m_handshake_io(io),
185  m_version(m_handshake_io->initial_record_version())
186  {
187  }

◆ ~Handshake_State()

virtual Botan::TLS::Handshake_State::~Handshake_State ( )
virtualdefault

◆ Handshake_State() [2/2]

Botan::TLS::Handshake_State::Handshake_State ( const Handshake_State )
delete

Member Function Documentation

◆ callbacks()

Callbacks& Botan::TLS::Handshake_State::callbacks ( ) const
inline

◆ cert_req() [1/2]

void Botan::TLS::Handshake_State::cert_req ( Certificate_Req cert_req)

Definition at line 235 of file tls_handshake_state.cpp.

References note_message().

236  {
237  m_cert_req.reset(cert_req);
238  note_message(*m_cert_req);
239  }
const Certificate_Req * cert_req() const
void note_message(const Handshake_Message &msg)

◆ cert_req() [2/2]

const Certificate_Req* Botan::TLS::Handshake_State::cert_req ( ) const
inline

Definition at line 134 of file tls_handshake_state.h.

Referenced by choose_sig_format(), parse_sig_format(), and version().

135  { return m_cert_req.get(); }

◆ choose_sig_format()

std::pair< std::string, Signature_Format > Botan::TLS::Handshake_State::choose_sig_format ( const Private_Key key,
std::string &  hash_algo,
std::string &  sig_algo,
bool  for_client_auth,
const Policy policy 
) const

Definition at line 422 of file tls_handshake_state.cpp.

References Botan::Public_Key::algo_name(), Botan::TLS::Policy::allowed_signature_hash(), cert_req(), client_hello(), Botan::DER_SEQUENCE, Botan::TLS::Alert::HANDSHAKE_FAILURE, hash_algo, Botan::IEEE_1363, Botan::TLS::Client_Hello::supported_algos(), Botan::TLS::Certificate_Req::supported_algos(), and version().

Referenced by Botan::TLS::Certificate_Verify::Certificate_Verify(), handshake_io(), and Botan::TLS::Server_Key_Exchange::Server_Key_Exchange().

427  {
428  const std::string sig_algo = key.algo_name();
429 
430  std::vector<std::pair<std::string, std::string>> supported_algos =
431  (for_client_auth) ? cert_req()->supported_algos() : client_hello()->supported_algos();
432 
433  const std::string hash_algo = choose_hash(sig_algo,
434  supported_algos,
435  this->version(),
436  policy);
437 
438  if(this->version().supports_negotiable_signature_algorithms())
439  {
440  // We skip this check for v1.0 since you're stuck with SHA-1 regardless
441 
442  if(!policy.allowed_signature_hash(hash_algo))
443  {
444  throw TLS_Exception(Alert::HANDSHAKE_FAILURE,
445  "Policy refuses to accept signing with any hash supported by peer");
446  }
447 
448  hash_algo_out = hash_algo;
449  sig_algo_out = sig_algo;
450  }
451 
452  if(sig_algo == "RSA")
453  {
454  const std::string padding = "EMSA3(" + hash_algo + ")";
455 
456  return std::make_pair(padding, IEEE_1363);
457  }
458  else if(sig_algo == "DSA" || sig_algo == "ECDSA")
459  {
460  const std::string padding = "EMSA1(" + hash_algo + ")";
461 
462  return std::make_pair(padding, DER_SEQUENCE);
463  }
464 
465  throw Invalid_Argument(sig_algo + " is invalid/unknown for TLS signatures");
466  }
const Certificate_Req * cert_req() const
AlgorithmIdentifier hash_algo
Definition: x509_obj.cpp:22
std::vector< std::pair< std::string, std::string > > supported_algos() const
std::vector< std::pair< std::string, std::string > > supported_algos() const
Definition: tls_messages.h:414
Protocol_Version version() const
const Client_Hello * client_hello() const

◆ ciphersuite()

const Ciphersuite& Botan::TLS::Handshake_State::ciphersuite ( ) const
inline

◆ client_certs() [1/2]

void Botan::TLS::Handshake_State::client_certs ( Certificate client_certs)

Definition at line 247 of file tls_handshake_state.cpp.

References note_message().

248  {
249  m_client_certs.reset(client_certs);
250  note_message(*m_client_certs);
251  }
const Certificate * client_certs() const
void note_message(const Handshake_Message &msg)

◆ client_certs() [2/2]

const Certificate* Botan::TLS::Handshake_State::client_certs ( ) const
inline

Definition at line 140 of file tls_handshake_state.h.

Referenced by version().

141  { return m_client_certs.get(); }

◆ client_finished() [1/2]

void Botan::TLS::Handshake_State::client_finished ( Finished client_finished)

Definition at line 277 of file tls_handshake_state.cpp.

References note_message().

278  {
279  m_client_finished.reset(client_finished);
280  note_message(*m_client_finished);
281  }
const Finished * client_finished() const
void note_message(const Handshake_Message &msg)

◆ client_finished() [2/2]

const Finished* Botan::TLS::Handshake_State::client_finished ( ) const
inline

Definition at line 158 of file tls_handshake_state.h.

Referenced by version().

159  { return m_client_finished.get(); }

◆ client_hello() [1/2]

void Botan::TLS::Handshake_State::client_hello ( Client_Hello client_hello)

◆ client_hello() [2/2]

const Client_Hello* Botan::TLS::Handshake_State::client_hello ( ) const
inline

Definition at line 122 of file tls_handshake_state.h.

Referenced by choose_sig_format(), parse_sig_format(), session_ticket(), srp_identifier(), and version().

123  { return m_client_hello.get(); }

◆ client_kex() [1/2]

void Botan::TLS::Handshake_State::client_kex ( Client_Key_Exchange client_kex)

Definition at line 253 of file tls_handshake_state.cpp.

References note_message().

254  {
255  m_client_kex.reset(client_kex);
256  note_message(*m_client_kex);
257  }
const Client_Key_Exchange * client_kex() const
void note_message(const Handshake_Message &msg)

◆ client_kex() [2/2]

const Client_Key_Exchange* Botan::TLS::Handshake_State::client_kex ( ) const
inline

Definition at line 143 of file tls_handshake_state.h.

Referenced by compute_session_keys(), and version().

144  { return m_client_kex.get(); }

◆ client_verify() [1/2]

void Botan::TLS::Handshake_State::client_verify ( Certificate_Verify client_verify)

Definition at line 259 of file tls_handshake_state.cpp.

References note_message().

260  {
261  m_client_verify.reset(client_verify);
262  note_message(*m_client_verify);
263  }
const Certificate_Verify * client_verify() const
void note_message(const Handshake_Message &msg)

◆ client_verify() [2/2]

const Certificate_Verify* Botan::TLS::Handshake_State::client_verify ( ) const
inline

Definition at line 146 of file tls_handshake_state.h.

Referenced by version().

147  { return m_client_verify.get(); }

◆ compute_session_keys() [1/2]

void Botan::TLS::Handshake_State::compute_session_keys ( )

Definition at line 288 of file tls_handshake_state.cpp.

References client_kex().

Referenced by callbacks().

289  {
290  m_session_keys = Session_Keys(this, client_kex()->pre_master_secret(), false);
291  }
const Client_Key_Exchange * client_kex() const

◆ compute_session_keys() [2/2]

void Botan::TLS::Handshake_State::compute_session_keys ( const secure_vector< uint8_t > &  resume_master_secret)

Definition at line 293 of file tls_handshake_state.cpp.

294  {
295  m_session_keys = Session_Keys(this, resume_master_secret, true);
296  }
secure_vector< uint8_t > resume_master_secret
Definition: tls_client.cpp:41

◆ confirm_transition_to()

void Botan::TLS::Handshake_State::confirm_transition_to ( Handshake_Type  msg_type)

Confirm that we were expecting this message type

Parameters
msg_typethe message type

Definition at line 298 of file tls_handshake_state.cpp.

References Botan::ASN1::to_string().

Referenced by handshake_io().

299  {
300  const uint32_t mask = bitmask_for_handshake_type(handshake_msg);
301 
302  m_hand_received_mask |= mask;
303 
304  const bool ok = (m_hand_expecting_mask & mask) != 0; // overlap?
305 
306  if(!ok)
307  throw Unexpected_Message("Unexpected state transition in handshake, got type " +
308  std::to_string(handshake_msg) +
309  " expected " + handshake_mask_to_string(m_hand_expecting_mask) +
310  " received " + handshake_mask_to_string(m_hand_received_mask));
311 
312  /* We don't know what to expect next, so force a call to
313  set_expected_next; if it doesn't happen, the next transition
314  check will always fail which is what we want.
315  */
316  m_hand_expecting_mask = 0;
317  }
std::string to_string(const BER_Object &obj)
Definition: asn1_obj.cpp:108

◆ get_next_handshake_msg()

std::pair< Handshake_Type, std::vector< uint8_t > > Botan::TLS::Handshake_State::get_next_handshake_msg ( )

Definition at line 332 of file tls_handshake_state.cpp.

References Botan::TLS::HANDSHAKE_CCS.

Referenced by handshake_io().

333  {
334  const bool expecting_ccs =
335  (bitmask_for_handshake_type(HANDSHAKE_CCS) & m_hand_expecting_mask) != 0;
336 
337  return m_handshake_io->get_next_record(expecting_ccs);
338  }

◆ handshake_io()

Handshake_IO& Botan::TLS::Handshake_State::handshake_io ( )
inline

◆ hash() [1/2]

Handshake_Hash& Botan::TLS::Handshake_State::hash ( )
inline

◆ hash() [2/2]

const Handshake_Hash& Botan::TLS::Handshake_State::hash ( ) const
inline

Definition at line 173 of file tls_handshake_state.h.

References note_message().

173 { return m_handshake_hash; }

◆ hello_verify_request()

void Botan::TLS::Handshake_State::hello_verify_request ( const Hello_Verify_Request hello_verify)

Definition at line 194 of file tls_handshake_state.cpp.

References handshake_io(), hash(), note_message(), Botan::TLS::Handshake_Hash::reset(), and Botan::TLS::Handshake_Hash::update().

Referenced by version().

195  {
196  note_message(hello_verify);
197 
198  m_client_hello->update_hello_cookie(hello_verify);
199  hash().reset();
200  hash().update(handshake_io().send(*m_client_hello));
201  note_message(*m_client_hello);
202  }
void update(const uint8_t in[], size_t length)
void note_message(const Handshake_Message &msg)

◆ new_session_ticket() [1/2]

void Botan::TLS::Handshake_State::new_session_ticket ( New_Session_Ticket new_session_ticket)

Definition at line 265 of file tls_handshake_state.cpp.

References note_message().

266  {
267  m_new_session_ticket.reset(new_session_ticket);
268  note_message(*m_new_session_ticket);
269  }
void note_message(const Handshake_Message &msg)
const New_Session_Ticket * new_session_ticket() const

◆ new_session_ticket() [2/2]

const New_Session_Ticket* Botan::TLS::Handshake_State::new_session_ticket ( ) const
inline

Definition at line 152 of file tls_handshake_state.h.

Referenced by session_ticket(), and version().

153  { return m_new_session_ticket.get(); }

◆ note_message()

void Botan::TLS::Handshake_State::note_message ( const Handshake_Message msg)

◆ operator=()

Handshake_State& Botan::TLS::Handshake_State::operator= ( const Handshake_State )
delete

◆ parse_sig_format()

std::pair< std::string, Signature_Format > Botan::TLS::Handshake_State::parse_sig_format ( const Public_Key key,
const std::string &  hash_algo,
const std::string &  sig_algo,
bool  for_client_auth,
const Policy policy 
) const

Definition at line 489 of file tls_handshake_state.cpp.

References Botan::Public_Key::algo_name(), Botan::TLS::Policy::allowed_signature_method(), cert_req(), client_hello(), Botan::DER_SEQUENCE, Botan::TLS::Alert::HANDSHAKE_FAILURE, hash_algo, Botan::IEEE_1363, Botan::TLS::Client_Hello::supported_algos(), Botan::TLS::Certificate_Req::supported_algos(), and version().

Referenced by handshake_io(), Botan::TLS::Certificate_Verify::verify(), and Botan::TLS::Server_Key_Exchange::verify().

494  {
495  const std::string key_type = key.algo_name();
496 
497  if(!policy.allowed_signature_method(key_type))
498  {
499  throw TLS_Exception(Alert::HANDSHAKE_FAILURE,
500  "Rejecting " + key_type + " signature");
501  }
502 
503  std::string hash_algo;
504 
505  if(this->version().supports_negotiable_signature_algorithms())
506  {
507  if(input_sig_algo != key_type)
508  throw Decoding_Error("Counterparty sent inconsistent key and sig types");
509 
510  if(input_hash_algo == "")
511  throw Decoding_Error("Counterparty did not send hash/sig IDS");
512 
513  hash_algo = input_hash_algo;
514 
515  if(for_client_auth && !cert_req())
516  {
517  throw TLS_Exception(Alert::HANDSHAKE_FAILURE,
518  "No certificate verify set");
519  }
520 
521  /*
522  Confirm the signature type we just received against the
523  supported_algos list that we sent; it better be there.
524  */
525 
526  const auto supported_algos =
527  for_client_auth ? cert_req()->supported_algos() :
529 
530  if(!supported_algos_include(supported_algos, key_type, hash_algo))
531  {
532  throw TLS_Exception(Alert::HANDSHAKE_FAILURE,
533  "TLS signature extension did not allow for " +
534  key_type + "/" + hash_algo + " signature");
535  }
536  }
537  else
538  {
539  if(input_hash_algo != "" || input_sig_algo != "")
540  throw Decoding_Error("Counterparty sent hash/sig IDs with old version");
541 
542  if(key_type == "RSA")
543  {
544  hash_algo = "Parallel(MD5,SHA-160)";
545  }
546  else if(key_type == "DSA" || key_type == "ECDSA")
547  {
548  hash_algo = "SHA-1";
549  }
550  else
551  {
552  throw Invalid_Argument(key_type + " is invalid/unknown for TLS signatures");
553  }
554 
555  /*
556  There is no check on the acceptability of a v1.0/v1.1 hash type,
557  since it's implicit with use of the protocol
558  */
559  }
560 
561  if(key_type == "RSA")
562  {
563  const std::string padding = "EMSA3(" + hash_algo + ")";
564  return std::make_pair(padding, IEEE_1363);
565  }
566  else if(key_type == "DSA" || key_type == "ECDSA")
567  {
568  const std::string padding = "EMSA1(" + hash_algo + ")";
569  return std::make_pair(padding, DER_SEQUENCE);
570  }
571 
572  throw Invalid_Argument(key_type + " is invalid/unknown for TLS signatures");
573  }
const Certificate_Req * cert_req() const
AlgorithmIdentifier hash_algo
Definition: x509_obj.cpp:22
std::vector< std::pair< std::string, std::string > > supported_algos() const
std::vector< std::pair< std::string, std::string > > supported_algos() const
Definition: tls_messages.h:414
Protocol_Version version() const
const Client_Hello * client_hello() const

◆ protocol_specific_prf()

KDF * Botan::TLS::Handshake_State::protocol_specific_prf ( ) const

Definition at line 360 of file tls_handshake_state.cpp.

References Botan::TLS::Policy::allowed_signature_hashes(), ciphersuite(), Botan::get_kdf(), hash(), Botan::TLS::Ciphersuite::prf_algo(), Botan::TLS::Protocol_Version::supports_negotiable_signature_algorithms(), and version().

Referenced by handshake_io(), and Botan::TLS::Session_Keys::Session_Keys().

361  {
362  if(version().supports_ciphersuite_specific_prf())
363  {
364  const std::string prf_algo = ciphersuite().prf_algo();
365 
366  if(prf_algo == "MD5" || prf_algo == "SHA-1")
367  return get_kdf("TLS-12-PRF(SHA-256)");
368 
369  return get_kdf("TLS-12-PRF(" + prf_algo + ")");
370  }
371 
372  // Old PRF used in TLS v1.0, v1.1 and DTLS v1.0
373  return get_kdf("TLS-PRF");
374  }
std::string prf_algo() const
const Ciphersuite & ciphersuite() const
KDF * get_kdf(const std::string &algo_spec)
Definition: kdf.cpp:236
Protocol_Version version() const

◆ received_handshake_msg()

bool Botan::TLS::Handshake_State::received_handshake_msg ( Handshake_Type  msg_type) const

Return true iff we have received a particular message already

Parameters
msg_typethe message type

Definition at line 324 of file tls_handshake_state.cpp.

Referenced by handshake_io().

325  {
326  const uint32_t mask = bitmask_for_handshake_type(handshake_msg);
327 
328  return (m_hand_received_mask & mask) != 0;
329  }

◆ server_cert_status() [1/2]

void Botan::TLS::Handshake_State::server_cert_status ( Certificate_Status server_cert_status)

Definition at line 223 of file tls_handshake_state.cpp.

References note_message().

224  {
225  m_server_cert_status.reset(server_cert_status);
226  note_message(*m_server_cert_status);
227  }
const Certificate_Status * server_cert_status() const
void note_message(const Handshake_Message &msg)

◆ server_cert_status() [2/2]

const Certificate_Status* Botan::TLS::Handshake_State::server_cert_status ( ) const
inline

Definition at line 149 of file tls_handshake_state.h.

Referenced by version().

150  { return m_server_cert_status.get(); }

◆ server_certs() [1/2]

void Botan::TLS::Handshake_State::server_certs ( Certificate server_certs)

Definition at line 217 of file tls_handshake_state.cpp.

References note_message().

Referenced by Botan::TLS::Client::Client(), and Botan::TLS::Client_Key_Exchange::Client_Key_Exchange().

218  {
219  m_server_certs.reset(server_certs);
220  note_message(*m_server_certs);
221  }
const Certificate * server_certs() const
void note_message(const Handshake_Message &msg)

◆ server_certs() [2/2]

const Certificate* Botan::TLS::Handshake_State::server_certs ( ) const
inline

Definition at line 128 of file tls_handshake_state.h.

Referenced by version().

129  { return m_server_certs.get(); }

◆ server_finished() [1/2]

void Botan::TLS::Handshake_State::server_finished ( Finished server_finished)

Definition at line 271 of file tls_handshake_state.cpp.

References note_message().

272  {
273  m_server_finished.reset(server_finished);
274  note_message(*m_server_finished);
275  }
const Finished * server_finished() const
void note_message(const Handshake_Message &msg)

◆ server_finished() [2/2]

const Finished* Botan::TLS::Handshake_State::server_finished ( ) const
inline

Definition at line 155 of file tls_handshake_state.h.

Referenced by version().

156  { return m_server_finished.get(); }

◆ server_hello() [1/2]

void Botan::TLS::Handshake_State::server_hello ( Server_Hello server_hello)

Definition at line 210 of file tls_handshake_state.cpp.

References Botan::TLS::Ciphersuite::by_id(), and note_message().

Referenced by Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), Botan::TLS::Server_Key_Exchange::Server_Key_Exchange(), Botan::TLS::Session_Keys::Session_Keys(), and Botan::TLS::Server_Key_Exchange::verify().

211  {
212  m_server_hello.reset(server_hello);
213  m_ciphersuite = Ciphersuite::by_id(m_server_hello->ciphersuite());
214  note_message(*m_server_hello);
215  }
const Server_Hello * server_hello() const
void note_message(const Handshake_Message &msg)
static Ciphersuite by_id(uint16_t suite)

◆ server_hello() [2/2]

const Server_Hello* Botan::TLS::Handshake_State::server_hello ( ) const
inline

Definition at line 125 of file tls_handshake_state.h.

Referenced by version().

126  { return m_server_hello.get(); }

◆ server_hello_done() [1/2]

void Botan::TLS::Handshake_State::server_hello_done ( Server_Hello_Done server_hello_done)

Definition at line 241 of file tls_handshake_state.cpp.

References note_message().

242  {
243  m_server_hello_done.reset(server_hello_done);
244  note_message(*m_server_hello_done);
245  }
void note_message(const Handshake_Message &msg)
const Server_Hello_Done * server_hello_done() const

◆ server_hello_done() [2/2]

const Server_Hello_Done* Botan::TLS::Handshake_State::server_hello_done ( ) const
inline

Definition at line 137 of file tls_handshake_state.h.

Referenced by version().

138  { return m_server_hello_done.get(); }

◆ server_kex() [1/2]

void Botan::TLS::Handshake_State::server_kex ( Server_Key_Exchange server_kex)

Definition at line 229 of file tls_handshake_state.cpp.

References note_message().

Referenced by Botan::TLS::Client_Key_Exchange::Client_Key_Exchange().

230  {
231  m_server_kex.reset(server_kex);
232  note_message(*m_server_kex);
233  }
const Server_Key_Exchange * server_kex() const
void note_message(const Handshake_Message &msg)

◆ server_kex() [2/2]

const Server_Key_Exchange* Botan::TLS::Handshake_State::server_kex ( ) const
inline

Definition at line 131 of file tls_handshake_state.h.

Referenced by version().

132  { return m_server_kex.get(); }

◆ session_keys()

const Session_Keys& Botan::TLS::Handshake_State::session_keys ( ) const
inline

Definition at line 163 of file tls_handshake_state.h.

163 { return m_session_keys; }

◆ session_ticket()

std::vector< uint8_t > Botan::TLS::Handshake_State::session_ticket ( ) const

Definition at line 352 of file tls_handshake_state.cpp.

References client_hello(), new_session_ticket(), Botan::TLS::Client_Hello::session_ticket(), and Botan::TLS::New_Session_Ticket::ticket().

Referenced by handshake_io().

353  {
354  if(new_session_ticket() && !new_session_ticket()->ticket().empty())
355  return new_session_ticket()->ticket();
356 
357  return client_hello()->session_ticket();
358  }
std::vector< uint8_t > session_ticket() const
const std::vector< uint8_t > & ticket() const
Definition: tls_messages.h:598
const New_Session_Ticket * new_session_ticket() const
const Client_Hello * client_hello() const

◆ set_expected_next()

void Botan::TLS::Handshake_State::set_expected_next ( Handshake_Type  msg_type)

Record that we are expecting a particular message type next

Parameters
msg_typethe message type

Definition at line 319 of file tls_handshake_state.cpp.

Referenced by handshake_io().

320  {
321  m_hand_expecting_mask |= bitmask_for_handshake_type(handshake_msg);
322  }

◆ set_version()

void Botan::TLS::Handshake_State::set_version ( const Protocol_Version version)

Definition at line 283 of file tls_handshake_state.cpp.

References version().

Referenced by version().

284  {
285  m_version = version;
286  }
Protocol_Version version() const

◆ srp_identifier()

std::string Botan::TLS::Handshake_State::srp_identifier ( ) const

Definition at line 340 of file tls_handshake_state.cpp.

References ciphersuite(), and client_hello().

Referenced by handshake_io().

341  {
342 #if defined(BOTAN_HAS_SRP6)
343  // Authenticated via the successful key exchange
344  if(ciphersuite().valid() && ciphersuite().kex_algo() == "SRP_SHA")
345  return client_hello()->srp_identifier();
346 #endif
347 
348  return "";
349  }
const Ciphersuite & ciphersuite() const
const Client_Hello * client_hello() const

◆ version()

Protocol_Version Botan::TLS::Handshake_State::version ( ) const
inline

The documentation for this class was generated from the following files: