crypto: testmgr - always print the actual driver name
Subsystems (2)
cover crypto: testmgr - always print the actual driver name
When alg_test() is called from tcrypt.ko rather than from the algorithm registration code, "driver" is actually the algorithm name, not the driver name. So it shouldn't be used in places where a driver name is wanted, e.g. when reporting a test failure or when checking whether the driver is the generic driver or not.
See https://lkml.kernel.org/r/20200910122248.GA22506@Red for an example where this caused a problem. The self-tests reported "alg: ahash: md5 test failed", but it wasn't mentioned which md5 implementation it was.
Fix this by getting the driver name from the crypto tfm object that actually got allocated.
Eric Biggers (4):
crypto: aead - add crypto_aead_driver_name()
crypto: testmgr - always print the actual hash driver name
crypto: testmgr - always print the actual AEAD driver name
crypto: testmgr - always print the actual skcipher driver name
crypto/testmgr.c | 121 +++++++++++++++++++----------------------- include/crypto/aead.h | 5 ++ 2 files changed, 59 insertions(+), 67 deletions(-)
base-commit: 3650b228f83adda7e5ee532e2b90429c03f7b9ec
Signature · 1 line
2.29.1
PATCH 1/4 crypto: aead - add crypto_aead_driver_name()
From: Eric Biggers <[email protected]>
Add crypto_aead_driver_name(), which is analogous to crypto_skcipher_driver_name().
--- include/crypto/aead.h | 5 +++++ 1 file changed, 5 insertions(+)
include/crypto/aead.h +5 -0
@@ -191,6 +191,11 @@ static inline void crypto_free_aead(struct crypto_aead *tfm)crypto_destroy_tfm (tfm,crypto_aead_tfm (tfm)); } +static inline const char *crypto_aead_driver_name (struct crypto_aead *tfm) +{ +return crypto_tfm_alg_driver_name (crypto_aead_tfm (tfm)); +} +static inline struct aead_alg *crypto_aead_alg (struct crypto_aead *tfm) { return container_of(crypto_aead_tfm(tfm)->__crt_alg,
Signature · 1 line
2.29.1
PATCH 2/4 crypto: testmgr - always print the actual hash driver name
In reply to Eric BiggersFrom: Eric Biggers <[email protected]>
When alg_test() is called from tcrypt.ko rather than from the algorithm registration code, "driver" is actually the algorithm name, not the driver name. So it shouldn't be used in places where a driver name is wanted, e.g. when reporting a test failure or when checking whether the driver is the generic driver or not.
Fix this for the hash algorithm tests by getting the driver name from the crypto_ahash or crypto_shash that actually got allocated.
--- crypto/testmgr.c | 43 ++++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 23 deletions(-)
crypto/testmgr.c +20 -23
@@ -1171,8 +1171,7 @@ static inline const void *sg_data(struct scatterlist *sg) }/* Test one hash test vector in one configuration, using the shash API */ -static int test_shash_vec_cfg(const char *driver, - const struct hash_testvec *vec, +static int test_shash_vec_cfg(const struct hash_testvec *vec, const char *vec_name, const struct testvec_config *cfg, struct shash_desc *desc,
@@ -1183,6 +1182,7 @@ static int test_shash_vec_cfg(const char *driver,const unsigned int alignmask =crypto_shash_alignmask (tfm);const unsigned int digestsize =crypto_shash_digestsize (tfm);const unsigned int statesize =crypto_shash_statesize (tfm); +const char *driver =crypto_shash_driver_name (tfm);const struct test_sg_division *divs[XBUFSIZE ];unsigned int i;u8 result[HASH_MAX_DIGESTSIZE +TESTMGR_POISON_LEN ];
@@ -1355,8 +1355,7 @@ static int check_nonfinal_ahash_op(const char *op, int err, }/* Test one hash test vector in one configuration, using the ahash API */ -static int test_ahash_vec_cfg(const char *driver, - const struct hash_testvec *vec, +static int test_ahash_vec_cfg(const struct hash_testvec *vec, const char *vec_name, const struct testvec_config *cfg, struct ahash_request *req,
@@ -1367,6 +1366,7 @@ static int test_ahash_vec_cfg(const char *driver,const unsigned int alignmask =crypto_ahash_alignmask (tfm);const unsigned int digestsize =crypto_ahash_digestsize (tfm);const unsigned int statesize =crypto_ahash_statesize (tfm); +const char *driver =crypto_ahash_driver_name (tfm);const u32 req_flags =CRYPTO_TFM_REQ_MAY_BACKLOG | cfg->req_flags;const struct test_sg_division *divs[XBUFSIZE ];DECLARE_CRYPTO_WAIT (wait);
@@ -1521,8 +1521,7 @@ static int test_ahash_vec_cfg(const char *driver, driver, cfg); } -static int test_hash_vec_cfg(const char *driver, - const struct hash_testvec *vec, +static int test_hash_vec_cfg(const struct hash_testvec *vec, const char *vec_name, const struct testvec_config *cfg, struct ahash_request *req,
@@ -1539,20 +1538,18 @@ static int test_hash_vec_cfg(const char *driver,*/ if (desc) { - err =test_shash_vec_cfg (driver, vec, vec_name, cfg, desc, tsgl, + err =test_shash_vec_cfg (vec, vec_name, cfg, desc, tsgl, hashstate);if (err)return err; } -return test_ahash_vec_cfg (driver, vec, vec_name, cfg, req, tsgl, - hashstate); +return test_ahash_vec_cfg (vec, vec_name, cfg, req, tsgl, hashstate); } -static int test_hash_vec (const char *driver,const struct hash_testvec *vec, -unsigned int vec_num,struct ahash_request *req, -struct shash_desc *desc,struct test_sglist *tsgl, -u8 *hashstate) +static int test_hash_vec (const struct hash_testvec *vec,unsigned int vec_num, +struct ahash_request *req,struct shash_desc *desc, +struct test_sglist *tsgl,u8 *hashstate) {char vec_name[16 ];unsigned int i;
@@ -1561,7 +1558,7 @@ static int test_hash_vec(const char *driver, const struct hash_testvec *vec,sprintf (vec_name,"%u" , vec_num);for (i =0 ; i <ARRAY_SIZE (default_hash_testvec_configs); i++) { - err =test_hash_vec_cfg (driver, vec, vec_name, + err =test_hash_vec_cfg (vec, vec_name, &default_hash_testvec_configs[i], req, desc, tsgl, hashstate);if (err)
@@ -1576,7 +1573,7 @@ static int test_hash_vec(const char *driver, const struct hash_testvec *vec,for (i =0 ; i < fuzz_iterations; i++) {generate_random_testvec_config (&cfg, cfgname,sizeof (cfgname)); - err =test_hash_vec_cfg (driver, vec, vec_name, &cfg, + err =test_hash_vec_cfg (vec, vec_name, &cfg, req, desc, tsgl, hashstate);if (err)return err;
@@ -1633,8 +1630,7 @@ static void generate_random_hash_testvec(struct shash_desc *desc,* Test the hash algorithm represented by @req against the corresponding generic * implementation, if one is available. */ -static int test_hash_vs_generic_impl(const char *driver, - const char *generic_driver, +static int test_hash_vs_generic_impl(const char *generic_driver, unsigned int maxkeysize, struct ahash_request *req, struct shash_desc *desc,
@@ -1646,6 +1642,7 @@ static int test_hash_vs_generic_impl(const char *driver,const unsigned int blocksize =crypto_ahash_blocksize (tfm);const unsigned int maxdatasize = (2 *PAGE_SIZE ) -TESTMGR_POISON_LEN ;const char *algname =crypto_hash_alg_common (tfm)->base.cra_name; +const char *driver =crypto_ahash_driver_name (tfm);char _generic_driver[CRYPTO_MAX_ALG_NAME ];struct crypto_shash *generic_tfm =NULL ;struct shash_desc *generic_desc =NULL ;
@@ -1732,7 +1729,7 @@ static int test_hash_vs_generic_impl(const char *driver, vec_name, sizeof(vec_name));generate_random_testvec_config (cfg, cfgname,sizeof (cfgname)); - err =test_hash_vec_cfg (driver, &vec, vec_name, cfg, + err =test_hash_vec_cfg (&vec, vec_name, cfg, req, desc, tsgl, hashstate);if (err) goto out;
@@ -1749,8 +1746,7 @@ static int test_hash_vs_generic_impl(const char *driver,return err; }#else /* !CONFIG_CRYPTO_MANAGER_EXTRA_TESTS */ -static int test_hash_vs_generic_impl(const char *driver, - const char *generic_driver, +static int test_hash_vs_generic_impl(const char *generic_driver, unsigned int maxkeysize, struct ahash_request *req, struct shash_desc *desc,
@@ -1820,6 +1816,7 @@ static int __alg_test_hash(const struct hash_testvec *vecs, driver, PTR_ERR(atfm));return PTR_ERR (atfm); } + driver =crypto_ahash_driver_name (atfm); req =ahash_request_alloc (atfm,GFP_KERNEL );if (!req) {
@@ -1859,13 +1856,12 @@ static int __alg_test_hash(const struct hash_testvec *vecs, }for (i =0 ; i < num_vecs; i++) { - err =test_hash_vec (driver, &vecs[i], i, req, desc, tsgl, - hashstate); + err =test_hash_vec (&vecs[i], i, req, desc, tsgl, hashstate);if (err) goto out;cond_resched (); } - err =test_hash_vs_generic_impl (driver, generic_driver, maxkeysize, req, + err =test_hash_vs_generic_impl (generic_driver, maxkeysize, req, desc, tsgl, hashstate); out:kfree (hashstate);
@@ -3602,6 +3598,7 @@ static int alg_test_crc32c(const struct alg_test_desc *desc, "%ld\n", driver, PTR_ERR(tfm));return PTR_ERR (tfm); } + driver =crypto_shash_driver_name (tfm); do { SHASH_DESC_ON_STACK(shash, tfm);
Signature · 1 line
2.29.1
PATCH 3/4 crypto: testmgr - always print the actual AEAD driver name
In reply to Eric BiggersFrom: Eric Biggers <[email protected]>
When alg_test() is called from tcrypt.ko rather than from the algorithm registration code, "driver" is actually the algorithm name, not the driver name. So it shouldn't be used in places where a driver name is wanted, e.g. when reporting a test failure or when checking whether the driver is the generic driver or not.
Fix this for the AEAD algorithm tests by getting the driver name from the crypto_aead that actually got allocated.
--- crypto/testmgr.c | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-)
crypto/testmgr.c +18 -24
@@ -1919,8 +1919,7 @@ static int alg_test_hash(const struct alg_test_desc *desc, const char *driver,return err; } -static int test_aead_vec_cfg(const char *driver, int enc, - const struct aead_testvec *vec, +static int test_aead_vec_cfg(int enc, const struct aead_testvec *vec, const char *vec_name, const struct testvec_config *cfg, struct aead_request *req,
@@ -1930,6 +1929,7 @@ static int test_aead_vec_cfg(const char *driver, int enc,const unsigned int alignmask =crypto_aead_alignmask (tfm);const unsigned int ivsize =crypto_aead_ivsize (tfm);const unsigned int authsize = vec->clen - vec->plen; +const char *driver =crypto_aead_driver_name (tfm);const u32 req_flags =CRYPTO_TFM_REQ_MAY_BACKLOG | cfg->req_flags;const char *op = enc ?"encryption" :"decryption" ;DECLARE_CRYPTO_WAIT (wait);
@@ -2102,9 +2102,8 @@ static int test_aead_vec_cfg(const char *driver, int enc,return 0 ; } -static int test_aead_vec (const char *driver,int enc, -const struct aead_testvec *vec,unsigned int vec_num, -struct aead_request *req, +static int test_aead_vec (int enc,const struct aead_testvec *vec, +unsigned int vec_num,struct aead_request *req,struct cipher_test_sglists *tsgls) {char vec_name[16 ];
@@ -2117,7 +2116,7 @@ static int test_aead_vec(const char *driver, int enc,sprintf (vec_name,"%u" , vec_num);for (i =0 ; i <ARRAY_SIZE (default_cipher_testvec_configs); i++) { - err =test_aead_vec_cfg (driver, enc, vec, vec_name, + err =test_aead_vec_cfg (enc, vec, vec_name, &default_cipher_testvec_configs[i], req, tsgls);if (err)
@@ -2132,7 +2131,7 @@ static int test_aead_vec(const char *driver, int enc,for (i =0 ; i < fuzz_iterations; i++) {generate_random_testvec_config (&cfg, cfgname,sizeof (cfgname)); - err =test_aead_vec_cfg (driver, enc, vec, vec_name, + err =test_aead_vec_cfg (enc, vec, vec_name, &cfg, req, tsgls);if (err)return err;
@@ -2148,7 +2147,6 @@ static int test_aead_vec(const char *driver, int enc,struct aead_extra_tests_ctx {struct aead_request *req;struct crypto_aead *tfm; -const char *driver;const struct alg_test_desc *test_desc;struct cipher_test_sglists *tsgls;unsigned int maxdatasize;
@@ -2354,7 +2352,7 @@ static int test_aead_inauthentic_inputs(struct aead_extra_tests_ctx *ctx)if (ctx->vec.novrfy) {generate_random_testvec_config (&ctx->cfg, ctx->cfgname,sizeof (ctx->cfgname)); - err =test_aead_vec_cfg (ctx->driver,DECRYPT , &ctx->vec, + err =test_aead_vec_cfg (DECRYPT , &ctx->vec, ctx->vec_name, &ctx->cfg, ctx->req, ctx->tsgls);if (err)
@@ -2373,7 +2371,7 @@ static int test_aead_vs_generic_impl(struct aead_extra_tests_ctx *ctx) {struct crypto_aead *tfm = ctx->tfm;const char *algname =crypto_aead_alg (tfm)->base.cra_name; -const char *driver = ctx->driver; +const char *driver =crypto_aead_driver_name (tfm);const char *generic_driver = ctx->test_desc->generic_driver;char _generic_driver[CRYPTO_MAX_ALG_NAME ];struct crypto_aead *generic_tfm =NULL ;
@@ -2450,14 +2448,14 @@ static int test_aead_vs_generic_impl(struct aead_extra_tests_ctx *ctx)generate_random_testvec_config (&ctx->cfg, ctx->cfgname,sizeof (ctx->cfgname));if (!ctx->vec.novrfy) { - err =test_aead_vec_cfg (driver,ENCRYPT , &ctx->vec, + err =test_aead_vec_cfg (ENCRYPT , &ctx->vec, ctx->vec_name, &ctx->cfg, ctx->req, ctx->tsgls);if (err) goto out; }if (ctx->vec.crypt_error ==0 || ctx->vec.novrfy) { - err =test_aead_vec_cfg (driver,DECRYPT , &ctx->vec, + err =test_aead_vec_cfg (DECRYPT , &ctx->vec, ctx->vec_name, &ctx->cfg, ctx->req, ctx->tsgls);if (err)
@@ -2472,8 +2470,7 @@ static int test_aead_vs_generic_impl(struct aead_extra_tests_ctx *ctx)return err; } -static int test_aead_extra (const char *driver, -const struct alg_test_desc *test_desc, +static int test_aead_extra (const struct alg_test_desc *test_desc,struct aead_request *req,struct cipher_test_sglists *tsgls) {
@@ -2489,7 +2486,6 @@ static int test_aead_extra(const char *driver,return -ENOMEM ; ctx->req = req; ctx->tfm =crypto_aead_reqtfm (req); - ctx->driver = driver; ctx->test_desc = test_desc; ctx->tsgls = tsgls; ctx->maxdatasize = (2 *PAGE_SIZE ) -TESTMGR_POISON_LEN ;
@@ -2524,8 +2520,7 @@ static int test_aead_extra(const char *driver, return err; }#else /* !CONFIG_CRYPTO_MANAGER_EXTRA_TESTS */ -static int test_aead_extra (const char *driver, -const struct alg_test_desc *test_desc, +static int test_aead_extra (const struct alg_test_desc *test_desc,struct aead_request *req,struct cipher_test_sglists *tsgls) {
@@ -2533,8 +2528,7 @@ static int test_aead_extra(const char *driver, }#endif /* !CONFIG_CRYPTO_MANAGER_EXTRA_TESTS */ -static int test_aead (const char *driver,int enc, -const struct aead_test_suite *suite, +static int test_aead (int enc,const struct aead_test_suite *suite,struct aead_request *req,struct cipher_test_sglists *tsgls) {
@@ -2542,8 +2536,7 @@ static int test_aead(const char *driver, int enc,int err;for (i =0 ; i < suite->count; i++) { - err =test_aead_vec (driver, enc, &suite->vecs[i], i, req, - tsgls); + err =test_aead_vec (enc, &suite->vecs[i], i, req, tsgls);if (err)return err;cond_resched ();
@@ -2571,6 +2564,7 @@ static int alg_test_aead(const struct alg_test_desc *desc, const char *driver, driver, PTR_ERR(tfm));return PTR_ERR (tfm); } + driver =crypto_aead_driver_name (tfm); req =aead_request_alloc (tfm,GFP_KERNEL );if (!req) {
@@ -2588,15 +2582,15 @@ static int alg_test_aead(const struct alg_test_desc *desc, const char *driver, goto out; } - err =test_aead (driver,ENCRYPT , suite, req, tsgls); + err =test_aead (ENCRYPT , suite, req, tsgls);if (err) goto out; - err =test_aead (driver,DECRYPT , suite, req, tsgls); + err =test_aead (DECRYPT , suite, req, tsgls);if (err) goto out; - err =test_aead_extra (driver, desc, req, tsgls); + err =test_aead_extra (desc, req, tsgls); out:free_cipher_test_sglists (tsgls);aead_request_free (req);
Signature · 1 line
2.29.1
PATCH 4/4 crypto: testmgr - always print the actual skcipher driver name
In reply to Eric BiggersFrom: Eric Biggers <[email protected]>
When alg_test() is called from tcrypt.ko rather than from the algorithm registration code, "driver" is actually the algorithm name, not the driver name. So it shouldn't be used in places where a driver name is wanted, e.g. when reporting a test failure or when checking whether the driver is the generic driver or not.
Fix this for the skcipher algorithm tests by getting the driver name from the crypto_skcipher that actually got allocated.
--- crypto/testmgr.c | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-)
crypto/testmgr.c +16 -20
@@ -2685,8 +2685,7 @@ static int test_cipher(struct crypto_cipher *tfm, int enc,return ret; } -static int test_skcipher_vec_cfg(const char *driver, int enc, - const struct cipher_testvec *vec, +static int test_skcipher_vec_cfg(int enc, const struct cipher_testvec *vec, const char *vec_name, const struct testvec_config *cfg, struct skcipher_request *req,
@@ -2695,6 +2694,7 @@ static int test_skcipher_vec_cfg(const char *driver, int enc,struct crypto_skcipher *tfm =crypto_skcipher_reqtfm (req);const unsigned int alignmask =crypto_skcipher_alignmask (tfm);const unsigned int ivsize =crypto_skcipher_ivsize (tfm); +const char *driver =crypto_skcipher_driver_name (tfm);const u32 req_flags =CRYPTO_TFM_REQ_MAY_BACKLOG | cfg->req_flags;const char *op = enc ?"encryption" :"decryption" ;DECLARE_CRYPTO_WAIT (wait);
@@ -2849,8 +2849,7 @@ static int test_skcipher_vec_cfg(const char *driver, int enc,return 0 ; } -static int test_skcipher_vec (const char *driver,int enc, -const struct cipher_testvec *vec, +static int test_skcipher_vec (int enc,const struct cipher_testvec *vec,unsigned int vec_num,struct skcipher_request *req,struct cipher_test_sglists *tsgls)
@@ -2865,7 +2864,7 @@ static int test_skcipher_vec(const char *driver, int enc,sprintf (vec_name,"%u" , vec_num);for (i =0 ; i <ARRAY_SIZE (default_cipher_testvec_configs); i++) { - err =test_skcipher_vec_cfg (driver, enc, vec, vec_name, + err =test_skcipher_vec_cfg (enc, vec, vec_name, &default_cipher_testvec_configs[i], req, tsgls);if (err)
@@ -2880,7 +2879,7 @@ static int test_skcipher_vec(const char *driver, int enc,for (i =0 ; i < fuzz_iterations; i++) {generate_random_testvec_config (&cfg, cfgname,sizeof (cfgname)); - err =test_skcipher_vec_cfg (driver, enc, vec, vec_name, + err =test_skcipher_vec_cfg (enc, vec, vec_name, &cfg, req, tsgls);if (err)return err;
@@ -2951,8 +2950,7 @@ static void generate_random_cipher_testvec(struct skcipher_request *req,* Test the skcipher algorithm represented by @req against the corresponding * generic implementation, if one is available. */ -static int test_skcipher_vs_generic_impl (const char *driver, -const char *generic_driver, +static int test_skcipher_vs_generic_impl (const char *generic_driver,struct skcipher_request *req,struct cipher_test_sglists *tsgls) {
@@ -2962,6 +2960,7 @@ static int test_skcipher_vs_generic_impl(const char *driver,const unsigned int blocksize =crypto_skcipher_blocksize (tfm);const unsigned int maxdatasize = (2 *PAGE_SIZE ) -TESTMGR_POISON_LEN ;const char *algname =crypto_skcipher_alg (tfm)->base.cra_name; +const char *driver =crypto_skcipher_driver_name (tfm);char _generic_driver[CRYPTO_MAX_ALG_NAME ];struct crypto_skcipher *generic_tfm =NULL ;struct skcipher_request *generic_req =NULL ;
@@ -3067,11 +3066,11 @@ static int test_skcipher_vs_generic_impl(const char *driver, vec_name, sizeof(vec_name));generate_random_testvec_config (cfg, cfgname,sizeof (cfgname)); - err =test_skcipher_vec_cfg (driver,ENCRYPT , &vec, vec_name, + err =test_skcipher_vec_cfg (ENCRYPT , &vec, vec_name, cfg, req, tsgls);if (err) goto out; - err =test_skcipher_vec_cfg (driver,DECRYPT , &vec, vec_name, + err =test_skcipher_vec_cfg (DECRYPT , &vec, vec_name, cfg, req, tsgls);if (err) goto out;
@@ -3089,8 +3088,7 @@ static int test_skcipher_vs_generic_impl(const char *driver, return err; }#else /* !CONFIG_CRYPTO_MANAGER_EXTRA_TESTS */ -static int test_skcipher_vs_generic_impl (const char *driver, -const char *generic_driver, +static int test_skcipher_vs_generic_impl (const char *generic_driver,struct skcipher_request *req,struct cipher_test_sglists *tsgls) {
@@ -3098,8 +3096,7 @@ static int test_skcipher_vs_generic_impl(const char *driver, }#endif /* !CONFIG_CRYPTO_MANAGER_EXTRA_TESTS */ -static int test_skcipher (const char *driver,int enc, -const struct cipher_test_suite *suite, +static int test_skcipher (int enc,const struct cipher_test_suite *suite,struct skcipher_request *req,struct cipher_test_sglists *tsgls) {
@@ -3107,8 +3104,7 @@ static int test_skcipher(const char *driver, int enc,int err;for (i =0 ; i < suite->count; i++) { - err =test_skcipher_vec (driver, enc, &suite->vecs[i], i, req, - tsgls); + err =test_skcipher_vec (enc, &suite->vecs[i], i, req, tsgls);if (err)return err;cond_resched ();
@@ -3136,6 +3132,7 @@ static int alg_test_skcipher(const struct alg_test_desc *desc, driver, PTR_ERR(tfm));return PTR_ERR (tfm); } + driver =crypto_skcipher_driver_name (tfm); req =skcipher_request_alloc (tfm,GFP_KERNEL );if (!req) {
@@ -3153,16 +3150,15 @@ static int alg_test_skcipher(const struct alg_test_desc *desc, goto out; } - err =test_skcipher (driver,ENCRYPT , suite, req, tsgls); + err =test_skcipher (ENCRYPT , suite, req, tsgls);if (err) goto out; - err =test_skcipher (driver,DECRYPT , suite, req, tsgls); + err =test_skcipher (DECRYPT , suite, req, tsgls);if (err) goto out; - err =test_skcipher_vs_generic_impl (driver, desc->generic_driver, req, - tsgls); + err =test_skcipher_vs_generic_impl (desc->generic_driver, req, tsgls); out:free_cipher_test_sglists (tsgls);skcipher_request_free (req);
Signature · 1 line
2.29.1
Herbert Xu
maintainerQuoted 19 lines · Eric Biggers
When
alg_test()is called from tcrypt.ko rather than from the algorithm registration code, "driver" is actually the algorithm name, not the driver name. So it shouldn't be used in places where a driver name is wanted, e.g. when reporting a test failure or when checking whether the driver is the generic driver or not.See https://lkml.kernel.org/r/20200910122248.GA22506@Red for an example where this caused a problem. The self-tests reported "alg: ahash: md5 test failed", but it wasn't mentioned which md5 implementation it was.
Fix this by getting the driver name from the crypto tfm object that actually got allocated.
Eric Biggers (4):
crypto: aead - addcrypto_aead_driver_name()
crypto: testmgr - always print the actual hash driver name
crypto: testmgr - always print the actual AEAD driver name
crypto: testmgr - always print the actual skcipher driver name
Quoted 6 lines
crypto/testmgr.c| 121 +++++++++++++++++++-----------------------include/crypto/aead.h| 5 ++2 files changed, 59 insertions(+), 67 deletions(-)base-commit:
3650b228f83adda7e5ee532e2b90429c03f7b9ec
All applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt