From bb000dd3d507db089f8c5db5da3365aeaeb093f3 Mon Sep 17 00:00:00 2001 From: pjd Date: Wed, 17 Aug 2005 07:59:07 +0000 Subject: Assert proper key size also in userland by defining KASSERT in !_KERNEL case. --- sys/crypto/rijndael/rijndael-alg-fst.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/crypto') diff --git a/sys/crypto/rijndael/rijndael-alg-fst.c b/sys/crypto/rijndael/rijndael-alg-fst.c index 9f02aa6..5197e22 100644 --- a/sys/crypto/rijndael/rijndael-alg-fst.c +++ b/sys/crypto/rijndael/rijndael-alg-fst.c @@ -33,6 +33,8 @@ __FBSDID("$FreeBSD$"); #include #else #include +#include +#define KASSERT(exp, msg) assert(exp) #endif #include @@ -734,10 +736,8 @@ int rijndaelKeySetupEnc(u32 rk[/*4*(Nr + 1)*/], const u8 cipherKey[], int keyBit int i = 0; u32 temp; -#ifdef _KERNEL KASSERT(keyBits == 128 || keyBits == 192 || keyBits == 256, ("Invalid key size (%d).", keyBits)); -#endif rk[0] = GETU32(cipherKey ); rk[1] = GETU32(cipherKey + 4); rk[2] = GETU32(cipherKey + 8); -- cgit v1.1