Botan 3.6.1
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 474 of file msg_client_hello.cpp.

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

◆ 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 480 of file msg_client_hello.cpp.

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

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

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)
protected

Definition at line 435 of file msg_client_hello.cpp.

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

References 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 270 of file msg_client_hello.cpp.

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

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

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

◆ ciphersuites()

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

Definition at line 200 of file msg_client_hello.cpp.

200 {
201 return m_data->ciphersuites();
202}

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

◆ compression_methods()

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

Definition at line 141 of file msg_client_hello.cpp.

196 {
197 return m_data->comp_methods();
198}

◆ cookie()

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

Definition at line 387 of file msg_client_hello.cpp.

387 {
388 return m_data->hello_cookie();
389}

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

◆ cookie_input_data()

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

Definition at line 249 of file msg_client_hello.cpp.

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

References BOTAN_STATE_CHECK, and Botan::TLS::Client_Hello::m_data.

◆ extension_types()

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

Definition at line 204 of file msg_client_hello.cpp.

204 {
205 return m_data->extensions().extension_types();
206}

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

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

◆ 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 184 of file msg_client_hello.cpp.

184 {
185 return m_data->legacy_version();
186}

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

◆ next_protocols()

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

Definition at line 373 of file msg_client_hello.cpp.

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

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

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

◆ offered_suite()

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

Definition at line 258 of file msg_client_hello.cpp.

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

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

Referenced by Client_Hello_12().

◆ prefers_compressed_ec_points()

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

Definition at line 296 of file msg_client_hello.cpp.

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

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

◆ random()

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

Definition at line 99 of file msg_client_hello.cpp.

188 {
189 return m_data->random();
190}

References Botan::TLS::Protocol_Version::is_datagram_protocol().

◆ renegotiation_info()

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

Definition at line 314 of file msg_client_hello.cpp.

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

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

Referenced by Botan::TLS::Channel_Impl_12::secure_renegotiation_check().

◆ secure_renegotiation()

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

Definition at line 310 of file msg_client_hello.cpp.

310 {
311 return m_data->extensions().has<Renegotiation_Extension>();
312}

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

Referenced by 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 369 of file msg_client_hello.cpp.

369 {
370 return m_data->extensions().has<Signature_Algorithms>();
371}

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

◆ 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 221 of file msg_client_hello.cpp.

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

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

◆ session_handle()

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

Definition at line 339 of file msg_client_hello.cpp.

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

References Botan::TLS::Client_Hello::session_id(), and session_ticket().

◆ session_id()

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

Definition at line 192 of file msg_client_hello.cpp.

192 {
193 return m_data->session_id();
194}

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

Referenced by session_handle().

◆ session_ticket()

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

Definition at line 332 of file msg_client_hello.cpp.

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

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

Referenced by 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 263 of file msg_client_hello.cpp.

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

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

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

◆ sni_hostname()

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

Definition at line 303 of file msg_client_hello.cpp.

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

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

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

◆ srtp_profiles()

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

Definition at line 380 of file msg_client_hello.cpp.

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

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

◆ supported_dh_groups()

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

Definition at line 289 of file msg_client_hello.cpp.

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

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

◆ supported_ecc_curves()

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

Definition at line 282 of file msg_client_hello.cpp.

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

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

◆ supported_versions()

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

Definition at line 321 of file msg_client_hello.cpp.

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

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

◆ supports_alpn()

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

Definition at line 353 of file msg_client_hello.cpp.

353 {
354 return m_data->extensions().has<Application_Layer_Protocol_Notification>();
355}

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

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

◆ supports_cert_status_message()

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

Definition at line 361 of file msg_client_hello.cpp.

361 {
362 return m_data->extensions().has<Certificate_Status_Request>();
363}

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

Referenced by 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 365 of file msg_client_hello.cpp.

365 {
366 return m_data->extensions().has<Encrypt_then_MAC>();
367}

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

Referenced by 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 357 of file msg_client_hello.cpp.

357 {
358 return m_data->extensions().has<Extended_Master_Secret>();
359}

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

Referenced by 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 328 of file msg_client_hello.cpp.

328 {
329 return m_data->extensions().has<Session_Ticket_Extension>();
330}

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

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

◆ type()

Handshake_Type Botan::TLS::Client_Hello::type ( ) const
overridevirtualinherited

◆ type_string()

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

Definition at line 19 of file tls_handshake_state.cpp.

19 {
21}
virtual Handshake_Type type() const =0
const char * handshake_type_to_string(Handshake_Type type)

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

◆ update_hello_cookie()

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

Definition at line 212 of file msg_client_hello.cpp.

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

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

◆ 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 }

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

Friends And Related Symbol Documentation

◆ Client_Hello_13

friend class Client_Hello_13
friend

Definition at line 185 of file tls_messages.h.

Member Data Documentation

◆ m_data

std::unique_ptr<Client_Hello_Internal> Botan::TLS::Client_Hello::m_data
protectedinherited

Definition at line 144 of file tls_messages.h.

Referenced by Botan::TLS::Client_Hello::certificate_signature_schemes(), Botan::TLS::Client_Hello::ciphersuites(), Botan::TLS::Client_Hello::Client_Hello(), Client_Hello_12(), Client_Hello_12(), Client_Hello_12(), Botan::TLS::Client_Hello_13::Client_Hello_13(), Botan::TLS::Client_Hello::compression_methods(), Botan::TLS::Client_Hello::cookie(), Botan::TLS::Client_Hello::cookie_input_data(), Botan::TLS::Client_Hello::extension_types(), Botan::TLS::Client_Hello::extensions(), Botan::TLS::Client_Hello_13::highest_supported_version(), Botan::TLS::Client_Hello::legacy_version(), Botan::TLS::Client_Hello::next_protocols(), Botan::TLS::Client_Hello::offered_suite(), prefers_compressed_ec_points(), Botan::TLS::Client_Hello::random(), renegotiation_info(), Botan::TLS::Client_Hello_13::retry(), secure_renegotiation(), Botan::TLS::Client_Hello::sent_signature_algorithms(), Botan::TLS::Client_Hello::serialize(), Botan::TLS::Client_Hello::session_id(), session_ticket(), Botan::TLS::Client_Hello::signature_schemes(), Botan::TLS::Client_Hello::sni_hostname(), Botan::TLS::Client_Hello::srtp_profiles(), Botan::TLS::Client_Hello::supported_dh_groups(), Botan::TLS::Client_Hello::supported_ecc_curves(), Botan::TLS::Client_Hello::supported_versions(), Botan::TLS::Client_Hello::supports_alpn(), supports_cert_status_message(), supports_encrypt_then_mac(), supports_extended_master_secret(), supports_session_ticket(), update_hello_cookie(), and Botan::TLS::Client_Hello_13::validate_updates().


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