Skip to content

Commit 134bdac

Browse files
Tuong Liendavem330
authored andcommitted
tipc: add new AEAD key structure for user API
The new structure 'tipc_aead_key' is added to the 'tipc.h' for user to be able to transfer a key to TIPC in kernel. Netlink will be used for this purpose in the later commits. Acked-by: Ying Xue <[email protected]> Acked-by: Jon Maloy <[email protected]> Signed-off-by: Tuong Lien <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4cbf8ac commit 134bdac

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

include/uapi/linux/tipc.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,27 @@ struct tipc_sioc_nodeid_req {
233233
char node_id[TIPC_NODEID_LEN];
234234
};
235235

236+
/*
237+
* TIPC Crypto, AEAD
238+
*/
239+
#define TIPC_AEAD_ALG_NAME (32)
240+
241+
struct tipc_aead_key {
242+
char alg_name[TIPC_AEAD_ALG_NAME];
243+
unsigned int keylen; /* in bytes */
244+
char key[];
245+
};
246+
247+
#define TIPC_AEAD_KEYLEN_MIN (16 + 4)
248+
#define TIPC_AEAD_KEYLEN_MAX (32 + 4)
249+
#define TIPC_AEAD_KEY_SIZE_MAX (sizeof(struct tipc_aead_key) + \
250+
TIPC_AEAD_KEYLEN_MAX)
251+
252+
static inline int tipc_aead_key_size(struct tipc_aead_key *key)
253+
{
254+
return sizeof(*key) + key->keylen;
255+
}
256+
236257
/* The macros and functions below are deprecated:
237258
*/
238259

0 commit comments

Comments
 (0)