diff mbox

xfrm: Fix key lengths for rfc3686(ctr(aes))

Message ID alpine.LFD.1.10.1107281246381.11308@net-test1.az.mvista.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Tushar Gohad July 28, 2011, 8:36 p.m. UTC
Fix the min and max bit lengths for AES-CTR (RFC3686) keys.
The number of bits in key spec is the key length (128/256)
plus 32 bits of nonce.

This change takes care of the "Invalid key length" errors
reported by setkey when specifying 288 bit keys for aes-ctr.

Signed-off-by: Tushar Gohad <tgohad@mvista.com>
---
  net/xfrm/xfrm_algo.c |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)

Comments

Herbert Xu July 29, 2011, 12:05 a.m. UTC | #1
On Thu, Jul 28, 2011 at 01:36:20PM -0700, Tushar Gohad wrote:
>
> Fix the min and max bit lengths for AES-CTR (RFC3686) keys.
> The number of bits in key spec is the key length (128/256)
> plus 32 bits of nonce.
>
> This change takes care of the "Invalid key length" errors
> reported by setkey when specifying 288 bit keys for aes-ctr.
>
> Signed-off-by: Tushar Gohad <tgohad@mvista.com>

Acked-by: Herbert Xu <herbert@gondor.apana.org.au>

Thanks,
David Miller July 29, 2011, 1:25 a.m. UTC | #2
From: Tushar Gohad <tgohad@mvista.com>
Date: Thu, 28 Jul 2011 13:36:20 -0700 (MST)

> 
> Fix the min and max bit lengths for AES-CTR (RFC3686) keys.
> The number of bits in key spec is the key length (128/256)
> plus 32 bits of nonce.
> 
> This change takes care of the "Invalid key length" errors
> reported by setkey when specifying 288 bit keys for aes-ctr.
> 
> Signed-off-by: Tushar Gohad <tgohad@mvista.com>

APplied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/xfrm/xfrm_algo.c b/net/xfrm/xfrm_algo.c
index 58064d9..791ab2e 100644
--- a/net/xfrm/xfrm_algo.c
+++ b/net/xfrm/xfrm_algo.c
@@ -462,8 +462,8 @@  static struct xfrm_algo_desc ealg_list[] = {
  	.desc = {
  		.sadb_alg_id = SADB_X_EALG_AESCTR,
  		.sadb_alg_ivlen	= 8,
-		.sadb_alg_minbits = 128,
-		.sadb_alg_maxbits = 256
+		.sadb_alg_minbits = 160,
+		.sadb_alg_maxbits = 288
  	}
  },
  };