lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150330131034.GA6251@gondor.apana.org.au>
Date:	Tue, 31 Mar 2015 00:10:34 +1100
From:	Herbert Xu <herbert@...dor.apana.org.au>
To:	Stephan Mueller <smueller@...onox.de>
Cc:	linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 02/20] crypto: testmgr to use CRYPTO_ALG_INTERNAL

On Fri, Mar 27, 2015 at 11:50:42PM +0100, Stephan Mueller wrote:
> If a cipher allocation fails with -ENOENT, the testmgr now retries
> to allocate the cipher with CRYPTO_ALG_INTERNAL flag.
> 
> As all ciphers, including the internal ciphers will be processed by
> the testmgr, it needs to be able to allocate those ciphers.
> 
> Signed-off-by: Stephan Mueller <smueller@...onox.de>
> ---
>  crypto/testmgr.c | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/crypto/testmgr.c b/crypto/testmgr.c
> index 1f879ad..609bafa 100644
> --- a/crypto/testmgr.c
> +++ b/crypto/testmgr.c
> @@ -1506,6 +1506,9 @@ static int alg_test_aead(const struct alg_test_desc *desc, const char *driver,
>  	int err = 0;
>  
>  	tfm = crypto_alloc_aead(driver, type, mask);
> +	if (PTR_ERR(tfm) == -ENOENT)
> +		tfm = crypto_alloc_aead(driver, type | CRYPTO_ALG_INTERNAL,
> +					mask | CRYPTO_ALG_INTERNAL);

We need to be able to say give me an algorithm regardless of the
INTERNAL bit.  How about treating (type & CRYPTO_ALG_INTERNAL) &&
!(mask & CRYPTO_ALG_INTERNAL) as that special case?

So in patch 1 you would do

	if (!((type | mask) & CRYPTO_ALG_INTERNAL))
		mask |= CRYPTO_ALG_INTERNAL;

Thanks,
-- 
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ