Re: [PATCH v5 1/4] Documentation/bindings: Document the SafeXel cryptographic engine driver

2017-05-23 Thread Antoine Tenart
Hi Thomas, On Mon, May 22, 2017 at 09:34:16PM +0200, Thomas Petazzoni wrote: > On Mon, 22 May 2017 16:45:11 +0200, Antoine Tenart wrote: > > + interrupts = > IRQ_TYPE_LEVEL_HIGH)>, > > You already got the feedback previously that an interrupt that is both > edge and level at the same

[PATCH 2/2] crypto: engine - Permit to enqueue skcipher request

2017-05-23 Thread Corentin Labbe
The crypto engine could actually only enqueue hash and ablkcipher request. This patch permit it to enqueue skcipher requets by adding all necessary functions. The only problem is that ablkcipher and skcipher id are the same, so only one cipher type is usable on the same crypto engine.

[PATCH v3 10/11] crypto: ecc - don't be selfish on pubkeys

2017-05-23 Thread Tudor Ambarus
Rename ecdh_make_pub_key() to ecc_make_pub_key(). This function might as well be used by ecdsa. Signed-off-by: Tudor Ambarus --- crypto/ecc.c | 4 ++-- crypto/ecc.h | 4 ++-- crypto/ecdh.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git

[PATCH v3 11/11] crypto: dh - fix memleak in setkey

2017-05-23 Thread Tudor Ambarus
setkey can be called multiple times during the existence of the transformation object. In case of multiple setkey calls, the old key was not freed and we leaked memory. Free the old MPI key if any. Signed-off-by: Tudor Ambarus --- crypto/dh.c | 3 +++ 1 file

Re: [PATCH v3 1/3] Documentation/bindings: Document the SafeXel cryptographic engine driver

2017-05-23 Thread Marc Zyngier
On 22/05/17 20:37, Thomas Petazzoni wrote: > Hello, > > On Mon, 22 May 2017 16:02:33 +0100, Marc Zyngier wrote: > >>> It also says: 87 => 34 En Lv 5, which is the IRQ I'm looking for. >> >> Ah, that one as well. So how is the interrupt routed? Via the ICU, and >> then to the GIC (with several

[PATCH v3 07/11] crypto: testmgr - check err on kpp maxsize

2017-05-23 Thread Tudor Ambarus
crypto_kpp_maxsize() returns minimum length for output buffer or error code if key hasn't been set. Check for error before allocating memory. Signed-off-by: Tudor Ambarus --- crypto/testmgr.c | 5 + 1 file changed, 5 insertions(+) diff --git a/crypto/testmgr.c

[PATCH v3 00/11] fixes for ecc, ec(dh), rsa & testmgr

2017-05-23 Thread Tudor Ambarus
Hi, These are various fixes that I made while reading kpp and akcipher implementations. For KEYS there is only one patch. It checks the return value of crypto_akcipher_maxsize(). Changes in v3: - change error code to ENOKEY instead of EINVAL in dh/ecdh/rsa_max_size() - reorder commits -

[PATCH v3 06/11] crypto: rsa - change err code in rsa_max_size

2017-05-23 Thread Tudor Ambarus
If key was not successfully set, return -ENOKEY instead of -EINVAL. Signed-off-by: Tudor Ambarus --- crypto/rsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/rsa.c b/crypto/rsa.c index 4c280b6..3cf640e 100644 --- a/crypto/rsa.c +++

[PATCH v3 02/11] crypto: ecc - remove unused function arguments

2017-05-23 Thread Tudor Ambarus
Signed-off-by: Tudor Ambarus --- crypto/ecc.c | 8 +++- crypto/ecc.h | 13 +++-- crypto/ecdh.c | 11 +-- 3 files changed, 11 insertions(+), 21 deletions(-) diff --git a/crypto/ecc.c b/crypto/ecc.c index 414c78a..69b4cc4 100644 ---

[PATCH v3 04/11] crypto: dh - fix dh_max_size

2017-05-23 Thread Tudor Ambarus
If someone called this function before a successful setkey, we would end up in a NULL dereference. The function should return minimum size for output buffer or error code if key hasn't been set. Signed-off-by: Tudor Ambarus --- crypto/dh.c | 2 +- 1 file changed, 1

[PATCH v3 03/11] crypto: ecc - remove unnecessary casts

2017-05-23 Thread Tudor Ambarus
ecc software implementation works with chunks of u64 data. There were some unnecessary casts to u8 and then back to u64 for the ecc keys. This patch removes the unnecessary casts. Signed-off-by: Tudor Ambarus --- crypto/ecc.c | 28 +---

[PATCH v3 09/11] crypto: KEYS: check err on akcipher maxsize

2017-05-23 Thread Tudor Ambarus
crypto_akcipher_maxsize() returns minimum length for output buffer or error code if key hasn't been set. Check for error before allocating memory. Signed-off-by: Tudor Ambarus --- crypto/asymmetric_keys/public_key.c | 5 + 1 file changed, 5 insertions(+) diff

[PATCH v3 01/11] crypto: kpp, (ec)dh - fix typos

2017-05-23 Thread Tudor Ambarus
While here, add missing argument description (ndigits). Signed-off-by: Tudor Ambarus --- crypto/dh.c | 4 ++-- crypto/dh_helper.c| 4 ++-- crypto/ecc.h | 8 +--- crypto/ecdh.c | 4 ++-- crypto/ecdh_helper.c | 4 ++--

[PATCH v3 08/11] crypto: testmgr - check err on akcipher maxsize

2017-05-23 Thread Tudor Ambarus
crypto_akcipher_maxsize() returns minimum length for output buffer or error code if key hasn't been set. Check for error before allocating memory. Signed-off-by: Tudor Ambarus --- crypto/testmgr.c | 5 + 1 file changed, 5 insertions(+) diff --git

[PATCH v3 05/11] crypto: ecdh - fix ecdh_max_size

2017-05-23 Thread Tudor Ambarus
If someone called this function before a successful setkey, we would end up in a NULL dereference. The function should return minimum size for output buffer or error code if key hasn't been set. Signed-off-by: Tudor Ambarus --- crypto/ecdh.c | 6 +++--- 1 file

Re: [PATCH v1 1/2] dt-bindings: timeriomem_rng: Add entropy quality property

2017-05-23 Thread Rob Herring
On Wed, May 17, 2017 at 03:29:10PM -0700, Rick Altherr wrote: > Signed-off-by: Rick Altherr > --- > > Documentation/devicetree/bindings/rng/timeriomem_rng.txt | 7 +++ > 1 file changed, 7 insertions(+) Acked-by: Rob Herring

[PATCH 1/2] crypto: engine - replace pr_xxx by dev_xxx

2017-05-23 Thread Corentin Labbe
By adding a struct device *dev to struct engine, we could store the device used at register time and so use all dev_xxx functions instead of pr_xxx. Signed-off-by: Corentin Labbe --- crypto/crypto_engine.c | 23 +-- include/crypto/engine.h | 1 +

Re: [PATCH v3 1/3] Documentation/bindings: Document the SafeXel cryptographic engine driver

2017-05-23 Thread Thomas Petazzoni
Hello, On Tue, 23 May 2017 12:13:28 +0100, Marc Zyngier wrote: > > The crypto block being in the CP part, it has a wired interrupt to the > > ICU (also in the CP). The ICU then turns this wired interrupt into a > > memory write transaction to a register called GICP SPI in the AP, which > >

Re: [PATCH 1/2] crypto: engine - replace pr_xxx by dev_xxx

2017-05-23 Thread Joe Perches
On Tue, 2017-05-23 at 14:09 +0200, Corentin Labbe wrote: > By adding a struct device *dev to struct engine, we could store the > device used at register time and so use all dev_xxx functions instead of > pr_xxx. trivia: > diff --git a/include/crypto/engine.h b/include/crypto/engine.h [] > @@

Re: [PATCH] X.509: Fix error code in x509_cert_parse()

2017-05-23 Thread David Howells
Dan Carpenter wrote: > cert->pub->key = kmemdup(ctx->key, ctx->key_size, GFP_KERNEL); > - if (!cert->pub->key) > + if (!cert->pub->key) { > + ret = -ENOMEM; > goto error_decode; > + } Put the "ret = -ENOMEM" line before the

[PATCH] X.509: Fix error code in x509_cert_parse()

2017-05-23 Thread Dan Carpenter
We forgot to set the error code on this path so it could result in returning NULL which leads to a NULL dereference. Fixes: db6c43bd2132 ("crypto: KEYS: convert public key and digsig asym to the akcipher api") Signed-off-by: Dan Carpenter diff --git

[PATCH v8 1/2] crypto: skcipher AF_ALG - overhaul memory management

2017-05-23 Thread Stephan Müller
The updated memory management is described in the top part of the code. As one benefit of the changed memory management, the AIO and synchronous operation is now implemented in one common function. The AF_ALG operation uses the async kernel crypto API interface for each cipher operation. Thus, the

[PATCH v8 2/2] crypto: aead AF_ALG - overhaul memory management

2017-05-23 Thread Stephan Müller
The updated memory management is described in the top part of the code. As one benefit of the changed memory management, the AIO and synchronous operation is now implemented in one common function. The AF_ALG operation uses the async kernel crypto API interface for each cipher operation. Thus, the

[PATCH v8 0/2] crypto: AF_ALG memory management fix

2017-05-23 Thread Stephan Müller
Hi Herbert, Changes v8: - algif_skcipher: fix complaint by checkpatch.pl - algif_aead: port to 4.12-rc1 - algif_aead: fix complaint by checkpatch.pl With the changes, you will see a lot of code duplication now as I deliberately tried to use the same struct and variable names, the same function

[PATCH] drivers: staging: ccree: ISO C forbids casting to and from non-scalar

2017-05-23 Thread Raphaël Beamonte
Fixes the following sparse warnings: drivers/staging/ccree/ssi_hash.c:2447:24: warning: cast to non-scalar drivers/staging/ccree/ssi_hash.c:2447:24: warning: cast from non-scalar drivers/staging/ccree/ssi_hash.c:2448:28: warning: cast to non-scalar drivers/staging/ccree/ssi_hash.c:2448:28:

[PATCH 02/27] Drivers: ccree: ssi_sysfs.c - align block comments

2017-05-23 Thread Derek Robson
Fixed block comment alignment, Style fix only Found using checkpatch Signed-off-by: Derek Robson --- drivers/staging/ccree/ssi_sysfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/ccree/ssi_sysfs.c b/drivers/staging/ccree/ssi_sysfs.c

[PATCH 03/27] Drivers: ccree: ssi_request_mgr.h - align block comments

2017-05-23 Thread Derek Robson
Fixed block comment alignment, Style fix only Found using checkpatch Signed-off-by: Derek Robson --- drivers/staging/ccree/ssi_request_mgr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ccree/ssi_request_mgr.h

[PATCH 01/27] Drivers: ccree: ssi_sysfs.h - align block comments

2017-05-23 Thread Derek Robson
Fixed block comment alignment, Style fix only Found using checkpatch Signed-off-by: Derek Robson --- drivers/staging/ccree/ssi_sysfs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ccree/ssi_sysfs.h b/drivers/staging/ccree/ssi_sysfs.h

[PATCH 19/27] Drivers: ccree: ssi_cipher.h - align block comments

2017-05-23 Thread Derek Robson
Fixed block comment alignment, Style fix only Found using checkpatch Signed-off-by: Derek Robson --- drivers/staging/ccree/ssi_cipher.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ccree/ssi_cipher.h

[PATCH 17/27] Drivers: ccree: ssi_driver.h - align block comments

2017-05-23 Thread Derek Robson
Fixed block comment alignment, Style fix only Found using checkpatch Signed-off-by: Derek Robson --- drivers/staging/ccree/ssi_driver.h | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/staging/ccree/ssi_driver.h

[PATCH 15/27] Drivers: ccree: ssi_fips.h - align block comments

2017-05-23 Thread Derek Robson
Fixed block comment alignment, Style fix only Found using checkpatch Signed-off-by: Derek Robson --- drivers/staging/ccree/ssi_fips.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/ccree/ssi_fips.h b/drivers/staging/ccree/ssi_fips.h

[PATCH 14/27] Drivers: ccree: ssi_fips_data.h - align block comments

2017-05-23 Thread Derek Robson
Fixed block comment alignment, Style fix only Found using checkpatch Signed-off-by: Derek Robson --- drivers/staging/ccree/ssi_fips_data.h | 93 +-- 1 file changed, 46 insertions(+), 47 deletions(-) diff --git

[PATCH 05/27] Drivers: ccree: ssi_pm_ext.h - align block comments

2017-05-23 Thread Derek Robson
Fixed block comment alignment, Style fix only Found using checkpatch Signed-off-by: Derek Robson --- drivers/staging/ccree/ssi_pm_ext.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ccree/ssi_pm_ext.h

[PATCH 06/27] Drivers: ccree: ssi_pm_ext.c - align block comments

2017-05-23 Thread Derek Robson
Fixed block comment alignment, Style fix only Found using checkpatch Signed-off-by: Derek Robson --- drivers/staging/ccree/ssi_pm_ext.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/ccree/ssi_pm_ext.c

[PATCH 04/27] Drivers: ccree: ssi_request_mgr.c - align block comments

2017-05-23 Thread Derek Robson
Fixed block comment alignment, Style fix only Found using checkpatch Signed-off-by: Derek Robson --- drivers/staging/ccree/ssi_request_mgr.c | 37 - 1 file changed, 22 insertions(+), 15 deletions(-) diff --git

[PATCH 07/27] Drivers: ccree: ssi_pm.h - align block comments

2017-05-23 Thread Derek Robson
Fixed block comment alignment, Style fix only Found using checkpatch Signed-off-by: Derek Robson --- drivers/staging/ccree/ssi_pm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ccree/ssi_pm.h b/drivers/staging/ccree/ssi_pm.h index

[PATCH 27/27] Drivers: ccree: cc_crypto_ctx.h - align block comments

2017-05-23 Thread Derek Robson
Fixed block comment alignment, Style fix only Found using checkpatch Signed-off-by: Derek Robson --- drivers/staging/ccree/cc_crypto_ctx.h | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/staging/ccree/cc_crypto_ctx.h

[PATCH 26/27] Drivers: ccree: cc_hw_queue_defs.h - align block comments

2017-05-23 Thread Derek Robson
Fixed block comment alignment, Style fix only Found using checkpatch Signed-off-by: Derek Robson --- drivers/staging/ccree/cc_hw_queue_defs.h | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git

[PATCH 00/27] Drivers: ccree - align block comments

2017-05-23 Thread Derek Robson
Fixed block comments across whole ccree driver Derek Robson (27): Drivers: ccree: ssi_sysfs.h - align block comments Drivers: ccree: ssi_sysfs.c - align block comments Drivers: ccree: ssi_request_mgr.h - align block comments Drivers: ccree: ssi_request_mgr.c - align block comments

[PATCH 13/27] Drivers: ccree: ssi_fips_ext.c - align block comments

2017-05-23 Thread Derek Robson
Fixed block comment alignment, Style fix only Found using checkpatch Signed-off-by: Derek Robson --- drivers/staging/ccree/ssi_fips_ext.c | 46 ++-- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git

[PATCH 11/27] Drivers: ccree: ssi_fips_local.c - align block comments

2017-05-23 Thread Derek Robson
Fixed block comment alignment, Style fix only Found using checkpatch Signed-off-by: Derek Robson --- drivers/staging/ccree/ssi_fips_local.c | 21 - 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/drivers/staging/ccree/ssi_fips_local.c

[PATCH 10/27] Drivers: ccree: ssi_hash.c - align block comments

2017-05-23 Thread Derek Robson
Fixed block comment alignment, Style fix only Found using checkpatch Signed-off-by: Derek Robson --- drivers/staging/ccree/ssi_hash.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/staging/ccree/ssi_hash.c

[PATCH 08/27] Drivers: ccree: ssi_ivgen.c - align block comments

2017-05-23 Thread Derek Robson
Fixed block comment alignment, Style fix only Found using checkpatch Signed-off-by: Derek Robson --- drivers/staging/ccree/ssi_ivgen.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/ccree/ssi_ivgen.c

[PATCH 12/27] Drivers: ccree: ssi_fips_ll.c - align block comments

2017-05-23 Thread Derek Robson
Fixed block comment alignment, Style fix only Found using checkpatch Signed-off-by: Derek Robson --- drivers/staging/ccree/ssi_fips_ll.c | 21 - 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/drivers/staging/ccree/ssi_fips_ll.c

[PATCH 09/27] Drivers: ccree: ssi_hash.h - align block comments

2017-05-23 Thread Derek Robson
Fixed block comment alignment, Style fix only Found using checkpatch Signed-off-by: Derek Robson --- drivers/staging/ccree/ssi_hash.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ccree/ssi_hash.h b/drivers/staging/ccree/ssi_hash.h index

[PATCH 25/27] Drivers: ccree: cc_regs.h - align block comments

2017-05-23 Thread Derek Robson
Fixed block comment alignment, Style fix only Found using checkpatch Signed-off-by: Derek Robson --- drivers/staging/ccree/cc_regs.h | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/staging/ccree/cc_regs.h

[PATCH 22/27] Drivers: ccree: ssi_aead.h - align block comments

2017-05-23 Thread Derek Robson
Fixed block comment alignment, Style fix only Found using checkpatch Signed-off-by: Derek Robson --- drivers/staging/ccree/ssi_aead.h | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/ccree/ssi_aead.h

[PATCH 24/27] Drivers: ccree: hash_defs.h - align block comments

2017-05-23 Thread Derek Robson
Fixed block comment alignment, Style fix only Found using checkpatch Signed-off-by: Derek Robson --- drivers/staging/ccree/hash_defs.h | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/staging/ccree/hash_defs.h

[PATCH 23/27] Drivers: ccree: ssi_aead.c - align block comments

2017-05-23 Thread Derek Robson
Fixed block comment alignment, Style fix only Found using checkpatch Signed-off-by: Derek Robson --- drivers/staging/ccree/ssi_aead.c | 45 ++-- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git

[PATCH 21/27] Drivers: ccree: ssi_buffer_mgr.c - align block comments

2017-05-23 Thread Derek Robson
Fixed block comment alignment, Style fix only Found using checkpatch Signed-off-by: Derek Robson --- drivers/staging/ccree/ssi_buffer_mgr.c | 87 +++--- 1 file changed, 49 insertions(+), 38 deletions(-) diff --git

[PATCH 20/27] Drivers: ccree: ssi_buffer_mgr.h - align block comments

2017-05-23 Thread Derek Robson
Fixed block comment alignment, Style fix only Found using checkpatch Signed-off-by: Derek Robson --- drivers/staging/ccree/ssi_buffer_mgr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ccree/ssi_buffer_mgr.h

[PATCH 18/27] Drivers: ccree: ssi_config.h - align block comments

2017-05-23 Thread Derek Robson
Fixed block comment alignment, Style fix only Found using checkpatch Signed-off-by: Derek Robson --- drivers/staging/ccree/ssi_config.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/ccree/ssi_config.h

[PATCH 16/27] Drivers: ccree: ssi_fips.c - align block comments

2017-05-23 Thread Derek Robson
Fixed block comment alignment, Style fix only Found using checkpatch Signed-off-by: Derek Robson --- drivers/staging/ccree/ssi_fips.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/ccree/ssi_fips.c

Re: [PATCH v2 08/11] crypto: testmgr - check err on akcipher maxsize

2017-05-23 Thread Tudor Ambarus
On 23.05.2017 07:08, Herbert Xu wrote: On Wed, May 17, 2017 at 06:00:35PM +0300, Tudor Ambarus wrote: crypto_akcipher_maxsize() returns minimum length for output buffer or error code if key hasn't been set. Signed-off-by: Tudor Ambarus --- crypto/testmgr.c | 5

Re: ecdh: generation and retention of ecc privkey in kernel/hardware

2017-05-23 Thread Tudor Ambarus
On 23.05.2017 06:58, Herbert Xu wrote: On Thu, Apr 27, 2017 at 05:17:58PM +0300, Tudor Ambarus wrote: Hi, Herbert, I'm working with a crypto accelerator that is capable of generating and retaining ecc private keys in hardware and further use them for ecdh. The private keys can not be read