@@ -393,8 +393,12 @@ enum CompressionType: u8 {
393
393
Gzip = 0x2
394
394
};
395
395
396
- enum EncryptionType : u8 {
397
- // Experimental
396
+ enum EncryptionType : u32 {
397
+ TLS = 0x544c534b, /* TLS Key Log */
398
+ SSH = 0x5353484b, /* SSH Key Log */
399
+ WIREGUARD = 0x57474b4c, /* WireGuard Key Log */
400
+ ZIGBEE_NWK_KEY = 0x5a4e574b, /* Zigbee NWK Key */
401
+ ZIGBEE_APS_KEY = 0x5a415053 /* Zigbee APS Key */
398
402
};
399
403
400
404
enum FixedLengthType : u8 {
@@ -410,12 +414,16 @@ struct CompressionBlock{
410
414
u32 block_len2[[name("BlockLen2")]];
411
415
};
412
416
413
- // Experimental
414
417
struct EncryptionBlock{
415
418
BlockType block_type[[name("BlockType")]];
416
419
u32 block_len1[[name("BlockLen1")]];
417
420
EncryptionType comp_type [[name("Encryption")]];
418
- char data[block_len1];
421
+ u32 secrets_len[[name("SecretsLength")]];
422
+ char data[secrets_len];
423
+ padding[-$ & 3];
424
+ // https://ietf-opsawg-wg.github.io/draft-ietf-opsawg-pcap/draft-ietf-opsawg-pcapng.html#section-4.7-6.6.1
425
+ // No DSB-specific options are currently defined
426
+ // Option options;
419
427
u32 block_len2[[name("BlockLen2")]];
420
428
};
421
429
@@ -505,6 +513,12 @@ struct PCAPng{
505
513
} else {
506
514
be CustomBlock CBN;
507
515
}
516
+ } else if (block_type == BlockType::Decryption) {
517
+ if (order == PcapOrder::Little) {
518
+ le EncryptionBlock DSB;
519
+ } else {
520
+ be EncryptionBlock DSB;
521
+ }
508
522
} else {
509
523
std::print("Unknown BlockType at offset {:#x}\n", $);
510
524
break;
0 commit comments