mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [Crypto] twofish-flag.patch
@ 2004-07-09 17:12 Thomas DuBuisson
  2004-07-09 17:59 ` James Morris
  2004-07-10  0:06 ` David S. Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Thomas DuBuisson @ 2004-07-09 17:12 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 246 bytes --]

Unless there is a good reason for the flag handling to be different in 
twofish than in AES or Serpent I think this needs applied.  It just sets 
the proper flag if someone tries to run twofish_setkey with an improper 
key size.

Thomas DuBuisson

[-- Attachment #2: Type: TEXT/PLAIN, Size: 546 bytes --]

--- linux-2.6.7/crypto/twofish.c.orig	2004-06-15 22:20:26.000000000 -0700
+++ linux-2.6.7/crypto/twofish.c	2004-07-08 11:03:02.000000000 -0700
@@ -663,7 +663,10 @@ static int twofish_setkey(void *cx, cons
 
 	/* Check key length. */
 	if (key_len != 16 && key_len != 24 && key_len != 32)
+	{
+		*flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
 		return -EINVAL; /* unsupported key length */
+	}
 
 	/* Compute the first two words of the S vector.  The magic numbers are
 	 * the entries of the RS matrix, preprocessed through poly_to_exp. The

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

* Re: [Crypto] twofish-flag.patch
  2004-07-09 17:12 [Crypto] twofish-flag.patch Thomas DuBuisson
@ 2004-07-09 17:59 ` James Morris
  2004-07-10  0:06 ` David S. Miller
  1 sibling, 0 replies; 3+ messages in thread
From: James Morris @ 2004-07-09 17:59 UTC (permalink / raw)
  To: Thomas DuBuisson; +Cc: linux-kernel

On Fri, 9 Jul 2004, Thomas DuBuisson wrote:

> Unless there is a good reason for the flag handling to be different in 
> twofish than in AES or Serpent I think this needs applied.  It just sets 
> the proper flag if someone tries to run twofish_setkey with an improper 
> key size.

This looks fine to me.


- James
-- 
James Morris
<jmorris@redhat.com>



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

* Re: [Crypto] twofish-flag.patch
  2004-07-09 17:12 [Crypto] twofish-flag.patch Thomas DuBuisson
  2004-07-09 17:59 ` James Morris
@ 2004-07-10  0:06 ` David S. Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David S. Miller @ 2004-07-10  0:06 UTC (permalink / raw)
  To: Thomas DuBuisson; +Cc: linux-kernel

On Fri, 9 Jul 2004 10:12:12 -0700 (PDT)
Thomas DuBuisson <tomd@csds.uidaho.edu> wrote:

> Unless there is a good reason for the flag handling to be different in 
> twofish than in AES or Serpent I think this needs applied.  It just sets 
> the proper flag if someone tries to run twofish_setkey with an improper 
> key size.

Applied, thanks Thomas.


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

end of thread, other threads:[~2004-07-10  0:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-09 17:12 [Crypto] twofish-flag.patch Thomas DuBuisson
2004-07-09 17:59 ` James Morris
2004-07-10  0:06 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome