Skip to content

Commit 555fa17

Browse files
smuellerDDherbertx
authored andcommitted
crypto: sha-mb - mark Multi buffer SHA1 helper cipher
Flag all Multi buffer SHA1 helper ciphers as internal ciphers to prevent them from being called by normal users. Signed-off-by: Stephan Mueller <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent f52bbf5 commit 555fa17

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

arch/x86/crypto/sha-mb/sha1_mb.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,8 @@ static struct shash_alg sha1_mb_shash_alg = {
694694
* use ASYNC flag as some buffers in multi-buffer
695695
* algo may not have completed before hashing thread sleep
696696
*/
697-
.cra_flags = CRYPTO_ALG_TYPE_SHASH | CRYPTO_ALG_ASYNC,
697+
.cra_flags = CRYPTO_ALG_TYPE_SHASH | CRYPTO_ALG_ASYNC |
698+
CRYPTO_ALG_INTERNAL,
698699
.cra_blocksize = SHA1_BLOCK_SIZE,
699700
.cra_module = THIS_MODULE,
700701
.cra_list = LIST_HEAD_INIT(sha1_mb_shash_alg.base.cra_list),
@@ -770,7 +771,9 @@ static int sha1_mb_async_init_tfm(struct crypto_tfm *tfm)
770771
struct sha1_mb_ctx *ctx = crypto_tfm_ctx(tfm);
771772
struct mcryptd_hash_ctx *mctx;
772773

773-
mcryptd_tfm = mcryptd_alloc_ahash("__intel_sha1-mb", 0, 0);
774+
mcryptd_tfm = mcryptd_alloc_ahash("__intel_sha1-mb",
775+
CRYPTO_ALG_INTERNAL,
776+
CRYPTO_ALG_INTERNAL);
774777
if (IS_ERR(mcryptd_tfm))
775778
return PTR_ERR(mcryptd_tfm);
776779
mctx = crypto_ahash_ctx(&mcryptd_tfm->base);

0 commit comments

Comments
 (0)