Re: [2.6 patch] crypto/aes.c: array overrun

2006-03-15 Thread Herbert Xu
On Wed, Mar 15, 2006 at 11:11:32AM +1000, David McCullough wrote: > > No problems, attached. Patch applied. BTW, please attach a Signed-off-by line for your next patch submission. Thanks a lot. -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]> Home

Re: [2.6 patch] crypto/aes.c: array overrun

2006-03-14 Thread David McCullough
Jivin Herbert Xu lays it down ... > On Wed, Mar 15, 2006 at 08:54:48AM +1000, David McCullough wrote: > > > > struct aes_ctx { > > int key_length; > > - u32 E[60]; > > - u32 D[60]; > > + u32 _KEYS[120]; > > }; > > Looks good. Thanks for this David. > > Could you please change the

Re: [2.6 patch] crypto/aes.c: array overrun

2006-03-14 Thread Herbert Xu
On Wed, Mar 15, 2006 at 08:54:48AM +1000, David McCullough wrote: > > struct aes_ctx { > int key_length; > - u32 E[60]; > - u32 D[60]; > + u32 _KEYS[120]; > }; Looks good. Thanks for this David. Could you please change the name from _KEYS to buf and patch the x86-64 version

Re: [2.6 patch] crypto/aes.c: array overrun

2006-03-14 Thread David McCullough
Jivin [EMAIL PROTECTED] lays it down ... > On Sat, 11 Mar 2006 13:41:16 +1100, Herbert Xu said: > > > OK this is not pretty but it is actually correct. Notice how we only > > overstep the mark for E_KEY but never for D_KEY. Since D_KEY is only > > initialised after this, it is OK for us to tras

Re: [2.6 patch] crypto/aes.c: array overrun

2006-03-14 Thread Valdis . Kletnieks
On Sat, 11 Mar 2006 13:41:16 +1100, Herbert Xu said: > OK this is not pretty but it is actually correct. Notice how we only > overstep the mark for E_KEY but never for D_KEY. Since D_KEY is only > initialised after this, it is OK for us to trash the start of D_KEY. I think a big comment block d

Re: [2.6 patch] crypto/aes.c: array overrun

2006-03-13 Thread Pavel Machek
On So 11-03-06 13:41:16, Herbert Xu wrote: > On Sat, Mar 11, 2006 at 02:03:39AM +0100, Adrian Bunk wrote: > > > > ... > > #define loop8(i)\ > > ... > > > t ^= E_KEY[8 * i + 7]; E_KEY[8 * i + 15] = t; \ > > } > > > > static int > > aes_set_key(void *ctx_a

Re: [2.6 patch] crypto/aes.c: array overrun

2006-03-10 Thread Herbert Xu
On Sat, Mar 11, 2006 at 02:03:39AM +0100, Adrian Bunk wrote: > > ... > #define loop8(i)\ ... > t ^= E_KEY[8 * i + 7]; E_KEY[8 * i + 15] = t; \ > } > > static int > aes_set_key(void *ctx_arg, const u8 *in_key, unsigned int key_len, u32 *flags) > { > ... >

[2.6 patch] crypto/aes.c: array overrun

2006-03-10 Thread Adrian Bunk
The Coverity checker spotted the following in crypto/aes.c: <-- snip --> ... struct aes_ctx { int key_length; u32 E[60]; u32 D[60]; }; #define E_KEY ctx->E ... #define loop8(i)\ { t = ror32(t, 8); ; t = ls_box(t) ^ rco_tab[i]; \