Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

tls_messages.h
Go to the documentation of this file.
1 /*
2 * TLS Messages
3 * (C) 2004-2011,2015 Jack Lloyd
4 * 2016 Matthias Gierlings
5 *
6 * Botan is released under the Simplified BSD License (see license.txt)
7 */
8
9 #ifndef BOTAN_TLS_MESSAGES_H__
10 #define BOTAN_TLS_MESSAGES_H__
11
12 #include <botan/tls_extensions.h>
13 #include <botan/tls_handshake_msg.h>
14 #include <botan/tls_session.h>
15 #include <botan/tls_policy.h>
16 #include <botan/tls_ciphersuite.h>
17 #include <botan/bigint.h>
18 #include <botan/x509cert.h>
19 #include <vector>
20 #include <string>
21 #include <set>
22
23 #if defined(BOTAN_HAS_CECPQ1)
24 #include <botan/cecpq1.h>
25 #endif
26
27 #if defined(BOTAN_HAS_SRP6)
28 #include <botan/srp6.h>
29 #endif
30
31 namespace Botan {
32
33 class Credentials_Manager;
34
35 namespace TLS {
36
37 class Session;
38 class Handshake_IO;
39 class Handshake_State;
40
41 std::vector<uint8_t> make_hello_random(RandomNumberGenerator& rng,
42 const Policy& policy);
43
44 /**
45 * DTLS Hello Verify Request
46 */
47 class BOTAN_DLL Hello_Verify_Request final : public Handshake_Message
48 {
49 public:
50 std::vector<uint8_t> serialize() const override;
51 Handshake_Type type() const override { return HELLO_VERIFY_REQUEST; }
52
53 std::vector<uint8_t> cookie() const { return m_cookie; }
54
55 explicit Hello_Verify_Request(const std::vector<uint8_t>& buf);
56
57 Hello_Verify_Request(const std::vector<uint8_t>& client_hello_bits,
58 const std::string& client_identity,
59 const SymmetricKey& secret_key);
60 private:
61 std::vector<uint8_t> m_cookie;
62 };
63
64 /**
65 * Client Hello Message
66 */
67 class BOTAN_DLL Client_Hello final : public Handshake_Message
68 {
69 public:
70 class Settings
71 {
72 public:
73 Settings(const Protocol_Version version,
74 const std::string& hostname = "",
75 const std::string& srp_identifier = "")
76 : m_new_session_version(version),
77 m_hostname(hostname),
78 m_srp_identifier(srp_identifier) {}
79
80 const Protocol_Version protocol_version() const { return m_new_session_version; }
81 const std::string& hostname() const { return m_hostname; }
82 const std::string& srp_identifier() const { return m_srp_identifier; }
83
84 private:
85 const Protocol_Version m_new_session_version;
86 const std::string m_hostname;
87 const std::string m_srp_identifier;
88 };
89
90 Handshake_Type type() const override { return CLIENT_HELLO; }
91
92 Protocol_Version version() const { return m_version; }
93
94 const std::vector<uint8_t>& random() const { return m_random; }
95
96 const std::vector<uint8_t>& session_id() const { return m_session_id; }
97
98 std::vector<uint16_t> ciphersuites() const { return m_suites; }
99
100 std::vector<uint8_t> compression_methods() const { return m_comp_methods; }
101
102 bool offered_suite(uint16_t ciphersuite) const;
103
104 bool sent_fallback_scsv() const;
105
106 std::vector<std::pair<std::string, std::string>> supported_algos() const
107 {
108 if(Signature_Algorithms* sigs = m_extensions.get<Signature_Algorithms>())
109 return sigs->supported_signature_algorthms();
110 return std::vector<std::pair<std::string, std::string>>();
111 }
112
113 std::set<std::string> supported_sig_algos() const
114 {
115 std::set<std::string> sig;
116 for(auto&& hash_and_sig : supported_algos())
117 sig.insert(hash_and_sig.second);
118 return sig;
119 }
120
121 std::vector<std::string> supported_ecc_curves() const
122 {
123 if(Supported_Elliptic_Curves* ecc = m_extensions.get<Supported_Elliptic_Curves>())
124 return ecc->curves();
125 return std::vector<std::string>();
126 }
127
128 bool prefers_compressed_ec_points() const
129 {
130 if(Supported_Point_Formats* ecc_formats = m_extensions.get<Supported_Point_Formats>())
131 {
132 return ecc_formats->prefers_compressed();
133 }
134 return false;
135 }
136
137 std::string sni_hostname() const
138 {
139 if(Server_Name_Indicator* sni = m_extensions.get<Server_Name_Indicator>())
140 return sni->host_name();
141 return "";
142 }
143
144 #if defined(BOTAN_HAS_SRP6)
145 std::string srp_identifier() const
146 {
147 if(SRP_Identifier* srp = m_extensions.get<SRP_Identifier>())
148 return srp->identifier();
149 return "";
150 }
151 #endif
152
153 bool secure_renegotiation() const
154 {
155 return m_extensions.has<Renegotiation_Extension>();
156 }
157
158 std::vector<uint8_t> renegotiation_info() const
159 {
160 if(Renegotiation_Extension* reneg = m_extensions.get<Renegotiation_Extension>())
161 return reneg->renegotiation_info();
162 return std::vector<uint8_t>();
163 }
164
165 bool supports_session_ticket() const
166 {
167 return m_extensions.has<Session_Ticket>();
168 }
169
170 std::vector<uint8_t> session_ticket() const
171 {
172 if(Session_Ticket* ticket = m_extensions.get<Session_Ticket>())
173 return ticket->contents();
174 return std::vector<uint8_t>();
175 }
176
177 bool supports_alpn() const
178 {
179 return m_extensions.has<Application_Layer_Protocol_Notification>();
180 }
181
182 bool supports_extended_master_secret() const
183 {
184 return m_extensions.has<Extended_Master_Secret>();
185 }
186
187 bool supports_cert_status_message() const
188 {
189 return m_extensions.has<Certificate_Status_Request>();
190 }
191
192 bool supports_encrypt_then_mac() const
193 {
194 return m_extensions.has<Encrypt_then_MAC>();
195 }
196
197 bool sent_signature_algorithms() const
198 {
199 return m_extensions.has<Signature_Algorithms>();
200 }
201
202 std::vector<std::string> next_protocols() const
203 {
204 if(auto alpn = m_extensions.get<Application_Layer_Protocol_Notification>())
205 return alpn->protocols();
206 return std::vector<std::string>();
207 }
208
209 std::vector<uint16_t> srtp_profiles() const
210 {
211 if(SRTP_Protection_Profiles* srtp = m_extensions.get<SRTP_Protection_Profiles>())
212 return srtp->profiles();
213 return std::vector<uint16_t>();
214 }
215
216 void update_hello_cookie(const Hello_Verify_Request& hello_verify);
217
218 std::set<Handshake_Extension_Type> extension_types() const
219 { return m_extensions.extension_types(); }
220
221 Client_Hello(Handshake_IO& io,
222 Handshake_Hash& hash,
223 const Policy& policy,
224 RandomNumberGenerator& rng,
225 const std::vector<uint8_t>& reneg_info,
226 const Client_Hello::Settings& client_settings,
227 const std::vector<std::string>& next_protocols);
228
229 Client_Hello(Handshake_IO& io,
230 Handshake_Hash& hash,
231 const Policy& policy,
232 RandomNumberGenerator& rng,
233 const std::vector<uint8_t>& reneg_info,
234 const Session& resumed_session,
235 const std::vector<std::string>& next_protocols);
236
237 explicit Client_Hello(const std::vector<uint8_t>& buf);
238
239 private:
240 std::vector<uint8_t> serialize() const override;
241
242 Protocol_Version m_version;
243 std::vector<uint8_t> m_session_id;
244 std::vector<uint8_t> m_random;
245 std::vector<uint16_t> m_suites;
246 std::vector<uint8_t> m_comp_methods;
247 std::vector<uint8_t> m_hello_cookie; // DTLS only
248
249 Extensions m_extensions;
250 };
251
252 /**
253 * Server Hello Message
254 */
255 class BOTAN_DLL Server_Hello final : public Handshake_Message
256 {
257 public:
258 class Settings
259 {
260 public:
261 Settings(const std::vector<uint8_t> new_session_id,
262 Protocol_Version new_session_version,
263 uint16_t ciphersuite,
264 uint8_t compression,
265 bool offer_session_ticket)
266 : m_new_session_id(new_session_id),
267 m_new_session_version(new_session_version),
268 m_ciphersuite(ciphersuite),
269 m_compression(compression),
270 m_offer_session_ticket(offer_session_ticket) {}
271
272 const std::vector<uint8_t>& session_id() const { return m_new_session_id; }
273 Protocol_Version protocol_version() const { return m_new_session_version; }
274 uint16_t ciphersuite() const { return m_ciphersuite; }
275 uint8_t compression() const { return m_compression; }
276 bool offer_session_ticket() const { return m_offer_session_ticket; }
277
278 private:
279 const std::vector<uint8_t> m_new_session_id;
280 Protocol_Version m_new_session_version;
281 uint16_t m_ciphersuite;
282 uint8_t m_compression;
283 bool m_offer_session_ticket;
284 };
285
286
287 Handshake_Type type() const override { return SERVER_HELLO; }
288
289 Protocol_Version version() const { return m_version; }
290
291 const std::vector<uint8_t>& random() const { return m_random; }
292
293 const std::vector<uint8_t>& session_id() const { return m_session_id; }
294
295 uint16_t ciphersuite() const { return m_ciphersuite; }
296
297 uint8_t compression_method() const { return m_comp_method; }
298
299 bool secure_renegotiation() const
300 {
301 return m_extensions.has<Renegotiation_Extension>();
302 }
303
304 std::vector<uint8_t> renegotiation_info() const
305 {
306 if(Renegotiation_Extension* reneg = m_extensions.get<Renegotiation_Extension>())
307 return reneg->renegotiation_info();
308 return std::vector<uint8_t>();
309 }
310
311 bool supports_extended_master_secret() const
312 {
313 return m_extensions.has<Extended_Master_Secret>();
314 }
315
316 bool supports_encrypt_then_mac() const
317 {
318 return m_extensions.has<Encrypt_then_MAC>();
319 }
320
321 bool supports_certificate_status_message() const
322 {
323 return m_extensions.has<Certificate_Status_Request>();
324 }
325
326 bool supports_session_ticket() const
327 {
328 return m_extensions.has<Session_Ticket>();
329 }
330
331 uint16_t srtp_profile() const
332 {
333 if(auto srtp = m_extensions.get<SRTP_Protection_Profiles>())
334 {
335 auto prof = srtp->profiles();
336 if(prof.size() != 1 || prof[0] == 0)
337 throw Decoding_Error("Server sent malformed DTLS-SRTP extension");
338 return prof[0];
339 }
340
341 return 0;
342 }
343
344 std::string next_protocol() const
345 {
346 if(auto alpn = m_extensions.get<Application_Layer_Protocol_Notification>())
347 return alpn->single_protocol();
348 return "";
349 }
350
351 std::set<Handshake_Extension_Type> extension_types() const
352 { return m_extensions.extension_types(); }
353
354 bool prefers_compressed_ec_points() const
355 {
356 if(auto ecc_formats = m_extensions.get<Supported_Point_Formats>())
357 {
358 return ecc_formats->prefers_compressed();
359 }
360 return false;
361 }
362
363 Server_Hello(Handshake_IO& io,
364 Handshake_Hash& hash,
365 const Policy& policy,
366 RandomNumberGenerator& rng,
367 const std::vector<uint8_t>& secure_reneg_info,
368 const Client_Hello& client_hello,
369 const Server_Hello::Settings& settings,
370 const std::string next_protocol);
371
372 Server_Hello(Handshake_IO& io,
373 Handshake_Hash& hash,
374 const Policy& policy,
375 RandomNumberGenerator& rng,
376 const std::vector<uint8_t>& secure_reneg_info,
377 const Client_Hello& client_hello,
378 Session& resumed_session,
379 bool offer_session_ticket,
380 const std::string& next_protocol);
381
382 explicit Server_Hello(const std::vector<uint8_t>& buf);
383 private:
384 std::vector<uint8_t> serialize() const override;
385
386 Protocol_Version m_version;
387 std::vector<uint8_t> m_session_id, m_random;
388 uint16_t m_ciphersuite;
389 uint8_t m_comp_method;
390
391 Extensions m_extensions;
392 };
393
394 /**
395 * Client Key Exchange Message
396 */
397 class BOTAN_DLL Client_Key_Exchange final : public Handshake_Message
398 {
399 public:
400 Handshake_Type type() const override { return CLIENT_KEX; }
401
402 const secure_vector<uint8_t>& pre_master_secret() const
403 { return m_pre_master; }
404
405 Client_Key_Exchange(Handshake_IO& io,
406 Handshake_State& state,
407 const Policy& policy,
408 Credentials_Manager& creds,
409 const Public_Key* server_public_key,
410 const std::string& hostname,
411 RandomNumberGenerator& rng);
412
413 Client_Key_Exchange(const std::vector<uint8_t>& buf,
414 const Handshake_State& state,
415 const Private_Key* server_rsa_kex_key,
416 Credentials_Manager& creds,
417 const Policy& policy,
418 RandomNumberGenerator& rng);
419
420 private:
421 std::vector<uint8_t> serialize() const override
422 { return m_key_material; }
423
424 std::vector<uint8_t> m_key_material;
425 secure_vector<uint8_t> m_pre_master;
426 };
427
428 /**
429 * Certificate Message
430 */
431 class BOTAN_DLL Certificate final : public Handshake_Message
432 {
433 public:
434 Handshake_Type type() const override { return CERTIFICATE; }
435 const std::vector<X509_Certificate>& cert_chain() const { return m_certs; }
436
437 size_t count() const { return m_certs.size(); }
438 bool empty() const { return m_certs.empty(); }
439
440 Certificate(Handshake_IO& io,
441 Handshake_Hash& hash,
442 const std::vector<X509_Certificate>& certs);
443
444 explicit Certificate(const std::vector<uint8_t>& buf, const Policy &policy);
445 private:
446 std::vector<uint8_t> serialize() const override;
447
448 std::vector<X509_Certificate> m_certs;
449 };
450
451 /**
452 * Certificate Status (RFC 6066)
453 */
454 class BOTAN_DLL Certificate_Status final : public Handshake_Message
455 {
456 public:
457 Handshake_Type type() const override { return CERTIFICATE_STATUS; }
458
459 std::shared_ptr<const OCSP::Response> response() const { return m_response; }
460
461 Certificate_Status(const std::vector<uint8_t>& buf);
462
463 Certificate_Status(Handshake_IO& io,
464 Handshake_Hash& hash,
465 std::shared_ptr<const OCSP::Response> response);
466
467 private:
468 std::vector<uint8_t> serialize() const override;
469 std::shared_ptr<const OCSP::Response> m_response;
470 };
471
472 /**
473 * Certificate Request Message
474 */
475 class BOTAN_DLL Certificate_Req final : public Handshake_Message
476 {
477 public:
478 Handshake_Type type() const override { return CERTIFICATE_REQUEST; }
479
480 const std::vector<std::string>& acceptable_cert_types() const
481 { return m_cert_key_types; }
482
483 std::vector<X509_DN> acceptable_CAs() const { return m_names; }
484
485 std::vector<std::pair<std::string, std::string> > supported_algos() const
486 { return m_supported_algos; }
487
488 Certificate_Req(Handshake_IO& io,
489 Handshake_Hash& hash,
490 const Policy& policy,
491 const std::vector<X509_DN>& allowed_cas,
492 Protocol_Version version);
493
494 Certificate_Req(const std::vector<uint8_t>& buf,
495 Protocol_Version version);
496 private:
497 std::vector<uint8_t> serialize() const override;
498
499 std::vector<X509_DN> m_names;
500 std::vector<std::string> m_cert_key_types;
501
502 std::vector<std::pair<std::string, std::string> > m_supported_algos;
503 };
504
505 /**
506 * Certificate Verify Message
507 */
508 class BOTAN_DLL Certificate_Verify final : public Handshake_Message
509 {
510 public:
511 Handshake_Type type() const override { return CERTIFICATE_VERIFY; }
512
513 /**
514 * Check the signature on a certificate verify message
515 * @param cert the purported certificate
516 * @param state the handshake state
517 * @param policy the TLS policy
518 */
519 bool verify(const X509_Certificate& cert,
520 const Handshake_State& state,
521 const Policy& policy) const;
522
523 Certificate_Verify(Handshake_IO& io,
524 Handshake_State& state,
525 const Policy& policy,
526 RandomNumberGenerator& rng,
527 const Private_Key* key);
528
529 Certificate_Verify(const std::vector<uint8_t>& buf,
530 Protocol_Version version);
531 private:
532 std::vector<uint8_t> serialize() const override;
533
534 std::string m_sig_algo; // sig algo used to create signature
535 std::string m_hash_algo; // hash used to create signature
536 std::vector<uint8_t> m_signature;
537 };
538
539 /**
540 * Finished Message
541 */
542 class BOTAN_DLL Finished final : public Handshake_Message
543 {
544 public:
545 Handshake_Type type() const override { return FINISHED; }
546
547 std::vector<uint8_t> verify_data() const
548 { return m_verification_data; }
549
550 bool verify(const Handshake_State& state,
551 Connection_Side side) const;
552
553 Finished(Handshake_IO& io,
554 Handshake_State& state,
555 Connection_Side side);
556
557 explicit Finished(const std::vector<uint8_t>& buf);
558 private:
559 std::vector<uint8_t> serialize() const override;
560
561 std::vector<uint8_t> m_verification_data;
562 };
563
564 /**
565 * Hello Request Message
566 */
567 class BOTAN_DLL Hello_Request final : public Handshake_Message
568 {
569 public:
570 Handshake_Type type() const override { return HELLO_REQUEST; }
571
572 explicit Hello_Request(Handshake_IO& io);
573 explicit Hello_Request(const std::vector<uint8_t>& buf);
574 private:
575 std::vector<uint8_t> serialize() const override;
576 };
577
578 /**
579 * Server Key Exchange Message
580 */
581 class BOTAN_DLL Server_Key_Exchange final : public Handshake_Message
582 {
583 public:
584 Handshake_Type type() const override { return SERVER_KEX; }
585
586 const std::vector<uint8_t>& params() const { return m_params; }
587
588 bool verify(const Public_Key& server_key,
589 const Handshake_State& state,
590 const Policy& policy) const;
591
592 // Only valid for certain kex types
593 const Private_Key& server_kex_key() const;
594
595 #if defined(BOTAN_HAS_SRP6)
596 // Only valid for SRP negotiation
597 SRP6_Server_Session& server_srp_params() const
598 {
599 BOTAN_ASSERT_NONNULL(m_srp_params);
600 return *m_srp_params;
601 }
602 #endif
603
604 #if defined(BOTAN_HAS_CECPQ1)
605 // Only valid for CECPQ1 negotiation
606 const CECPQ1_key& cecpq1_key() const
607 {
608 BOTAN_ASSERT_NONNULL(m_cecpq1_key);
609 return *m_cecpq1_key;
610 }
611 #endif
612
613 Server_Key_Exchange(Handshake_IO& io,
614 Handshake_State& state,
615 const Policy& policy,
616 Credentials_Manager& creds,
617 RandomNumberGenerator& rng,
618 const Private_Key* signing_key = nullptr);
619
620 Server_Key_Exchange(const std::vector<uint8_t>& buf,
621 const std::string& kex_alg,
622 const std::string& sig_alg,
623 Protocol_Version version);
624
625 ~Server_Key_Exchange() = default;
626 private:
627 std::vector<uint8_t> serialize() const override;
628
629 #if defined(BOTAN_HAS_SRP6)
630 std::unique_ptr<SRP6_Server_Session> m_srp_params;
631 #endif
632
633 #if defined(BOTAN_HAS_CECPQ1)
634 std::unique_ptr<CECPQ1_key> m_cecpq1_key;
635 #endif
636
637 std::unique_ptr<Private_Key> m_kex_key;
638
639 std::vector<uint8_t> m_params;
640
641 std::string m_sig_algo; // sig algo used to create signature
642 std::string m_hash_algo; // hash used to create signature
643 std::vector<uint8_t> m_signature;
644 };
645
646 /**
647 * Server Hello Done Message
648 */
649 class BOTAN_DLL Server_Hello_Done final : public Handshake_Message
650 {
651 public:
652 Handshake_Type type() const override { return SERVER_HELLO_DONE; }
653
654 Server_Hello_Done(Handshake_IO& io, Handshake_Hash& hash);
655 explicit Server_Hello_Done(const std::vector<uint8_t>& buf);
656 private:
657 std::vector<uint8_t> serialize() const override;
658 };
659
660 /**
661 * New Session Ticket Message
662 */
663 class BOTAN_DLL New_Session_Ticket final : public Handshake_Message
664 {
665 public:
666 Handshake_Type type() const override { return NEW_SESSION_TICKET; }
667
668 uint32_t ticket_lifetime_hint() const { return m_ticket_lifetime_hint; }
669 const std::vector<uint8_t>& ticket() const { return m_ticket; }
670
671 New_Session_Ticket(Handshake_IO& io,
672 Handshake_Hash& hash,
673 const std::vector<uint8_t>& ticket,
674 uint32_t lifetime);
675
676 New_Session_Ticket(Handshake_IO& io,
677 Handshake_Hash& hash);
678
679 explicit New_Session_Ticket(const std::vector<uint8_t>& buf);
680 private:
681 std::vector<uint8_t> serialize() const override;
682
683 uint32_t m_ticket_lifetime_hint = 0;
684 std::vector<uint8_t> m_ticket;
685 };
686
687 /**
688 * Change Cipher Spec
689 */
690 class BOTAN_DLL Change_Cipher_Spec final : public Handshake_Message
691 {
692 public:
693 Handshake_Type type() const override { return HANDSHAKE_CCS; }
694
695 std::vector<uint8_t> serialize() const override
696 { return std::vector<uint8_t>(1, 1); }
697 };
698
699 }
700
701 }
702
703 #endif
Botan::TLS::Hello_Verify_Request::type
Handshake_Type type() const override
Definition: tls_messages.h:51
Botan::TLS::Client_Hello::supports_cert_status_message
bool supports_cert_status_message() const
Definition: tls_messages.h:187
Botan::TLS::Server_Hello_Done::type
Handshake_Type type() const override
Definition: tls_messages.h:652
Botan::TLS::Server_Hello::compression_method
uint8_t compression_method() const
Definition: tls_messages.h:297
Botan::TLS::Session
Definition: tls_session.h:27
Botan::TLS::Certificate_Req::acceptable_CAs
std::vector< X509_DN > acceptable_CAs() const
Definition: tls_messages.h:483
Botan::TLS::Server_Hello::supports_encrypt_then_mac
bool supports_encrypt_then_mac() const
Definition: tls_messages.h:316
Botan::TLS::Certificate_Req
Definition: tls_messages.h:475
Botan::TLS::Server_Hello
Definition: tls_messages.h:255
Botan::TLS::Server_Hello::next_protocol
std::string next_protocol() const
Definition: tls_messages.h:344
Botan::OctetString
Definition: symkey.h:19
Botan::TLS::Certificate_Status::type
Handshake_Type type() const override
Definition: tls_messages.h:457
Botan::TLS::Hello_Verify_Request
Definition: tls_messages.h:47
Botan::TLS::Client_Key_Exchange::type
Handshake_Type type() const override
Definition: tls_messages.h:400
Botan::TLS::Certificate::cert_chain
const std::vector< X509_Certificate > & cert_chain() const
Definition: tls_messages.h:435
Botan::TLS::Client_Hello::supports_session_ticket
bool supports_session_ticket() const
Definition: tls_messages.h:165
Botan::TLS::Encrypt_then_MAC
Definition: tls_extensions.h:380
Botan::CECPQ1_key
Definition: cecpq1.h:16
Botan::RandomNumberGenerator
Definition: rng.h:25
Botan::TLS::Client_Hello::supported_algos
std::vector< std::pair< std::string, std::string > > supported_algos() const
Definition: tls_messages.h:106
Botan::Private_Key
Definition: pk_keys.h:166
Botan::TLS::Certificate_Verify
Definition: tls_messages.h:508
Botan::TLS::Renegotiation_Extension
Definition: tls_extensions.h:128
Botan::TLS::CLIENT_KEX
Definition: tls_magic.h:49
Botan::TLS::Client_Hello::Settings::Settings
Settings(const Protocol_Version version, const std::string &hostname="", const std::string &srp_identifier="")
Definition: tls_messages.h:73
Botan::TLS::Server_Key_Exchange::type
Handshake_Type type() const override
Definition: tls_messages.h:584
Botan::TLS::Hello_Request
Definition: tls_messages.h:567
Botan::TLS::New_Session_Ticket::ticket
const std::vector< uint8_t > & ticket() const
Definition: tls_messages.h:669
Botan::TLS::Finished
Definition: tls_messages.h:542
Botan::TLS::Server_Key_Exchange::params
const std::vector< uint8_t > & params() const
Definition: tls_messages.h:586
Botan::TLS::Server_Hello::Settings::protocol_version
Protocol_Version protocol_version() const
Definition: tls_messages.h:273
Botan::TLS::Certificate_Verify::type
Handshake_Type type() const override
Definition: tls_messages.h:511
Botan::TLS::NEW_SESSION_TICKET
Definition: tls_magic.h:43
Botan::TLS::HELLO_VERIFY_REQUEST
Definition: tls_magic.h:42
Botan::TLS::CERTIFICATE
Definition: tls_magic.h:44
Botan::TLS::Application_Layer_Protocol_Notification
Definition: tls_extensions.h:157
Botan::TLS::Handshake_Hash
Definition: tls_handshake_hash.h:22
Botan::TLS::New_Session_Ticket::ticket_lifetime_hint
uint32_t ticket_lifetime_hint() const
Definition: tls_messages.h:668
Botan::TLS::Client_Key_Exchange::pre_master_secret
const secure_vector< uint8_t > & pre_master_secret() const
Definition: tls_messages.h:402
Botan::TLS::SERVER_HELLO
Definition: tls_magic.h:41
Botan::TLS::Certificate::count
size_t count() const
Definition: tls_messages.h:437
Botan::TLS::Session_Ticket
Definition: tls_extensions.h:193
Botan::TLS::Protocol_Version
Definition: tls_version.h:21
Botan::TLS::Client_Hello::prefers_compressed_ec_points
bool prefers_compressed_ec_points() const
Definition: tls_messages.h:128
Botan::TLS::Server_Key_Exchange
Definition: tls_messages.h:581
Botan::TLS::Server_Hello::Settings::Settings
Settings(const std::vector< uint8_t > new_session_id, Protocol_Version new_session_version, uint16_t ciphersuite, uint8_t compression, bool offer_session_ticket)
Definition: tls_messages.h:261
Botan::SRP6_Server_Session
Definition: srp6.h:66
Botan::TLS::New_Session_Ticket::type
Handshake_Type type() const override
Definition: tls_messages.h:666
Botan::TLS::Connection_Side
Connection_Side
Definition: tls_magic.h:27
Botan::TLS::Server_Hello::Settings
Definition: tls_messages.h:258
Botan::TLS::Server_Hello_Done
Definition: tls_messages.h:649
Botan::TLS::Server_Hello::supports_extended_master_secret
bool supports_extended_master_secret() const
Definition: tls_messages.h:311
Botan::TLS::SERVER_HELLO_DONE
Definition: tls_magic.h:47
Botan::TLS::Supported_Point_Formats
Definition: tls_extensions.h:261
Botan::TLS::Client_Hello::renegotiation_info
std::vector< uint8_t > renegotiation_info() const
Definition: tls_messages.h:158
Botan::TLS::Client_Hello::Settings
Definition: tls_messages.h:70
Botan::TLS::Server_Hello::Settings::compression
uint8_t compression() const
Definition: tls_messages.h:275
Botan::TLS::Client_Hello::random
const std::vector< uint8_t > & random() const
Definition: tls_messages.h:94
Botan::TLS::SRTP_Protection_Profiles
Definition: tls_extensions.h:334
Botan::X509_Certificate
Definition: x509cert.h:36
Botan::TLS::Client_Key_Exchange
Definition: tls_messages.h:397
Botan::TLS::Client_Hello::supports_alpn
bool supports_alpn() const
Definition: tls_messages.h:177
Botan::secure_vector
std::vector< T, secure_allocator< T >> secure_vector
Definition: secmem.h:121
Botan::TLS::Certificate::type
Handshake_Type type() const override
Definition: tls_messages.h:434
Botan::TLS::Extended_Master_Secret
Definition: tls_extensions.h:360
Botan::TLS::CERTIFICATE_STATUS
Definition: tls_magic.h:53
BOTAN_ASSERT_NONNULL
#define BOTAN_ASSERT_NONNULL(ptr)
Definition: assert.h:79
Botan::TLS::Finished::type
Handshake_Type type() const override
Definition: tls_messages.h:545
Botan::TLS::Server_Hello::session_id
const std::vector< uint8_t > & session_id() const
Definition: tls_messages.h:293
Botan::TLS::Handshake_Message
Definition: tls_handshake_msg.h:26
Botan::TLS::Client_Hello::sni_hostname
std::string sni_hostname() const
Definition: tls_messages.h:137
Botan::TLS::Server_Hello::Settings::offer_session_ticket
bool offer_session_ticket() const
Definition: tls_messages.h:276
Botan::TLS::FINISHED
Definition: tls_magic.h:50
Botan::TLS::Client_Hello::next_protocols
std::vector< std::string > next_protocols() const
Definition: tls_messages.h:202
Botan::TLS::Server_Hello::random
const std::vector< uint8_t > & random() const
Definition: tls_messages.h:291
Botan::TLS::HELLO_REQUEST
Definition: tls_magic.h:39
Botan::TLS::Hello_Verify_Request::cookie
std::vector< uint8_t > cookie() const
Definition: tls_messages.h:53
Botan::Decoding_Error
Definition: exceptn.h:189
Botan::TLS::Extensions
Definition: tls_extensions.h:430
Botan::TLS::Server_Hello::version
Protocol_Version version() const
Definition: tls_messages.h:289
Botan::TLS::Hello_Request::type
Handshake_Type type() const override
Definition: tls_messages.h:570
Botan::TLS::Client_Hello::supports_encrypt_then_mac
bool supports_encrypt_then_mac() const
Definition: tls_messages.h:192
Botan::TLS::Handshake_IO
Definition: tls_handshake_io.h:30
Botan
Definition: alg_id.cpp:13
Botan::Credentials_Manager
Definition: credentials_manager.h:28
Botan::TLS::Certificate
Definition: tls_messages.h:431
Botan::TLS::Server_Hello::srtp_profile
uint16_t srtp_profile() const
Definition: tls_messages.h:331
Botan::TLS::Certificate_Req::type
Handshake_Type type() const override
Definition: tls_messages.h:478
Botan::TLS::Client_Hello::sent_signature_algorithms
bool sent_signature_algorithms() const
Definition: tls_messages.h:197
Botan::TLS::make_hello_random
std::vector< uint8_t > make_hello_random(RandomNumberGenerator &rng, const Policy &policy)
Definition: msg_client_hello.cpp:28
Botan::TLS::HANDSHAKE_CCS
Definition: tls_magic.h:55
Botan::Public_Key
Definition: pk_keys.h:24
server_public_key
std::unique_ptr< Public_Key > server_public_key
Definition: tls_client.cpp:40
Botan::TLS::Server_Name_Indicator
Definition: tls_extensions.h:74
Botan::TLS::Policy
Definition: tls_policy.h:26
Botan::TLS::Client_Hello::version
Protocol_Version version() const
Definition: tls_messages.h:92
Botan::TLS::Certificate_Req::acceptable_cert_types
const std::vector< std::string > & acceptable_cert_types() const
Definition: tls_messages.h:480
Botan::TLS::CERTIFICATE_REQUEST
Definition: tls_magic.h:46
Botan::TLS::Change_Cipher_Spec::serialize
std::vector< uint8_t > serialize() const override
Definition: tls_messages.h:695
Botan::TLS::Client_Hello::Settings::protocol_version
const Protocol_Version protocol_version() const
Definition: tls_messages.h:80
Botan::TLS::Supported_Elliptic_Curves
Definition: tls_extensions.h:232
Botan::TLS::New_Session_Ticket
Definition: tls_messages.h:663
Botan::TLS::Signature_Algorithms
Definition: tls_extensions.h:294
Botan::TLS::Server_Hello::supports_session_ticket
bool supports_session_ticket() const
Definition: tls_messages.h:326
Botan::TLS::Certificate_Status_Request
Definition: tls_extensions.h:400
Botan::TLS::CERTIFICATE_VERIFY
Definition: tls_magic.h:48
Botan::TLS::Client_Hello::supports_extended_master_secret
bool supports_extended_master_secret() const
Definition: tls_messages.h:182
Botan::TLS::Client_Hello::srtp_profiles
std::vector< uint16_t > srtp_profiles() const
Definition: tls_messages.h:209
Botan::TLS::Server_Hello::extension_types
std::set< Handshake_Extension_Type > extension_types() const
Definition: tls_messages.h:351
Botan::TLS::Handshake_State
Definition: tls_handshake_state.h:47
Botan::TLS::Client_Hello::extension_types
std::set< Handshake_Extension_Type > extension_types() const
Definition: tls_messages.h:218
Botan::TLS::Certificate_Req::supported_algos
std::vector< std::pair< std::string, std::string > > supported_algos() const
Definition: tls_messages.h:485
Botan::TLS::Server_Hello::type
Handshake_Type type() const override
Definition: tls_messages.h:287
Botan::TLS::Server_Hello::secure_renegotiation
bool secure_renegotiation() const
Definition: tls_messages.h:299
Botan::TLS::Server_Hello::renegotiation_info
std::vector< uint8_t > renegotiation_info() const
Definition: tls_messages.h:304
Botan::TLS::Certificate_Status::response
std::shared_ptr< const OCSP::Response > response() const
Definition: tls_messages.h:459
Botan::TLS::Server_Hello::Settings::session_id
const std::vector< uint8_t > & session_id() const
Definition: tls_messages.h:272
Botan::TLS::CLIENT_HELLO
Definition: tls_magic.h:40
Botan::TLS::Client_Hello::session_id
const std::vector< uint8_t > & session_id() const
Definition: tls_messages.h:96
Botan::TLS::SERVER_KEX
Definition: tls_magic.h:45
Botan::TLS::Finished::verify_data
std::vector< uint8_t > verify_data() const
Definition: tls_messages.h:547
Botan::TLS::Change_Cipher_Spec
Definition: tls_messages.h:690
Botan::TLS::Server_Hello::supports_certificate_status_message
bool supports_certificate_status_message() const
Definition: tls_messages.h:321
Botan::TLS::Certificate_Status
Definition: tls_messages.h:454
Botan::TLS::Client_Hello::supported_sig_algos
std::set< std::string > supported_sig_algos() const
Definition: tls_messages.h:113
Botan::TLS::Certificate::empty
bool empty() const
Definition: tls_messages.h:438
hash
MechanismType hash
Definition: p11_mechanism.cpp:63
Botan::TLS::Client_Hello::secure_renegotiation
bool secure_renegotiation() const
Definition: tls_messages.h:153
Botan::TLS::Server_Hello::ciphersuite
uint16_t ciphersuite() const
Definition: tls_messages.h:295
Botan::TLS::Change_Cipher_Spec::type
Handshake_Type type() const override
Definition: tls_messages.h:693
Botan::TLS::Server_Hello::Settings::ciphersuite
uint16_t ciphersuite() const
Definition: tls_messages.h:274
Botan::TLS::Client_Hello::supported_ecc_curves
std::vector< std::string > supported_ecc_curves() const
Definition: tls_messages.h:121
Botan::TLS::Client_Hello::Settings::srp_identifier
const std::string & srp_identifier() const
Definition: tls_messages.h:82
Botan::TLS::Client_Hello::session_ticket
std::vector< uint8_t > session_ticket() const
Definition: tls_messages.h:170
Botan::TLS::Client_Hello::Settings::hostname
const std::string & hostname() const
Definition: tls_messages.h:81
Botan::TLS::Handshake_Type
Handshake_Type
Definition: tls_magic.h:38
Botan::TLS::Server_Hello::prefers_compressed_ec_points
bool prefers_compressed_ec_points() const
Definition: tls_messages.h:354
Botan::TLS::Client_Hello::type
Handshake_Type type() const override
Definition: tls_messages.h:90
Botan::TLS::Client_Hello::ciphersuites
std::vector< uint16_t > ciphersuites() const
Definition: tls_messages.h:98
Botan::TLS::Client_Hello::compression_methods
std::vector< uint8_t > compression_methods() const
Definition: tls_messages.h:100
Botan::TLS::Client_Hello
Definition: tls_messages.h:67