blob: 6949d650c9fc97f4c1f54662a7ae89a37542452e [file] [log] [blame]
Christopher Ferris1308ad32017-11-14 17:32:13 -08001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI_LINUX_TLS_H
20#define _UAPI_LINUX_TLS_H
21#include <linux/types.h>
Christopher Ferris1308ad32017-11-14 17:32:13 -080022#define TLS_TX 1
Christopher Ferris76a1d452018-06-27 14:12:29 -070023#define TLS_RX 2
Christopher Ferris1308ad32017-11-14 17:32:13 -080024#define TLS_VERSION_MINOR(ver) ((ver) & 0xFF)
25#define TLS_VERSION_MAJOR(ver) (((ver) >> 8) & 0xFF)
26#define TLS_VERSION_NUMBER(id) ((((id ##_VERSION_MAJOR) & 0xFF) << 8) | ((id ##_VERSION_MINOR) & 0xFF))
27#define TLS_1_2_VERSION_MAJOR 0x3
28#define TLS_1_2_VERSION_MINOR 0x3
29#define TLS_1_2_VERSION TLS_VERSION_NUMBER(TLS_1_2)
Christopher Ferris24f97eb2019-05-20 12:58:13 -070030#define TLS_1_3_VERSION_MAJOR 0x3
31#define TLS_1_3_VERSION_MINOR 0x4
32#define TLS_1_3_VERSION TLS_VERSION_NUMBER(TLS_1_3)
Christopher Ferris1308ad32017-11-14 17:32:13 -080033#define TLS_CIPHER_AES_GCM_128 51
34#define TLS_CIPHER_AES_GCM_128_IV_SIZE 8
35#define TLS_CIPHER_AES_GCM_128_KEY_SIZE 16
36#define TLS_CIPHER_AES_GCM_128_SALT_SIZE 4
37#define TLS_CIPHER_AES_GCM_128_TAG_SIZE 16
38#define TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE 8
Christopher Ferris24f97eb2019-05-20 12:58:13 -070039#define TLS_CIPHER_AES_GCM_256 52
40#define TLS_CIPHER_AES_GCM_256_IV_SIZE 8
41#define TLS_CIPHER_AES_GCM_256_KEY_SIZE 32
42#define TLS_CIPHER_AES_GCM_256_SALT_SIZE 4
43#define TLS_CIPHER_AES_GCM_256_TAG_SIZE 16
44#define TLS_CIPHER_AES_GCM_256_REC_SEQ_SIZE 8
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -070045#define TLS_CIPHER_AES_CCM_128 53
46#define TLS_CIPHER_AES_CCM_128_IV_SIZE 8
47#define TLS_CIPHER_AES_CCM_128_KEY_SIZE 16
48#define TLS_CIPHER_AES_CCM_128_SALT_SIZE 4
49#define TLS_CIPHER_AES_CCM_128_TAG_SIZE 16
50#define TLS_CIPHER_AES_CCM_128_REC_SEQ_SIZE 8
Christopher Ferris1308ad32017-11-14 17:32:13 -080051#define TLS_SET_RECORD_TYPE 1
Christopher Ferris76a1d452018-06-27 14:12:29 -070052#define TLS_GET_RECORD_TYPE 2
Christopher Ferris1308ad32017-11-14 17:32:13 -080053struct tls_crypto_info {
54 __u16 version;
55 __u16 cipher_type;
56};
57struct tls12_crypto_info_aes_gcm_128 {
58 struct tls_crypto_info info;
59 unsigned char iv[TLS_CIPHER_AES_GCM_128_IV_SIZE];
60 unsigned char key[TLS_CIPHER_AES_GCM_128_KEY_SIZE];
61 unsigned char salt[TLS_CIPHER_AES_GCM_128_SALT_SIZE];
62 unsigned char rec_seq[TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE];
63};
Christopher Ferris24f97eb2019-05-20 12:58:13 -070064struct tls12_crypto_info_aes_gcm_256 {
65 struct tls_crypto_info info;
66 unsigned char iv[TLS_CIPHER_AES_GCM_256_IV_SIZE];
67 unsigned char key[TLS_CIPHER_AES_GCM_256_KEY_SIZE];
68 unsigned char salt[TLS_CIPHER_AES_GCM_256_SALT_SIZE];
69 unsigned char rec_seq[TLS_CIPHER_AES_GCM_256_REC_SEQ_SIZE];
70};
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -070071struct tls12_crypto_info_aes_ccm_128 {
72 struct tls_crypto_info info;
73 unsigned char iv[TLS_CIPHER_AES_CCM_128_IV_SIZE];
74 unsigned char key[TLS_CIPHER_AES_CCM_128_KEY_SIZE];
75 unsigned char salt[TLS_CIPHER_AES_CCM_128_SALT_SIZE];
76 unsigned char rec_seq[TLS_CIPHER_AES_CCM_128_REC_SEQ_SIZE];
77};
Christopher Ferris9584fa42019-12-09 15:36:13 -080078enum {
79 TLS_INFO_UNSPEC,
80 TLS_INFO_VERSION,
81 TLS_INFO_CIPHER,
82 TLS_INFO_TXCONF,
83 TLS_INFO_RXCONF,
84 __TLS_INFO_MAX,
85};
86#define TLS_INFO_MAX (__TLS_INFO_MAX - 1)
87#define TLS_CONF_BASE 1
88#define TLS_CONF_SW 2
89#define TLS_CONF_HW 3
90#define TLS_CONF_HW_RECORD 4
Christopher Ferris1308ad32017-11-14 17:32:13 -080091#endif