diff options
author | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2005-08-17 07:59:07 +0000 |
---|---|---|
committer | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2005-08-17 07:59:07 +0000 |
commit | 12e755355b4a49869a09b0ddcc188db6fb32197a (patch) | |
tree | f1a442d240b0726d949baa8ec7ccf47857c4db3a /sys/crypto/rijndael/rijndael-alg-fst.c | |
parent | a07b0febaa9128b40144b9858eb5da06916e6e82 (diff) |
Assert proper key size also in userland by defining KASSERT in !_KERNEL case.
Notes
Notes:
svn path=/head/; revision=149176
Diffstat (limited to 'sys/crypto/rijndael/rijndael-alg-fst.c')
-rw-r--r-- | sys/crypto/rijndael/rijndael-alg-fst.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/crypto/rijndael/rijndael-alg-fst.c b/sys/crypto/rijndael/rijndael-alg-fst.c index 9f02aa648b05..5197e226a26e 100644 --- a/sys/crypto/rijndael/rijndael-alg-fst.c +++ b/sys/crypto/rijndael/rijndael-alg-fst.c @@ -33,6 +33,8 @@ __FBSDID("$FreeBSD$"); #include <sys/systm.h> #else #include <string.h> +#include <assert.h> +#define KASSERT(exp, msg) assert(exp) #endif #include <crypto/rijndael/rijndael.h> @@ -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); |