@@ -686,6 +686,37 @@ s! {
686
686
pub rlim_cur: rlim64_t,
687
687
pub rlim_max: rlim64_t,
688
688
}
689
+
690
+ // linux/tls.h
691
+
692
+ pub struct tls_crypto_info {
693
+ pub version: :: __u16,
694
+ pub cipher_type: :: __u16,
695
+ }
696
+
697
+ pub struct tls12_crypto_info_aes_gcm_128 {
698
+ pub info: tls_crypto_info,
699
+ pub iv: [ :: c_uchar; TLS_CIPHER_AES_GCM_128_IV_SIZE ] ,
700
+ pub key: [ :: c_uchar; TLS_CIPHER_AES_GCM_128_KEY_SIZE ] ,
701
+ pub salt: [ :: c_uchar; TLS_CIPHER_AES_GCM_128_SALT_SIZE ] ,
702
+ pub rec_seq: [ :: c_uchar; TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE ] ,
703
+ }
704
+
705
+ pub struct tls12_crypto_info_aes_gcm_256 {
706
+ pub info: tls_crypto_info,
707
+ pub iv: [ :: c_uchar; TLS_CIPHER_AES_GCM_256_IV_SIZE ] ,
708
+ pub key: [ :: c_uchar; TLS_CIPHER_AES_GCM_256_KEY_SIZE ] ,
709
+ pub salt: [ :: c_uchar; TLS_CIPHER_AES_GCM_256_SALT_SIZE ] ,
710
+ pub rec_seq: [ :: c_uchar; TLS_CIPHER_AES_GCM_256_REC_SEQ_SIZE ] ,
711
+ }
712
+
713
+ pub struct tls12_crypto_info_chacha20_poly1305 {
714
+ pub info: tls_crypto_info,
715
+ pub iv: [ :: c_uchar; TLS_CIPHER_CHACHA20_POLY1305_IV_SIZE ] ,
716
+ pub key: [ :: c_uchar; TLS_CIPHER_CHACHA20_POLY1305_KEY_SIZE ] ,
717
+ pub salt: [ :: c_uchar; TLS_CIPHER_CHACHA20_POLY1305_SALT_SIZE ] ,
718
+ pub rec_seq: [ :: c_uchar; TLS_CIPHER_CHACHA20_POLY1305_REC_SEQ_SIZE ] ,
719
+ }
689
720
}
690
721
691
722
s_no_extra_traits ! {
@@ -3238,6 +3269,41 @@ pub const HWTSTAMP_FILTER_PTP_V2_DELAY_REQ: ::c_uint = 14;
3238
3269
pub const HWTSTAMP_FILTER_NTP_ALL : :: c_uint = 15 ;
3239
3270
3240
3271
// linux/tls.h
3272
+ pub const TLS_TX : :: c_int = 1 ;
3273
+ pub const TLS_RX : :: c_int = 2 ;
3274
+
3275
+ pub const TLS_1_2_VERSION_MAJOR : :: __u8 = 0x3 ;
3276
+ pub const TLS_1_2_VERSION_MINOR : :: __u8 = 0x3 ;
3277
+ pub const TLS_1_2_VERSION : :: __u16 =
3278
+ ( ( TLS_1_2_VERSION_MAJOR as :: __u16 ) << 8 ) | ( TLS_1_2_VERSION_MINOR as :: __u16 ) ;
3279
+
3280
+ pub const TLS_1_3_VERSION_MAJOR : :: __u8 = 0x3 ;
3281
+ pub const TLS_1_3_VERSION_MINOR : :: __u8 = 0x4 ;
3282
+ pub const TLS_1_3_VERSION : :: __u16 =
3283
+ ( ( TLS_1_3_VERSION_MAJOR as :: __u16 ) << 8 ) | ( TLS_1_3_VERSION_MINOR as :: __u16 ) ;
3284
+
3285
+ pub const TLS_CIPHER_AES_GCM_128 : :: __u16 = 51 ;
3286
+ pub const TLS_CIPHER_AES_GCM_128_IV_SIZE : usize = 8 ;
3287
+ pub const TLS_CIPHER_AES_GCM_128_KEY_SIZE : usize = 16 ;
3288
+ pub const TLS_CIPHER_AES_GCM_128_SALT_SIZE : usize = 4 ;
3289
+ pub const TLS_CIPHER_AES_GCM_128_TAG_SIZE : usize = 16 ;
3290
+ pub const TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE : usize = 8 ;
3291
+
3292
+ pub const TLS_CIPHER_AES_GCM_256 : :: __u16 = 52 ;
3293
+ pub const TLS_CIPHER_AES_GCM_256_IV_SIZE : usize = 8 ;
3294
+ pub const TLS_CIPHER_AES_GCM_256_KEY_SIZE : usize = 32 ;
3295
+ pub const TLS_CIPHER_AES_GCM_256_SALT_SIZE : usize = 4 ;
3296
+ pub const TLS_CIPHER_AES_GCM_256_TAG_SIZE : usize = 16 ;
3297
+ pub const TLS_CIPHER_AES_GCM_256_REC_SEQ_SIZE : usize = 8 ;
3298
+
3299
+ pub const TLS_CIPHER_CHACHA20_POLY1305 : :: __u16 = 54 ;
3300
+ pub const TLS_CIPHER_CHACHA20_POLY1305_IV_SIZE : usize = 12 ;
3301
+ pub const TLS_CIPHER_CHACHA20_POLY1305_KEY_SIZE : usize = 32 ;
3302
+ pub const TLS_CIPHER_CHACHA20_POLY1305_SALT_SIZE : usize = 0 ;
3303
+ pub const TLS_CIPHER_CHACHA20_POLY1305_TAG_SIZE : usize = 16 ;
3304
+ pub const TLS_CIPHER_CHACHA20_POLY1305_REC_SEQ_SIZE : usize = 8 ;
3305
+
3306
+ pub const TLS_SET_RECORD_TYPE : :: c_int = 1 ;
3241
3307
pub const TLS_GET_RECORD_TYPE : :: c_int = 2 ;
3242
3308
3243
3309
pub const SOL_TLS : :: c_int = 282 ;
0 commit comments