diff options
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, |