Re: [PATCH 2/3] crypto: algif_akcipher user space interface

2015-07-22 Thread Tadeusz Struk
On 07/21/2015 03:13 PM, Stephan Mueller wrote: +static ssize_t akcipher_sendpage(struct socket *sock, struct page *page, + int offset, size_t size, int flags) +{ + struct sock *sk = sock-sk; + struct alg_sock *ask = alg_sk(sk); + struct akcipher_ctx

[PATCH 1/8] crypto: nx - remove __init/__exit from VIO functions

2015-07-22 Thread Dan Streetman
Remove the __init and __exit modifiers from the VIO driver probe and remove functions. The driver functions should not be marked __init/__exit because they can/will be called during runtime, not only at module init and exit. Signed-off-by: Dan Streetman ddstr...@ieee.org ---

[PATCH 0/8] remove 'platform' shared NX driver

2015-07-22 Thread Dan Streetman
The shared 'platform' driver module isn't needed, the platform drivers can directly register with crypto instead. It only adds unneeded complexity and problems. The first 4 patches are minor updates/bugfixes to the pSeries driver. The 5th patch is a minor update to the NX crypto driver. The

[PATCH 3/8] crypto: nx - move kzalloc() out of spinlock

2015-07-22 Thread Dan Streetman
Move the kzalloc() calls in nx842_probe() and nx842_OF_upd() to the top of the functions, before taking the devdata spinlock. Since kzalloc() without GFP_ATOMIC can sleep, it can't be called while holding a spinlock. Move the calls to before taking the lock. Signed-off-by: Dan Streetman

[PATCH 5/8] crypto: nx - use common code for both NX decompress success cases

2015-07-22 Thread Dan Streetman
Replace the duplicated finishing code (set destination buffer length and set return code to 0) in the case of decompressing a buffer with no header with a goto to the success case of decompressing a buffer with a header. This is a trivial change that allows both success cases to use common code,

[PATCH 7/8] crypto: nx - rename nx-842-crypto.c to nx-842.c

2015-07-22 Thread Dan Streetman
The last commit merged nx-842.c's code into nx-842-crypto.c. It did not rename nx-842-crypto.c to nx-842.c, in order to let the patch more clearly show what was merged. This just renames nx-842-crypto.c to nx-842.c, with no changes to its code. Signed-off-by: Dan Streetman ddstr...@ieee.org ---

[PATCH 2/8] crypto: nx - remove pSeries NX 'status' field

2015-07-22 Thread Dan Streetman
Remove the 'status' field from the pSeries NX driver data. The 'status' field isn't used by the driver at all; it simply checks the devicetree status node at initialization, and returns success if 'okay' and failure otherwise. Signed-off-by: Dan Streetman ddstr...@ieee.org ---

[PATCH 8/8] crypto: nx - make platform drivers directly register with crypto

2015-07-22 Thread Dan Streetman
Remove the common 'platform' registration module, and move the crypto compression driver registration into each of the pSeries and PowerNV platform NX 842 drivers. Change the nx-842.c code into simple common functions that each platform driver uses to perform constraints-based buffer changes,

[PATCH 4/8] crypto: nx - don't register pSeries driver if ENODEV

2015-07-22 Thread Dan Streetman
Don't register the pSeries driver when parsing the device tree returns ENODEV. The nx842_probe() function in the pSeries driver returns error instead of registering as a crypto compression driver, when it receives an error return value from the nx842_OF_upd() function that probes the device tree

[PATCH 6/8] crypto: nx - merge nx-compress and nx-compress-crypto

2015-07-22 Thread Dan Streetman
Merge the nx-842.c code into nx-842-crypto.c. This allows later patches to remove the 'platform' driver, and instead allow each platform driver to directly register with the crypto compression api. Signed-off-by: Dan Streetman ddstr...@ieee.org --- drivers/crypto/nx/Kconfig | 17

Re: [PATCH 2/3] crypto: algif_akcipher user space interface

2015-07-22 Thread Stephan Mueller
Am Mittwoch, 22. Juli 2015, 09:01:15 schrieb Tadeusz Struk: Hi Tadeusz, On 07/21/2015 03:13 PM, Stephan Mueller wrote: +static ssize_t akcipher_sendpage(struct socket *sock, struct page *page, +int offset, size_t size, int flags) +{ + struct sock *sk =

DocBook update: skip the akcipher for now?

2015-07-22 Thread Stephan Mueller
Hi Herbert, Tadeusz, I am just developing patches to the kernel crypto API DocBook. Thanks to Tadeusz, the API calls are nicely documented. There are only a very minor tidbits I want to add. What is missing is the link from the DocBook to the akcipher API. I would like to prepare the patch,

Re: [PATCH 0/3] AF_ALG interface for akcipher

2015-07-22 Thread Stephan Mueller
Am Mittwoch, 22. Juli 2015, 09:32:41 schrieb Herbert Xu: Hi Herbert, I think we should finish the conversion of the only in-kernel user of RSA before we add the user-space interface. Otherwise this unnecessarily ties our hands to the current API. Agreed. After my question around the SGL

crypto: ixp4xx - Remove bogus BUG_ON on scattered dst buffer

2015-07-22 Thread Herbert Xu
This patch removes a bogus BUG_ON in the ablkcipher path that triggers when the destination buffer is different from the source buffer and is scattered. Signed-off-by: Herbert Xu herb...@gondor.apana.org.au diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c index

Re: [PATCH] crypto: rsa - fix invalid check for keylen in fips mode

2015-07-22 Thread Tadeusz Struk
On 07/21/2015 05:25 AM, Herbert Xu wrote: On Mon, Jul 20, 2015 at 05:18:26PM -0700, Tadeusz Struk wrote: The condition checking allowed key length was invalid. Reported-by: Dan Carpenter dan.carpen...@oracle.com Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com Applied. Herbert,

Re: [PATCH] crypto: rsa - fix invalid check for keylen in fips mode

2015-07-22 Thread Herbert Xu
On Wed, Jul 22, 2015 at 06:38:45AM -0700, Tadeusz Struk wrote: On 07/21/2015 05:25 AM, Herbert Xu wrote: On Mon, Jul 20, 2015 at 05:18:26PM -0700, Tadeusz Struk wrote: The condition checking allowed key length was invalid. Reported-by: Dan Carpenter dan.carpen...@oracle.com

Re: DocBook update: skip the akcipher for now?

2015-07-22 Thread Herbert Xu
On Wed, Jul 22, 2015 at 10:24:40PM +0200, Stephan Mueller wrote: Hi Herbert, Tadeusz, I am just developing patches to the kernel crypto API DocBook. Thanks to Tadeusz, the API calls are nicely documented. There are only a very minor tidbits I want to add. What is missing is the link

Re: [PATCH 0/3] AF_ALG interface for akcipher

2015-07-22 Thread Tadeusz Struk
On 07/22/2015 06:53 PM, Herbert Xu wrote: On Wed, Jul 22, 2015 at 02:58:18PM +0300, Horia Geantă wrote: OTOH, caam has SG support for all PK operations, including rsa-encrypt, rsa-decrypt primitives. We are working at upstreaming - aligning our internal caam-pkc with akcipher. OK. Then

Re: [PATCH 0/3] AF_ALG interface for akcipher

2015-07-22 Thread Herbert Xu
On Wed, Jul 22, 2015 at 10:14:30PM -0700, Tadeusz Struk wrote: We can add a flag to akcipher_request to say if src/dst are SGs or buffers, but is this really necessary? No it shouldn't be done as a flag. If we are going to do SGs then it needs to be part of the API. That means replacing

Re: [PATCH 2/3] crypto: algif_akcipher user space interface

2015-07-22 Thread Stephan Mueller
Am Mittwoch, 22. Juli 2015, 15:04:37 schrieb Tadeusz Struk: Hi Tadeusz, On 07/22/2015 11:55 AM, Stephan Mueller wrote: I concur with you. But we have only two options: - either use SGLs which the current akcipher API does not do - or do a memcpy of the sendpage data into the

Re: [PATCH 0/3] AF_ALG interface for akcipher

2015-07-22 Thread Horia Geantă
On 7/22/2015 7:19 AM, Tadeusz Struk wrote: On 07/21/2015 06:32 PM, Herbert Xu wrote: I think we should finish the conversion of the only in-kernel user of RSA before we add the user-space interface. Otherwise this unnecessarily ties our hands to the current API. For example, do we want an