brintos

brintos / linux-shallow public Read only

0
0
Text · 2.8 KiB · ff02287 Raw
79 lines · c
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */2/*3 * Copyright (c) 2016-2017, Mellanox Technologies. All rights reserved.4 *5 * This software is available to you under a choice of one of two6 * licenses.  You may choose to be licensed under the terms of the GNU7 * General Public License (GPL) Version 2, available from the file8 * COPYING in the main directory of this source tree, or the9 * OpenIB.org BSD license below:10 *11 *     Redistribution and use in source and binary forms, with or12 *     without modification, are permitted provided that the following13 *     conditions are met:14 *15 *      - Redistributions of source code must retain the above16 *        copyright notice, this list of conditions and the following17 *        disclaimer.18 *19 *      - Redistributions in binary form must reproduce the above20 *        copyright notice, this list of conditions and the following21 *        disclaimer in the documentation and/or other materials22 *        provided with the distribution.23 *24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE31 * SOFTWARE.32 */33 34#ifndef _UAPI_LINUX_TLS_H35#define _UAPI_LINUX_TLS_H36 37#include <linux/types.h>38 39/* TLS socket options */40#define TLS_TX			1	/* Set transmit parameters */41#define TLS_RX			2	/* Set receive parameters */42 43/* Supported versions */44#define TLS_VERSION_MINOR(ver)	((ver) & 0xFF)45#define TLS_VERSION_MAJOR(ver)	(((ver) >> 8) & 0xFF)46 47#define TLS_VERSION_NUMBER(id)	((((id##_VERSION_MAJOR) & 0xFF) << 8) |	\48				 ((id##_VERSION_MINOR) & 0xFF))49 50#define TLS_1_2_VERSION_MAJOR	0x351#define TLS_1_2_VERSION_MINOR	0x352#define TLS_1_2_VERSION		TLS_VERSION_NUMBER(TLS_1_2)53 54/* Supported ciphers */55#define TLS_CIPHER_AES_GCM_128				5156#define TLS_CIPHER_AES_GCM_128_IV_SIZE			857#define TLS_CIPHER_AES_GCM_128_KEY_SIZE		1658#define TLS_CIPHER_AES_GCM_128_SALT_SIZE		459#define TLS_CIPHER_AES_GCM_128_TAG_SIZE		1660#define TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE		861 62#define TLS_SET_RECORD_TYPE	163#define TLS_GET_RECORD_TYPE	264 65struct tls_crypto_info {66	__u16 version;67	__u16 cipher_type;68};69 70struct tls12_crypto_info_aes_gcm_128 {71	struct tls_crypto_info info;72	unsigned char iv[TLS_CIPHER_AES_GCM_128_IV_SIZE];73	unsigned char key[TLS_CIPHER_AES_GCM_128_KEY_SIZE];74	unsigned char salt[TLS_CIPHER_AES_GCM_128_SALT_SIZE];75	unsigned char rec_seq[TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE];76};77 78#endif /* _UAPI_LINUX_TLS_H */79