[PATCH] crypto/nx: add missing call to of_node_put()

2021-02-25 Thread Yang Li
In one of the error paths of the for_each_child_of_node() loop, add missing call to of_node_put(). Fix the following coccicheck warning: ./drivers/crypto/nx/nx-common-powernv.c:927:1-23: WARNING: Function "for_each_child_of_node" should have of_node_put() before return around line 936. Reported-b

Re: [PATCH 04/13] x86/crypto/aesni-intel_avx: Standardize stack alignment prologue

2021-02-25 Thread Peter Zijlstra
On Wed, Feb 24, 2021 at 10:29:17AM -0600, Josh Poimboeuf wrote: > Use RBP instead of R14 for saving the old stack pointer before > realignment. This resembles what compilers normally do. > > This enables ORC unwinding by allowing objtool to understand the stack > realignment. > > Signed-off-by:

Re: [PATCH 00/13] x86/crypto/asm: objtool support

2021-02-25 Thread Peter Zijlstra
On Wed, Feb 24, 2021 at 10:29:13AM -0600, Josh Poimboeuf wrote: > Standardize the crypto asm to make it resemble compiler-generated code, > so that objtool can understand it. > > This magically enables ORC unwinding from crypto code. It also fixes > the last known remaining objtool warnings on vm

Re: [PATCH] crypto/nx: add missing call to of_node_put()

2021-02-25 Thread Michael Ellerman
Yang Li writes: > In one of the error paths of the for_each_child_of_node() loop, > add missing call to of_node_put(). > > Fix the following coccicheck warning: > ./drivers/crypto/nx/nx-common-powernv.c:927:1-23: WARNING: Function > "for_each_child_of_node" should have of_node_put() before return

Re: [PATCH v2] vio: make remove callback return void

2021-02-25 Thread Michael Ellerman
Uwe Kleine-König writes: > The driver core ignores the return value of struct bus_type::remove() > because there is only little that can be done. To simplify the quest to > make this function return void, let struct vio_driver::remove() return > void, too. All users already unconditionally return

Re: [PATCH] crypto/nx: add missing call to of_node_put()

2021-02-25 Thread kernel test robot
Hi Yang, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on powerpc/next] [also build test WARNING on cryptodev/master crypto/master v5.11 next-20210225] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest

Re: [PATCH 00/13] x86/crypto/asm: objtool support

2021-02-25 Thread Josh Poimboeuf
On Thu, Feb 25, 2021 at 10:46:56AM +0100, Peter Zijlstra wrote: > On Wed, Feb 24, 2021 at 10:29:13AM -0600, Josh Poimboeuf wrote: > > Standardize the crypto asm to make it resemble compiler-generated code, > > so that objtool can understand it. > > > > This magically enables ORC unwinding from cry

Re: [PATCH v2] vio: make remove callback return void

2021-02-25 Thread Arnd Bergmann
On Thu, Feb 25, 2021 at 12:52 PM Michael Ellerman wrote: > > Uwe Kleine-König writes: > > The driver core ignores the return value of struct bus_type::remove() > > because there is only little that can be done. To simplify the quest to > > make this function return void, let struct vio_driver::re

[PATCH v9 0/9] Add support for x509 certs with NIST P384/256/192 keys

2021-02-25 Thread Stefan Berger
From: Stefan Berger This series of patches adds support for x509 certificates signed by a CA that uses NIST P384, P256 or P192 keys for signing. It also adds support for certificates where the public key is one of this type of a key. The math for ECDSA signature verification is also added as well

[PATCH v9 3/9] x509: Add support for parsing x509 certs with ECDSA keys

2021-02-25 Thread Stefan Berger
From: Stefan Berger This patch adds support for parsing of x509 certificates that contain ECDSA keys, such as NIST P256, that have been signed by a CA using any of the current SHA hash algorithms. Cc: David Howells Cc: keyri...@vger.kernel.org Signed-off-by: Stefan Berger --- v7->v8: - do n

[PATCH v9 2/9] x509: Detect sm2 keys by their parameters OID

2021-02-25 Thread Stefan Berger
From: Stefan Berger Detect whether a key is an sm2 type of key by its OID in the parameters array rather than assuming that everything under OID_id_ecPublicKey is sm2, which is not the case. Cc: David Howells Cc: keyri...@vger.kernel.org Signed-off-by: Stefan Berger Reviewed-by: Tianjia Zhang

[PATCH v9 4/9] ima: Support EC keys for signature verification

2021-02-25 Thread Stefan Berger
From: Stefan Berger Add support for IMA signature verification for EC keys. Since SHA type of hashes can be used by RSA and ECDSA signature schemes we need to look at the key and derive from the key which signature scheme to use. Since this can be applied to all types of keys, we change the selec

[PATCH v9 9/9] certs: Add support for using elliptic curve keys for signing modules

2021-02-25 Thread Stefan Berger
From: Stefan Berger This patch adds support for using elliptic curve keys for signing modules. It uses a NIST P384 (secp384r1) key if the user chooses an elliptic curve key and will have ECDSA support built into the kernel. Note: A developer choosing an ECDSA key for signing modules has to manua

[PATCH v9 8/9] ecdsa: Register NIST P384 and extend test suite

2021-02-25 Thread Stefan Berger
From: Saulo Alessandre * crypto/ecdsa.c - add ecdsa_nist_p384_init_tfm - register and unregister P384 tfm * crypto/testmgr.c - add test vector for P384 on vector of tests * crypto/testmgr.h - add test vector params for P384(sha1, sha224, sha256, sha384 and sha512) Signed-off-by: Sa

[PATCH v9 1/9] crypto: Add support for ECDSA signature verification

2021-02-25 Thread Stefan Berger
From: Stefan Berger Add support for parsing the parameters of a NIST P256 or NIST P192 key. Enable signature verification using these keys. The new module is enabled with CONFIG_ECDSA: Elliptic Curve Digital Signature Algorithm (NIST P192, P256 etc.) is A NIST cryptographic standard algorithm

[PATCH v9 7/9] crypto: Add math to support fast NIST P384

2021-02-25 Thread Stefan Berger
From: Saulo Alessandre * crypto/ecc.c - change ecc_get_curve to accept nist_p384 - add vli_mmod_fast_384 - change some routines to pass ecc_curve forward until vli_mmod_fast * crypto/ecc.h - add ECC_CURVE_NIST_P384_DIGITS - change ECC_MAX_DIGITS to P384 size Signed-off-by: Saulo Aless

[PATCH v9 6/9] crypto: Add NIST P384 curve parameters

2021-02-25 Thread Stefan Berger
From: Saulo Alessandre * crypto/ecc_curve_defs.h - add nist_p384 params * include/crypto/ecdh.h - add ECC_CURVE_NIST_P384 Signed-off-by: Saulo Alessandre Tested-by: Stefan Berger --- crypto/ecc_curve_defs.h | 32 include/crypto/ecdh.h | 1 + 2 files ch

[PATCH v9 5/9] x509: Add OID for NIST P384 and extend parser for it

2021-02-25 Thread Stefan Berger
From: Saulo Alessandre * crypto/asymmetric_keys/x509_cert_parser.c - prepare x509 parser to load nist_secp384r1 * include/linux/oid_registry.h - add OID_id_secp384r1 Signed-off-by: Saulo Alessandre Tested-by: Stefan Berger --- crypto/asymmetric_keys/x509_cert_parser.c | 3 +++ include/li

[PATCH 0/7] Add support for AEAD algorithms in Qualcomm Crypto Engine driver

2021-02-25 Thread Thara Gopinath
Enable support for AEAD algorithms in Qualcomm CE driver. The first three patches in this series are cleanups and add a few missing pieces required to add support for AEAD algorithms. Patch 4 introduces supported AEAD transformations on Qualcomm CE. Patches 5 and 6 implements the h/w infrastruct

[PATCH 3/7] crypto: qce: Add mode for rfc4309

2021-02-25 Thread Thara Gopinath
rf4309 is the specification that uses aes ccm algorithms with IPsec security packets. Add a submode to identify rfc4309 ccm(aes) algorithm in the crypto driver. Signed-off-by: Thara Gopinath --- drivers/crypto/qce/common.h | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git

[PATCH 1/7] crypto: qce: common: Add MAC failed error checking

2021-02-25 Thread Thara Gopinath
MAC_FAILED gets set in the status register if authenthication fails for ccm algorithms(during decryption). Add support to catch and flag this error. Signed-off-by: Thara Gopinath --- drivers/crypto/qce/common.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drive

[PATCH 2/7] crypto: qce: common: Make result dump optional

2021-02-25 Thread Thara Gopinath
Qualcomm crypto engine allows for IV registers and status register to be concatenated to the output. This option is enabled by setting the RESULTS_DUMP field in GOPROC register. This is useful for most of the algorithms to either retrieve status of operation or in case of authentication algorithms

[PATCH 5/7] crypto: qce: common: Clean up qce_auth_cfg

2021-02-25 Thread Thara Gopinath
Remove various redundant checks in qce_auth_cfg. Also allow qce_auth_cfg to take auth_size as a parameter which is a required setting for ccm(aes) algorithms Signed-off-by: Thara Gopinath --- drivers/crypto/qce/common.c | 21 + 1 file changed, 9 insertions(+), 12 deletions(-)

[PATCH 4/7] crypto: qce: Add support for AEAD algorithms

2021-02-25 Thread Thara Gopinath
Introduce support to enable following algorithms in Qualcomm Crypto Engine. - authenc(hmac(sha1),cbc(des)) - authenc(hmac(sha1),cbc(des3_ede)) - authenc(hmac(sha256),cbc(des)) - authenc(hmac(sha256),cbc(des3_ede)) - authenc(hmac(sha256),cbc(aes)) - ccm(aes) - rfc4309(ccm(aes)) Signed-off-by: Thar

[PATCH 7/7] crypto: qce: aead: Schedule fallback algorithm

2021-02-25 Thread Thara Gopinath
Qualcomm crypto engine does not handle the following scenarios and will issue an abort. In such cases, pass on the transformation to a fallback algorithm. - DES3 algorithms with all three keys same. - AES192 algorithms. - 0 length messages. Signed-off-by: Thara Gopinath --- drivers/crypto/qce/a

[PATCH 6/7] crypto: qce: common: Add support for AEAD algorithms

2021-02-25 Thread Thara Gopinath
Add register programming sequence for enabling AEAD algorithms on the Qualcomm crypto engine. Signed-off-by: Thara Gopinath --- drivers/crypto/qce/common.c | 155 +++- 1 file changed, 153 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/qce/common.c b/dr

[PATCH v2] vio: make remove callback return void

2021-02-25 Thread Uwe Kleine-König
The driver core ignores the return value of struct bus_type::remove() because there is only little that can be done. To simplify the quest to make this function return void, let struct vio_driver::remove() return void, too. All users already unconditionally return 0, this commit makes it obvious th

[PATCH v2] crypto/nx: add missing call to of_node_put()

2021-02-25 Thread Yang Li
In one of the error paths of the for_each_child_of_node() loop, add missing call to of_node_put(). Fix the following coccicheck warning: ./drivers/crypto/nx/nx-common-powernv.c:927:1-23: WARNING: Function "for_each_child_of_node" should have of_node_put() before return around line 936. Reported-b