aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/algapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/algapi.c')
-rw-r--r--crypto/algapi.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/crypto/algapi.c b/crypto/algapi.c
index 2a0271b5f62a..c0755cf4f53f 100644
--- a/crypto/algapi.c
+++ b/crypto/algapi.c
@@ -10,6 +10,7 @@
10 * 10 *
11 */ 11 */
12 12
13#include <crypto/algapi.h>
13#include <linux/err.h> 14#include <linux/err.h>
14#include <linux/errno.h> 15#include <linux/errno.h>
15#include <linux/fips.h> 16#include <linux/fips.h>
@@ -59,6 +60,15 @@ static int crypto_check_alg(struct crypto_alg *alg)
59 if (alg->cra_blocksize > PAGE_SIZE / 8) 60 if (alg->cra_blocksize > PAGE_SIZE / 8)
60 return -EINVAL; 61 return -EINVAL;
61 62
63 if (!alg->cra_type && (alg->cra_flags & CRYPTO_ALG_TYPE_MASK) ==
64 CRYPTO_ALG_TYPE_CIPHER) {
65 if (alg->cra_alignmask > MAX_CIPHER_ALIGNMASK)
66 return -EINVAL;
67
68 if (alg->cra_blocksize > MAX_CIPHER_BLOCKSIZE)
69 return -EINVAL;
70 }
71
62 if (alg->cra_priority < 0) 72 if (alg->cra_priority < 0)
63 return -EINVAL; 73 return -EINVAL;
64 74