Re: [PATCH] crypto/testmgr: don't copy from source IV too much

2015-09-04 Thread Herbert Xu
On Fri, Sep 04, 2015 at 07:42:26PM +0300, Andrey Ryabinin wrote: > > But noticed that some algs don't set ivsize (which makes it zero). > E.g. "ecb-cast6-avx" doesn't set it, but test vectors > (cast6_enc_tv_template[], cast6_dec_tv_template[]) > have .iv of 16bytes. ECB should always have an IV

Re: [PATCH] crypto/testmgr: don't copy from source IV too much

2015-09-04 Thread Andrey Ryabinin
On 09/03/2015 04:20 PM, Herbert Xu wrote: > On Thu, Sep 03, 2015 at 02:32:00PM +0300, Andrey Ryabinin wrote: >> While the destination buffer 'iv' is MAX_IVLEN size, >> the source 'template[i].iv' could be smaller. Thus >> copying it via memcpy() leads to invalid memory access. >> Use strlcpy() inst

Re: [PATCH] crypto/testmgr: don't copy from source IV too much

2015-09-03 Thread Herbert Xu
On Thu, Sep 03, 2015 at 02:32:00PM +0300, Andrey Ryabinin wrote: > While the destination buffer 'iv' is MAX_IVLEN size, > the source 'template[i].iv' could be smaller. Thus > copying it via memcpy() leads to invalid memory access. > Use strlcpy() instead. > > Signed-off-by: Andrey Ryabinin Thank

[PATCH] crypto/testmgr: don't copy from source IV too much

2015-09-03 Thread Andrey Ryabinin
While the destination buffer 'iv' is MAX_IVLEN size, the source 'template[i].iv' could be smaller. Thus copying it via memcpy() leads to invalid memory access. Use strlcpy() instead. Signed-off-by: Andrey Ryabinin --- crypto/testmgr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) di