|
@@ -10,6 +10,7 @@
|
|
*
|
|
*
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
+#include <crypto/algapi.h>
|
|
#include <linux/err.h>
|
|
#include <linux/err.h>
|
|
#include <linux/errno.h>
|
|
#include <linux/errno.h>
|
|
#include <linux/fips.h>
|
|
#include <linux/fips.h>
|
|
@@ -59,6 +60,15 @@ static int crypto_check_alg(struct crypto_alg *alg)
|
|
if (alg->cra_blocksize > PAGE_SIZE / 8)
|
|
if (alg->cra_blocksize > PAGE_SIZE / 8)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
+ if (!alg->cra_type && (alg->cra_flags & CRYPTO_ALG_TYPE_MASK) ==
|
|
|
|
+ CRYPTO_ALG_TYPE_CIPHER) {
|
|
|
|
+ if (alg->cra_alignmask > MAX_CIPHER_ALIGNMASK)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
|
|
+ if (alg->cra_blocksize > MAX_CIPHER_BLOCKSIZE)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+ }
|
|
|
|
+
|
|
if (alg->cra_priority < 0)
|
|
if (alg->cra_priority < 0)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|