Index: opencrypto/xform.c =================================================================== RCS file: /usr/repo/src/sys/opencrypto/xform.c,v retrieving revision 1.5 diff -u -p -r1.5 xform.c --- opencrypto/xform.c 11 Mar 2005 17:24:46 -0000 1.5 +++ opencrypto/xform.c 16 Aug 2005 18:39:35 -0000 @@ -512,6 +512,8 @@ rijndael128_setkey(u_int8_t **sched, u_i { int err; + if (len != 16 && len != 24 && len != 32) + return (EINVAL); MALLOC(*sched, u_int8_t *, sizeof(rijndael_ctx), M_CRYPTO_DATA, M_NOWAIT|M_ZERO); if (*sched != NULL) { Index: crypto/rijndael/rijndael-alg-fst.c =================================================================== RCS file: /usr/repo/src/sys/crypto/rijndael/rijndael-alg-fst.c,v retrieving revision 1.8 diff -u -p -r1.8 rijndael-alg-fst.c --- crypto/rijndael/rijndael-alg-fst.c 11 Mar 2005 16:26:10 -0000 1.8 +++ crypto/rijndael/rijndael-alg-fst.c 16 Aug 2005 18:41:31 -0000 @@ -734,6 +734,8 @@ int rijndaelKeySetupEnc(u32 rk[/*4*(Nr + int i = 0; u32 temp; + KASSERT(keyBits == 128 || keyBits == 192 || keyBits == 256, + ("Invalid key size (%d).", keyBits)); rk[0] = GETU32(cipherKey ); rk[1] = GETU32(cipherKey + 4); rk[2] = GETU32(cipherKey + 8);