xfrm: Define new XFRM netlink auth attribute with specified truncation bits
authorMartin Willi <martin@strongswan.org>
Wed, 25 Nov 2009 00:29:51 +0000 (00:29 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 25 Nov 2009 23:48:37 +0000 (15:48 -0800)
The new XFRMA_ALG_AUTH_TRUNC attribute taking a xfrm_algo_auth as
argument allows the installation of authentication algorithms with
a truncation length specified in userspace, i.e. SHA256 with 128 bit
instead of 96 bit truncation.

Signed-off-by: Martin Willi <martin@strongswan.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/xfrm.h

index 3246f0e66bccd8ee2694bdfe59de69fb45d401ee..29e04beb1fc90ab233709232d02892b62c19a7d8 100644 (file)
@@ -90,6 +90,13 @@ struct xfrm_algo {
        char            alg_key[0];
 };
 
+struct xfrm_algo_auth {
+       char            alg_name[64];
+       unsigned int    alg_key_len;    /* in bits */
+       unsigned int    alg_trunc_len;  /* in bits */
+       char            alg_key[0];
+};
+
 struct xfrm_algo_aead {
        char            alg_name[64];
        unsigned int    alg_key_len;    /* in bits */
@@ -274,6 +281,7 @@ enum xfrm_attr_type_t {
        XFRMA_MIGRATE,
        XFRMA_ALG_AEAD,         /* struct xfrm_algo_aead */
        XFRMA_KMADDRESS,        /* struct xfrm_user_kmaddress */
+       XFRMA_ALG_AUTH_TRUNC,   /* struct xfrm_algo_auth */
        __XFRMA_MAX
 
 #define XFRMA_MAX (__XFRMA_MAX - 1)