From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753500AbbC3TcF (ORCPT ); Mon, 30 Mar 2015 15:32:05 -0400 Received: from mail.eperm.de ([89.247.134.16]:39574 "EHLO mail.eperm.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751990AbbC3TcB convert rfc822-to-8bit (ORCPT ); Mon, 30 Mar 2015 15:32:01 -0400 From: Stephan Mueller To: Herbert Xu 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 Message-ID: <6768727.OdoHOMWXfn@tachyon.chronox.de> User-Agent: KMail/4.14.4 (Linux/3.19.1-201.fc21.x86_64; KDE/4.14.6; x86_64; ; ) In-Reply-To: <20150330131034.GA6251@gondor.apana.org.au> References: <1746748.uPZFXamDiM@tachyon.chronox.de> <1657882.6iCTT84gKK@tachyon.chronox.de> <20150330131034.GA6251@gondor.apana.org.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="iso-8859-1" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > --- > > > > 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