In case of AEAD, some crypto engines expect assoc data and iv to be contiguous. This is how native IPsec works; make testmgr's behaviour the same. (Alternative would be to fix this in the crypto engine drivers, but this is pricy since it would involve memory allocation and copy in the hot path.) Signed-off-by: Horia Geanta <horia.geanta@xxxxxxxxxxxxx> --- crypto/testmgr.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/crypto/testmgr.c b/crypto/testmgr.c index ee62d5c..af2a1a3 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c @@ -374,7 +374,7 @@ static int test_aead(struct crypto_aead *tfm, int enc, unsigned int authsize; void *input; void *assoc; - char iv[MAX_IVLEN]; + char *iv; char *xbuf[XBUFSIZE]; char *axbuf[XBUFSIZE]; @@ -412,11 +412,12 @@ static int test_aead(struct crypto_aead *tfm, int enc, ret = -EINVAL; if (WARN_ON(template[i].ilen > PAGE_SIZE || - template[i].alen > PAGE_SIZE)) + template[i].alen + MAX_IVLEN > PAGE_SIZE)) goto out; memcpy(input, template[i].input, template[i].ilen); memcpy(assoc, template[i].assoc, template[i].alen); + iv = (char*)assoc + template[i].alen; if (template[i].iv) memcpy(iv, template[i].iv, MAX_IVLEN); else -- 1.7.3.4 -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html