aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/tcrypt.c
diff options
context:
space:
mode:
authorRabin Vincent <rabinv@axis.com>2017-01-18 08:54:05 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2017-01-23 09:50:24 -0500
commit76512f2d8ca5e68160f4df0dead5e8e7b4bdb08e (patch)
tree109ded5e183fc740d14be0402f0b74195a5ef7f3 /crypto/tcrypt.c
parent3bfb2e6b32443841ff90460a78bdefb19f8d61e8 (diff)
crypto: tcrypt - Add debug prints
tcrypt is very tight-lipped when it succeeds, but a bit more feedback would be useful when developing or debugging crypto drivers, especially since even a successful run ends with the module failing to insert. Add a couple of debug prints, which can be enabled with dynamic debug: Before: # insmod tcrypt.ko mode=10 insmod: can't insert 'tcrypt.ko': Resource temporarily unavailable After: # insmod tcrypt.ko mode=10 dyndbg tcrypt: testing ecb(aes) tcrypt: testing cbc(aes) tcrypt: testing lrw(aes) tcrypt: testing xts(aes) tcrypt: testing ctr(aes) tcrypt: testing rfc3686(ctr(aes)) tcrypt: all tests passed insmod: can't insert 'tcrypt.ko': Resource temporarily unavailable Signed-off-by: Rabin Vincent <rabinv@axis.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/tcrypt.c')
-rw-r--r--crypto/tcrypt.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index ae22f05d5936..9a11f3c2bf98 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -22,6 +22,8 @@
22 * 22 *
23 */ 23 */
24 24
25#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
26
25#include <crypto/aead.h> 27#include <crypto/aead.h>
26#include <crypto/hash.h> 28#include <crypto/hash.h>
27#include <crypto/skcipher.h> 29#include <crypto/skcipher.h>
@@ -1010,6 +1012,8 @@ static inline int tcrypt_test(const char *alg)
1010{ 1012{
1011 int ret; 1013 int ret;
1012 1014
1015 pr_debug("testing %s\n", alg);
1016
1013 ret = alg_test(alg, alg, 0, 0); 1017 ret = alg_test(alg, alg, 0, 0);
1014 /* non-fips algs return -EINVAL in fips mode */ 1018 /* non-fips algs return -EINVAL in fips mode */
1015 if (fips_enabled && ret == -EINVAL) 1019 if (fips_enabled && ret == -EINVAL)
@@ -2059,6 +2063,8 @@ static int __init tcrypt_mod_init(void)
2059 if (err) { 2063 if (err) {
2060 printk(KERN_ERR "tcrypt: one or more tests failed!\n"); 2064 printk(KERN_ERR "tcrypt: one or more tests failed!\n");
2061 goto err_free_tv; 2065 goto err_free_tv;
2066 } else {
2067 pr_debug("all tests passed\n");
2062 } 2068 }
2063 2069
2064 /* We intentionaly return -EAGAIN to prevent keeping the module, 2070 /* We intentionaly return -EAGAIN to prevent keeping the module,