Skip to contentSkip to conversation

crypto: remove a duplicate checks in __cbc_decrypt()

PATCH In review Dan Carpenter 4 participants 4 messages Feb 13, 2014 – Feb 25, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: remove a duplicate checks in __cbc_decrypt()

We checked "nbytes < bsize" before so it can't happen here.

---
This doesn't change how the code works, but maybe their is a bug in the original code. Please review?

arch/x86/crypto/cast5_avx_glue.c +0 -3
index e6a3700489b9..e57e20ab5e0b 100644
@@ -203,9 +203,6 @@ static unsigned int __cbc_decrypt(struct blkcipher_desc *desc,
 			src -= 1;
 			dst -= 1;
 		} while (nbytes >= bsize * CAST5_PARALLEL_BLOCKS);
-
-		if (nbytes < bsize)
-			goto done;
 	}
 
 	/* Handle leftovers */
arch/x86/crypto/blowfish_glue.c +0 -3
index 50ec333b70e6..8af519ed73d1 100644
@@ -223,9 +223,6 @@ static unsigned int __cbc_decrypt(struct blkcipher_desc *desc,
 			src -= 1;
 			dst -= 1;
 		} while (nbytes >= bsize * 4);
-
-		if (nbytes < bsize)
-			goto done;
 	}
 
 	/* Handle leftovers */
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Dan Carpenter

We checked "nbytes < bsize" before so it can't happen here.

Quoted 37 lines

---
This doesn't change how the code works, but maybe their is a bug in the original code. Please review?

arch/x86/crypto/cast5_avx_glue.c +0 -3
index e6a3700489b9..e57e20ab5e0b 100644
@@ -203,9 +203,6 @@ static unsigned int __cbc_decrypt(struct blkcipher_desc *desc,
 			src -= 1;
 			dst -= 1;
 		} while (nbytes >= bsize * CAST5_PARALLEL_BLOCKS);
-
-		if (nbytes < bsize)
-			goto done;
 	}
 
 	/* Handle leftovers */
arch/x86/crypto/blowfish_glue.c +0 -4
index 50ec333b70e6..8af519ed73d1 100644
@@ -223,9 +223,6 @@ static unsigned int __cbc_decrypt(struct blkcipher_desc *desc,
 			src -= 1;
 			dst -= 1;
 		} while (nbytes >= bsize * 4);
-
-		if (nbytes < bsize)
-			goto done;
 	}
 
 	/* Handle leftovers */
--

To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Acked-by on v1 1/1
#2 lore raw
In reply to Dan Carpenter
Quoted 1 line · Dan Carpenter
Quoted 23 lines

---
This doesn't change how the code works, but maybe their is a bug in the original code. Please review?

arch/x86/crypto/cast5_avx_glue.c +0 -3
index e6a3700489b9..e57e20ab5e0b 100644
@@ -203,9 +203,6 @@ static unsigned int __cbc_decrypt(struct blkcipher_desc *desc,
 			src -= 1;
 			dst -= 1;
 		} while (nbytes >= bsize * CAST5_PARALLEL_BLOCKS);
-
-		if (nbytes < bsize)
-			goto done;
 	}
 
 	/* Handle leftovers */
arch/x86/crypto/blowfish_glue.c +0 -0
index 50ec333b70e6..8af519ed73d1 100644

arch/x86/crypto/blowfish_glue.c static unsigned int __cbc_decrypt(struct blkcipher_desc *desc, · line 228

Quoted 9 lines
arch/x86/crypto/blowfish_glue.c +0 -3
@@ -223,9 +223,6 @@ static unsigned int __cbc_decrypt(struct blkcipher_desc *desc,
 			src -= 1;
 			dst -= 1;
 		} while (nbytes >= bsize * 4);
-
-		if (nbytes < bsize)
-			goto done;
 	}
 
 	/* Handle leftovers */

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#3 lore raw
Quoted 4 lines · Johannes Götzfried
Quoted 1 line · Dan Carpenter

Patch applied. Thanks!

Signature · 7 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html