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: <20190321114209.qdaql3kdtfsnfzla@altlinux.org>
Date:   Thu, 21 Mar 2019 14:42:10 +0300
From:   Vitaly Chikunov <vt@...linux.org>
To:     Herbert Xu <herbert@...dor.apana.org.au>
Cc:     David Howells <dhowells@...hat.com>,
        Mimi Zohar <zohar@...ux.ibm.com>,
        Dmitry Kasatkin <dmitry.kasatkin@...il.com>,
        linux-integrity@...r.kernel.org, keyrings@...r.kernel.org,
        linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v7 02/11] crypto: akcipher - check the presence of
 callback before the call

Herbert,

On Thu, Mar 21, 2019 at 07:19:18PM +0800, Herbert Xu wrote:
> On Fri, Mar 01, 2019 at 08:59:09PM +0300, Vitaly Chikunov wrote:
> > Because with introduction of EC-RDSA and change in workings of RSA in
> > regard to sign/verify, akcipher could have not all callbacks defined,
> > check the presence of callbacks before calling them to increase
> > robustness.
> > 
> > Signed-off-by: Vitaly Chikunov <vt@...linux.org>
> > ---
> >  include/crypto/akcipher.h | 25 ++++++++++++++++---------
> >  1 file changed, 16 insertions(+), 9 deletions(-)
> > 
> > diff --git a/include/crypto/akcipher.h b/include/crypto/akcipher.h
> > index 2d690494568c..f537fad1989f 100644
> > --- a/include/crypto/akcipher.h
> > +++ b/include/crypto/akcipher.h
> > @@ -268,7 +268,10 @@ static inline unsigned int crypto_akcipher_maxsize(struct crypto_akcipher *tfm)
> >  {
> >  	struct akcipher_alg *alg = crypto_akcipher_alg(tfm);
> >  
> > -	return alg->max_size(tfm);
> > +	if (alg->max_size)
> > +		return alg->max_size(tfm);
> > +	else
> > +		return 0;
> >  }
> 
> Please do these checks at registration time instead and provide
> default implementations as needed.

I guess patch "PATCH v7 01/11] KEYS: report to keyctl only actually
supported key ops" should also be removed and will infer anything from
presence of the callbacks.


Thanks,


> 
> 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ