aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crypto/testmgr.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index 758d02847308..f4ed6d4205e7 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -429,7 +429,7 @@ static int __test_aead(struct crypto_aead *tfm, int enc,
429 struct scatterlist *sgout; 429 struct scatterlist *sgout;
430 const char *e, *d; 430 const char *e, *d;
431 struct tcrypt_result result; 431 struct tcrypt_result result;
432 unsigned int authsize; 432 unsigned int authsize, iv_len;
433 void *input; 433 void *input;
434 void *output; 434 void *output;
435 void *assoc; 435 void *assoc;
@@ -500,10 +500,11 @@ static int __test_aead(struct crypto_aead *tfm, int enc,
500 500
501 memcpy(input, template[i].input, template[i].ilen); 501 memcpy(input, template[i].input, template[i].ilen);
502 memcpy(assoc, template[i].assoc, template[i].alen); 502 memcpy(assoc, template[i].assoc, template[i].alen);
503 iv_len = crypto_aead_ivsize(tfm);
503 if (template[i].iv) 504 if (template[i].iv)
504 memcpy(iv, template[i].iv, MAX_IVLEN); 505 memcpy(iv, template[i].iv, iv_len);
505 else 506 else
506 memset(iv, 0, MAX_IVLEN); 507 memset(iv, 0, iv_len);
507 508
508 crypto_aead_clear_flags(tfm, ~0); 509 crypto_aead_clear_flags(tfm, ~0);
509 if (template[i].wk) 510 if (template[i].wk)