DragonFlyBSD Kernel Audit
DF-0963 / fix.diff
← back to finding ↓ download raw
diff --git a/crypto/rijndael/rijndael-alg-fst.c b/crypto/rijndael/rijndael-alg-fst.c
--- a/crypto/rijndael/rijndael-alg-fst.c
+++ b/crypto/rijndael/rijndael-alg-fst.c
@@ -732,6 +732,8 @@
  * @return	the number of rounds for the given cipher key size.
  */
 int rijndaelKeySetupEnc(u32 rk[/*4*(Nr + 1)*/], const u8 cipherKey[], int keyBits) {
+	if (keyBits != 128 && keyBits != 192 && keyBits != 256)
+		return -1;
 	int i = 0;
 	u32 temp;