Botan 3.10.0
Crypto and TLS for C&
Botan::TLS::Client_Hello_12 Class Referencefinal

#include <tls_messages.h>

Inheritance diagram for Botan::TLS::Client_Hello_12:
Botan::TLS::Client_Hello Botan::TLS::Handshake_Message

Classes

class  Settings

Public Member Functions

std::vector< Signature_Schemecertificate_signature_schemes () const
const std::vector< uint16_t > & ciphersuites () const
 Client_Hello_12 (const std::vector< uint8_t > &buf)
 Client_Hello_12 (Handshake_IO &io, Handshake_Hash &hash, const Policy &policy, Callbacks &cb, RandomNumberGenerator &rng, const std::vector< uint8_t > &reneg_info, const Session_with_Handle &session_and_handle, const std::vector< std::string > &next_protocols)
 Client_Hello_12 (Handshake_IO &io, Handshake_Hash &hash, const Policy &policy, Callbacks &cb, RandomNumberGenerator &rng, const std::vector< uint8_t > &reneg_info, const Settings &client_settings, const std::vector< std::string > &next_protocols)
const std::vector< uint8_t > & compression_methods () const
const std::vector< uint8_t > & cookie () const
std::vector< uint8_t > cookie_input_data () const
std::set< Extension_Codeextension_types () const
const Extensionsextensions () const
Protocol_Version legacy_version () const
std::vector< std::string > next_protocols () const
bool offered_suite (uint16_t ciphersuite) const
bool prefers_compressed_ec_points () const
const std::vector< uint8_t > & random () const
std::vector< uint8_t > renegotiation_info () const
bool secure_renegotiation () const
bool sent_signature_algorithms () const
std::vector< uint8_t > serialize () const override
std::optional< Session_Handlesession_handle () const
const Session_IDsession_id () const
Session_Ticket session_ticket () const
std::vector< Signature_Schemesignature_schemes () const
std::string sni_hostname () const
std::vector< uint16_t > srtp_profiles () const
std::vector< Group_Paramssupported_dh_groups () const
std::vector< Group_Paramssupported_ecc_curves () const
std::vector< Protocol_Versionsupported_versions () const
bool supports_alpn () const
bool supports_cert_status_message () const
bool supports_encrypt_then_mac () const
bool supports_extended_master_secret () const
bool supports_session_ticket () const
Handshake_Type type () const override
std::string type_string () const
void update_hello_cookie (const Hello_Verify_Request &hello_verify)
virtual Handshake_Type wire_type () const

Protected Member Functions

 Client_Hello_12 (std::unique_ptr< Client_Hello_Internal > data)

Protected Attributes

std::unique_ptr< Client_Hello_Internal > m_data

Friends

class Client_Hello_13

Detailed Description

Definition at line 147 of file tls_messages.h.

Constructor & Destructor Documentation

◆ Client_Hello_12() [1/4]

Botan::TLS::Client_Hello_12::Client_Hello_12 ( const std::vector< uint8_t > & buf)
explicit

Definition at line 473 of file msg_client_hello.cpp.

473 :
474 Client_Hello_12(std::make_unique<Client_Hello_Internal>(buf)) {}
Client_Hello_12(const std::vector< uint8_t > &buf)

References Client_Hello_12().

Referenced by Client_Hello_12(), and Client_Hello_13.

◆ Client_Hello_12() [2/4]

Botan::TLS::Client_Hello_12::Client_Hello_12 ( Handshake_IO & io,
Handshake_Hash & hash,
const Policy & policy,
Callbacks & cb,
RandomNumberGenerator & rng,
const std::vector< uint8_t > & reneg_info,
const Settings & client_settings,
const std::vector< std::string > & next_protocols )

Definition at line 479 of file msg_client_hello.cpp.

486 {
487 m_data->m_legacy_version = client_settings.protocol_version();
488 m_data->m_random = make_hello_random(rng, cb, policy);
489 m_data->m_suites = policy.ciphersuite_list(client_settings.protocol_version());
490
491 if(!policy.acceptable_protocol_version(m_data->legacy_version())) {
492 throw Internal_Error("Offering " + m_data->legacy_version().to_string() +
493 " but our own policy does not accept it");
494 }
495
496 /*
497 * Place all empty extensions in front to avoid a bug in some systems
498 * which reject hellos when the last extension in the list is empty.
499 */
500
501 // NOLINTBEGIN(*-owning-memory)
502
503 // EMS must always be used with TLS 1.2, regardless of the policy used.
504
505 m_data->extensions().add(new Extended_Master_Secret);
506
507 if(policy.negotiate_encrypt_then_mac()) {
508 m_data->extensions().add(new Encrypt_then_MAC);
509 }
510
511 m_data->extensions().add(new Session_Ticket_Extension());
512
513 m_data->extensions().add(new Renegotiation_Extension(reneg_info));
514
515 m_data->extensions().add(new Supported_Versions(m_data->legacy_version(), policy));
516
517 if(hostname_acceptable_for_sni(client_settings.hostname())) {
518 m_data->extensions().add(new Server_Name_Indicator(client_settings.hostname()));
519 }
520
521 if(policy.support_cert_status_message()) {
522 m_data->extensions().add(new Certificate_Status_Request({}, {}));
523 }
524
525 add_tls12_supported_groups_extensions(policy);
526
527 m_data->extensions().add(new Signature_Algorithms(policy.acceptable_signature_schemes()));
528 if(auto cert_signing_prefs = policy.acceptable_certificate_signature_schemes()) {
529 // RFC 8446 4.2.3
530 // TLS 1.2 implementations SHOULD also process this extension.
531 // Implementations which have the same policy in both cases MAY omit
532 // the "signature_algorithms_cert" extension.
533 m_data->extensions().add(new Signature_Algorithms_Cert(std::move(cert_signing_prefs.value())));
534 }
535
536 if(reneg_info.empty() && !next_protocols.empty()) {
537 m_data->extensions().add(new Application_Layer_Protocol_Notification(next_protocols));
538 }
539
540 if(m_data->legacy_version().is_datagram_protocol()) {
541 m_data->extensions().add(new SRTP_Protection_Profiles(policy.srtp_profiles()));
542 }
543
544 // NOLINTEND(*-owning-memory)
545
546 cb.tls_modify_extensions(m_data->extensions(), Connection_Side::Client, type());
547
548 hash.update(io.send(*this));
549}
std::unique_ptr< Client_Hello_Internal > m_data
std::vector< std::string > next_protocols() const
virtual Handshake_Type type() const =0
std::vector< uint8_t > make_hello_random(RandomNumberGenerator &rng, Callbacks &cb, const Policy &policy)

References Botan::TLS::Policy::acceptable_certificate_signature_schemes(), Botan::TLS::Policy::acceptable_protocol_version(), Botan::TLS::Policy::acceptable_signature_schemes(), Botan::TLS::Policy::ciphersuite_list(), Botan::TLS::Client, Botan::TLS::Client_Hello_12::Settings::hostname(), Botan::TLS::Client_Hello::m_data, Botan::TLS::make_hello_random(), Botan::TLS::Policy::negotiate_encrypt_then_mac(), Botan::TLS::Client_Hello::next_protocols(), Botan::TLS::Client_Hello_12::Settings::protocol_version(), Botan::TLS::Handshake_IO::send(), Botan::TLS::Policy::srtp_profiles(), Botan::TLS::Policy::support_cert_status_message(), Botan::TLS::Callbacks::tls_modify_extensions(), Botan::TLS::Client_Hello::type(), and Botan::TLS::Handshake_Hash::update().

◆ Client_Hello_12() [3/4]

Botan::TLS::Client_Hello_12::Client_Hello_12 ( Handshake_IO & io,
Handshake_Hash & hash,
const Policy & policy,
Callbacks & cb,
RandomNumberGenerator & rng,
const std::vector< uint8_t > & reneg_info,
const Session_with_Handle & session_and_handle,
const std::vector< std::string > & next_protocols )

Definition at line 554 of file msg_client_hello.cpp.

561 {
562 m_data->m_legacy_version = session.session.version();
563 m_data->m_random = make_hello_random(rng, cb, policy);
564
565 // RFC 5077 3.4
566 // When presenting a ticket, the client MAY generate and include a
567 // Session ID in the TLS ClientHello. [...] If a ticket is presented by
568 // the client, the server MUST NOT attempt to use the Session ID in the
569 // ClientHello for stateful session resumption.
570 m_data->m_session_id = session.handle.id().value_or(Session_ID(make_hello_random(rng, cb, policy)));
571 m_data->m_suites = policy.ciphersuite_list(m_data->legacy_version());
572
573 if(!policy.acceptable_protocol_version(session.session.version())) {
574 throw Internal_Error("Offering " + m_data->legacy_version().to_string() +
575 " but our own policy does not accept it");
576 }
577
578 if(!value_exists(m_data->ciphersuites(), session.session.ciphersuite_code())) {
579 m_data->m_suites.push_back(session.session.ciphersuite_code());
580 }
581
582 /*
583 * As EMS must always be used with TLS 1.2, add it even if it wasn't used
584 * in the original session. If the server understands it and follows the
585 * RFC it should reject our resume attempt and upgrade us to a new session
586 * with the EMS protection.
587 */
588 // NOLINTBEGIN(*-owning-memory)
589 m_data->extensions().add(new Extended_Master_Secret);
590
591 if(session.session.supports_encrypt_then_mac()) {
592 m_data->extensions().add(new Encrypt_then_MAC);
593 }
594
595 if(session.handle.is_ticket()) {
596 m_data->extensions().add(new Session_Ticket_Extension(session.handle.ticket().value()));
597 }
598
599 m_data->extensions().add(new Renegotiation_Extension(reneg_info));
600
601 const std::string hostname = session.session.server_info().hostname();
602
603 if(hostname_acceptable_for_sni(hostname)) {
604 m_data->extensions().add(new Server_Name_Indicator(hostname));
605 }
606
607 if(policy.support_cert_status_message()) {
608 m_data->extensions().add(new Certificate_Status_Request({}, {}));
609 }
610
611 add_tls12_supported_groups_extensions(policy);
612
613 m_data->extensions().add(new Signature_Algorithms(policy.acceptable_signature_schemes()));
614 if(auto cert_signing_prefs = policy.acceptable_certificate_signature_schemes()) {
615 // RFC 8446 4.2.3
616 // TLS 1.2 implementations SHOULD also process this extension.
617 // Implementations which have the same policy in both cases MAY omit
618 // the "signature_algorithms_cert" extension.
619 m_data->extensions().add(new Signature_Algorithms_Cert(std::move(cert_signing_prefs.value())));
620 }
621
622 if(reneg_info.empty() && !next_protocols.empty()) {
623 m_data->extensions().add(new Application_Layer_Protocol_Notification(next_protocols));
624 }
625 // NOLINTEND(*-owning-memory)
626
627 cb.tls_modify_extensions(m_data->extensions(), Connection_Side::Client, type());
628
629 hash.update(io.send(*this));
630}
Strong< std::vector< uint8_t >, struct Session_ID_ > Session_ID
holds a TLS 1.2 session ID for stateful resumption
Definition tls_session.h:31
bool value_exists(const std::vector< T > &vec, const V &val)
Definition stl_util.h:51

References Botan::TLS::Policy::acceptable_certificate_signature_schemes(), Botan::TLS::Policy::acceptable_protocol_version(), Botan::TLS::Policy::acceptable_signature_schemes(), Botan::TLS::Session_Base::ciphersuite_code(), Botan::TLS::Policy::ciphersuite_list(), Botan::TLS::Client, Botan::TLS::Session_with_Handle::handle, Botan::TLS::Server_Information::hostname(), Botan::TLS::Session_Handle::id(), Botan::TLS::Session_Handle::is_ticket(), Botan::TLS::Client_Hello::m_data, Botan::TLS::make_hello_random(), Botan::TLS::Client_Hello::next_protocols(), Botan::TLS::Handshake_IO::send(), Botan::TLS::Session_Base::server_info(), Botan::TLS::Session_with_Handle::session, Botan::TLS::Policy::support_cert_status_message(), Botan::TLS::Session_Base::supports_encrypt_then_mac(), Botan::TLS::Session_Handle::ticket(), Botan::TLS::Callbacks::tls_modify_extensions(), Botan::TLS::Client_Hello::type(), Botan::TLS::Handshake_Hash::update(), Botan::value_exists(), and Botan::TLS::Session_Base::version().

◆ Client_Hello_12() [4/4]

Botan::TLS::Client_Hello_12::Client_Hello_12 ( std::unique_ptr< Client_Hello_Internal > data)
explicitprotected

Definition at line 434 of file msg_client_hello.cpp.

434 : Client_Hello(std::move(data)) {
435 const uint16_t TLS_EMPTY_RENEGOTIATION_INFO_SCSV = 0x00FF;
436
437 if(offered_suite(static_cast<uint16_t>(TLS_EMPTY_RENEGOTIATION_INFO_SCSV))) {
438 if(Renegotiation_Extension* reneg = m_data->extensions().get<Renegotiation_Extension>()) {
439 if(!reneg->renegotiation_info().empty()) {
440 throw TLS_Exception(Alert::HandshakeFailure, "Client sent renegotiation SCSV and non-empty extension");
441 }
442 } else {
443 // add fake extension
444 m_data->extensions().add(new Renegotiation_Extension()); // NOLINT(*-owning-memory)
445 }
446 }
447}
bool offered_suite(uint16_t ciphersuite) const

References Botan::TLS::Client_Hello::Client_Hello(), Botan::TLS::Client_Hello::m_data, and Botan::TLS::Client_Hello::offered_suite().

Member Function Documentation

◆ certificate_signature_schemes()

std::vector< Signature_Scheme > Botan::TLS::Client_Hello::certificate_signature_schemes ( ) const
inherited

Definition at line 268 of file msg_client_hello.cpp.

268 {
269 // RFC 8446 4.2.3
270 // If no "signature_algorithms_cert" extension is present, then the
271 // "signature_algorithms" extension also applies to signatures appearing
272 // in certificates.
273 if(Signature_Algorithms_Cert* sigs = m_data->extensions().get<Signature_Algorithms_Cert>()) {
274 return sigs->supported_schemes();
275 } else {
276 return signature_schemes();
277 }
278}
std::vector< Signature_Scheme > signature_schemes() const

References m_data, and signature_schemes().

Referenced by Botan::TLS::Certificate_13::Certificate_13(), and ~Client_Hello().

◆ ciphersuites()

const std::vector< uint16_t > & Botan::TLS::Client_Hello::ciphersuites ( ) const
inherited

Definition at line 198 of file msg_client_hello.cpp.

198 {
199 return m_data->ciphersuites();
200}

References m_data.

Referenced by ~Client_Hello().

◆ compression_methods()

const std::vector< uint8_t > & Botan::TLS::Client_Hello::compression_methods ( ) const

Definition at line 141 of file msg_client_hello.cpp.

194 {
195 return m_data->comp_methods();
196}

◆ cookie()

const std::vector< uint8_t > & Botan::TLS::Client_Hello::cookie ( ) const
inherited

Definition at line 385 of file msg_client_hello.cpp.

385 {
386 return m_data->hello_cookie();
387}

References m_data.

Referenced by ~Client_Hello().

◆ cookie_input_data()

std::vector< uint8_t > Botan::TLS::Client_Hello::cookie_input_data ( ) const
inherited

Definition at line 247 of file msg_client_hello.cpp.

247 {
248 BOTAN_STATE_CHECK(!m_data->hello_cookie_input_bits().empty());
249
250 return m_data->hello_cookie_input_bits();
251}
#define BOTAN_STATE_CHECK(expr)
Definition assert.h:49

References BOTAN_STATE_CHECK, and m_data.

Referenced by ~Client_Hello().

◆ extension_types()

std::set< Extension_Code > Botan::TLS::Client_Hello::extension_types ( ) const
inherited

Definition at line 202 of file msg_client_hello.cpp.

202 {
203 return m_data->extensions().extension_types();
204}

References m_data.

Referenced by Botan::TLS::Server_Hello_12::Server_Hello_12(), Botan::TLS::Client_Hello_13::validate_updates(), and ~Client_Hello().

◆ extensions()

◆ legacy_version()

Protocol_Version Botan::TLS::Client_Hello::legacy_version ( ) const
inherited

Return the version indicated in the ClientHello. This may differ from the version indicated in the supported_versions extension.

See RFC 8446 4.1.2: TLS 1.3, the client indicates its version preferences in the "supported_versions" extension (Section 4.2.1) and the legacy_version field MUST be set to 0x0303, which is the version number for TLS 1.2.

Definition at line 182 of file msg_client_hello.cpp.

182 {
183 return m_data->legacy_version();
184}

References m_data.

Referenced by ~Client_Hello().

◆ next_protocols()

std::vector< std::string > Botan::TLS::Client_Hello::next_protocols ( ) const
inherited

Definition at line 371 of file msg_client_hello.cpp.

371 {
372 if(auto* alpn = m_data->extensions().get<Application_Layer_Protocol_Notification>()) {
373 return alpn->protocols();
374 }
375 return {};
376}

References m_data.

Referenced by Botan::TLS::Client_Hello_12::Client_Hello_12(), Botan::TLS::Client_Hello_12::Client_Hello_12(), Botan::TLS::Client_Hello_13::Client_Hello_13(), and ~Client_Hello().

◆ offered_suite()

bool Botan::TLS::Client_Hello::offered_suite ( uint16_t ciphersuite) const
inherited

Definition at line 256 of file msg_client_hello.cpp.

256 {
257 return std::find(m_data->ciphersuites().cbegin(), m_data->ciphersuites().cend(), ciphersuite) !=
258 m_data->ciphersuites().cend();
259}

References m_data.

Referenced by Botan::TLS::Client_Hello_12::Client_Hello_12(), and ~Client_Hello().

◆ prefers_compressed_ec_points()

bool Botan::TLS::Client_Hello_12::prefers_compressed_ec_points ( ) const

Definition at line 294 of file msg_client_hello.cpp.

294 {
295 if(Supported_Point_Formats* ecc_formats = m_data->extensions().get<Supported_Point_Formats>()) {
296 return ecc_formats->prefers_compressed();
297 }
298 return false;
299}

References Botan::TLS::Client_Hello::m_data.

Referenced by Client_Hello_13.

◆ random()

const std::vector< uint8_t > & Botan::TLS::Client_Hello::random ( ) const

Definition at line 99 of file msg_client_hello.cpp.

186 {
187 return m_data->random();
188}

References Botan::TLS::Client_Hello::extensions(), and Botan::TLS::Protocol_Version::is_datagram_protocol().

◆ renegotiation_info()

std::vector< uint8_t > Botan::TLS::Client_Hello_12::renegotiation_info ( ) const

Definition at line 312 of file msg_client_hello.cpp.

312 {
313 if(Renegotiation_Extension* reneg = m_data->extensions().get<Renegotiation_Extension>()) {
314 return reneg->renegotiation_info();
315 }
316 return {};
317}

References Botan::TLS::Client_Hello::m_data.

Referenced by Client_Hello_13, and Botan::TLS::Channel_Impl_12::secure_renegotiation_check().

◆ secure_renegotiation()

bool Botan::TLS::Client_Hello_12::secure_renegotiation ( ) const

Definition at line 308 of file msg_client_hello.cpp.

308 {
309 return m_data->extensions().has<Renegotiation_Extension>();
310}

References Botan::TLS::Client_Hello::m_data.

Referenced by Client_Hello_13, Botan::TLS::Channel_Impl_12::secure_renegotiation_check(), and Botan::TLS::Server_Hello_12::Server_Hello_12().

◆ sent_signature_algorithms()

bool Botan::TLS::Client_Hello::sent_signature_algorithms ( ) const
inherited

Definition at line 367 of file msg_client_hello.cpp.

367 {
368 return m_data->extensions().has<Signature_Algorithms>();
369}

References m_data.

Referenced by ~Client_Hello().

◆ serialize()

std::vector< uint8_t > Botan::TLS::Client_Hello::serialize ( ) const
overridevirtualinherited
Returns
DER representation of this message

Implements Botan::TLS::Handshake_Message.

Definition at line 219 of file msg_client_hello.cpp.

219 {
220 std::vector<uint8_t> buf;
221 buf.reserve(1024); // working around GCC warning
222
223 buf.push_back(m_data->legacy_version().major_version());
224 buf.push_back(m_data->legacy_version().minor_version());
225 buf += m_data->random();
226
227 append_tls_length_value(buf, m_data->session_id().get(), 1);
228
229 if(m_data->legacy_version().is_datagram_protocol()) {
230 append_tls_length_value(buf, m_data->hello_cookie(), 1);
231 }
232
233 append_tls_length_value(buf, m_data->ciphersuites(), 2);
234 append_tls_length_value(buf, m_data->comp_methods(), 1);
235
236 /*
237 * May not want to send extensions at all in some cases. If so,
238 * should include SCSV value (if reneg info is empty, if not we are
239 * renegotiating with a modern server)
240 */
241
242 buf += m_data->extensions().serialize(Connection_Side::Client);
243
244 return buf;
245}
void append_tls_length_value(std::vector< uint8_t, Alloc > &buf, const T *vals, size_t vals_size, size_t tag_size)
Definition tls_reader.h:184

References Botan::TLS::append_tls_length_value(), Botan::TLS::Client, and m_data.

Referenced by ~Client_Hello().

◆ session_handle()

std::optional< Session_Handle > Botan::TLS::Client_Hello_12::session_handle ( ) const

Definition at line 337 of file msg_client_hello.cpp.

337 {
338 // RFC 5077 3.4
339 // If a ticket is presented by the client, the server MUST NOT attempt
340 // to use the Session ID in the ClientHello for stateful session
341 // resumption.
342 if(auto ticket = session_ticket(); !ticket.empty()) {
343 return Session_Handle(ticket);
344 } else if(const auto& id = session_id(); !id.empty()) {
345 return Session_Handle(id);
346 } else {
347 return std::nullopt;
348 }
349}
Session_Ticket session_ticket() const
const Session_ID & session_id() const
bool empty() const noexcept(noexcept(this->get().empty()))

References Botan::detail::Container_Strong_Adapter_Base< T >::empty(), Botan::TLS::Client_Hello::session_id(), and session_ticket().

Referenced by Client_Hello_13.

◆ session_id()

const Session_ID & Botan::TLS::Client_Hello::session_id ( ) const
inherited

Definition at line 190 of file msg_client_hello.cpp.

190 {
191 return m_data->session_id();
192}

References m_data.

Referenced by Botan::TLS::Client_Hello_12::session_handle(), and ~Client_Hello().

◆ session_ticket()

Session_Ticket Botan::TLS::Client_Hello_12::session_ticket ( ) const

Definition at line 330 of file msg_client_hello.cpp.

330 {
331 if(auto* ticket = m_data->extensions().get<Session_Ticket_Extension>()) {
332 return ticket->contents();
333 }
334 return {};
335}

References Botan::TLS::Client_Hello::m_data.

Referenced by Client_Hello_13, session_handle(), and Botan::TLS::Handshake_State::session_ticket().

◆ signature_schemes()

std::vector< Signature_Scheme > Botan::TLS::Client_Hello::signature_schemes ( ) const
inherited

Definition at line 261 of file msg_client_hello.cpp.

261 {
262 if(Signature_Algorithms* sigs = m_data->extensions().get<Signature_Algorithms>()) {
263 return sigs->supported_schemes();
264 }
265 return {};
266}

References m_data.

Referenced by Botan::TLS::Certificate_13::Certificate_13(), certificate_signature_schemes(), Botan::TLS::Handshake_State::choose_sig_format(), and ~Client_Hello().

◆ sni_hostname()

std::string Botan::TLS::Client_Hello::sni_hostname ( ) const
inherited

Definition at line 301 of file msg_client_hello.cpp.

301 {
302 if(Server_Name_Indicator* sni = m_data->extensions().get<Server_Name_Indicator>()) {
303 return sni->host_name();
304 }
305 return "";
306}

References m_data.

Referenced by Botan::TLS::Certificate_13::Certificate_13(), Botan::TLS::Certificate_Request_13::maybe_create(), and ~Client_Hello().

◆ srtp_profiles()

std::vector< uint16_t > Botan::TLS::Client_Hello::srtp_profiles ( ) const
inherited

Definition at line 378 of file msg_client_hello.cpp.

378 {
379 if(SRTP_Protection_Profiles* srtp = m_data->extensions().get<SRTP_Protection_Profiles>()) {
380 return srtp->profiles();
381 }
382 return {};
383}

References m_data.

Referenced by ~Client_Hello().

◆ supported_dh_groups()

std::vector< Group_Params > Botan::TLS::Client_Hello::supported_dh_groups ( ) const
inherited

Definition at line 287 of file msg_client_hello.cpp.

287 {
288 if(Supported_Groups* groups = m_data->extensions().get<Supported_Groups>()) {
289 return groups->dh_groups();
290 }
291 return std::vector<Group_Params>();
292}

References m_data.

Referenced by ~Client_Hello().

◆ supported_ecc_curves()

std::vector< Group_Params > Botan::TLS::Client_Hello::supported_ecc_curves ( ) const
inherited

Definition at line 280 of file msg_client_hello.cpp.

280 {
281 if(Supported_Groups* groups = m_data->extensions().get<Supported_Groups>()) {
282 return groups->ec_groups();
283 }
284 return {};
285}

References m_data.

Referenced by ~Client_Hello().

◆ supported_versions()

std::vector< Protocol_Version > Botan::TLS::Client_Hello::supported_versions ( ) const
inherited

Definition at line 319 of file msg_client_hello.cpp.

319 {
320 if(Supported_Versions* versions = m_data->extensions().get<Supported_Versions>()) {
321 return versions->versions();
322 }
323 return {};
324}

References m_data.

Referenced by ~Client_Hello().

◆ supports_alpn()

bool Botan::TLS::Client_Hello::supports_alpn ( ) const
inherited

Definition at line 351 of file msg_client_hello.cpp.

351 {
352 return m_data->extensions().has<Application_Layer_Protocol_Notification>();
353}

References m_data.

Referenced by Botan::TLS::Server_Hello_12::Server_Hello_12(), Botan::TLS::Server_Hello_12::Server_Hello_12(), and ~Client_Hello().

◆ supports_cert_status_message()

bool Botan::TLS::Client_Hello_12::supports_cert_status_message ( ) const

Definition at line 359 of file msg_client_hello.cpp.

359 {
360 return m_data->extensions().has<Certificate_Status_Request>();
361}

References Botan::TLS::Client_Hello::m_data.

Referenced by Client_Hello_13, and Botan::TLS::Server_Hello_12::Server_Hello_12().

◆ supports_encrypt_then_mac()

bool Botan::TLS::Client_Hello_12::supports_encrypt_then_mac ( ) const

Definition at line 363 of file msg_client_hello.cpp.

363 {
364 return m_data->extensions().has<Encrypt_then_MAC>();
365}

References Botan::TLS::Client_Hello::m_data.

Referenced by Client_Hello_13, Botan::TLS::Server_Hello_12::Server_Hello_12(), and Botan::TLS::Server_Hello_12::Server_Hello_12().

◆ supports_extended_master_secret()

bool Botan::TLS::Client_Hello_12::supports_extended_master_secret ( ) const

Definition at line 355 of file msg_client_hello.cpp.

355 {
356 return m_data->extensions().has<Extended_Master_Secret>();
357}

References Botan::TLS::Client_Hello::m_data.

Referenced by Client_Hello_13, Botan::TLS::Server_Hello_12::Server_Hello_12(), and Botan::TLS::Server_Hello_12::Server_Hello_12().

◆ supports_session_ticket()

bool Botan::TLS::Client_Hello_12::supports_session_ticket ( ) const

Definition at line 326 of file msg_client_hello.cpp.

326 {
327 return m_data->extensions().has<Session_Ticket_Extension>();
328}

References Botan::TLS::Client_Hello::m_data.

Referenced by Client_Hello_13, and Botan::TLS::Server_Hello_12::Server_Hello_12().

◆ type()

◆ type_string()

std::string Botan::TLS::Handshake_Message::type_string ( ) const
inherited
Returns
string representation of this message type

Definition at line 18 of file tls_handshake_state.cpp.

18 {
20}
const char * handshake_type_to_string(Handshake_Type type)

References Botan::TLS::handshake_type_to_string(), and type().

◆ update_hello_cookie()

void Botan::TLS::Client_Hello_12::update_hello_cookie ( const Hello_Verify_Request & hello_verify)

Definition at line 210 of file msg_client_hello.cpp.

210 {
211 BOTAN_STATE_CHECK(m_data->legacy_version().is_datagram_protocol());
212
213 m_data->m_hello_cookie = hello_verify.cookie();
214}

References BOTAN_STATE_CHECK, Botan::TLS::Hello_Verify_Request::cookie(), and Botan::TLS::Client_Hello::m_data.

Referenced by Client_Hello_13.

◆ wire_type()

virtual Handshake_Type Botan::TLS::Handshake_Message::wire_type ( ) const
inlinevirtualinherited
Returns
the wire representation of the message's type

Reimplemented in Botan::TLS::Hello_Retry_Request.

Definition at line 39 of file tls_handshake_msg.h.

39 {
40 // Usually equal to the Handshake_Type enum value,
41 // with the exception of TLS 1.3 Hello Retry Request.
42 return type();
43 }

References type().

Referenced by Botan::TLS::Stream_Handshake_IO::send().

◆ Client_Hello_13

Member Data Documentation

◆ m_data


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