algboss.c (b7c8e55db7141dcbb9d5305a3260fa0ed62a1bcc) algboss.c (326a6346ffb5b19eb593530d9d3096d409e46f62)
1/*
2 * Create default crypto algorithm instances.
3 *
4 * Copyright (c) 2006 Herbert Xu <herbert@gondor.apana.org.au>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)

--- 192 unchanged lines hidden (view full) ---

201err_free_param:
202 kfree(param);
203err_put_module:
204 module_put(THIS_MODULE);
205err:
206 return NOTIFY_OK;
207}
208
1/*
2 * Create default crypto algorithm instances.
3 *
4 * Copyright (c) 2006 Herbert Xu <herbert@gondor.apana.org.au>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)

--- 192 unchanged lines hidden (view full) ---

201err_free_param:
202 kfree(param);
203err_put_module:
204 module_put(THIS_MODULE);
205err:
206 return NOTIFY_OK;
207}
208
209#ifdef CONFIG_CRYPTO_MANAGER_TESTS
210static int cryptomgr_test(void *data)
211{
212 struct crypto_test_param *param = data;
213 u32 type = param->type;
214 int err = 0;
215
209static int cryptomgr_test(void *data)
210{
211 struct crypto_test_param *param = data;
212 u32 type = param->type;
213 int err = 0;
214
215#ifdef CONFIG_CRYPTO_MANAGER_DISABLE_TESTS
216 goto skiptest;
217#endif
218
216 if (type & CRYPTO_ALG_TESTED)
217 goto skiptest;
218
219 err = alg_test(param->driver, param->alg, type, CRYPTO_ALG_TESTED);
220
221skiptest:
222 crypto_alg_tested(param->driver, err);
223

--- 38 unchanged lines hidden (view full) ---

262
263err_free_param:
264 kfree(param);
265err_put_module:
266 module_put(THIS_MODULE);
267err:
268 return NOTIFY_OK;
269}
219 if (type & CRYPTO_ALG_TESTED)
220 goto skiptest;
221
222 err = alg_test(param->driver, param->alg, type, CRYPTO_ALG_TESTED);
223
224skiptest:
225 crypto_alg_tested(param->driver, err);
226

--- 38 unchanged lines hidden (view full) ---

265
266err_free_param:
267 kfree(param);
268err_put_module:
269 module_put(THIS_MODULE);
270err:
271 return NOTIFY_OK;
272}
270#endif /* CONFIG_CRYPTO_MANAGER_TESTS */
271
272static int cryptomgr_notify(struct notifier_block *this, unsigned long msg,
273 void *data)
274{
275 switch (msg) {
276 case CRYPTO_MSG_ALG_REQUEST:
277 return cryptomgr_schedule_probe(data);
273
274static int cryptomgr_notify(struct notifier_block *this, unsigned long msg,
275 void *data)
276{
277 switch (msg) {
278 case CRYPTO_MSG_ALG_REQUEST:
279 return cryptomgr_schedule_probe(data);
278#ifdef CONFIG_CRYPTO_MANAGER_TESTS
279 case CRYPTO_MSG_ALG_REGISTER:
280 return cryptomgr_schedule_test(data);
280 case CRYPTO_MSG_ALG_REGISTER:
281 return cryptomgr_schedule_test(data);
281#endif
282 }
283
284 return NOTIFY_DONE;
285}
286
287static struct notifier_block cryptomgr_notifier = {
288 .notifier_call = cryptomgr_notify,
289};

--- 17 unchanged lines hidden ---
282 }
283
284 return NOTIFY_DONE;
285}
286
287static struct notifier_block cryptomgr_notifier = {
288 .notifier_call = cryptomgr_notify,
289};

--- 17 unchanged lines hidden ---