diff options
-rw-r--r-- | crypto/testmgr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 35c2de136971..fa18753f5c34 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c | |||
@@ -940,6 +940,7 @@ static int __test_skcipher(struct crypto_skcipher *tfm, int enc, | |||
940 | char *xbuf[XBUFSIZE]; | 940 | char *xbuf[XBUFSIZE]; |
941 | char *xoutbuf[XBUFSIZE]; | 941 | char *xoutbuf[XBUFSIZE]; |
942 | int ret = -ENOMEM; | 942 | int ret = -ENOMEM; |
943 | unsigned int ivsize = crypto_skcipher_ivsize(tfm); | ||
943 | 944 | ||
944 | if (testmgr_alloc_buf(xbuf)) | 945 | if (testmgr_alloc_buf(xbuf)) |
945 | goto out_nobuf; | 946 | goto out_nobuf; |
@@ -975,7 +976,7 @@ static int __test_skcipher(struct crypto_skcipher *tfm, int enc, | |||
975 | continue; | 976 | continue; |
976 | 977 | ||
977 | if (template[i].iv) | 978 | if (template[i].iv) |
978 | memcpy(iv, template[i].iv, MAX_IVLEN); | 979 | memcpy(iv, template[i].iv, ivsize); |
979 | else | 980 | else |
980 | memset(iv, 0, MAX_IVLEN); | 981 | memset(iv, 0, MAX_IVLEN); |
981 | 982 | ||
@@ -1051,7 +1052,7 @@ static int __test_skcipher(struct crypto_skcipher *tfm, int enc, | |||
1051 | continue; | 1052 | continue; |
1052 | 1053 | ||
1053 | if (template[i].iv) | 1054 | if (template[i].iv) |
1054 | memcpy(iv, template[i].iv, MAX_IVLEN); | 1055 | memcpy(iv, template[i].iv, ivsize); |
1055 | else | 1056 | else |
1056 | memset(iv, 0, MAX_IVLEN); | 1057 | memset(iv, 0, MAX_IVLEN); |
1057 | 1058 | ||