[PATCH 15/16] crypto: mark GHASH ARMv8 vmull.p64 helper ciphers

2015-03-19 Thread Stephan Mueller
Flag all GHASH ARMv8 vmull.p64 helper ciphers as internal ciphers to prevent them from being called by normal users. Signed-off-by: Stephan Mueller --- arch/arm/crypto/ghash-ce-glue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/crypto/ghash-ce-glue.c b/arch/arm

[PATCH 13/16] crypto: mark NEON bit sliced AES helper ciphers

2015-03-19 Thread Stephan Mueller
Flag all NEON bit sliced AES helper ciphers as internal ciphers to prevent them from being called by normal users. Signed-off-by: Stephan Mueller --- arch/arm/crypto/aesbs-glue.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/arm/crypto/aesbs-glue.c b/arch/arm

[PATCH 09/16] crypto: mark Serpent AVX2 helper ciphers

2015-03-19 Thread Stephan Mueller
Flag all Serpent AVX2 helper ciphers as internal ciphers to prevent them from being called by normal users. Signed-off-by: Stephan Mueller --- arch/x86/crypto/serpent_avx2_glue.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/arch/x86/crypto

[PATCH 12/16] crypto: mark Twofish AVX helper ciphers

2015-03-19 Thread Stephan Mueller
Flag all Twofish AVX helper ciphers as internal ciphers to prevent them from being called by normal users. Signed-off-by: Stephan Mueller --- arch/x86/crypto/twofish_avx_glue.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/arch/x86/crypto

[PATCH 07/16] crypto: mark CAST6 helper ciphers

2015-03-19 Thread Stephan Mueller
Flag all CAST6 helper ciphers as internal ciphers to prevent them from being called by normal users. Signed-off-by: Stephan Mueller --- arch/x86/crypto/cast6_avx_glue.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/arch/x86/crypto/cast6_avx_glue.c b/arch

[PATCH 10/16] crypto: mark Serpent AVX helper ciphers

2015-03-19 Thread Stephan Mueller
Flag all Serpent AVX helper ciphers as internal ciphers to prevent them from being called by normal users. Signed-off-by: Stephan Mueller --- arch/x86/crypto/serpent_avx_glue.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/arch/x86/crypto

[PATCH 08/16] crypto: mark ghash clmulni helper ciphers

2015-03-19 Thread Stephan Mueller
Flag all ash clmulni helper ciphers as internal ciphers to prevent them from being called by normal users. Signed-off-by: Stephan Mueller --- arch/x86/crypto/ghash-clmulni-intel_glue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/crypto/ghash-clmulni

[PATCH 05/16] crypto: mark CAST5 helper ciphers

2015-03-19 Thread Stephan Mueller
Flag all CAST5 helper ciphers as internal ciphers to prevent them from being called by normal users. Signed-off-by: Stephan Mueller --- arch/x86/crypto/cast5_avx_glue.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/x86/crypto/cast5_avx_glue.c b/arch/x86

[PATCH 02/16] crypto: /proc/crypto: identify internal ciphers

2015-03-19 Thread Stephan Mueller
With ciphers that now cannot be accessed via the kernel crypto API, callers shall be able to identify the ciphers that are not callable. The /proc/crypto file is added a boolean field identifying that such internal ciphers. Signed-off-by: Stephan Mueller --- crypto/proc.c | 3 +++ 1 file

[PATCH 03/16] crypto: mark AES-NI helper ciphers

2015-03-19 Thread Stephan Mueller
Flag all AES-NI helper ciphers as internal ciphers to prevent them from being called by normal users. Signed-off-by: Stephan Mueller --- arch/x86/crypto/aesni-intel_glue.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/arch/x86/crypto/aesni-intel_glue.c

[PATCH 04/16] crypto: mark AES-NI Camellia helper ciphers

2015-03-19 Thread Stephan Mueller
Flag all AES-NI Camellia helper ciphers as internal ciphers to prevent them from being called by normal users. Signed-off-by: Stephan Mueller --- arch/x86/crypto/camellia_aesni_avx2_glue.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/arch/x86/crypto

[PATCH 06/16] crypto: mark AVX Camellia helper ciphers

2015-03-19 Thread Stephan Mueller
Flag all AVX Camellia helper ciphers as internal ciphers to prevent them from being called by normal users. Signed-off-by: Stephan Mueller --- arch/x86/crypto/camellia_aesni_avx_glue.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/arch/x86/crypto

[PATCH 01/16] crypto: prevent helper ciphers from being used

2015-03-19 Thread Stephan Mueller
r callers cannot use ciphers marked with this flag using the kernel crypto API. The various crypto_alloc_* calls will return an error. This patch modified all callers of __crypto_alloc_tfm to honor the new flag, except the crypto_spawn_tfm function that services the crypto_*_spawn_* API. Signed-off

[PATCH 11/16] crypto: mark Serpent SSE2 helper ciphers

2015-03-19 Thread Stephan Mueller
Flag all Serpent SSE2 helper ciphers as internal ciphers to prevent them from being called by normal users. Signed-off-by: Stephan Mueller --- arch/x86/crypto/serpent_sse2_glue.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/arch/x86/crypto

[PATCH 16/16] crypto: mark 64 bit ARMv8 AES helper ciphers

2015-03-19 Thread Stephan Mueller
Flag all 64 bit ARMv8 AES helper ciphers as internal ciphers to prevent them from being called by normal users. Signed-off-by: Stephan Mueller --- arch/arm64/crypto/aes-glue.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/arm64/crypto/aes-glue.c b/arch

Re: [BUG/PATCH] kernel RNG and its secrets

2015-03-18 Thread Stephan Mueller
Am Mittwoch, 18. März 2015, 16:09:34 schrieb Hannes Frederic Sowa: Hi Hannes, >On Wed, Mar 18, 2015, at 13:42, Daniel Borkmann wrote: >> On 03/18/2015 01:20 PM, Stephan Mueller wrote: >> > Am Mittwoch, 18. März 2015, 13:19:07 schrieb Hannes Frederic Sowa: >> >>&g

Re: [BUG/PATCH] kernel RNG and its secrets

2015-03-18 Thread Stephan Mueller
Am Mittwoch, 18. März 2015, 13:19:07 schrieb Hannes Frederic Sowa: Hi Hannes, >On Wed, Mar 18, 2015, at 13:14, Stephan Mueller wrote: >> Am Mittwoch, 18. März 2015, 13:02:12 schrieb Hannes Frederic Sowa: >> >> Hi Hannes, >> >> >On Wed, Mar 18, 2015, at 12

Re: [BUG/PATCH] kernel RNG and its secrets

2015-03-18 Thread Stephan Mueller
Am Mittwoch, 18. März 2015, 13:02:12 schrieb Hannes Frederic Sowa: Hi Hannes, >On Wed, Mar 18, 2015, at 12:09, Stephan Mueller wrote: >> Am Mittwoch, 18. März 2015, 11:56:43 schrieb Daniel Borkmann: >> >On 03/18/2015 11:50 AM, Hannes Frederic Sowa wrote: >> >>

Re: [BUG/PATCH] kernel RNG and its secrets

2015-03-18 Thread Stephan Mueller
Am Mittwoch, 18. März 2015, 11:56:43 schrieb Daniel Borkmann: Hi Daniel, >On 03/18/2015 11:50 AM, Hannes Frederic Sowa wrote: >> On Wed, Mar 18, 2015, at 10:53, mancha wrote: >>> Hi. >>> >>> The kernel RNG introduced memzero_explicit in d4c5efdb9777 to >>> protect >>> >>> memory cleansing again

Re: [RFC PATCH] crypto: prevent helper ciphers from being allocated by users

2015-03-17 Thread Stephan Mueller
Am Dienstag, 17. März 2015, 22:45:52 schrieb Herbert Xu: Hi Herbert, >On Tue, Mar 17, 2015 at 12:40:12PM +0100, Stephan Mueller wrote: >> >How about adding a flag to all these internal algorithms and then >> >change crypto_alg_mod_lookup to disable that flag by default?

Re: [RFC PATCH] crypto: prevent helper ciphers from being allocated by users

2015-03-17 Thread Stephan Mueller
Am Dienstag, 17. März 2015, 22:23:50 schrieb Herbert Xu: Hi Herbert, >On Fri, Mar 13, 2015 at 10:09:21PM +0100, Stephan Mueller wrote: >> +struct crypto_tfm *__crypto_alloc_tfm_safe(struct crypto_alg *alg, >> u32 type, +

Re: [RFC PATCH] crypto: prevent helper ciphers from being allocated by users

2015-03-15 Thread Stephan Mueller
Am Freitag, 13. März 2015, 22:09:21 schrieb Stephan Mueller: Hi Stephan, > Hi, > > Several hardware related cipher implementations are implemented as follows: > a "helper" cipher implementation is registered with the kernel crypto API. > > Such helper ciphers are ne

[RFC PATCH] crypto: prevent helper ciphers from being allocated by users

2015-03-13 Thread Stephan Mueller
Hi, Several hardware related cipher implementations are implemented as follows: a "helper" cipher implementation is registered with the kernel crypto API. Such helper ciphers are never intended to be called by normal users. In some cases, calling them via the normal crypto API may even cause fa

[PATCH RESEND] crypto: algif_rng - zeroize buffer with random data

2015-03-13 Thread Stephan Mueller
Due to the change to RNGs to always return zero in success case, the RNG interface must zeroize the buffer with the length provided by the caller. Signed-off-by: Stephan Mueller --- crypto/algif_rng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/algif_rng.c b

[PATCH v2] crypto: AES-NI - fix memory usage in GCM decryption

2015-03-12 Thread Stephan Mueller
to demonstrate that the crypto operation still delivers the right results. [1] http://www.chronox.de/libkcapi.html CC: Tadeusz Struk Signed-off-by: Stephan Mueller --- arch/x86/crypto/aesni-intel_glue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/crypto/ae

Re: [PATCH] crypto: AES-NI: fix memory usage in GCM decryption

2015-03-11 Thread Stephan Mueller
Am Dienstag, 10. März 2015, 20:45:43 schrieb Herbert Xu: Hi Herbert, > On Sun, Mar 08, 2015 at 07:49:58PM +0100, Stephan Mueller wrote: > > The RFC4106 GCM decryption operation tries to overwrite cryptlen memory > > in req->dst. As the destination buffer for decryption only nee

[PATCH] crypto: algif_rng - zeroize buffer holding random data

2015-03-10 Thread Stephan Mueller
Due to the change to RNGs to always return zero in success case, the RNG interface must zeroize the buffer with the length provided by the caller. Signed-off-by: Stephan Mueller --- crypto/algif_rng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/algif_rng.c b

Re: [PATCH] crypto: DRBG return code handling inside testmgr.c

2015-03-10 Thread Stephan Mueller
Am Dienstag, 10. März 2015, 16:14:17 schrieb Alexander Bergmann: Hi Alexander, > Hi Herbert, > > I just fixed a small DRBG return code issue inside testmgr.c directly > related to the RNG changes Stephan submitted. Can you please resend it as an inline patch and copy linux-crypto too? Also, th

Re: linux-next: build warnings after merge of the crypto tree

2015-03-10 Thread Stephan Mueller
Am Dienstag, 10. März 2015, 17:44:54 schrieb Stephen Rothwell: Hi Stephen, >Hi Herbert, > >On Tue, 10 Mar 2015 17:03:28 +1100 Herbert Xu wrote: >> On Tue, Mar 10, 2015 at 04:44:17PM +1100, Stephen Rothwell wrote: >> > After merging the crypto tree, today's (and the past few days) >> > linux-nex

[PATCH] crypto: AES-NI: fix memory usage in GCM decryption

2015-03-08 Thread Stephan Mueller
ttp://www.chronox.de/libkcapi.html CC: Tadeusz Struk Signed-off-by: Stephan Mueller --- arch/x86/crypto/aesni-intel_glue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c index 6893f49..8f7900e8 100644 --

[PATCH 1/2] crypto: Documentation - AEAD / RNG AF_ALG interface

2015-03-06 Thread Stephan Mueller
description is now added. Also, a brief description of the zero-copy interface with an example code snippet is provided. Signed-off-by: Stephan Mueller --- Documentation/DocBook/crypto-API.tmpl | 596 ++ Documentation/crypto/crypto-API-userspace.txt | 205

[PATCH 0/2] crypto: Documentation - add AF_ALG to DocBook

2015-03-06 Thread Stephan Mueller
Hi, the AF_ALG interface description is added to the kernel crypto API DocBook. It is extended by the newly added AEAD and RNG interfaces. An example of the documentation can be viewed at [1]. [1] http://www.chronox.de/crypto-API/User.html Stephan Mueller (2): crypto: Documentation - AEAD

[PATCH 2/2] MAINTAINERS: add crypto-API.tmpl

2015-03-06 Thread Stephan Mueller
The file Documentation/DocBook/crypto-API.tmpl documents the kernel crypto API and is maintained. Signed-off-by: Stephan Mueller --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index ddc5a8c..c10814e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS

[PATCH] crypto: RNGs must return 0 in success case

2015-03-05 Thread Stephan Mueller
Change the RNGs to always return 0 in success case. This patch ensures that seqiv.c works with RNGs other than krng. seqiv expects that any return code other than 0 is an error. Without the patch, rfc4106(gcm(aes)) will not work when using a DRBG or an ANSI X9.31 RNG. Signed-off-by: Stephan

Re: RFC: sysctl fixes

2015-03-04 Thread Stephan Mueller
Am Mittwoch, 4. März 2015, 15:18:19 schrieb Marian Marinov: Hi Marian, >Hello, >we are running hundreds of containers and we got some valid requests >from customers that want to be able to change their container's >hostname using the sysctl command. > >The current implementation does not allow ea

Re: [PATCH v13 0/2] crypto: AF_ALG: add AEAD support

2015-03-04 Thread Stephan Mueller
Am Mittwoch, 4. März 2015, 22:16:32 schrieb Herbert Xu: Hi Herbert, >On Sat, Feb 28, 2015 at 08:49:22PM +0100, Stephan Mueller wrote: >> Hi, >> >> This patch set adds AEAD support to the AF_ALG interface >> exported by the kernel crypto API. >> > >All ap

[PATCH 0/2] crypto: drbg: performance improvements

2015-03-01 Thread Stephan Mueller
Hi, The following patches increase the performance of the CTR DRBG and Hash DRBG. The updates successfully pass the CAVS testing. for Hash DRBG and CTR DRBG. Stephan Mueller (2): crypto: drbg: use single block cipher API crypto: drbg: remove superflowous memsets crypto/drbg.c | 57

[PATCH 2/2] crypto: drbg: remove superflowous memsets

2015-03-01 Thread Stephan Mueller
The DRBG code contains memset(0) calls to initialize a varaible that are not necessary as the variable is always overwritten by the processing. This patch increases the CTR and Hash DRBGs by about 5%. Signed-off-by: Stephan Mueller --- crypto/drbg.c | 18 -- 1 file changed, 18

[PATCH 1/2] crypto: drbg: use single block cipher API

2015-03-01 Thread Stephan Mueller
The CTR DRBG only encrypts one single block at a time. Thus, use the single block crypto API to avoid additional overhead from the block chaining modes. With the patch, the speed of the DRBG increases between 30% and 40%. The DRBG still passes the CTR DRBG CAVS test. Signed-off-by: Stephan

[PATCH v13 1/2] crypto: AF_ALG: add AEAD support

2015-02-28 Thread Stephan Mueller
en and how that operation is performed. A fully working example using all aspects of AEAD is provided at http://www.chronox.de/libkcapi.html Signed-off-by: Stephan Mueller --- crypto/algif_aead.c | 666 1 file changed, 666 insertions(+) c

[PATCH v13 0/2] crypto: AF_ALG: add AEAD support

2015-02-28 Thread Stephan Mueller
ase in sendmsg (reported by Herbert Xu) * correct some formatting as suggested by checkpatch.pl Changes v13: * convert recvmsg to use the iov_iter API Stephan Mueller (2): crypto: AF_ALG: add AEAD support crypto: AF_ALG: enable AEAD interface compilation crypto/Kconfig | 9 + c

[PATCH v13 2/2] crypto: AF_ALG: enable AEAD interface compilation

2015-02-28 Thread Stephan Mueller
Enable compilation of the AEAD AF_ALG support and provide a Kconfig option to compile the AEAD AF_ALG support. Signed-off-by: Stephan Mueller --- crypto/Kconfig | 9 + crypto/Makefile | 1 + 2 files changed, 10 insertions(+) diff --git a/crypto/Kconfig b/crypto/Kconfig index 2ca8d15

[PATCH] crypto: Documentation - describe internal structure

2015-02-27 Thread Stephan Mueller
The kernel crypto API has many indirections which warrant a description as otherwise one can get easily lost. The description explains the layers of the kernel crypto API based on examples. Signed-off-by: Stephan Mueller --- Documentation/DocBook/crypto-API.tmpl | 264

Re: [PATCH v12 1/2] crypto: AF_ALG: add AEAD support

2015-02-27 Thread Stephan Mueller
Am Freitag, 27. Februar 2015, 10:34:37 schrieb Tadeusz Struk: Hi Tadeusz, > On 02/27/2015 02:26 AM, Stephan Mueller wrote: > >>>> This patch adds the AEAD support for AF_ALG. > >>>> > >>>> >> > The implementation is based on algif_

Re: [PATCH v12 1/2] crypto: AF_ALG: add AEAD support

2015-02-27 Thread Stephan Mueller
Am Freitag, 27. Februar 2015, 22:49:44 schrieb Herbert Xu: Hi Herbert, >On Thu, Feb 05, 2015 at 04:10:58PM +0100, Stephan Mueller wrote: >> Am Donnerstag, 29. Januar 2015, 21:24:45 schrieb Stephan Mueller: >> >> Hi Herbert, >> >> > This patch adds the AEA

Re: [PATCH v12 1/2] crypto: AF_ALG: add AEAD support

2015-02-05 Thread Stephan Mueller
Am Donnerstag, 29. Januar 2015, 21:24:45 schrieb Stephan Mueller: Hi Herbert, > This patch adds the AEAD support for AF_ALG. > > The implementation is based on algif_skcipher, but contains heavy > modifications to streamline the interface for AEAD uses. > > To use AEAD, the u

Re: [PATCH 0/3] crypto: algif - change algif_skcipher to be asynchronous

2015-02-02 Thread Stephan Mueller
Am Montag, 2. Februar 2015, 07:03:02 schrieb Tadeusz Struk: Hi Tadeusz, >On 02/01/2015 10:31 AM, Stephan Mueller wrote: >> Hi Tadeusz, >> >>> > The way the algif_skcipher works currently is that on >>> > sendmsg/sendpage it builds an sgl for the input

Re: [PATCH 0/3] crypto: algif - change algif_skcipher to be asynchronous

2015-02-01 Thread Stephan Mueller
Am Donnerstag, 29. Januar 2015, 15:13:39 schrieb Tadeusz Struk: Hi Tadeusz, > The way the algif_skcipher works currently is that on sendmsg/sendpage it > builds an sgl for the input data and then on read/recvmsg it sends the job > for encryption putting the user to sleep till the data is processe

[PATCH v12 2/2] crypto: AF_ALG: enable AEAD interface compilation

2015-01-29 Thread Stephan Mueller
Enable compilation of the AEAD AF_ALG support and provide a Kconfig option to compile the AEAD AF_ALG support. Signed-off-by: Stephan Mueller --- crypto/Kconfig | 9 + crypto/Makefile | 1 + 2 files changed, 10 insertions(+) diff --git a/crypto/Kconfig b/crypto/Kconfig index 50f4da4

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

2015-01-29 Thread Stephan Mueller
ECs (reported by Herbert Xu) * prevent an edge condition error case in sendmsg (reported by Herbert Xu) * correct some formatting as suggested by checkpatch.pl Stephan Mueller (2): crypto: AF_ALG: add AEAD support crypto: AF_ALG: enable AEAD interface compilation crypto/Kconfig

[PATCH v12 1/2] crypto: AF_ALG: add AEAD support

2015-01-29 Thread Stephan Mueller
en and how that operation is performed. A fully working example using all aspects of AEAD is provided at http://www.chronox.de/libkcapi.html Signed-off-by: Stephan Mueller --- crypto/algif_aead.c | 666 1 file changed, 666 insertions(+) c

Re: [PATCH v11 1/2] crypto: AF_ALG: add AEAD support

2015-01-25 Thread Stephan Mueller
Am Montag, 26. Januar 2015, 15:37:33 schrieb Herbert Xu: Hi Herbert, > On Mon, Jan 26, 2015 at 05:35:07AM +0100, Stephan Mueller wrote: > > It seems I have misunderstood you in the last discussion. > > I thought you were limiting the receive SGL by ALG_MAX_PAGES rather > than

Re: [PATCH v11 1/2] crypto: AF_ALG: add AEAD support

2015-01-25 Thread Stephan Mueller
Am Montag, 26. Januar 2015, 15:32:18 schrieb Herbert Xu: Hi Herbert, > On Mon, Jan 26, 2015 at 05:26:33AM +0100, Stephan Mueller wrote: > > Am Montag, 26. Januar 2015, 10:55:50 schrieb Herbert Xu: > > > > Hi Herbert, > > > > > On Wed, Jan 21, 2015 at 02:

Re: [PATCH v11 1/2] crypto: AF_ALG: add AEAD support

2015-01-25 Thread Stephan Mueller
Am Montag, 26. Januar 2015, 11:06:31 schrieb Herbert Xu: Hi Herbert, > On Wed, Jan 21, 2015 at 02:19:17AM +0100, Stephan Mueller wrote: > > + /* > > +* Require exactly one IOV block as the AEAD operation is a one shot > > +* due to the authentication tag. > &

Re: [PATCH v11 1/2] crypto: AF_ALG: add AEAD support

2015-01-25 Thread Stephan Mueller
Am Montag, 26. Januar 2015, 10:55:50 schrieb Herbert Xu: Hi Herbert, > On Wed, Jan 21, 2015 at 02:19:17AM +0100, Stephan Mueller wrote: > > + /* use the existing memory in an allocated page */ > > + if (ctx->merge) { > > + sg

Re: [PATCH] crypto/testmgr: mark rfc4106(gcm(aes)) as fips_allowed

2015-01-23 Thread Stephan Mueller
Am Freitag, 23. Januar 2015, 12:42:15 schrieb Jarod Wilson: Hi Jarod, >This gcm variant is popular for ipsec use, and there are folks who >would like to use it while in fips mode. Mark it with fips_allowed=1 >to facilitate that. Acked-by: Stephan Mueller For the records: this change

Re: [PATCH] crypto: aesni: add setkey for driver-gcm-aes-aesni

2015-01-22 Thread Stephan Mueller
Am Donnerstag, 22. Januar 2015, 10:23:57 schrieb Tadeusz Struk: Hi Tadeusz, >On 01/20/2015 05:25 PM, Stephan Mueller wrote: >>> Rather than adding a bogus setkey function, please fix this mess >>> properly by moving the top-level setkey function into the __driver >&

Re: [PATCH] crypto: aesni: add setkey for driver-gcm-aes-aesni

2015-01-20 Thread Stephan Mueller
Am Dienstag, 20. Januar 2015, 14:17:04 schrieb Herbert Xu: Hi Tadeusz, > On Sun, Jan 18, 2015 at 11:56:03PM +0100, Stephan Mueller wrote: > > The cipher registered as __driver-gcm-aes-aesni is never intended > > to be used directly by any caller. Instead it is a service mechanism

[PATCH v11 1/2] crypto: AF_ALG: add AEAD support

2015-01-20 Thread Stephan Mueller
en and how that operation is performed. A fully working example using all aspects of AEAD is provided at http://www.chronox.de/libkcapi.html Signed-off-by: Stephan Mueller --- crypto/algif_aead.c | 638 1 file changed, 638 insertions(+) c

[PATCH v11 2/2] crypto: AF_ALG: enable AEAD interface compilation

2015-01-20 Thread Stephan Mueller
Enable compilation of the AEAD AF_ALG support and provide a Kconfig option to compile the AEAD AF_ALG support. Signed-off-by: Stephan Mueller --- crypto/Kconfig | 9 + crypto/Makefile | 1 + 2 files changed, 10 insertions(+) diff --git a/crypto/Kconfig b/crypto/Kconfig index 50f4da4

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

2015-01-20 Thread Stephan Mueller
m service function * remove now unneeded ctx->trunc and MSG_TRUNC error return Stephan Mueller (2): crypto: AF_ALG: add AEAD support crypto: AF_ALG: enable AEAD interface compilation crypto/Kconfig | 9 + crypto/Makefile | 1 + cryp

Re: [PATCH] crypto: aesni: add setkey for driver-gcm-aes-aesni

2015-01-19 Thread Stephan Mueller
Am Dienstag, 20. Januar 2015, 14:37:05 schrieb Herbert Xu: Hi Herbert, >On Tue, Jan 20, 2015 at 04:35:41AM +0100, Stephan Mueller wrote: >> This in turn would then turn the __driver implementation into a full >> GCM implementation. That would mean that we should rename it from &

Re: [PATCH] crypto: aesni: add setkey for driver-gcm-aes-aesni

2015-01-19 Thread Stephan Mueller
Am Dienstag, 20. Januar 2015, 14:17:04 schrieb Herbert Xu: Hi Herbert, >On Sun, Jan 18, 2015 at 11:56:03PM +0100, Stephan Mueller wrote: >> The cipher registered as __driver-gcm-aes-aesni is never intended >> to be used directly by any caller. Instead it is a service mechanism &g

Re: [PATCH v8 1/2] crypto: AF_ALG: add AEAD support

2015-01-19 Thread Stephan Mueller
Am Dienstag, 20. Januar 2015, 14:00:17 schrieb Herbert Xu: Hi Herbert, >On Fri, Jan 09, 2015 at 04:30:45AM +0100, Stephan Mueller wrote: >> Am Donnerstag, 8. Januar 2015, 22:09:31 schrieb Herbert Xu: >> >> Hi Herbert, >> >> > On Wed, Jan 07, 2015 at 04:

[PATCH] crypto: aesni: add setkey for driver-gcm-aes-aesni

2015-01-18 Thread Stephan Mueller
to crypto_aead_setkey will cause a NULL pointer dereference without this patch. CC: Tadeusz Struk Signed-off-by: Stephan Mueller --- arch/x86/crypto/aesni-intel_glue.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni

[PATCH] crypto: Documentation: remove colons in comments

2015-01-18 Thread Stephan Mueller
comments that shall not be treated as headings. Signed-off-by: Stephan Mueller --- include/linux/crypto.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/crypto.h b/include/linux/crypto.h index 9099834..fb5ef16 100644 --- a/include/linux/crypto.h +++ b

Re: [PATCH] crypto: aesni: add setkey for driver-gcm-aes-aesni

2015-01-18 Thread Stephan Mueller
Am Sonntag, 18. Januar 2015, 23:56:03 schrieb Stephan Mueller: Hi Tadeusz, > The cipher registered as __driver-gcm-aes-aesni is never intended > to be used directly by any caller. Instead it is a service mechanism to > rfc4106-gcm-aesni. > > The kernel crypto API unconditio

Re: Intel GCM: __driver-gcm-aes-aesni setkey missing

2015-01-18 Thread Stephan Mueller
Am Samstag, 17. Januar 2015, 17:37:06 schrieb Tadeusz Struk: Hi Tadeusz, > Hi Stephan, > > On 01/17/2015 10:23 AM, Stephan Mueller wrote: > > during testing of my algif_aead patch with the different GCM > > implementations I am able to trigger a kernel crash from user spa

Intel GCM: __driver-gcm-aes-aesni setkey missing

2015-01-17 Thread Stephan Mueller
Hi Gabriele, Adrian, Tadeusz, Aidan, during testing of my algif_aead patch with the different GCM implementations I am able to trigger a kernel crash from user space using __driver-gcm-aes- aesni. As I hope that algif_aead is going to be included, unprivileged userspace would then reliably cras

Re: [PATCH v10 0/2] crypto: AF_ALG: add AEAD and RNG support

2015-01-14 Thread Stephan Mueller
Am Mittwoch, 14. Januar 2015, 22:00:11 schrieb Herbert Xu: Hi Herbert, > On Wed, Jan 14, 2015 at 04:46:31AM -0500, Neil Horman wrote: > > On Wed, Jan 14, 2015 at 04:52:29AM +0100, Stephan Mueller wrote: > > > Hi, > > > > > > This patch set adds AEAD and

[PATCH v10 2/2] crypto: AF_ALG: enable AEAD interface compilation

2015-01-13 Thread Stephan Mueller
Enable compilation of the AEAD AF_ALG support and provide a Kconfig option to compile the AEAD AF_ALG support. Signed-off-by: Stephan Mueller --- crypto/Kconfig | 9 + crypto/Makefile | 1 + 2 files changed, 10 insertions(+) diff --git a/crypto/Kconfig b/crypto/Kconfig index 50f4da4

[PATCH v10 1/2] crypto: AF_ALG: add AEAD support

2015-01-13 Thread Stephan Mueller
en and how that operation is performed. A fully working example using all aspects of AEAD is provided at http://www.chronox.de/libkcapi.html Signed-off-by: Stephan Mueller --- crypto/algif_aead.c | 680 1 file changed, 680 insertions(+) c

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

2015-01-13 Thread Stephan Mueller
initialize ctx->trunc in aead_accept_parent to zero * fix one line with code formatting problems Stephan Mueller (2): crypto: AF_ALG: add AEAD support crypto: AF_ALG: enable AEAD interface compilation crypto/Kconfig | 9 + crypto/Makefile | 1 + crypto/

Re: [PATCH v9 1/2] crypto: AF_ALG: add AEAD support

2015-01-11 Thread Stephan Mueller
Am Sonntag, 11. Januar 2015, 04:45:53 schrieb Stephan Mueller: Hi Herbert, > +static int aead_accept_parent(void *private, struct sock *sk) > +{ > + struct aead_ctx *ctx; > + struct alg_sock *ask = alg_sk(sk); > + unsigned int len = sizeof(*ctx) + crypto_aead_

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

2015-01-10 Thread Stephan Mueller
d in sendmsg/sendpage * release all buffers in case insufficient data was provided in sendmsg/sendpage * bug fix in sendmsg: when a new page is allocated, reset sg->offset to 0 -- the error is visible with the new tests in [1] when using the -d flag with the test application Stephan Muelle

[PATCH v9 1/2] crypto: AF_ALG: add AEAD support

2015-01-10 Thread Stephan Mueller
en and how that operation is performed. A fully working example using all aspects of AEAD is provided at http://www.chronox.de/libkcapi.html Signed-off-by: Stephan Mueller --- crypto/algif_aead.c | 679 1 file changed, 679 insertions(+) c

[PATCH v9 2/2] crypto: AF_ALG: enable AEAD interface compilation

2015-01-10 Thread Stephan Mueller
Enable compilation of the AEAD AF_ALG support and provide a Kconfig option to compile the AEAD AF_ALG support. Signed-off-by: Stephan Mueller --- crypto/Kconfig | 9 + crypto/Makefile | 1 + 2 files changed, 10 insertions(+) diff --git a/crypto/Kconfig b/crypto/Kconfig index 50f4da4

Re: [PATCH v8 1/2] crypto: AF_ALG: add AEAD support

2015-01-08 Thread Stephan Mueller
Am Donnerstag, 8. Januar 2015, 22:09:31 schrieb Herbert Xu: Hi Herbert, > On Wed, Jan 07, 2015 at 04:51:38PM +0100, Stephan Mueller wrote: > > + if (!aead_writable(sk)) { > > + /* > > +* If there is more data to be ex

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

2015-01-07 Thread Stephan Mueller
6th page for plaintext). See [1] for updated test case. Stephan Mueller (2): crypto: AF_ALG: add AEAD support crypto: AF_ALG: enable AEAD interface compilation crypto/Kconfig | 9 + crypto/Makefile | 1 + crypto/algif_aead.c | 666 +++

[PATCH v8 2/2] crypto: AF_ALG: enable AEAD interface compilation

2015-01-07 Thread Stephan Mueller
Enable compilation of the AEAD AF_ALG support and provide a Kconfig option to compile the AEAD AF_ALG support. Signed-off-by: Stephan Mueller --- crypto/Kconfig | 9 + crypto/Makefile | 1 + 2 files changed, 10 insertions(+) diff --git a/crypto/Kconfig b/crypto/Kconfig index 50f4da4

[PATCH v8 1/2] crypto: AF_ALG: add AEAD support

2015-01-07 Thread Stephan Mueller
en and how that operation is performed. A fully working example using all aspects of AEAD is provided at http://www.chronox.de/libkcapi.html Signed-off-by: Stephan Mueller --- crypto/algif_aead.c | 666 1 file changed, 666 insertions(+) c

[PATCH v2] crypto: AEAD: add check for presence of auth tag

2015-01-05 Thread Stephan Mueller
The AEAD decryption operation requires the authentication tag to be present as part of the cipher text buffer. The added check verifies that the caller provides a cipher text with at least the authentication tag. Signed-off-by: Stephan Mueller --- include/linux/crypto.h | 3 +++ 1 file changed

Re: [PATCH v7 1/2] crypto: AF_ALG: add AEAD support

2015-01-05 Thread Stephan Mueller
Am Montag, 5. Januar 2015, 21:51:06 schrieb Herbert Xu: Hi Herbert, > On Mon, Jan 05, 2015 at 11:46:50AM +0100, Stephan Mueller wrote: > > The need for that check lies in aead_recvmsg: > > /* > > > > * first chunk of input is AD -- o

Re: [PATCH] crypto: AEAD: add check for presence of auth tag

2015-01-05 Thread Stephan Mueller
Am Montag, 5. Januar 2015, 21:55:40 schrieb Herbert Xu: Hi Herbert, > On Mon, Jan 05, 2015 at 11:53:38AM +0100, Stephan Mueller wrote: > > Could you please check: I am unable to find the function. > > It's in crypto/authenc.c. > > > Note, there is

Re: [PATCH v7 1/2] crypto: AF_ALG: add AEAD support

2015-01-05 Thread Stephan Mueller
Am Montag, 5. Januar 2015, 21:51:06 schrieb Herbert Xu: Hi Herbert, > On Mon, Jan 05, 2015 at 11:46:50AM +0100, Stephan Mueller wrote: > > The need for that check lies in aead_recvmsg: > > /* > > > > * first chunk of input is AD -- o

Re: [PATCH] crypto: AEAD: add check for presence of auth tag

2015-01-05 Thread Stephan Mueller
Am Montag, 5. Januar 2015, 21:39:57 schrieb Herbert Xu: Hi Herbert, > On Mon, Jan 05, 2015 at 11:26:48AM +0100, Stephan Mueller wrote: > > Could you please help me understand where that check should be and what > > should be done at the crypto API level? > > All I was a

Re: [PATCH v7 1/2] crypto: AF_ALG: add AEAD support

2015-01-05 Thread Stephan Mueller
Am Montag, 5. Januar 2015, 21:31:59 schrieb Herbert Xu: Hi Herbert, > On Fri, Jan 02, 2015 at 03:41:33PM +0100, Stephan Mueller wrote: > > + if (!con.aead_assoclen) > > + return -EINVAL; > > AD being zero should

Re: [PATCH] crypto: AEAD: add check for presence of auth tag

2015-01-05 Thread Stephan Mueller
Am Montag, 5. Januar 2015, 21:19:01 schrieb Herbert Xu: Hi Herbert, > On Tue, Dec 30, 2014 at 10:16:03PM +0100, Stephan Mueller wrote: > > The AEAD decryption operation requires the authentication tag to be > > present as part of the cipher text buffer. The added check verifi

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

2015-01-02 Thread Stephan Mueller
30/200. Otherwise, user space can trigger a kernel crash. * RNG: patch dropped as it was applied * AEAD: port Kconfig/Makefile patch forward to current code base Stephan Mueller (2): crypto: AF_ALG: add AEAD support crypto: AF_ALG: enable AEAD interface compilation crypto/Kconfig | 9 +

[PATCH v7 2/2] crypto: AF_ALG: enable AEAD interface compilation

2015-01-02 Thread Stephan Mueller
Enable compilation of the AEAD AF_ALG support and provide a Kconfig option to compile the AEAD AF_ALG support. Signed-off-by: Stephan Mueller --- crypto/Kconfig | 9 + crypto/Makefile | 1 + 2 files changed, 10 insertions(+) diff --git a/crypto/Kconfig b/crypto/Kconfig index 50f4da4

[PATCH v7 1/2] crypto: AF_ALG: add AEAD support

2015-01-02 Thread Stephan Mueller
en and how that operation is performed. A fully working example using all aspects of AEAD is provided at http://www.chronox.de/libkcapi.html Signed-off-by: Stephan Mueller --- crypto/algif_aead.c | 631 1 file changed, 631 insertions(+) c

Re: [PATCH v6 4/4] crypto: AF_ALG: enable RNG interface compilation

2014-12-30 Thread Stephan Mueller
Am Montag, 29. Dezember 2014, 21:41:58 schrieb Herbert Xu: Hi Herbert, > On Thu, Dec 25, 2014 at 11:00:39PM +0100, Stephan Mueller wrote: > > Enable compilation of the RNG AF_ALG support and provide a Kconfig > > option to compile the RNG AF_ALG support. > > > > Sig

Re: [PATCH v6 1/4] crypto: AF_ALG: add AEAD support

2014-12-30 Thread Stephan Mueller
Am Dienstag, 30. Dezember 2014, 04:33:41 schrieb Herbert Xu: Hi Herbert, > On Mon, Dec 29, 2014 at 04:05:40PM +0100, Stephan Mueller wrote: > > This would mean that the check must stay in recvmsg as only here we know > > that the caller wants data to be processed. > > On th

[PATCH] crypto: AEAD: add check for presence of auth tag

2014-12-30 Thread Stephan Mueller
than once. Thus, the speed penalty should be marginal. Signed-off-by: Stephan Mueller --- include/linux/crypto.h | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/include/linux/crypto.h b/include/linux/crypto.h index 9c8776d..badc53b 100644 --- a/include/linux

Re: [PATCH v6 1/4] crypto: AF_ALG: add AEAD support

2014-12-30 Thread Stephan Mueller
Am Dienstag, 30. Dezember 2014, 04:33:41 schrieb Herbert Xu: Hi Herbert, > > > > PS we should add a length check for missing/partial auth tags > > > to crypto_aead_decrypt. We can then remove such checks from > > > individual implementations. > > > > I agree in full here. Shall I create such a

Re: [PATCH v6 1/4] crypto: AF_ALG: add AEAD support

2014-12-29 Thread Stephan Mueller
Am Montag, 29. Dezember 2014, 21:33:19 schrieb Herbert Xu: Hi Herbert, > On Thu, Dec 25, 2014 at 11:01:47PM +0100, Stephan Mueller wrote: > > + err = -ENOMEM; > > This should be EINVAL. Changed > > > + if (!aead_sufficient_data(ctx)) > > + goto unlo

Re: algif_hash: splice of data > 2**16

2014-12-25 Thread Stephan Mueller
Am Mittwoch, 24. Dezember 2014, 16:12:53 schrieb Stephan Mueller: Hi Christophe, > Am Mittwoch, 24. Dezember 2014, 15:10:14 schrieb leroy christophe: > > Hi leroy, > > > Le 24/12/2014 10:03, Stephan Mueller a écrit : > > > Am Dienstag, 23. Dezember 2014, 18:16:

[PATCH v6 2/4] crypto: AF_ALG: enable AEAD interface compilation

2014-12-25 Thread Stephan Mueller
Enable compilation of the AEAD AF_ALG support and provide a Kconfig option to compile the AEAD AF_ALG support. Signed-off-by: Stephan Mueller --- crypto/Kconfig | 9 + crypto/Makefile | 1 + 2 files changed, 10 insertions(+) diff --git a/crypto/Kconfig b/crypto/Kconfig index 1618468

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

2014-12-25 Thread Stephan Mueller
the zeroization patch for alg_setkey into a stand-alone patch submission * fix bug in aead_sufficient_data (reporter Herbert Xu) * testing of all interfaces with test application provided with libkcapi version 0.6.2 Stephan Mueller (4): crypto: AF_ALG: add AEAD support crypto: AF_ALG: ena

[PATCH v6 3/4] crypto: AF_ALG: add random number generator support

2014-12-25 Thread Stephan Mueller
e RNG implementation requires seeding. If so, the RNG is seeded with output from get_random_bytes. A fully working example using all aspects of the RNG interface is provided at http://www.chronox.de/libkcapi.html Signed-off-by: Stephan Mueller --- crypto/algif_rng.c

<    1   2   3   4   5   6   7   8   9   10   >