Re: [PATCH] crypto: acomp - search acomp with scomp backend in crypto_has_acomp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 30, 2020 at 12:47:32PM +1200, Barry Song wrote:
>
> diff --git a/include/crypto/acompress.h b/include/crypto/acompress.h
> index d873f999b334..a7170848e6c2 100644
> --- a/include/crypto/acompress.h
> +++ b/include/crypto/acompress.h
> @@ -156,7 +156,7 @@ static inline void crypto_free_acomp(struct crypto_acomp *tfm)
>  static inline int crypto_has_acomp(const char *alg_name, u32 type, u32 mask)
>  {
>  	type &= ~CRYPTO_ALG_TYPE_MASK;
> -	type |= CRYPTO_ALG_TYPE_ACOMPRESS;
> +	type |= CRYPTO_ALG_TYPE_ACOMPRESS | CRYPTO_ALG_TYPE_SCOMPRESS;
>  	mask |= CRYPTO_ALG_TYPE_MASK;

I don't think this does what you think it does.  To find both
ACOMP and SCOMP, you should keep the type as is, but change the
mask to CRYPTO_ALG_TYPE_ACOMPRESS_MASK.

Cheers,
-- 
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux