[PATCH 3/4] crypto: kdf - SP800-108 Key Derivation Function

2016-01-25 Thread Stephan Mueller
The SP800-108 compliant Key Derivation Function is implemented as a random number generator considering that it behaves like a deterministic RNG. All three KDF types specified in SP800-108 are implemented. The code comments provide details about how to invoke the different KDF types. Signed-off-

[PATCH 0/4] crypto: Key Derivation Function (SP800-108)

2016-01-25 Thread Stephan Mueller
Hi, this patch set implements all three key derivation functions defined in SP800-108. The implementation is provided as a template for random number generators, since a KDF can be considered a form of deterministic RNG where the key material is used as a seed. With the KDF implemented as a temp

[PATCH 2/4] crypto: kdf - add known answer tests

2016-01-25 Thread Stephan Mueller
Add known answer tests to the testmgr for the KDF (SP800-108) cipher. Signed-off-by: Stephan Mueller --- crypto/testmgr.c | 167 +++ crypto/testmgr.h | 111 2 files changed, 278 insertions(+) diff --git a/c

[PATCH 4/4] crypto: kdf - enable compilation

2016-01-25 Thread Stephan Mueller
Include KDF into Kconfig and Makefile for compilation Signed-off-by: Stephan Mueller --- crypto/Kconfig | 7 +++ crypto/Makefile | 1 + 2 files changed, 8 insertions(+) diff --git a/crypto/Kconfig b/crypto/Kconfig index 7240821..aa4e1a4 100644 --- a/crypto/Kconfig +++ b/crypto/Kconfig @@ -

[PATCH 1/4] crypto: add template handling for RNGs

2016-01-25 Thread Stephan Mueller
This patch adds the ability to register templates for RNGs. RNGs are "meta" mechanisms using raw cipher primitives. Thus, RNGs can now be implemented as templates to allow the complete flexibility the kernel crypto API provides. Signed-off-by: Stephan Mueller --- crypto/rng.c | 31 ++

Re: [PATCH] crypto : sha1-mb : Add missing args_digest offset

2016-01-25 Thread Tim Chen
On Mon, 2016-01-25 at 16:46 -0800, Megha Dey wrote: > From: Megha Dey > > The _args_digest is defined as _args+_digest, both of which are the first > members of 2 separate structures, effectively yielding _args_digest to have > a value of zero. Thus, no errors have spawned yet due to this. To ens

[PATCH] crypto : sha1-mb : Add missing args_digest offset

2016-01-25 Thread Megha Dey
From: Megha Dey The _args_digest is defined as _args+_digest, both of which are the first members of 2 separate structures, effectively yielding _args_digest to have a value of zero. Thus, no errors have spawned yet due to this. To ensure sanity, adding the missing _args_digest offset to the sha1

[PATCH 05/22] hw_random: Fix dependencies for !HAS_IOMEM archs

2016-01-25 Thread Richard Weinberger
Not every arch has io memory. So, unbreak the build by fixing the dependencies. Signed-off-by: Richard Weinberger --- drivers/char/hw_random/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig index dbf2271..ff00331 100644 -

GCM: cra_name == cra_driver_name

2016-01-25 Thread Stephan Mueller
Hi Herbert, with the current cryptodev tree, when I call a compound AEAD cipher with cra_driver_name for the first time, this cra_driver_name gets registered also as cra_name. Note, using other compound ciphers (like HMAC or symmetric ciphers), I do not see that error. With that registering, I

Re: [PATCH v3 0/4] crypto: add algif_akcipher user space API

2016-01-25 Thread Stephan Mueller
Am Freitag, 18. Dezember 2015, 00:49:57 schrieb Stephan Mueller: Hi Herbert, [...] > Changes v3: > * fix hack in alg_setkey and alg_setsockopt by avoding branches for > setkey and setpubkey as pointed out by Marcel Holtmann > * removal of patch for fixing SGL handling as this is already inclu

AF_ALG: hash returns -ENOKEY

2016-01-25 Thread Stephan Mueller
Hi Herbert, during testing of the current cryptodev-2.6 key, the AF_ALG hash does not seem to work as it used to. Regardless whether I use the vmsplice or the sendmsg call, I get -ENOKEY using a normal hash. When you use by libkcapi/test/ [1] test application with the following command, I alw

Re: [PATCH 2/2] n2rng: Attach on T5/M5, T7/M7 SPARC CPUs

2016-01-25 Thread Anatoly Pugachev
n2rng: Attach on T5/M5, T7/M7 SPARC CPUs (space to tab fixes after variable names) Signed-off-by: Anatoly Pugachev --- drivers/char/hw_random/n2-drv.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/char/hw_random/n2-drv.c b/drivers/char/hw_random/n2-drv.c index 843d6f6.

Re: [dm-devel] [PATCH 22/26] iscsi_tcp: Use ahash

2016-01-25 Thread Mike Christie
On 01/24/2016 07:19 AM, Herbert Xu wrote: > This patch replaces uses of the long obsolete hash interface with > ahash. > > Signed-off-by: Herbert Xu > --- > > drivers/scsi/iscsi_tcp.c| 54 > ++-- > drivers/scsi/iscsi_tcp.h|4 +-- > drivers/

Re: [PATCH 1/2] n2rng: documentation, add DT bindings, vendor prefixes

2016-01-25 Thread David Miller
From: Anatoly Pugachev Date: Mon, 25 Jan 2016 19:09:21 +0300 > n2rng: documentation, add DT bindings, vendor prefixes > > Signed-off-by: Anatoly Pugachev Acked-by: David S. Miller -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majord...@

Re: [PATCH 2/2] n2rng: Attach on T5/M5, T7/M7 SPARC CPUs

2016-01-25 Thread David Miller
From: Anatoly Pugachev Date: Mon, 25 Jan 2016 19:09:39 +0300 > n2rng: Attach on T5/M5, T7/M7 SPARC CPUs > > Signed-off-by: Anatoly Pugachev Acked-by: David S. Miller -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majord...@vger.kernel.or

Re: [PATCH 1/4] crypto: sunxi - don't print uninitialized data

2016-01-25 Thread Arnd Bergmann
On Monday 25 January 2016 17:53:48 Arnd Bergmann wrote: > gcc correctly warns that the printk output contains a variable that > is not initialized in some cases: > > drivers/crypto/sunxi-ss/sun4i-ss-cipher.c: In function 'sun4i_ss_cipher_poll': > drivers/crypto/sunxi-ss/sun4i-ss-cipher.c:254:76: w

[PATCH 1/4] crypto: sunxi - don't print uninitialized data

2016-01-25 Thread Arnd Bergmann
gcc correctly warns that the printk output contains a variable that is not initialized in some cases: drivers/crypto/sunxi-ss/sun4i-ss-cipher.c: In function 'sun4i_ss_cipher_poll': drivers/crypto/sunxi-ss/sun4i-ss-cipher.c:254:76: warning: 'todo' may be used uninitialized in this function [-Wmayb

[PATCH] crypto: hash - select CRYPTO_HASH where needed

2016-01-25 Thread Arnd Bergmann
The ghash and poly1305 hash implementations can be enabled when CONFIG_CRYPTO_HASH is turned off, causing a link error: crypto/built-in.o: In function `ghash_mod_init': (.init.text+0xd0): undefined reference to `crypto_register_shash' crypto/built-in.o: In function `ghash_mod_exit': (.exit.text+0x

[PATCH 1/2] crypto: jitterentropy - always select CRYPTO_RNG

2016-01-25 Thread Arnd Bergmann
When building the jitterentropy driver by itself, we get a link error when CRYPTO_RNG is not enabled as well: crypto/built-in.o: In function `jent_mod_init': jitterentropy-kcapi.c:(.init.text+0x98): undefined reference to `crypto_register_rng' crypto/built-in.o: In function `jent_mod_exit': jitte

Re: [PATCH 0/2] n2rng: Attach on T5/M5, T7/M7 SPARC CPUs

2016-01-25 Thread Anatoly Pugachev
On Mon, Jan 25, 2016 at 10:41:01PM +0800, Herbert Xu wrote: > On Fri, Jan 15, 2016 at 03:22:53PM -0500, David Miller wrote: > > From: Anatoly Pugachev > > Date: Thu, 14 Jan 2016 00:43:18 +0300 > > > > > This patch adds support for recent oracle hardware (T5/M5, T7/M7 SPARC > > > CPUs), > > > so

Re: [PATCH 16/26] libceph: Use skcipher

2016-01-25 Thread Ilya Dryomov
On Sun, Jan 24, 2016 at 2:18 PM, Herbert Xu wrote: > This patch replaces uses of blkcipher with skcipher. > > Signed-off-by: Herbert Xu > --- > > net/ceph/crypto.c | 97 > +++--- > 1 file changed, 56 insertions(+), 41 deletions(-) Could you get

[PATCH 1/2] n2rng: documentation, add DT bindings, vendor prefixes

2016-01-25 Thread Anatoly Pugachev
n2rng: documentation, add DT bindings, vendor prefixes Signed-off-by: Anatoly Pugachev --- .../devicetree/bindings/sparc_sun_oracle_rng.txt | 30 ++ .../devicetree/bindings/vendor-prefixes.txt| 2 ++ 2 files changed, 32 insertions(+) create mode 100644 Documentati

[PATCH 2/2] n2rng: Attach on T5/M5, T7/M7 SPARC CPUs

2016-01-25 Thread Anatoly Pugachev
n2rng: Attach on T5/M5, T7/M7 SPARC CPUs Signed-off-by: Anatoly Pugachev --- drivers/char/hw_random/n2-drv.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/char/hw_random/n2-drv.c b/drivers/char/hw_random/n2-drv.c index 843d6f6..8bee43a 100644 --- a/drivers/char/hw_rando

re: [PATCH] eCryptfs: Clean up crypto initialization

2016-01-25 Thread Dan Carpenter
Hello Michael Halcrow, The patch e5d9cbde6ce0: "[PATCH] eCryptfs: Clean up crypto initialization" from Oct 30, 2006, leads to the following static checker warning: fs/ecryptfs/crypto.c:1625 ecryptfs_process_key_cipher() error: get_random_bytes() 'dummy_key' too small (64 vs 429496

Re: [PATCH v1] crypto: ccp - Add hash state import and export support

2016-01-25 Thread Tom Lendacky
On 01/25/2016 01:20 AM, Herbert Xu wrote: > On Fri, Jan 22, 2016 at 11:22:48AM -0600, Tom Lendacky wrote: >> On 01/12/2016 11:17 AM, Tom Lendacky wrote: >>> Commit 8996eafdcbad ("crypto: ahash - ensure statesize is non-zero") >>> added a check to prevent ahash algorithms from successfully registeri

Re: [PATCH 0/5] crypto: atmel-sha: fix registration issue and other bugs

2016-01-25 Thread Cyrille Pitchen
Hi Herbert, Le 25/01/2016 15:48, Herbert Xu a écrit : > On Fri, Jan 15, 2016 at 03:49:30PM +0100, Cyrille Pitchen wrote: >> Hi all, >> >> This series of patches fixes many issues such as the algo registration >> failure >> or the broken support of context switches. >> >> This series was applied t

Re: [PATCH 1/4] hw_random: bcm63xx-rng: remove unused variables

2016-01-25 Thread Herbert Xu
On Sun, Jan 17, 2016 at 10:03:54AM +0100, Álvaro Fernández Rojas wrote: > These variables where left as unused in commit 6229c16060fe > ("hwrng: bcm63xx - make use of devm_hwrng_register") > > Fixes the following warning: > drivers/char/hw_random/bcm63xx-rng.c: In function 'bcm63xx_rng_probe': > d

Re: [PATCH] crypto: drbg - remove FIPS 140-2 continuous test

2016-01-25 Thread Herbert Xu
On Fri, Jan 22, 2016 at 09:52:28AM +0100, Stephan Mueller wrote: > Hi, > > the following patch is fully CAVS tested on 64 bit and 32 bit. > > Note, this change cannot be made for random.c or ansi_cprng.c, unfortunately. > > ---8<--- > The newly released FIPS 140-2 IG 9.8 specifies that for SP800

Re: [PATCH] Reduced reqsize in qat_algs

2016-01-25 Thread Herbert Xu
On Tue, Jan 19, 2016 at 05:34:04PM +, Giovanni Cabiddu wrote: > From: Cabiddu, Giovanni > > req_alloc functions already take into account the request data structure > when allocating memory. > > Signed-off-by: Giovanni Cabiddu > Signed-off-by: Tadeusz Struk Applied. -- Email: Herbert Xu

Re: [PATCH 0/5] crypto: atmel-sha: fix registration issue and other bugs

2016-01-25 Thread Herbert Xu
On Fri, Jan 15, 2016 at 03:49:30PM +0100, Cyrille Pitchen wrote: > Hi all, > > This series of patches fixes many issues such as the algo registration failure > or the broken support of context switches. > > This series was applied to linux-next and tested on a sama5d2 xplained > ultra board. We n

Re: [PATCH 1/2] crypto: s5p-sss - Fix minor coding style violations

2016-01-25 Thread Herbert Xu
On Mon, Jan 11, 2016 at 08:45:50PM +0900, Krzysztof Kozlowski wrote: > Improve a little bit code readability and use dev_info/err for printing > messages. > > Signed-off-by: Krzysztof Kozlowski Both applied. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://g

Re: [PATCH 2/2] crypto: caam - enable LARGE_BURST for enhancing DMA transactions size

2016-01-25 Thread Herbert Xu
On Tue, Jan 12, 2016 at 05:14:10PM +0200, Horia Geantă wrote: > Increasing CAAM DMA engine transaction size either > -reduces the number of required transactions or > -adds the ability to transfer more data with same transaction count > > Signed-off-by: Horia Geantă Applied. -- Email: Herbert X

Re: [PATCH v1] crypto: ccp - Add hash state import and export support

2016-01-25 Thread Herbert Xu
On Tue, Jan 12, 2016 at 11:17:38AM -0600, Tom Lendacky wrote: > Commit 8996eafdcbad ("crypto: ahash - ensure statesize is non-zero") > added a check to prevent ahash algorithms from successfully registering > if the import and export functions were not implemented. This prevents > an oops in the ha

Re: [PATCH] crypto: qat - remove redundant function call

2016-01-25 Thread Herbert Xu
On Wed, Jan 06, 2016 at 05:56:20PM +0800, Yang Pingchao wrote: > adf_dev_restore(accel_dev) was called in adf_dev_shutdown,no > need to call it in adf_device_reset_worker after adf_dev_shutdown > was called. > > Signed-off-by: Yang Pingchao Applied. -- Email: Herbert Xu Home Page: http://gondo

Re: [PATCH] crypto: qat - change name for c6xx dev type

2016-01-25 Thread Herbert Xu
On Tue, Jan 05, 2016 at 11:14:55AM -0800, Tadeusz Struk wrote: > change name for c6x dev type to more generic. > > Signed-off-by: Tadeusz Struk Applied. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscrib

Re: [PATCH] crypto: qat - Pack cfg ctl structs

2016-01-25 Thread Herbert Xu
On Mon, Jan 11, 2016 at 03:23:47PM +, Ahsan Atta wrote: > -This is required to support 32bit adf_ctl >utility on a 64bit driver > > Signed-off-by: Ahsan Atta Applied. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~her

Re: [PATCH] crypto: ANSI X9.31 DRNG is not allowed in FIPS 140-2

2016-01-25 Thread Herbert Xu
On Tue, Jan 05, 2016 at 01:12:21PM +0100, Stephan Mueller wrote: > As per update of the FIPS 140-2 Annex C supported by SP800-131A, the > ANSI X9.31 DRNG is not an allowed cipher in FIPS mode any more. > > CC: Neil Horman > Signed-off-by: Stephan Mueller Applied. -- Email: Herbert Xu Home Pag

Re: [PATCH 0/2] n2rng: Attach on T5/M5, T7/M7 SPARC CPUs

2016-01-25 Thread Herbert Xu
On Fri, Jan 15, 2016 at 03:22:53PM -0500, David Miller wrote: > From: Anatoly Pugachev > Date: Thu, 14 Jan 2016 00:43:18 +0300 > > > This patch adds support for recent oracle hardware (T5/M5, T7/M7 SPARC > > CPUs), > > so n2_rng driver would work on them. > > > > 1. n2rng: Attach on T5/M5, T7/M

Re: [PATCH v2 3/3] crypto: mxs-dcp - provide statesize and import/export()

2016-01-25 Thread Herbert Xu
On Wed, Jan 13, 2016 at 03:52:04PM -0200, Fabio Estevam wrote: > From: Fabio Estevam > > Currently the mxs-dcp driver fails to probe: > > mxs-dcp 80028000.dcp: Failed to register sha1 hash! > mxs-dcp: probe of 80028000.dcp failed with error -22 > > This happens since commit 8996eafdcbad ("crypt

Re: [PATCH v2 1/3] crypto: sahara - avoid needlessly saving and restoring sahara_ctx

2016-01-25 Thread Herbert Xu
On Wed, Jan 13, 2016 at 03:52:02PM -0200, Fabio Estevam wrote: > From: Fabio Estevam > > Based on commit 434b421241f2d0 ("crypto: caam - avoid needlessly saving and > restoring caam_hash_ctx") from Russell King. > > When exporting and importing the hash state, we will only export and > import in

Re: [PATCH] Don't require SpcSpOpusInfo in Authenticode pkcs7 signatures

2016-01-25 Thread Herbert Xu
Dave Young wrote: > >> So anyway, we should not be checking this field for presence or any >> particular value: if the field exists, it should be at the right place, >> but aside from that, as long as the hash matches the field is good. >> >> Signed-off-by: Peter Jones > > Tested-by: Dave Young

Re: [PATCH] crypto: chacha20_4block_xor_ssse3: Align stack pointer to 64 bytes

2016-01-25 Thread Herbert Xu
On Fri, Jan 22, 2016 at 08:55:24AM +0100, Martin Willi wrote: > Hi Eli, > > > This aligns the stack pointer in chacha20_4block_xor_ssse3 to 64 bytes. > > Fixes general protection faults and potential kernel panics. > > I assumed 16-byte alignment according to the System V AMD64 ABI, but > this is

Re: [PATCH v2 1/2] crypto: caam - make write transactions bufferable on PPC platforms

2016-01-25 Thread Herbert Xu
On Tue, Jan 12, 2016 at 05:59:29PM +0200, Horia Geantă wrote: > Previous change (see "Fixes" tag) to the MCFGR register > clears AWCACHE[0] ("bufferable" AXI3 attribute) (which is "1" at POR). > > This makes all writes non-bufferable, causing a ~ 5% performance drop > for PPC-based platforms. > >

Re: crypto: algif_hash: creating 0 sized array in hash_accept

2016-01-25 Thread Herbert Xu
On Mon, Jan 25, 2016 at 07:14:20AM -0500, Sasha Levin wrote: > Hi all, > > While fuzzing with trinity inside a KVM tools guest running the latest -next > kernel > I've hit: > > [ 828.386074] UBSAN: Undefined behaviour in crypto/algif_hash.c:185:7 > [ 828.386811] variable length array bound val

crypto: algif_hash: creating 0 sized array in hash_accept

2016-01-25 Thread Sasha Levin
Hi all, While fuzzing with trinity inside a KVM tools guest running the latest -next kernel I've hit: [ 828.386074] UBSAN: Undefined behaviour in crypto/algif_hash.c:185:7 [ 828.386811] variable length array bound value 0 <= 0 [ 828.387606] CPU: 1 PID: 17792 Comm: trinity-c313 Not tainted 4.