[GIT] Crypto Fixes for 5.0

2019-03-01 Thread Herbert Xu
Hi Linus: This push fixes a couple of issues in arm64/chacha that was introduced in 5.0. Please pull from git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6.git linus Eric Biggers (2): crypto: arm64/chacha - fix chacha_4block_xor_neon() for big endian crypto: arm64/

Re: [GIT] Crypto Fixes for 5.0

2019-03-01 Thread pr-tracker-bot
The pull request you sent on Thu, 28 Feb 2019 13:56:18 +0800: > git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6.git linus has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/3f25a5990d9d32e8f77ce830b9ea6c0e4f4bea4b Thank you! -- Deet-doot-dot, I am a bot

[PATCH v7 08/11] crypto: ecc - make ecc into separate module

2019-03-01 Thread Vitaly Chikunov
ecc.c have algorithms that could be used togeter by ecdh and ecrdsa. Make it separate module. Add CRYPTO_ECC into Kconfig. EXPORT_SYMBOL and document to what seems appropriate. Move structs ecc_point and ecc_curve from ecc_curve_defs.h into ecc.h. No code changes. Signed-off-by: Vitaly Chikunov

[PATCH v7 06/11] X.509: parse public key parameters from x509 for akcipher

2019-03-01 Thread Vitaly Chikunov
Some public key algorithms (like EC-DSA) keep in parameters field important data such as digest and curve OIDs (possibly more for different EC-DSA variants). Thus, just setting a public key (as for RSA) is not enough. Append parameters into the key stream for akcipher_set_{pub,priv}_key. Appended

[PATCH v7 07/11] crypto: Kconfig - create Public-key cryptography section

2019-03-01 Thread Vitaly Chikunov
Group RSA, DH, and ECDH into Public-key cryptography config section. Signed-off-by: Vitaly Chikunov --- crypto/Kconfig | 48 +--- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/crypto/Kconfig b/crypto/Kconfig index bbab6bf33519..370cbd

[PATCH v7 00/11] crypto: add EC-RDSA (GOST 34.10) algorithm

2019-03-01 Thread Vitaly Chikunov
This patchset changes akcipher API to support ECDSA style signature verification, augments x509 parser to make it work with EC-RDSA certificates, and, finally, implements EC-RDSA (GOST 34.10) signature verification and its integration with IMA. This patchset should be applied over cryptodev commit

[PATCH v7 03/11] crypto: rsa - unimplement sign/verify for raw RSA backends

2019-03-01 Thread Vitaly Chikunov
In preparation for new akcipher verify call remove sign/verify callbacks from RSA backends and make PKCS1 driver call encrypt/decrypt instead. This also complies with the well-known idea that raw RSA should never be used for sign/verify. It only should be used with proper padding scheme such as PK

[PATCH v7 05/11] KEYS: do not kmemdup digest in {public,tpm}_key_verify_signature

2019-03-01 Thread Vitaly Chikunov
Treat (struct public_key_signature)'s digest same as its signature (s). Since digest should be already in the kmalloc'd memory do not kmemdup digest value before calling {public,tpm}_key_verify_signature. Patch is split from the previous as suggested by Herbert Xu. Suggested-by: David Howells Cc

[PATCH v7 02/11] crypto: akcipher - check the presence of callback before the call

2019-03-01 Thread Vitaly Chikunov
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 --- include/crypto/akcipher.h | 25 ++

[PATCH v7 11/11] integrity: support EC-RDSA signatures for asymmetric_verify

2019-03-01 Thread Vitaly Chikunov
Allow to use EC-RDSA signatures for IMA by determining signature type by the hash algorithm name. This works good for EC-RDSA since Streebog and EC-RDSA should always be used together. Cc: Mimi Zohar Cc: Dmitry Kasatkin Cc: linux-integr...@vger.kernel.org Signed-off-by: Vitaly Chikunov --- sec

[PATCH v7 10/11] crypto: ecrdsa - add EC-RDSA test vectors to testmgr

2019-03-01 Thread Vitaly Chikunov
Add testmgr test vectors for EC-RDSA algorithm for every of five supported parameters (curves). Because there are no officially published test vectors for the curves, the vectors are generated by gost-engine. Signed-off-by: Vitaly Chikunov --- crypto/testmgr.c | 6 +++ crypto/testmgr.h | 154 +

[PATCH v7 09/11] crypto: ecrdsa - add EC-RDSA (GOST 34.10) algorithm

2019-03-01 Thread Vitaly Chikunov
Add Elliptic Curve Russian Digital Signature Algorithm (GOST R 34.10-2012, RFC 7091, ISO/IEC 14888-3) is one of the Russian (and since 2018 the CIS countries) cryptographic standard algorithms (called GOST algorithms). Only signature verification is supported, with intent to be used in the IMA. Su

[PATCH v7 04/11] crypto: akcipher - new verify API for public key algorithms

2019-03-01 Thread Vitaly Chikunov
Previous akcipher .verify() just `decrypts' (using RSA encrypt which is using public key) signature to uncover message hash, which was then compared in upper level public_key_verify_signature() with the expected hash value, which itself was never passed into verify(). This approach was incompatibl

[PATCH v7 01/11] KEYS: report to keyctl only actually supported key ops

2019-03-01 Thread Vitaly Chikunov
Because with the introduction of EC-RDSA and change in workings of RSA in regard to sign/verify, akcipher may have not all callbacks defined, report to keyctl only actually supported ops determined by the presence of the akcipher callbacks. Cc: David Howells Cc: keyri...@vger.kernel.org Signed-of

[PATCH RESEND v3] crypto: caam - add missing put_device() call

2019-03-01 Thread Horia Geantă
From: Wen Yang The of_find_device_by_node() takes a reference to the underlying device structure, we should release that reference. Fixes: 35af64038623 ("crypto: caam - Check for CAAM block presence before registering with crypto layer") Fixes: b189817cf789 ("crypto: caam/qi - add ablkcipher an

Re: [RFC PATCH 1/4] X.509: Parse public key parameters from x509 for akcipher

2019-03-01 Thread Vitaly Chikunov
Herbert, On Thu, Feb 28, 2019 at 06:37:15PM +0800, Herbert Xu wrote: > On Thu, Feb 28, 2019 at 01:33:37PM +0300, Vitaly Chikunov wrote: > > > > To make the same for set_{pub,priv}_key it will require patching RSA > > drivers anyway, since length of the key is stored just once as keylen > > argumen

Re: [PATCH] crypto: s5p-sss - fix AES support for Exynos5433

2019-03-01 Thread Krzysztof Kozlowski
On Fri, 1 Mar 2019 at 15:03, Kamil Konieczny wrote: > > Commit 0918f18c7179 ("crypto: s5p - add AES support for Exynos5433") > introduced bug in dereferencing clk_names[1] on platforms different from > Exynos5433. On Exynos board XU3 call trace is: > > "Unable to handle kernel paging request at vi

[PATCH] crypto: s5p-sss - fix AES support for Exynos5433

2019-03-01 Thread Kamil Konieczny
Commit 0918f18c7179 ("crypto: s5p - add AES support for Exynos5433") introduced bug in dereferencing clk_names[1] on platforms different from Exynos5433. On Exynos board XU3 call trace is: "Unable to handle kernel paging request at virtual address 4000" (strcmp) from [] (of_property_match_stri

Re: [PATCH v4 3/3] crypto: s5p: add AES support for Exynos5433

2019-03-01 Thread Krzysztof Kozlowski
On Fri, 1 Mar 2019 at 11:07, Ard Biesheuvel wrote: > > On Fri, 1 Mar 2019 at 10:56, Krzysztof Kozlowski wrote: > > > > On Fri, 22 Feb 2019 at 13:22, Kamil Konieczny > > wrote: > > > > > > Add AES crypto HW acceleration for Exynos5433, with the help of SlimSSS > > > IP. > > > > > > Reviewed-by:

Re: [PATCH v4 3/3] crypto: s5p: add AES support for Exynos5433

2019-03-01 Thread Ard Biesheuvel
On Fri, 1 Mar 2019 at 10:56, Krzysztof Kozlowski wrote: > > On Fri, 22 Feb 2019 at 13:22, Kamil Konieczny > wrote: > > > > Add AES crypto HW acceleration for Exynos5433, with the help of SlimSSS IP. > > > > Reviewed-by: Krzysztof Kozlowski > > Signed-off-by: Kamil Konieczny > > --- > > drivers

Re: [PATCH v4 3/3] crypto: s5p: add AES support for Exynos5433

2019-03-01 Thread Krzysztof Kozlowski
On Fri, 22 Feb 2019 at 13:22, Kamil Konieczny wrote: > > Add AES crypto HW acceleration for Exynos5433, with the help of SlimSSS IP. > > Reviewed-by: Krzysztof Kozlowski > Signed-off-by: Kamil Konieczny > --- > drivers/crypto/s5p-sss.c | 50 > 1 file cha