LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Stephan Mueller <smueller@chronox.de>
To: "'Herbert Xu" <herbert@gondor.apana.org.au>
Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v3 02/20] crypto: testmgr to use CRYPTO_ALG_INTERNAL
Date: Mon, 30 Mar 2015 21:56:31 +0200	[thread overview]
Message-ID: <35695803.75HNLbDkdq@tachyon.chronox.de> (raw)
In-Reply-To: <3417827.fluZli1WvQ@tachyon.chronox.de>

Allocate the ciphers irrespectively if they are marked as internal
or not. As all ciphers, including the internal ciphers will be
processed by the testmgr, it needs to be able to allocate those
ciphers.

Signed-off-by: Stephan Mueller <smueller@chronox.de>
---
 crypto/testmgr.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index 1f879ad..f9bce3d 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -1505,7 +1505,7 @@ static int alg_test_aead(const struct alg_test_desc *desc, const char *driver,
 	struct crypto_aead *tfm;
 	int err = 0;
 
-	tfm = crypto_alloc_aead(driver, type, mask);
+	tfm = crypto_alloc_aead(driver, type | CRYPTO_ALG_INTERNAL, mask);
 	if (IS_ERR(tfm)) {
 		printk(KERN_ERR "alg: aead: Failed to load transform for %s: "
 		       "%ld\n", driver, PTR_ERR(tfm));
@@ -1534,7 +1534,7 @@ static int alg_test_cipher(const struct alg_test_desc *desc,
 	struct crypto_cipher *tfm;
 	int err = 0;
 
-	tfm = crypto_alloc_cipher(driver, type, mask);
+	tfm = crypto_alloc_cipher(driver, type | CRYPTO_ALG_INTERNAL, mask);
 	if (IS_ERR(tfm)) {
 		printk(KERN_ERR "alg: cipher: Failed to load transform for "
 		       "%s: %ld\n", driver, PTR_ERR(tfm));
@@ -1563,7 +1563,7 @@ static int alg_test_skcipher(const struct alg_test_desc *desc,
 	struct crypto_ablkcipher *tfm;
 	int err = 0;
 
-	tfm = crypto_alloc_ablkcipher(driver, type, mask);
+	tfm = crypto_alloc_ablkcipher(driver, type | CRYPTO_ALG_INTERNAL, mask);
 	if (IS_ERR(tfm)) {
 		printk(KERN_ERR "alg: skcipher: Failed to load transform for "
 		       "%s: %ld\n", driver, PTR_ERR(tfm));
@@ -1636,7 +1636,7 @@ static int alg_test_hash(const struct alg_test_desc *desc, const char *driver,
 	struct crypto_ahash *tfm;
 	int err;
 
-	tfm = crypto_alloc_ahash(driver, type, mask);
+	tfm = crypto_alloc_ahash(driver, type | CRYPTO_ALG_INTERNAL, mask);
 	if (IS_ERR(tfm)) {
 		printk(KERN_ERR "alg: hash: Failed to load transform for %s: "
 		       "%ld\n", driver, PTR_ERR(tfm));
@@ -1664,7 +1664,7 @@ static int alg_test_crc32c(const struct alg_test_desc *desc,
 	if (err)
 		goto out;
 
-	tfm = crypto_alloc_shash(driver, type, mask);
+	tfm = crypto_alloc_shash(driver, type | CRYPTO_ALG_INTERNAL, mask);
 	if (IS_ERR(tfm)) {
 		printk(KERN_ERR "alg: crc32c: Failed to load transform for %s: "
 		       "%ld\n", driver, PTR_ERR(tfm));
@@ -1706,7 +1706,7 @@ static int alg_test_cprng(const struct alg_test_desc *desc, const char *driver,
 	struct crypto_rng *rng;
 	int err;
 
-	rng = crypto_alloc_rng(driver, type, mask);
+	rng = crypto_alloc_rng(driver, type | CRYPTO_ALG_INTERNAL, mask);
 	if (IS_ERR(rng)) {
 		printk(KERN_ERR "alg: cprng: Failed to load transform for %s: "
 		       "%ld\n", driver, PTR_ERR(rng));
@@ -1733,7 +1733,7 @@ static int drbg_cavs_test(struct drbg_testvec *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 "
 		       "%s\n", driver);
-- 
2.1.0



  parent reply	other threads:[~2015-03-30 20:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-30 19:54 [PATCH v3 00/20] crypto: restrict usage of helper ciphers Stephan Mueller
2015-03-30 19:55 ` [PATCH v3 01/20] crypto: prevent helper ciphers from being used Stephan Mueller
2015-03-30 19:56 ` Stephan Mueller [this message]
2015-03-30 19:57 ` [PATCH v3 03/20] crypto: cryptd to process CRYPTO_ALG_INTERNAL Stephan Mueller
2015-03-30 19:57 ` [PATCH v3 04/20] crypto: /proc/crypto: identify internal ciphers Stephan Mueller
2015-03-30 19:58 ` [PATCH v3 05/20] crypto: mark AES-NI helper ciphers Stephan Mueller
2015-03-30 20:01 ` [PATCH v3 06/20] crypto: mark ghash clmulni " Stephan Mueller
2015-03-30 20:02 ` [PATCH v3 07/20] crypto: mark GHASH ARMv8 vmull.p64 " Stephan Mueller
2015-03-30 20:03 ` [PATCH v3 08/20] crypto: mark AES-NI Camellia " Stephan Mueller
2015-03-30 20:03 ` [PATCH v3 09/20] crypto: mark CAST5 " Stephan Mueller
2015-03-30 20:04 ` [PATCH v3 10/20] crypto: mark AVX Camellia " Stephan Mueller
2015-03-30 20:05 ` [PATCH v3 11/20] crypto: mark CAST6 " Stephan Mueller
2015-03-30 20:06 ` [PATCH v3 12/20] crypto: mark Serpent AVX2 " Stephan Mueller
2015-03-30 20:07 ` [PATCH v3 13/20] crypto: mark Serpent AVX " Stephan Mueller
2015-03-30 20:07 ` [PATCH v3 14/20] crypto: mark Serpent SSE2 " Stephan Mueller
2015-03-30 20:08 ` [PATCH v3 15/20] crypto: mark Twofish AVX " Stephan Mueller
2015-03-30 20:09 ` [PATCH v3 16/20] crypto: mark NEON bit sliced AES " Stephan Mueller
2015-03-30 20:09 ` [PATCH v3 17/20] crypto: mark ARMv8 " Stephan Mueller
2015-03-30 20:10 ` [PATCH v3 18/20] crypto: mark 64 bit " Stephan Mueller
2015-03-30 20:10 ` [PATCH v3 19/20] crypto: mcryptd to process CRYPTO_ALG_INTERNAL Stephan Mueller
2015-03-30 20:11 ` [PATCH v3 20/20] crypto: mark Multi buffer SHA1 helper cipher Stephan Mueller
2015-03-31 13:34 ` [PATCH v3 00/20] crypto: restrict usage of helper ciphers Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=35695803.75HNLbDkdq@tachyon.chronox.de \
    --to=smueller@chronox.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH v3 02/20] crypto: testmgr to use CRYPTO_ALG_INTERNAL' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).