diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-01-31 17:22:45 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-01-31 17:22:45 -0500 |
commit | a103950e0dd2058df5e8a8d4a915707bdcf205f0 (patch) | |
tree | af5d091f768db4ed7a12fc3c5484d3e20ad9d514 /crypto/algapi.c | |
parent | 2cfa1cd3da14814a1e9ec6a4fce8612637d3ee3d (diff) | |
parent | 2d55807b7f7bf62bb05a8b91247c5eb7cd19ac04 (diff) |
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto updates from Herbert Xu:
"API:
- Enforce the setting of keys for keyed aead/hash/skcipher
algorithms.
- Add multibuf speed tests in tcrypt.
Algorithms:
- Improve performance of sha3-generic.
- Add native sha512 support on arm64.
- Add v8.2 Crypto Extentions version of sha3/sm3 on arm64.
- Avoid hmac nesting by requiring underlying algorithm to be unkeyed.
- Add cryptd_max_cpu_qlen module parameter to cryptd.
Drivers:
- Add support for EIP97 engine in inside-secure.
- Add inline IPsec support to chelsio.
- Add RevB core support to crypto4xx.
- Fix AEAD ICV check in crypto4xx.
- Add stm32 crypto driver.
- Add support for BCM63xx platforms in bcm2835 and remove bcm63xx.
- Add Derived Key Protocol (DKP) support in caam.
- Add Samsung Exynos True RNG driver.
- Add support for Exynos5250+ SoCs in exynos PRNG driver"
* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (166 commits)
crypto: picoxcell - Fix error handling in spacc_probe()
crypto: arm64/sha512 - fix/improve new v8.2 Crypto Extensions code
crypto: arm64/sm3 - new v8.2 Crypto Extensions implementation
crypto: arm64/sha3 - new v8.2 Crypto Extensions implementation
crypto: testmgr - add new testcases for sha3
crypto: sha3-generic - export init/update/final routines
crypto: sha3-generic - simplify code
crypto: sha3-generic - rewrite KECCAK transform to help the compiler optimize
crypto: sha3-generic - fixes for alignment and big endian operation
crypto: aesni - handle zero length dst buffer
crypto: artpec6 - remove select on non-existing CRYPTO_SHA384
hwrng: bcm2835 - Remove redundant dev_err call in bcm2835_rng_probe()
crypto: stm32 - remove redundant dev_err call in stm32_cryp_probe()
crypto: axis - remove unnecessary platform_get_resource() error check
crypto: testmgr - test misuse of result in ahash
crypto: inside-secure - make function safexcel_try_push_requests static
crypto: aes-generic - fix aes-generic regression on powerpc
crypto: chelsio - Fix indentation warning
crypto: arm64/sha1-ce - get rid of literal pool
crypto: arm64/sha2-ce - move the round constant table to .rodata section
...
Diffstat (limited to 'crypto/algapi.c')
-rw-r--r-- | crypto/algapi.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/crypto/algapi.c b/crypto/algapi.c index 9a636f961572..395b082d03a9 100644 --- a/crypto/algapi.c +++ b/crypto/algapi.c | |||
@@ -62,7 +62,7 @@ static int crypto_check_alg(struct crypto_alg *alg) | |||
62 | if (alg->cra_priority < 0) | 62 | if (alg->cra_priority < 0) |
63 | return -EINVAL; | 63 | return -EINVAL; |
64 | 64 | ||
65 | atomic_set(&alg->cra_refcnt, 1); | 65 | refcount_set(&alg->cra_refcnt, 1); |
66 | 66 | ||
67 | return crypto_set_driver_name(alg); | 67 | return crypto_set_driver_name(alg); |
68 | } | 68 | } |
@@ -123,7 +123,6 @@ static void crypto_remove_instance(struct crypto_instance *inst, | |||
123 | if (!tmpl || !crypto_tmpl_get(tmpl)) | 123 | if (!tmpl || !crypto_tmpl_get(tmpl)) |
124 | return; | 124 | return; |
125 | 125 | ||
126 | crypto_notify(CRYPTO_MSG_ALG_UNREGISTER, &inst->alg); | ||
127 | list_move(&inst->alg.cra_list, list); | 126 | list_move(&inst->alg.cra_list, list); |
128 | hlist_del(&inst->list); | 127 | hlist_del(&inst->list); |
129 | inst->alg.cra_destroy = crypto_destroy_instance; | 128 | inst->alg.cra_destroy = crypto_destroy_instance; |
@@ -236,7 +235,7 @@ static struct crypto_larval *__crypto_register_alg(struct crypto_alg *alg) | |||
236 | if (!larval->adult) | 235 | if (!larval->adult) |
237 | goto free_larval; | 236 | goto free_larval; |
238 | 237 | ||
239 | atomic_set(&larval->alg.cra_refcnt, 1); | 238 | refcount_set(&larval->alg.cra_refcnt, 1); |
240 | memcpy(larval->alg.cra_driver_name, alg->cra_driver_name, | 239 | memcpy(larval->alg.cra_driver_name, alg->cra_driver_name, |
241 | CRYPTO_MAX_ALG_NAME); | 240 | CRYPTO_MAX_ALG_NAME); |
242 | larval->alg.cra_priority = alg->cra_priority; | 241 | larval->alg.cra_priority = alg->cra_priority; |
@@ -392,7 +391,6 @@ static int crypto_remove_alg(struct crypto_alg *alg, struct list_head *list) | |||
392 | 391 | ||
393 | alg->cra_flags |= CRYPTO_ALG_DEAD; | 392 | alg->cra_flags |= CRYPTO_ALG_DEAD; |
394 | 393 | ||
395 | crypto_notify(CRYPTO_MSG_ALG_UNREGISTER, alg); | ||
396 | list_del_init(&alg->cra_list); | 394 | list_del_init(&alg->cra_list); |
397 | crypto_remove_spawns(alg, list, NULL); | 395 | crypto_remove_spawns(alg, list, NULL); |
398 | 396 | ||
@@ -411,7 +409,7 @@ int crypto_unregister_alg(struct crypto_alg *alg) | |||
411 | if (ret) | 409 | if (ret) |
412 | return ret; | 410 | return ret; |
413 | 411 | ||
414 | BUG_ON(atomic_read(&alg->cra_refcnt) != 1); | 412 | BUG_ON(refcount_read(&alg->cra_refcnt) != 1); |
415 | if (alg->cra_destroy) | 413 | if (alg->cra_destroy) |
416 | alg->cra_destroy(alg); | 414 | alg->cra_destroy(alg); |
417 | 415 | ||
@@ -470,7 +468,6 @@ int crypto_register_template(struct crypto_template *tmpl) | |||
470 | } | 468 | } |
471 | 469 | ||
472 | list_add(&tmpl->list, &crypto_template_list); | 470 | list_add(&tmpl->list, &crypto_template_list); |
473 | crypto_notify(CRYPTO_MSG_TMPL_REGISTER, tmpl); | ||
474 | err = 0; | 471 | err = 0; |
475 | out: | 472 | out: |
476 | up_write(&crypto_alg_sem); | 473 | up_write(&crypto_alg_sem); |
@@ -497,12 +494,10 @@ void crypto_unregister_template(struct crypto_template *tmpl) | |||
497 | BUG_ON(err); | 494 | BUG_ON(err); |
498 | } | 495 | } |
499 | 496 | ||
500 | crypto_notify(CRYPTO_MSG_TMPL_UNREGISTER, tmpl); | ||
501 | |||
502 | up_write(&crypto_alg_sem); | 497 | up_write(&crypto_alg_sem); |
503 | 498 | ||
504 | hlist_for_each_entry_safe(inst, n, list, list) { | 499 | hlist_for_each_entry_safe(inst, n, list, list) { |
505 | BUG_ON(atomic_read(&inst->alg.cra_refcnt) != 1); | 500 | BUG_ON(refcount_read(&inst->alg.cra_refcnt) != 1); |
506 | crypto_free_instance(inst); | 501 | crypto_free_instance(inst); |
507 | } | 502 | } |
508 | crypto_remove_final(&users); | 503 | crypto_remove_final(&users); |