15 #include <linux/ctype.h>
19 #include <linux/module.h>
21 #include <linux/rtnetlink.h>
22 #include <linux/sched.h>
23 #include <linux/slab.h>
24 #include <linux/string.h>
63 static int cryptomgr_probe(
void *
data)
87 crypto_tmpl_put(tmpl);
95 static int cryptomgr_schedule_probe(
struct crypto_larval *larval)
99 const char *
name = larval->
alg.cra_name;
111 for (p = name;
isalnum(*p) || *p ==
'-' || *p ==
'_'; p++)
115 if (!len || *p !=
'(')
127 for (;
isalnum(*p) || *p ==
'-' || *p ==
'_'; p++)
138 else if (*p ==
')' && !recursion--)
181 param->
type.attr.rta_len =
sizeof(param->
type);
185 param->
tb[0] = ¶m->
type.attr;
187 param->
otype = larval->
alg.cra_flags;
194 thread =
kthread_run(cryptomgr_probe, param,
"cryptomgr_probe");
210 static int cryptomgr_test(
void *data)
216 #ifdef CONFIG_CRYPTO_MANAGER_DISABLE_TESTS
232 static int cryptomgr_schedule_test(
struct crypto_alg *alg)
253 CRYPTO_ALG_TYPE_BLKCIPHER ? alg->cra_blkcipher.ivsize :
254 alg->cra_ablkcipher.ivsize)) ||
261 thread =
kthread_run(cryptomgr_test, param,
"cryptomgr_test");
280 return cryptomgr_schedule_probe(data);
282 return cryptomgr_schedule_test(data);
289 .notifier_call = cryptomgr_notify,
292 static int __init cryptomgr_init(
void)
297 static void __exit cryptomgr_exit(
void)