Re: [PATCH] tcrypt: Test algorithms by name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 19, 2009 at 07:47:37PM +0800, Herbert Xu wrote:
> On Fri, Jun 19, 2009 at 01:40:58PM +0200, Steffen Klassert wrote:
> > This adds the 'alg' module parameter to be able to test an
> > algorithm by name. If the algorithm type is not ad-hoc
> > clear for a algorithm (e.g. pcrypt, cryptd) it is possilbe
> > to set the algorithm type with the 'type' module parameter.
> > 
> > Signed-off-by: Steffen Klassert <steffen.klassert@xxxxxxxxxxx>
> 
> That was quick :)
> 
> Patch applied.  Thanks a lot Steffen!

BTW, I added this on top so that modprobe doesn't complain about
the return code:

tcrypt: one or more tests failed!
sys_init_module: 'tcrypt'->init suspiciously returned 1, it should follow 0/-E convention
sys_init_module: loading module anyway...
Pid: 3064, comm: modprobe Not tainted 2.6.30 #2
Call Trace:
 [<ffffffff81076826>] level2_spare_pgt+0x6e826/0x2d1760
 [<ffffffff8100b4ab>] level2_spare_pgt+0x34ab/0x2d1760

commit ea4006576945195ed35824acfb4007ca7cb78b70
Author: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Date:   Fri Jun 19 20:37:00 2009 +0800

    crypto: tcrypt - Fix module return code when testing by name
    
    We should return 0/-ENOENT instead of 1/0 when testing by name.
    
    Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>

diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index dfeec0c..a890a67 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -889,7 +889,7 @@ static int do_test(int m)
 
 static int do_alg_test(const char *alg, u32 type)
 {
-	return crypto_has_alg(alg, type, CRYPTO_ALG_TYPE_MASK);
+	return crypto_has_alg(alg, type, CRYPTO_ALG_TYPE_MASK) ? 0 : -ENOENT;
 }
 
 static int __init tcrypt_mod_init(void)

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux