Skip to contentSkip to conversation

IV size failing on skcipher API

PATCH In review Leonidas Da Silva Barbosa 2 participants 2 messages Nov 30, 2015 – Dec 4, 2015 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 IV size failing on skcipher API

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

Fixing this adding a correct size.

---
 drivers/crypto/vmx/aes_cbc.c | 2 +-
 drivers/crypto/vmx/aes_ctr.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/crypto/vmx/aes_cbc.c +1 -1
index 0b8fe2e..78a9786 100644
@@ -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,
drivers/crypto/vmx/aes_ctr.c +1 -1
index ee1306c..1febc4f 100644
@@ -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,
Signature · 1 line
2.1.0
maintainer
#1 lore raw
Quoted 7 lines · Leonidas Da Silva Barbosa

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

Fixing this adding a correct size.

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt