crypto: tcrypt - Add debug prints
PATCH 1/1 crypto: tcrypt - Add debug prints
From: Rabin Vincent <[email protected]>
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 <[email protected]>
--- crypto/tcrypt.c | 6 ++++++ 1 file changed, 6 insertions(+)
crypto/tcrypt.c +6 -0
@@ -22,6 +22,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <crypto/aead.h> #include <crypto/hash.h> #include <crypto/skcipher.h>
@@ -1010,6 +1012,8 @@ static inline int tcrypt_test(const char *alg) {int ret; +pr_debug ("testing %s\n" , alg); + ret =alg_test (alg, alg,0 ,0 );/* non-fips algs return -EINVAL in fips mode */ if (fips_enabled && ret == -EINVAL )
@@ -2059,6 +2063,8 @@ static int __init tcrypt_mod_init(void)if (err) {printk (KERN_ERR "tcrypt: one or more tests failed!\n" ); goto err_free_tv; + }else { +pr_debug ("all tests passed\n" ); }/* We intentionaly return -EAGAIN to prevent keeping the module,
Signature · 1 line
2.1.4
Herbert Xu
maintainerQuoted 24 lines · Rabin Vincent
From: Rabin Vincent <[email protected]>
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 unavailableAfter:
# 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
Quoted 1 line
Signed-off-by Rabin Vincent <[email protected]>
Patch 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