mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephan Mueller <smueller@chronox.de>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 02/20] crypto: testmgr to use CRYPTO_ALG_INTERNAL
Date: Mon, 30 Mar 2015 21:31:58 +0200	[thread overview]
Message-ID: <6768727.OdoHOMWXfn@tachyon.chronox.de> (raw)
In-Reply-To: <20150330131034.GA6251@gondor.apana.org.au>

Am Dienstag, 31. März 2015, 00:10:34 schrieb Herbert Xu:

Hi Herbert,

> 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@chronox.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;

Thank you for the hint. It works and I will release a patch shortly.
> 
> Thanks,


-- 
Ciao
Stephan

  reply	other threads:[~2015-03-30 19:32 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-27 22:49 [PATCH v2 00/20] crypto: restrict usage of helper ciphers Stephan Mueller
2015-03-27 22:49 ` [PATCH v2 01/20] crypto: prevent helper ciphers from being used Stephan Mueller
2015-03-27 22:50 ` [PATCH v2 02/20] crypto: testmgr to use CRYPTO_ALG_INTERNAL Stephan Mueller
2015-03-30 13:10   ` Herbert Xu
2015-03-30 19:31     ` Stephan Mueller [this message]
2015-03-27 22:51 ` [PATCH v2 03/20] crypto: cryptd to process CRYPTO_ALG_INTERNAL Stephan Mueller
2015-03-27 22:52 ` [PATCH v2 04/20] crypto: /proc/crypto: identify internal ciphers Stephan Mueller
2015-03-27 22:52 ` [PATCH v2 05/20] crypto: mark AES-NI helper ciphers Stephan Mueller
2015-03-27 22:53 ` [PATCH v2 06/20] crypto: mark ghash clmulni " Stephan Mueller
2015-03-27 22:54 ` [PATCH v2 07/20] crypto: mark GHASH ARMv8 vmull.p64 " Stephan Mueller
2015-03-27 22:54 ` [PATCH v2 08/20] crypto: mark AES-NI Camellia " Stephan Mueller
2015-03-27 22:55 ` [PATCH v2 09/20] crypto: mark CAST5 " Stephan Mueller
2015-03-27 22:55 ` [PATCH v2 10/20] crypto: mark AVX Camellia " Stephan Mueller
2015-03-27 22:56 ` [PATCH v2 11/20] crypto: mark CAST6 " Stephan Mueller
2015-03-27 22:56 ` [PATCH v2 12/20] crypto: mark Serpent AVX2 " Stephan Mueller
2015-03-27 22:57 ` [PATCH v2 13/20] crypto: mark Serpent AVX " Stephan Mueller
2015-03-27 22:57 ` [PATCH v2 14/20] crypto: mark Serpent SSE2 " Stephan Mueller
2015-03-27 22:58 ` [PATCH v2 15/20] crypto: mark Twofish AVX " Stephan Mueller
2015-03-27 22:59 ` [PATCH v2 16/20] crypto: mark NEON bit sliced AES " Stephan Mueller
2015-03-27 23:00 ` [PATCH v2 17/20] crypto: mark ARMv8 " Stephan Mueller
2015-03-27 23:00 ` [PATCH v2 18/20] crypto: mark 64 bit " Stephan Mueller
2015-03-27 23:01 ` [PATCH v2 19/20] crypto: mcryptd to process CRYPTO_ALG_INTERNAL Stephan Mueller
2015-03-27 23:02 ` [PATCH v2 20/20] crypto: mark Multi buffer SHA1 helper cipher Stephan Mueller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6768727.OdoHOMWXfn@tachyon.chronox.de \
    --to=smueller@chronox.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®