netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfrm: Fix key lengths for rfc3686(ctr(aes))
@ 2011-07-28 20:36 Tushar Gohad
  2011-07-29  0:05 ` Herbert Xu
  2011-07-29  1:25 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Tushar Gohad @ 2011-07-28 20:36 UTC (permalink / raw)
  To: Joy Latten, Herbert Xu; +Cc: netdev, tgohad


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(-)

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
  	}
  },
  };
-- 
1.6.3.3.202.g91879


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-07-29  1:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-28 20:36 [PATCH] xfrm: Fix key lengths for rfc3686(ctr(aes)) Tushar Gohad
2011-07-29  0:05 ` Herbert Xu
2011-07-29  1:25 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).