crypto: testmgr - use CRYPTO_ALG_INTERNAL

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>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Stephan Mueller 2015-03-30 21:56:31 +02:00 committed by Herbert Xu
parent 06ca7f68d4
commit 425a882991

View file

@ -1505,7 +1505,7 @@ static int alg_test_aead(const struct alg_test_desc *desc, const char *driver,
struct crypto_aead *tfm; struct crypto_aead *tfm;
int err = 0; int err = 0;
tfm = crypto_alloc_aead(driver, type, mask); tfm = crypto_alloc_aead(driver, type | CRYPTO_ALG_INTERNAL, mask);
if (IS_ERR(tfm)) { if (IS_ERR(tfm)) {
printk(KERN_ERR "alg: aead: Failed to load transform for %s: " printk(KERN_ERR "alg: aead: Failed to load transform for %s: "
"%ld\n", driver, PTR_ERR(tfm)); "%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; struct crypto_cipher *tfm;
int err = 0; int err = 0;
tfm = crypto_alloc_cipher(driver, type, mask); tfm = crypto_alloc_cipher(driver, type | CRYPTO_ALG_INTERNAL, mask);
if (IS_ERR(tfm)) { if (IS_ERR(tfm)) {
printk(KERN_ERR "alg: cipher: Failed to load transform for " printk(KERN_ERR "alg: cipher: Failed to load transform for "
"%s: %ld\n", driver, PTR_ERR(tfm)); "%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; struct crypto_ablkcipher *tfm;
int err = 0; int err = 0;
tfm = crypto_alloc_ablkcipher(driver, type, mask); tfm = crypto_alloc_ablkcipher(driver, type | CRYPTO_ALG_INTERNAL, mask);
if (IS_ERR(tfm)) { if (IS_ERR(tfm)) {
printk(KERN_ERR "alg: skcipher: Failed to load transform for " printk(KERN_ERR "alg: skcipher: Failed to load transform for "
"%s: %ld\n", driver, PTR_ERR(tfm)); "%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; struct crypto_ahash *tfm;
int err; int err;
tfm = crypto_alloc_ahash(driver, type, mask); tfm = crypto_alloc_ahash(driver, type | CRYPTO_ALG_INTERNAL, mask);
if (IS_ERR(tfm)) { if (IS_ERR(tfm)) {
printk(KERN_ERR "alg: hash: Failed to load transform for %s: " printk(KERN_ERR "alg: hash: Failed to load transform for %s: "
"%ld\n", driver, PTR_ERR(tfm)); "%ld\n", driver, PTR_ERR(tfm));
@ -1664,7 +1664,7 @@ static int alg_test_crc32c(const struct alg_test_desc *desc,
if (err) if (err)
goto out; goto out;
tfm = crypto_alloc_shash(driver, type, mask); tfm = crypto_alloc_shash(driver, type | CRYPTO_ALG_INTERNAL, mask);
if (IS_ERR(tfm)) { if (IS_ERR(tfm)) {
printk(KERN_ERR "alg: crc32c: Failed to load transform for %s: " printk(KERN_ERR "alg: crc32c: Failed to load transform for %s: "
"%ld\n", driver, PTR_ERR(tfm)); "%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; struct crypto_rng *rng;
int err; int err;
rng = crypto_alloc_rng(driver, type, mask); rng = crypto_alloc_rng(driver, type | CRYPTO_ALG_INTERNAL, mask);
if (IS_ERR(rng)) { if (IS_ERR(rng)) {
printk(KERN_ERR "alg: cprng: Failed to load transform for %s: " printk(KERN_ERR "alg: cprng: Failed to load transform for %s: "
"%ld\n", driver, PTR_ERR(rng)); "%ld\n", driver, PTR_ERR(rng));
@ -1733,7 +1733,7 @@ static int drbg_cavs_test(struct drbg_testvec *test, int pr,
if (!buf) if (!buf)
return -ENOMEM; return -ENOMEM;
drng = crypto_alloc_rng(driver, type, mask); drng = crypto_alloc_rng(driver, type | CRYPTO_ALG_INTERNAL, mask);
if (IS_ERR(drng)) { if (IS_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); "%s\n", driver);