| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
#pragma once |
| 17 |
|
| 18 |
#include "utils/s2n_blob.h" |
| 19 |
|
| 20 |
|
| 21 |
#if defined(S2N_KTLS_SUPPORTED) |
| 22 |
#include <linux/tls.h> |
| 23 |
|
| 24 |
typedef struct tls12_crypto_info_aes_gcm_128 s2n_ktls_crypto_info_tls12_aes_gcm_128; |
| 25 |
typedef struct tls12_crypto_info_aes_gcm_256 s2n_ktls_crypto_info_tls12_aes_gcm_256; |
| 26 |
#else |
| 27 |
#define TLS_1_2_VERSION 0 |
| 28 |
#define TLS_1_3_VERSION 0 |
| 29 |
|
| 30 |
#define TLS_CIPHER_AES_GCM_128 0 |
| 31 |
typedef struct s2n_ktls_crypto_info_stub s2n_ktls_crypto_info_tls12_aes_gcm_128; |
| 32 |
#define TLS_CIPHER_AES_GCM_256 0 |
| 33 |
typedef struct s2n_ktls_crypto_info_stub s2n_ktls_crypto_info_tls12_aes_gcm_256; |
| 34 |
#endif |
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
struct s2n_ktls_crypto_info_stub { |
| 42 |
struct { |
| 43 |
uint8_t version; |
| 44 |
uint8_t cipher_type; |
| 45 |
} info; |
| 46 |
uint8_t iv[1]; |
| 47 |
uint8_t key[1]; |
| 48 |
uint8_t salt[1]; |
| 49 |
uint8_t rec_seq[1]; |
| 50 |
}; |
| 51 |
|
| 52 |
struct s2n_ktls_crypto_info { |
| 53 |
struct s2n_blob value; |
| 54 |
union { |
| 55 |
s2n_ktls_crypto_info_tls12_aes_gcm_128 aes_gcm_128; |
| 56 |
s2n_ktls_crypto_info_tls12_aes_gcm_256 aes_gcm_256; |
| 57 |
} ciphers; |
| 58 |
}; |
| 59 |
|
| 60 |
struct s2n_ktls_crypto_info_inputs { |
| 61 |
struct s2n_blob iv; |
| 62 |
struct s2n_blob key; |
| 63 |
struct s2n_blob seq; |
| 64 |
}; |