PcapPlusPlus  21.05
SSLCommon.h
Go to the documentation of this file.
1 #ifndef PACKETPP_SSL_LAYER_COMMON
2 #define PACKETPP_SSL_LAYER_COMMON
3 
4 #include <string>
5 #include <stdint.h>
6 
16 namespace pcpp
17 {
18 
23 #pragma pack(push, 1)
25  {
27  uint8_t recordType;
29  uint16_t recordVersion;
31  uint16_t length;
32  };
33 #pragma pack(pop)
34 
35 
40 #pragma pack(push, 1)
42  {
44  uint8_t handshakeType;
46  uint8_t length1;
48  uint16_t length2;
49  };
50 #pragma pack(pop)
51 
52 
57 #pragma pack(push, 1)
59  {
61  uint16_t handshakeVersion;
63  uint8_t random[32];
64  };
65 #pragma pack(pop)
66 
67 
72 #pragma pack(push, 1)
74  {
77  };
78 #pragma pack(pop)
79 
80 
85 #pragma pack(push, 1)
87  {
89  uint8_t alertLevel;
92  };
93 #pragma pack(pop)
94 
95 
100  {
104  SSL_ALERT = 21,
109  };
110 
111 
119  {
120  public:
125  {
127  SSL2 = 0x0200,
129  SSL3 = 0x0300,
131  TLS1_0 = 0x0301,
133  TLS1_1 = 0x0302,
135  TLS1_2 = 0x0303,
137  TLS1_3 = 0x0304,
139  TLS1_3_D14 = 0x7f0e,
141  TLS1_3_D15 = 0x7f0f,
143  TLS1_3_D16 = 0x7f10,
145  TLS1_3_D17 = 0x7f11,
147  TLS1_3_D18 = 0x7f12,
149  TLS1_3_D19 = 0x7f13,
151  TLS1_3_D20 = 0x7f14,
153  TLS1_3_D21 = 0x7f15,
155  TLS1_3_D22 = 0x7f16,
157  TLS1_3_D23 = 0x7f17,
159  TLS1_3_D24 = 0x7f18,
161  TLS1_3_D25 = 0x7f19,
163  TLS1_3_D26 = 0x7f1a,
165  TLS1_3_D27 = 0x7f1b,
167  TLS1_3_D28 = 0x7f1c,
169  TLS1_3_FBD23 = 0xfb17,
171  TLS1_3_FBD26 = 0xfb1a,
173  Unknown = 0
174  };
175 
181  SSLVersion(uint16_t sslVersionValue) { m_SSLVersionValue = sslVersionValue; }
182 
190  SSLVersionEnum asEnum(bool countTlsDraftsAs1_3 = false);
191 
195  uint16_t asUInt() { return m_SSLVersionValue; }
196 
204  std::string toString(bool countTlsDraftsAs1_3 = false);
205 
206  private:
207  uint16_t m_SSLVersionValue;
208 
209  // unimplemented empty c'tor
210  SSLVersion();
211  };
212 
217  {
248  };
249 
254  {
261  };
262 
267  {
277  SSL_ALERT_RECORD_OVERFLOW = 22,
320  };
321 
326  {
353  };
354 
359  {
386  };
387 
392  {
469  };
470 
475  {
496  };
497 
502  {
579  };
580 
585  {
608  };
609 
610 } //namespace pcpp
611 
612 #endif // PACKETPP_SSL_LAYER_COMMON
The main namespace for the PcapPlusPlus lib.
Definition: SSLCommon.h:293
Definition: SSLCommon.h:428
Definition: SSLCommon.h:578
Definition: SSLCommon.h:589
Definition: SSLCommon.h:328
Definition: SSLCommon.h:603
Definition: SSLCommon.h:438
Definition: SSLCommon.h:299
Definition: SSLCommon.h:289
Definition: SSLCommon.h:330
Definition: SSLCommon.h:227
Definition: SSLCommon.h:456
Definition: SSLCommon.h:285
Definition: SSLCommon.h:313
Definition: SSLCommon.h:601
Definition: SSLCommon.h:256
Definition: SSLCommon.h:104
Definition: SSLCommon.h:550
Definition: SSLCommon.h:424
SSLKeyExchangeAlgorithm
Definition: SSLCommon.h:325
Definition: SSLCommon.h:534
Definition: SSLCommon.h:516
Definition: SSLCommon.h:334
uint8_t recordType
Definition: SSLCommon.h:27
Definition: SSLCommon.h:352
Definition: SSLCommon.h:558
Definition: SSLCommon.h:524
Definition: SSLCommon.h:260
Definition: SSLCommon.h:570
Definition: SSLCommon.h:303
Definition: SSLCommon.h:108
Definition: SSLCommon.h:410
Definition: SSLCommon.h:528
Definition: SSLCommon.h:243
uint16_t recordVersion
Definition: SSLCommon.h:29
Definition: SSLCommon.h:554
Definition: SSLCommon.h:281
Definition: SSLCommon.h:379
Definition: SSLCommon.h:383
Definition: SSLCommon.h:468
Definition: SSLCommon.h:106
Definition: SSLCommon.h:311
Definition: SSLCommon.h:508
SSLExtensionType
Definition: SSLCommon.h:501
Definition: SSLCommon.h:400
uint16_t length2
Definition: SSLCommon.h:48
SSLAuthenticationAlgorithm
Definition: SSLCommon.h:358
Definition: SSLCommon.h:442
Definition: SSLCommon.h:572
Definition: SSLCommon.h:346
Definition: SSLCommon.h:464
Definition: SSLCommon.h:102
Definition: SSLCommon.h:450
Definition: SSLCommon.h:548
Definition: SSLCommon.h:408
Definition: SSLCommon.h:522
Definition: SSLCommon.h:86
Definition: SSLCommon.h:273
uint16_t length
Definition: SSLCommon.h:31
Definition: SSLCommon.h:514
Definition: SSLCommon.h:375
Definition: SSLCommon.h:491
Definition: SSLCommon.h:526
Definition: SSLCommon.h:479
Definition: SSLCommon.h:307
Definition: SSLCommon.h:454
SSLHandshakeType
Definition: SSLCommon.h:216
Definition: SSLCommon.h:225
uint8_t changeCipherSpec
Definition: SSLCommon.h:76
Definition: SSLCommon.h:568
Definition: SSLCommon.h:599
Definition: SSLCommon.h:350
Definition: SSLCommon.h:418
Definition: SSLCommon.h:512
Definition: SSLCommon.h:229
uint8_t alertLevel
Definition: SSLCommon.h:89
Definition: SSLCommon.h:258
Definition: SSLCommon.h:560
Definition: SSLCommon.h:446
Definition: SSLCommon.h:532
Definition: SSLCommon.h:385
Definition: SSLCommon.h:452
Definition: SSLCommon.h:295
Definition: SSLCommon.h:574
Definition: SSLCommon.h:275
Definition: SSLCommon.h:283
Definition: SSLCommon.h:271
Definition: SSLCommon.h:510
Definition: SSLCommon.h:336
uint16_t handshakeVersion
Definition: SSLCommon.h:61
Definition: SSLCommon.h:576
uint8_t alertDescription
Definition: SSLCommon.h:91
Definition: SSLCommon.h:426
Definition: SSLCommon.h:462
Definition: SSLCommon.h:235
Definition: SSLCommon.h:422
Definition: SSLCommon.h:396
SSLSymetricEncryptionAlgorithm
Definition: SSLCommon.h:391
Definition: SSLCommon.h:420
Definition: SSLCommon.h:566
SSLAlertLevel
Definition: SSLCommon.h:253
Definition: SSLCommon.h:73
SSLAlertDescription
Definition: SSLCommon.h:266
Definition: SSLCommon.h:394
Definition: SSLCommon.h:530
Definition: SSLCommon.h:416
Definition: SSLCommon.h:436
Definition: SSLCommon.h:344
Definition: SSLCommon.h:562
Definition: SSLCommon.h:506
Definition: SSLCommon.h:605
Definition: SSLCommon.h:371
Definition: SSLCommon.h:219
Definition: SSLCommon.h:444
Definition: SSLCommon.h:593
Definition: SSLCommon.h:279
Definition: SSLCommon.h:481
Definition: SSLCommon.h:301
Definition: SSLCommon.h:363
Definition: SSLCommon.h:504
SSLVersion(uint16_t sslVersionValue)
Definition: SSLCommon.h:181
Definition: SSLCommon.h:538
Definition: SSLCommon.h:487
Definition: SSLCommon.h:432
Definition: SSLCommon.h:518
Definition: SSLCommon.h:434
uint8_t handshakeType
Definition: SSLCommon.h:44
Definition: SSLCommon.h:414
Definition: SSLCommon.h:221
Definition: SSLCommon.h:297
Definition: SSLCommon.h:369
Definition: SSLCommon.h:231
Definition: SSLCommon.h:223
Definition: SSLCommon.h:520
Definition: SSLCommon.h:597
SSLHashingAlgorithm
Definition: SSLCommon.h:474
Definition: SSLCommon.h:430
SSLClientCertificateType
Definition: SSLCommon.h:584
Definition: SSLCommon.h:402
Definition: SSLCommon.h:269
Definition: SSLCommon.h:291
Definition: SSLCommon.h:460
Definition: SSLCommon.h:591
Definition: SSLCommon.h:373
Definition: SSLCommon.h:546
Definition: SSLCommon.h:556
Definition: SSLCommon.h:319
Definition: SSLCommon.h:342
Definition: SSLCommon.h:367
Definition: SSLCommon.h:332
Definition: SSLCommon.h:118
Definition: SSLCommon.h:587
Definition: SSLCommon.h:241
Definition: SSLCommon.h:466
Definition: SSLCommon.h:493
Definition: SSLCommon.h:338
Definition: SSLCommon.h:58
Definition: SSLCommon.h:440
Definition: SSLCommon.h:544
Definition: SSLCommon.h:412
Definition: SSLCommon.h:237
Definition: SSLCommon.h:552
Definition: SSLCommon.h:247
Definition: SSLCommon.h:542
Definition: SSLCommon.h:458
Definition: SSLCommon.h:477
Definition: SSLCommon.h:595
Definition: SSLCommon.h:404
Definition: SSLCommon.h:406
Definition: SSLCommon.h:485
Definition: SSLCommon.h:305
SSLVersionEnum
Definition: SSLCommon.h:124
Definition: SSLCommon.h:483
Definition: SSLCommon.h:245
Definition: SSLCommon.h:309
Definition: SSLCommon.h:348
Definition: SSLCommon.h:495
Definition: SSLCommon.h:233
Definition: SSLCommon.h:317
Definition: SSLCommon.h:239
Definition: SSLCommon.h:365
Definition: SSLCommon.h:24
Definition: SSLCommon.h:340
Definition: SSLCommon.h:489
Definition: SSLCommon.h:287
Definition: SSLCommon.h:381
Definition: SSLCommon.h:377
uint8_t length1
Definition: SSLCommon.h:46
Definition: SSLCommon.h:607
Definition: SSLCommon.h:398
Definition: SSLCommon.h:41
Definition: SSLCommon.h:361
uint16_t asUInt()
Definition: SSLCommon.h:195
Definition: SSLCommon.h:448
SSLRecordType
Definition: SSLCommon.h:99
Definition: SSLCommon.h:315
Definition: SSLCommon.h:564