crypto: vmx - IV size failing on skcipher API
authorLeonidas Da Silva Barbosa <leosilva@linux.vnet.ibm.com>
Mon, 30 Nov 2015 18:19:03 +0000 (16:19 -0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 4 Dec 2015 14:29:56 +0000 (22:29 +0800)
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>
drivers/crypto/vmx/aes_cbc.c
drivers/crypto/vmx/aes_ctr.c

index 0b8fe2ec5315fc8253431ca533d953b9c72d7243..78a978613ca83261c5a2a327e18dc54f9adc516d 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 ee1306cd8f59bc5fd2d1f8b286ff5f553d53cc85..1febc4f1d9affb6380cf6b4fa2b9abc6e1c43dae 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,