crypto: vmx - IV size failing on skcipher API
authorLeonidas Da Silva Barbosa <leosilva@linux.vnet.ibm.com>
Mon, 27 Jun 2016 15:12:02 +0000 (09:12 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Sep 2016 06:27:48 +0000 (08:27 +0200)
[ Upstream commit 0d3d054b43719ef33232677ba27ba6097afdafbc ]

IV size was zero on CBC and CTR modes,
causing a bug triggered by skcipher.

Fixing this  adding a correct size.

Signed-off-by: Leonidas Da Silva Barbosa <leosilva@linux.vnet.ibm.com>
Signed-off-by: Paulo Smorigo <pfsmorigo@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/vmx/aes_cbc.c
drivers/crypto/vmx/aes_ctr.c

index f3801b983f4222fb874fbb2771967fa62debd525..3f8bb9a40df1268eda70f23bef13512308f73d91 100644 (file)
@@ -191,7 +191,7 @@ struct crypto_alg p8_aes_cbc_alg = {
        .cra_init = p8_aes_cbc_init,
        .cra_exit = p8_aes_cbc_exit,
        .cra_blkcipher = {
-                         .ivsize = 0,
+                         .ivsize = AES_BLOCK_SIZE,
                          .min_keysize = AES_MIN_KEY_SIZE,
                          .max_keysize = AES_MAX_KEY_SIZE,
                          .setkey = p8_aes_cbc_setkey,
index 404a1b69a3ab90511fbdee5cdd1994004c71e762..72f138985e1835675f7b4a54362b1e43ffd85a5f 100644 (file)
@@ -175,7 +175,7 @@ struct crypto_alg p8_aes_ctr_alg = {
        .cra_init = p8_aes_ctr_init,
        .cra_exit = p8_aes_ctr_exit,
        .cra_blkcipher = {
-                         .ivsize = 0,
+                         .ivsize = AES_BLOCK_SIZE,
                          .min_keysize = AES_MIN_KEY_SIZE,
                          .max_keysize = AES_MAX_KEY_SIZE,
                          .setkey = p8_aes_ctr_setkey,