[PATCH] crypto/testmgr: add missing spaces to drbg error strings

2014-07-29 Thread Jarod Wilson
S_ERR(drng)) { - printk(KERN_ERR "alg: drbg: could not allocate DRNG handle for" + printk(KERN_ERR "alg: drbg: could not allocate DRNG handle for " "%s\n", driver); kzfree(buf); return -ENOMEM; @@ -180

[PATCH 1/2] crypto-testmgr: Use common error handling code in drbg_cavs_test()

2017-10-21 Thread SF Markus Elfring
, if (IS_ERR(drng)) { printk(KERN_ERR "alg: drbg: could not allocate DRNG handle for " "%s\n", driver); - kzfree(buf); - return -ENOMEM; + ret = -ENOMEM; +

Re: [PATCH 3/6] crypto: kdf - add known answer tests

2019-01-11 Thread Eric Biggers
t;kdf_test()"? > +{ > + int ret = -EAGAIN; > + struct crypto_rng *drng; > + unsigned char *buf = kzalloc(test->expectedlen, GFP_KERNEL); s/unsigned char/u8 > + > + if (!buf) > + return -ENOMEM; > + > + drng = crypto

[PATCH v2 02/20] crypto: testmgr to use CRYPTO_ALG_INTERNAL

2015-03-27 Thread Stephan Mueller
ng = crypto_alloc_rng(driver, type, mask); + if (PTR_ERR(drng) == -ENOENT) + drng = crypto_alloc_rng(driver, type | CRYPTO_ALG_INTERNAL, + mask | CRYPTO_ALG_INTERNAL); if (IS_ERR(drng)) { printk(KERN_ERR "alg: dr

[PATCH v3 02/20] crypto: testmgr to use CRYPTO_ALG_INTERNAL

2015-03-30 Thread Stephan Mueller
c *test, int pr, if (!buf) return -ENOMEM; - drng = crypto_alloc_rng(driver, type, mask); + drng = crypto_alloc_rng(driver, type | CRYPTO_ALG_INTERNAL, mask); if (IS_ERR(drng)) { printk(KERN_ERR "alg: drbg: could not allocate DRNG handle for &q

[PATCH v8 6/7] Add DRBG test code to testmgr

2014-05-26 Thread Stephan Mueller
estentropy; + unsigned char *buf = kzalloc(test->expectedlen, GFP_KERNEL); + + if (!buf) + return -ENOMEM; + + drng = crypto_alloc_rng(driver, type, mask); + if (IS_ERR(drng)) { + printk(KERN_ERR "alg: drbg: could not alloca

[PATCH v9 6/6] Add DRBG test code to testmgr

2014-06-01 Thread Stephan Mueller
estentropy; + unsigned char *buf = kzalloc(test->expectedlen, GFP_KERNEL); + + if (!buf) + return -ENOMEM; + + drng = crypto_alloc_rng(driver, type, mask); + if (IS_ERR(drng)) { + printk(KERN_ERR "alg: drbg: could not alloca

[PATCH v7 6/6] Add DRBG test code to testmgr

2014-05-20 Thread Stephan Mueller
estentropy; + unsigned char *buf = kzalloc(test->expectedlen, GFP_KERNEL); + + if (!buf) + return -ENOMEM; + + drng = crypto_alloc_rng(driver, type, mask); + if (IS_ERR(drng)) { + printk(KERN_ERR "alg: drbg: could not alloca

[PATCH 6/6] Add DRBG test code to testmgr

2014-03-08 Thread Stephan Mueller
+ drng = crypto_alloc_rng(driver, type, mask); + if(IS_ERR(drng)) { + printk(KERN_ERR "alg: drbg: could not allocate DRNG handle for %s\n", driver); + return -ENOMEM; + } + + drbg = crypto_tfm_ctx(crypto_rng_tfm(drng)); + test_

[PATCH v2 6/6] Add DRBG test code to testmgr

2014-03-17 Thread Stephan Mueller
rbg_string addtl, pers, testentropy; + unsigned char *buf = kzalloc(test->expectedlen, GFP_KERNEL); + + if (!buf) + return -ENOMEM; + + drng = crypto_alloc_rng(driver, type, mask); + if (IS_ERR(drng)) { + printk(KERN_ERR "alg: drbg: could

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

2016-05-31 Thread Stephan Mueller
rng)) { + printk(KERN_ERR "alg: kdf: could not allocate cipher handle " + "for %s\n", driver); + kzfree(buf); + return -ENOMEM; + } + + ret = crypto_rng_reset(drng, test->K1, test->K1len); + if (

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

2016-01-25 Thread Stephan Mueller
rng)) { + printk(KERN_ERR "alg: kdf: could not allocate cipher handle " + "for %s\n", driver); + kzfree(buf); + return -ENOMEM; + } + + ret = crypto_rng_reset(drng, test->K1, test->K1len); + if (

Re: [PATCH 2/6] header file for DRBG

2014-03-10 Thread Rafael Aquini
copyright.) > + * > + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED > + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES > + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF > + * WHICH ARE HEREBY DISCLAIMED. IN NO E

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

2016-07-12 Thread Stephan Mueller
ntk(KERN_ERR "alg: kdf: could not allocate cipher handle " + "for %s\n", driver); + kzfree(buf); + return -ENOMEM; + } + + ret = crypto_rng_reset(drng, test->K1, test->K1len); + if (ret) { + printk(

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

2016-08-04 Thread Stephan Mueller
ntk(KERN_ERR "alg: kdf: could not allocate cipher handle " + "for %s\n", driver); + kzfree(buf); + return -ENOMEM; + } + + ret = crypto_rng_reset(drng, test->K1, test->K1len); + if (ret) { + printk(

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

2016-08-09 Thread Stephan Mueller
ntk(KERN_ERR "alg: kdf: could not allocate cipher handle " + "for %s\n", driver); + kzfree(buf); + return -ENOMEM; + } + + ret = crypto_rng_reset(drng, test->K1, test->K1len); + if (ret) { + printk(

[PATCH 3/6] crypto: kdf - add known answer tests

2019-01-11 Thread Stephan Müller
NAL, mask); + if (IS_ERR(drng)) { + printk(KERN_ERR "alg: kdf: could not allocate cipher handle " + "for %s\n", driver); + kzfree(buf); + return -ENOMEM; + } + + ret = crypto_rng_reset(drng

[PATCH v2 3/6] crypto: kdf - add known answer tests

2019-01-16 Thread Stephan Müller
ask); + if (IS_ERR(drng)) { + pr_err("alg: kdf: could not allocate cipher handle " + "for %s\n", driver); + kfree(buf); + return -ENOMEM; + } + + ret = crypto_rng_reset(drng, test->K1, tes

[PATCH 10/16] crypto: testmgr - Do not test internal algorithms

2016-11-01 Thread Herbert Xu
ERR "alg: cprng: Failed to load transform for %s: " "%ld\n", driver, PTR_ERR(rng)); @@ -1847,7 +1847,7 @@ static int drbg_cavs_test(struct drbg_testvec *test, int pr, if (!buf) return -ENOMEM; - drng = crypto_alloc_rng(driver, ty

Re: [PATCH 10/16] crypto: testmgr - Do not test internal algorithms

2016-11-10 Thread Marcelo Cerri
> int err; > > - rng = crypto_alloc_rng(driver, type | CRYPTO_ALG_INTERNAL, mask); > + rng = crypto_alloc_rng(driver, type, mask); > if (IS_ERR(rng)) { > printk(KERN_ERR "alg: cprng: Failed to load transform for %s: " >

[v2 PATCH 10/16] crypto: testmgr - Do not test internal algorithms

2016-11-13 Thread Herbert Xu
ERR "alg: cprng: Failed to load transform for %s: " "%ld\n", driver, PTR_ERR(rng)); @@ -1847,7 +1847,7 @@ static int drbg_cavs_test(struct drbg_testvec *test, int pr, if (!buf) return -ENOMEM; - drng = crypto_alloc_rng(driver, ty

[v3 PATCH 10/16] crypto: testmgr - Do not test internal algorithms

2016-11-22 Thread Herbert Xu
ERR "alg: cprng: Failed to load transform for %s: " "%ld\n", driver, PTR_ERR(rng)); @@ -1847,7 +1847,7 @@ static int drbg_cavs_test(struct drbg_testvec *test, int pr, if (!buf) return -ENOMEM; - drng = crypto_alloc_rng(driver, ty

[PATCH 1/6] SP800-90A Deterministic Random Bit Generator

2014-03-08 Thread Stephan Mueller
IES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF + * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS O

[PATCH v11 3/5] Linux Random Number Generator

2017-05-14 Thread Stephan Müller
between DRBG reseed intervals of the secondary + * DRBG. Note, this is enforced with the next request of random numbers from + * the secondary DRBG. Setting this value to zero implies a reseeding attempt + * before every generated random number. + */ +static int lrng_sdrbg_reseed_max_time = 600; + +/

[PATCH v2 1/6] SP800-90A Deterministic Random Bit Generator

2014-03-17 Thread Stephan Mueller
OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF + * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTI

[PATCH v6 3/5] crypto: Linux Random Number Generator

2016-08-11 Thread Stephan Mueller
ry DRBG. Setting this value to zero implies a reseeding attempt + * before every generated random number. + */ +static int lrng_sdrbg_reseed_max_time = 600; + +/** Crypto Implementations ***/ + +/** + * Allocate DRNG -- the provided integers should be used for s

[PATCH v5 3/7] crypto: Linux Random Number Generator

2016-06-19 Thread Stephan Mueller
of the secondary + * DRBG. Note, this is enforced with the next request of random numbers from + * the secondary DRBG. Setting this value to zero implies a reseeding attempt + * before every generated random number. + */ +static int lrng_sdrbg_reseed_max_time = 600; + +/** C

[PATCH v4 3/5] crypto: Linux Random Number Generator

2016-05-31 Thread Stephan Mueller
= lrng_drbg_alloc(); + if (!sdrbg->sdrbg) + goto err; + + atomic_set(&sdrbg->requests, 1); + spin_lock_init(&sdrbg->lock); + sdrbg->last_seeded = jiffies; + sdrbg->fully_seeded =

[PATCH v5 2/2] mm, treewide: Rename kzfree() to kfree_sensitive()

2020-06-16 Thread Waiman Long
crypto_free_shash(generic_tfm); - kzfree(generic_desc); + kfree_sensitive(generic_desc); return err; } #else /* !CONFIG_CRYPTO_MANAGER_EXTRA_TESTS */ @@ -3665,7 +3665,7 @@ static int drbg_cavs_test(const struct drbg_testvec *test, int pr, if (IS_ERR(drng)) {

[PATCH v4 2/3] mm, treewide: Rename kzfree() to kfree_sensitive()

2020-06-15 Thread Waiman Long
ee(vec.plaintext); kfree(vec.digest); crypto_free_shash(generic_tfm); - kzfree(generic_desc); + kfree_sensitive(generic_desc); return err; } #else /* !CONFIG_CRYPTO_MANAGER_EXTRA_TESTS */ @@ -3665,7 +3665,7 @@ static int drbg_cavs_test(const str