Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * net/tipc/crypto.h: Include file for TIPC crypto
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * Copyright (c) 2019, Ericsson AB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  * All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  * Redistribution and use in source and binary forms, with or without
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  * modification, are permitted provided that the following conditions are met:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11)  * 1. Redistributions of source code must retain the above copyright
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12)  *    notice, this list of conditions and the following disclaimer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13)  * 2. Redistributions in binary form must reproduce the above copyright
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14)  *    notice, this list of conditions and the following disclaimer in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15)  *    documentation and/or other materials provided with the distribution.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16)  * 3. Neither the names of the copyright holders nor the names of its
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17)  *    contributors may be used to endorse or promote products derived from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18)  *    this software without specific prior written permission.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20)  * Alternatively, this software may be distributed under the terms of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21)  * GNU General Public License ("GPL") version 2 as published by the Free
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22)  * Software Foundation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24)  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25)  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26)  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27)  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28)  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29)  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30)  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31)  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32)  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33)  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34)  * POSSIBILITY OF SUCH DAMAGE.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) #ifdef CONFIG_TIPC_CRYPTO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) #ifndef _TIPC_CRYPTO_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) #define _TIPC_CRYPTO_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) #include "core.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) #include "node.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) #include "msg.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) #include "bearer.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) #define TIPC_EVERSION			7
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) /* AEAD aes(gcm) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) #define TIPC_AES_GCM_KEY_SIZE_128	16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) #define TIPC_AES_GCM_KEY_SIZE_192	24
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) #define TIPC_AES_GCM_KEY_SIZE_256	32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) #define TIPC_AES_GCM_SALT_SIZE		4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) #define TIPC_AES_GCM_IV_SIZE		12
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) #define TIPC_AES_GCM_TAG_SIZE		16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57)  * TIPC crypto modes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58)  * - CLUSTER_KEY:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59)  *	One single key is used for both TX & RX in all nodes in the cluster.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60)  * - PER_NODE_KEY:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61)  *	Each nodes in the cluster has one TX key, for RX a node needs to know
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62)  *	its peers' TX key for the decryption of messages from those nodes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) enum {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 	CLUSTER_KEY = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	PER_NODE_KEY = (1 << 1),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) extern int sysctl_tipc_max_tfms __read_mostly;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) extern int sysctl_tipc_key_exchange_enabled __read_mostly;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73)  * TIPC encryption message format:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75)  *     3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76)  *     1 0 9 8 7 6 5 4|3 2 1 0 9 8 7 6|5 4 3 2 1 0 9 8|7 6 5 4 3 2 1 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77)  *    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78)  * w0:|Ver=7| User  |D|TX |RX |K|M|N|             Rsvd                |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79)  *    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80)  * w1:|                             Seqno                             |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81)  * w2:|                           (8 octets)                          |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82)  *    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83)  * w3:\                            Prevnode                           \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84)  *    /                        (4 or 16 octets)                       /
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85)  *    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86)  *    \                                                               \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87)  *    /       Encrypted complete TIPC V2 header and user data         /
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88)  *    \                                                               \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89)  *    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90)  *    |                                                               |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91)  *    |                             AuthTag                           |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92)  *    |                           (16 octets)                         |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93)  *    |                                                               |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94)  *    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96)  * Word0:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97)  *	Ver	: = 7 i.e. TIPC encryption message version
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98)  *	User	: = 7 (for LINK_PROTOCOL); = 13 (for LINK_CONFIG) or = 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99)  *	D	: The destined bit i.e. the message's destination node is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)  *	          "known" or not at the message encryption
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)  *	TX	: TX key used for the message encryption
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102)  *	RX	: Currently RX active key corresponding to the destination
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)  *	          node's TX key (when the "D" bit is set)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104)  *	K	: Keep-alive bit (for RPS, LINK_PROTOCOL/STATE_MSG only)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105)  *	M       : Bit indicates if sender has master key
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106)  *	N	: Bit indicates if sender has no RX keys corresponding to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)  *	          receiver's TX (when the "D" bit is set)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108)  *	Rsvd	: Reserved bit, field
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109)  * Word1-2:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110)  *	Seqno	: The 64-bit sequence number of the encrypted message, also
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111)  *		  part of the nonce used for the message encryption/decryption
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)  * Word3-:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113)  *	Prevnode: The source node address, or ID in case LINK_CONFIG only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114)  *	AuthTag	: The authentication tag for the message integrity checking
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)  *		  generated by the message encryption
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) struct tipc_ehdr {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	union {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 		struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) #if defined(__LITTLE_ENDIAN_BITFIELD)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 			__u8	destined:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 				user:4,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 				version:3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 			__u8	reserved_1:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 				rx_nokey:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 				master_key:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 				keepalive:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 				rx_key_active:2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 				tx_key:2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) #elif defined(__BIG_ENDIAN_BITFIELD)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 			__u8	version:3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 				user:4,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 				destined:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 			__u8	tx_key:2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 				rx_key_active:2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 				keepalive:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 				master_key:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 				rx_nokey:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 				reserved_1:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) #error  "Please fix <asm/byteorder.h>"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 			__be16	reserved_2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 		} __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 		__be32 w0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 	__be64 seqno;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 	union {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 		__be32 addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 		__u8 id[NODE_ID_LEN]; /* For a LINK_CONFIG message only! */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) #define EHDR_SIZE	(offsetof(struct tipc_ehdr, addr) + sizeof(__be32))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) #define EHDR_CFG_SIZE	(sizeof(struct tipc_ehdr))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) #define EHDR_MIN_SIZE	(EHDR_SIZE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) #define EHDR_MAX_SIZE	(EHDR_CFG_SIZE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) #define EMSG_OVERHEAD	(EHDR_SIZE + TIPC_AES_GCM_TAG_SIZE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) int tipc_crypto_start(struct tipc_crypto **crypto, struct net *net,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 		      struct tipc_node *node);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) void tipc_crypto_stop(struct tipc_crypto **crypto);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) void tipc_crypto_timeout(struct tipc_crypto *rx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) int tipc_crypto_xmit(struct net *net, struct sk_buff **skb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 		     struct tipc_bearer *b, struct tipc_media_addr *dst,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 		     struct tipc_node *__dnode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) int tipc_crypto_rcv(struct net *net, struct tipc_crypto *rx,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 		    struct sk_buff **skb, struct tipc_bearer *b);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) int tipc_crypto_key_init(struct tipc_crypto *c, struct tipc_aead_key *ukey,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 			 u8 mode, bool master_key);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) void tipc_crypto_key_flush(struct tipc_crypto *c);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) int tipc_crypto_key_distr(struct tipc_crypto *tx, u8 key,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 			  struct tipc_node *dest);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) void tipc_crypto_msg_rcv(struct net *net, struct sk_buff *skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) void tipc_crypto_rekeying_sched(struct tipc_crypto *tx, bool changed,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 				u32 new_intv);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) int tipc_aead_key_validate(struct tipc_aead_key *ukey, struct genl_info *info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) bool tipc_ehdr_validate(struct sk_buff *skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) static inline u32 msg_key_gen(struct tipc_msg *m)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 	return msg_bits(m, 4, 16, 0xffff);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) static inline void msg_set_key_gen(struct tipc_msg *m, u32 gen)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 	msg_set_bits(m, 4, 16, 0xffff, gen);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) static inline u32 msg_key_mode(struct tipc_msg *m)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	return msg_bits(m, 4, 0, 0xf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) static inline void msg_set_key_mode(struct tipc_msg *m, u32 mode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 	msg_set_bits(m, 4, 0, 0xf, mode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) #endif /* _TIPC_CRYPTO_H */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) #endif