Re: crypto: zeroization of sensitive data in af_alg

2014-11-11 Thread Daniel Borkmann
On 11/11/2014 05:16 AM, Stephan Mueller wrote: ... That is a good idea. Herbert: I can prepare a patch that uses memzero_explicit. However, your current tree does not yet implement that function as it was added to Linus' tree after you pulled from it. Yep, Ted took it [1] on top of the random

Re: [PATCH 1/2] crypto: AF_ALG - zeroize message digest buffer

2014-11-11 Thread Daniel Borkmann
Hi Stephan, On 11/11/2014 05:37 AM, Stephan Mueller wrote: Zeroize the buffer holding the message digest calculated for the consumer before the buffer is released by the hash AF_ALG interface handler. Signed-off-by: Stephan Mueller smuel...@chronox.de --- crypto/algif_hash.c | 2 ++ 1 file

[PATCH] crypto: caam - add support for givencrypt cbc(des) and cbc(des3_ede)

2014-11-11 Thread Catalin Vasile
Merge DES Cipher Block Chaining mode (CBC) and Triple DES Cipher Block Chaining mode (CBC) algorithms from ablkcipher to givencrypt. Signed-off-by: Catalin Vasile catalin.vas...@freescale.com --- drivers/crypto/caam/caamalg.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff

RE: [PATCH 1/2] crypto: Add Imagination Technologies hw hash accelerator

2014-11-11 Thread James Hartley
Hi Vladimir, thanks for the review! -Original Message- From: Vladimir Zapolskiy [mailto:vladimir_zapols...@mentor.com] Sent: 10 November 2014 15:10 To: James Hartley; herb...@gondor.apana.org.au; da...@davemloft.net; grant.lik...@linaro.org; robh...@kernel.org;

Re: Asynchronous usage of PCOMPRESS

2014-11-11 Thread Herbert Xu
On Mon, Nov 10, 2014 at 12:16:51PM -0600, Tom Lendacky wrote: Hi Herbert, Is the PCOMPRESS algorithm supposed to support asynchronous implementations? In other words, are callers expected to handle the -EINPROGRESS or -EAGAIN return codes that can be returned by an asynchronous

Re: [PATCH 1/2] crypto: Add Imagination Technologies hw hash accelerator

2014-11-11 Thread Vladimir Zapolskiy
Hi James, On 11.11.2014 16:59, James Hartley wrote: Hi Vladimir, thanks for the review! -Original Message- From: Vladimir Zapolskiy [mailto:vladimir_zapols...@mentor.com] Sent: 10 November 2014 15:10 To: James Hartley; herb...@gondor.apana.org.au; da...@davemloft.net;

RE: [PATCH 1/2] crypto: Add Imagination Technologies hw hash accelerator

2014-11-11 Thread James Hartley
Hi Vladimir -Original Message- From: linux-crypto-ow...@vger.kernel.org [mailto:linux-crypto- ow...@vger.kernel.org] On Behalf Of Vladimir Zapolskiy Sent: 11 November 2014 15:12 To: James Hartley; grant.lik...@linaro.org; robh...@kernel.org; a...@linux-foundation.org Cc:

Re: HELP: IPsec reordering issue

2014-11-11 Thread Ming Liu
Hi, Herbert: I've figured out a new patch for this issue reported by me previously, the basic idea is adding a cryptd_flush_queue function fixing it by being called from softirq to flush all previous queued elements before processing a new one, and it works very well so far per my test,

Re: [QUESTION] Crypto queue handling

2014-11-11 Thread Herbert Xu
On Tue, Nov 11, 2014 at 08:04:03PM +0200, Nicolae Rosia wrote: On Fri, May 30, 2014 at 4:41 PM, Herbert Xu herb...@gondor.apana.org.au wrote: [...] This is because the user is supposed to back off once they get EBUSY, until they're notified once the backlog entry is popped off (but not

[PATCH v3 10/13] crypto: Documentation - AEAD API documentation

2014-11-11 Thread Stephan Mueller
The API function calls exported by the kernel crypto API for AEAD ciphers to be used by consumers are documented. Signed-off-by: Stephan Mueller smuel...@chronox.de --- include/linux/crypto.h | 251 + 1 file changed, 251 insertions(+) diff --git

[PATCH v3 02/13] crypto: Documentation - compile crypto API spec

2014-11-11 Thread Stephan Mueller
Add the crypto API documentation into the DocBook Makefile to allow it being compiled Signed-off-by: Stephan Mueller smuel...@chronox.de --- Documentation/DocBook/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/DocBook/Makefile

[PATCH v3 05/13] crypto: Documentation - hash data structures

2014-11-11 Thread Stephan Mueller
The hash data structures needed to be filled in by cipher developers are documented. Signed-off-by: Stephan Mueller smuel...@chronox.de --- include/crypto/hash.h | 95 +++ 1 file changed, 95 insertions(+) diff --git a/include/crypto/hash.h

[PATCH v3 06/13] crypto: Documentation - AHASH API documentation

2014-11-11 Thread Stephan Mueller
The API function calls exported by the kernel crypto API for AHASHes to be used by consumers are documented. Signed-off-by: Stephan Mueller smuel...@chronox.de --- include/crypto/hash.h | 228 ++ 1 file changed, 228 insertions(+) diff --git

[PATCH v3 07/13] crypto: Documentation - SHASH API documentation

2014-11-11 Thread Stephan Mueller
The API function calls exported by the kernel crypto API for SHASHes to be used by consumers are documented. Signed-off-by: Stephan Mueller smuel...@chronox.de --- include/crypto/hash.h | 164 ++ 1 file changed, 164 insertions(+) diff --git

[PATCH v3 00/13] crypto: Documentation of kernel crypto API

2014-11-11 Thread Stephan Mueller
Hi, The following patch set adds documentation files under Documentation/crypto/ covering the high-level description of the API. In addition, it contains source code comments added to the header files of the kernel crypto API documenting the API functions. The documentation is provided in a

[PATCH v3 01/13] crypto: Documentation - crypto API high level spec

2014-11-11 Thread Stephan Mueller
The design of the kernel crypto API as well as hints to program with the kernel crypto API are given. The documentation contains: * design aspects of crypto API * develper specific hints * references to the API function description * source code examples CC: Marek Vasut ma...@denx.de

[PATCH v3 08/13] crypto: Documentation - cipher data structures

2014-11-11 Thread Stephan Mueller
The data structure of struct crypto_alg together with various other data structures needed by cipher developers is documented wit all parameters that can be set by a developer of a transformation. All parameters that are internal to the crypto API are marked as such. Signed-off-by: Stephan

[PATCH v3 04/13] crypto: Documentation - RNG API documentation

2014-11-11 Thread Stephan Mueller
The API function calls exported by the kernel crypto API for RNGs to be used by consumers are documented. Signed-off-by: Stephan Mueller smuel...@chronox.de --- include/crypto/rng.h | 80 1 file changed, 80 insertions(+) diff --git

[PATCH v3 03/13] crypto: Documentation - userspace interface spec

2014-11-11 Thread Stephan Mueller
The userspace interface of the kernel crypto API is documented with * a general explanation * a discussion of the memory in-place operation * the description of the message digest API * the description of the symmetric cipher API The documentation refers to libkcapi as a working example on

[PATCH v3 12/13] crypto: Documentation - CIPHER API documentation

2014-11-11 Thread Stephan Mueller
The API function calls exported by the kernel crypto API for signle block ciphers to be used by consumers are documented. Signed-off-by: Stephan Mueller smuel...@chronox.de --- include/linux/crypto.h | 89 ++ 1 file changed, 89 insertions(+) diff

[PATCH v3 09/13] crypto: Documentation - ABLKCIPHER API documentation

2014-11-11 Thread Stephan Mueller
The API function calls exported by the kernel crypto API for asynchronous block ciphers to be used by consumers are documented. Signed-off-by: Stephan Mueller smuel...@chronox.de --- include/linux/crypto.h | 206 + 1 file changed, 206 insertions(+)

[PATCH v3 11/13] crypto: Documentation - BLKCIPHER API documentation

2014-11-11 Thread Stephan Mueller
The API function calls exported by the kernel crypto API for synchronous block ciphers to be used by consumers are documented. Signed-off-by: Stephan Mueller smuel...@chronox.de --- include/linux/crypto.h | 188 + 1 file changed, 188 insertions(+)

[PATCH] crypto: aesni-intel - avoid IPsec re-ordering

2014-11-11 Thread Ming Liu
So far, the encryption/decryption are asynchronously processed in softirq and cryptd which would result in a implicit order of data, therefore leads IPSec stack also out of order while encapsulating or decapsulating packets. Consider the following scenario: DECRYPTION INBOUND

[PATCH 6/8] crypto: AF_ALG: make setkey optional

2014-11-11 Thread Stephan Mueller
The current AF_ALG implementation requires that a userspace interface implementation must provide a callback for setkey. Such a call is not appliable to random number generators. To prepare AF_ALG for the addition of a random number generator user space interface, this function callback

[PATCH 1/8] crypto: AF_ALG: add user space interface for AEAD

2014-11-11 Thread Stephan Mueller
AEAD requires the following data in addition to normal symmetric ciphers: * Associated authentication data of arbitrary length * Authentication tag for decryption * Length of authentication tag for encryption The authentication tag data is communicated as part of the

[PATCH 0/8] crypto: AF_ALG: add AEAD and RNG support

2014-11-11 Thread Stephan Mueller
Hi, This patch set adds AEAD and RNG support to the AF_ALG interface exported by the kernel crypto API. By extending AF_ALG with AEAD and RNG support, all cipher types the kernel crypto API allows access to are now accessible from userspace. The RNG support is stand-alone. The AEAD

[PATCH 3/8] crypto: AF_ALG: extend data structuers for AEAD

2014-11-11 Thread Stephan Mueller
The data structure holding the state of an ongoing symmetric cipher operation is extended by the data variables needed for AEAD. The request data structures are encapsulated by a union as the symmetric cipher implementation is either exclusively used for normal symmetric ciphers or for AEAD

[PATCH 2/8] crypto: AF_ALG: user space interface for cipher info

2014-11-11 Thread Stephan Mueller
The AF_ALG interface allows normal cipher (hash, encrypt, decrypt). However, it does not allow user space to obtain the following generic information about the currently active cipher: * block size of the cipher * IV size of the cipher * for AEAD, the maximum

[PATCH 7/8] crypto: AF_ALG: add random number generator support

2014-11-11 Thread Stephan Mueller
This patch adds the random number generator support for AF_ALG. A random number generator's purpose is to generate data without requiring the caller to provide any data. Therefore, the AF_ALG interface handler for RNGs only implements a callback handler for recvmsg. The following parameters

[PATCH 5/8] crypto: AF_ALG: add AEAD support

2014-11-11 Thread Stephan Mueller
This patch adds the AEAD support for AF_ALG. The AEAD implementation uses the entire memory handling and infrastructure of the existing skcipher implementation. To use AEAD, the user space consumer has to use the salg_type named aead. The AEAD extension only uses the bind callback as the key

[PATCH 4/8] crypto: AF_ALG: crypto API calls to inline functions

2014-11-11 Thread Stephan Mueller
To avoid excessive branches and cluttering the code, all kernel crypto API calls are extracted into separate inline functions. These functions invoke either the ablkcipher or the aead crypto API function calls, as necessary. Signed-off-by: Stephan Mueller smuel...@chronox.de ---

[PATCH 8/8] crypto: AF_ALG: enable RNG interface compilation

2014-11-11 Thread Stephan Mueller
Enable compilation of the RNG AF_ALG support and provide a Kconfig option to compile the RNG AF_ALG support. Signed-off-by: Stephan Mueller smuel...@chronox.de --- crypto/Kconfig | 9 + crypto/Makefile | 1 + 2 files changed, 10 insertions(+) diff --git a/crypto/Kconfig