diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2010-06-15 16:47:39 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2010-06-15 16:48:08 +0200 |
commit | cd4b075abdc6d2415476df9a0990b55152332e68 (patch) | |
tree | 6768a4d1a68f2662b204fa999cf7b2ee54ac32e8 /cryptodev_cipher.c | |
parent | c61cb90f289db622f5617be4fc0e07c46b3e9cd3 (diff) | |
download | kernel-crypto-cd4b075abdc6d2415476df9a0990b55152332e68.tar.gz kernel-crypto-cd4b075abdc6d2415476df9a0990b55152332e68.tar.xz kernel-crypto-cd4b075abdc6d2415476df9a0990b55152332e68.zip |
If alg->max_keysize==0, allow any key size.
Diffstat (limited to 'cryptodev_cipher.c')
-rw-r--r-- | cryptodev_cipher.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cryptodev_cipher.c b/cryptodev_cipher.c index d42bb2e0ba7..24368032b46 100644 --- a/cryptodev_cipher.c +++ b/cryptodev_cipher.c @@ -77,7 +77,7 @@ int cryptodev_cipher_init(struct cipher_data* out, const char* alg_name, uint8_t if (alg != NULL) { /* Was correct key length supplied? */ - if (unlikely((keylen < alg->min_keysize) || + if (alg->max_keysize > 0 && unlikely((keylen < alg->min_keysize) || (keylen > alg->max_keysize))) { dprintk(1,KERN_DEBUG,"Wrong keylen '%zu' for algorithm '%s'. Use %u to %u.\n", keylen, alg_name, alg->min_keysize, |