提交 134bdac3 编写于 作者: T Tuong Lien 提交者: David S. Miller

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: NYing Xue <ying.xue@windreiver.com>
Acked-by: NJon Maloy <jon.maloy@ericsson.com>
Signed-off-by: NTuong Lien <tuong.t.lien@dektech.com.au>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 4cbf8ac2
...@@ -233,6 +233,27 @@ struct tipc_sioc_nodeid_req { ...@@ -233,6 +233,27 @@ struct tipc_sioc_nodeid_req {
char node_id[TIPC_NODEID_LEN]; char node_id[TIPC_NODEID_LEN];
}; };
/*
* TIPC Crypto, AEAD
*/
#define TIPC_AEAD_ALG_NAME (32)
struct tipc_aead_key {
char alg_name[TIPC_AEAD_ALG_NAME];
unsigned int keylen; /* in bytes */
char key[];
};
#define TIPC_AEAD_KEYLEN_MIN (16 + 4)
#define TIPC_AEAD_KEYLEN_MAX (32 + 4)
#define TIPC_AEAD_KEY_SIZE_MAX (sizeof(struct tipc_aead_key) + \
TIPC_AEAD_KEYLEN_MAX)
static inline int tipc_aead_key_size(struct tipc_aead_key *key)
{
return sizeof(*key) + key->keylen;
}
/* The macros and functions below are deprecated: /* The macros and functions below are deprecated:
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册