diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-13 16:33:26 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-13 16:33:26 -0500 |
commit | e3aa91a7cb21a595169b20c64f63ca39a91a0c43 (patch) | |
tree | 6a92a2e595629949a45336c770c2408abba8444d /crypto | |
parent | 78a45c6f067824cf5d0a9fedea7339ac2e28603c (diff) | |
parent | 8606813a6c8997fd3bb805186056d78670eb86ca (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto update from Herbert Xu:
- The crypto API is now documented :)
- Disallow arbitrary module loading through crypto API.
- Allow get request with empty driver name through crypto_user.
- Allow speed testing of arbitrary hash functions.
- Add caam support for ctr(aes), gcm(aes) and their derivatives.
- nx now supports concurrent hashing properly.
- Add sahara support for SHA1/256.
- Add ARM64 version of CRC32.
- Misc fixes.
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (77 commits)
crypto: tcrypt - Allow speed testing of arbitrary hash functions
crypto: af_alg - add user space interface for AEAD
crypto: qat - fix problem with coalescing enable logic
crypto: sahara - add support for SHA1/256
crypto: sahara - replace tasklets with kthread
crypto: sahara - add support for i.MX53
crypto: sahara - fix spinlock initialization
crypto: arm - replace memset by memzero_explicit
crypto: powerpc - replace memset by memzero_explicit
crypto: sha - replace memset by memzero_explicit
crypto: sparc - replace memset by memzero_explicit
crypto: algif_skcipher - initialize upon init request
crypto: algif_skcipher - removed unneeded code
crypto: algif_skcipher - Fixed blocking recvmsg
crypto: drbg - use memzero_explicit() for clearing sensitive data
crypto: drbg - use MODULE_ALIAS_CRYPTO
crypto: include crypto- module prefix in template
crypto: user - add MODULE_ALIAS
crypto: sha-mb - remove a bogus NULL check
crytpo: qat - Fix 64 bytes requests
...
Diffstat (limited to 'crypto')
70 files changed, 191 insertions, 122 deletions
diff --git a/crypto/842.c b/crypto/842.c index 65c7a89cfa09..b48f4f108c47 100644 --- a/crypto/842.c +++ b/crypto/842.c | |||
@@ -180,3 +180,4 @@ module_exit(nx842_mod_exit); | |||
180 | 180 | ||
181 | MODULE_LICENSE("GPL"); | 181 | MODULE_LICENSE("GPL"); |
182 | MODULE_DESCRIPTION("842 Compression Algorithm"); | 182 | MODULE_DESCRIPTION("842 Compression Algorithm"); |
183 | MODULE_ALIAS_CRYPTO("842"); | ||
diff --git a/crypto/aes_generic.c b/crypto/aes_generic.c index fd0d6b454975..9b3c54c1cbe8 100644 --- a/crypto/aes_generic.c +++ b/crypto/aes_generic.c | |||
@@ -1474,4 +1474,4 @@ module_exit(aes_fini); | |||
1474 | 1474 | ||
1475 | MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm"); | 1475 | MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm"); |
1476 | MODULE_LICENSE("Dual BSD/GPL"); | 1476 | MODULE_LICENSE("Dual BSD/GPL"); |
1477 | MODULE_ALIAS("aes"); | 1477 | MODULE_ALIAS_CRYPTO("aes"); |
diff --git a/crypto/af_alg.c b/crypto/af_alg.c index bc21f520d489..1fa7bc31be63 100644 --- a/crypto/af_alg.c +++ b/crypto/af_alg.c | |||
@@ -421,6 +421,12 @@ int af_alg_cmsg_send(struct msghdr *msg, struct af_alg_control *con) | |||
421 | con->op = *(u32 *)CMSG_DATA(cmsg); | 421 | con->op = *(u32 *)CMSG_DATA(cmsg); |
422 | break; | 422 | break; |
423 | 423 | ||
424 | case ALG_SET_AEAD_ASSOCLEN: | ||
425 | if (cmsg->cmsg_len < CMSG_LEN(sizeof(u32))) | ||
426 | return -EINVAL; | ||
427 | con->aead_assoclen = *(u32 *)CMSG_DATA(cmsg); | ||
428 | break; | ||
429 | |||
424 | default: | 430 | default: |
425 | return -EINVAL; | 431 | return -EINVAL; |
426 | } | 432 | } |
diff --git a/crypto/algapi.c b/crypto/algapi.c index e8d3a7dca8c4..71a8143e23b1 100644 --- a/crypto/algapi.c +++ b/crypto/algapi.c | |||
@@ -509,8 +509,8 @@ static struct crypto_template *__crypto_lookup_template(const char *name) | |||
509 | 509 | ||
510 | struct crypto_template *crypto_lookup_template(const char *name) | 510 | struct crypto_template *crypto_lookup_template(const char *name) |
511 | { | 511 | { |
512 | return try_then_request_module(__crypto_lookup_template(name), "%s", | 512 | return try_then_request_module(__crypto_lookup_template(name), |
513 | name); | 513 | "crypto-%s", name); |
514 | } | 514 | } |
515 | EXPORT_SYMBOL_GPL(crypto_lookup_template); | 515 | EXPORT_SYMBOL_GPL(crypto_lookup_template); |
516 | 516 | ||
diff --git a/crypto/algif_hash.c b/crypto/algif_hash.c index 83cd2cc49c9f..01f56eb7816e 100644 --- a/crypto/algif_hash.c +++ b/crypto/algif_hash.c | |||
@@ -258,8 +258,8 @@ static void hash_sock_destruct(struct sock *sk) | |||
258 | struct alg_sock *ask = alg_sk(sk); | 258 | struct alg_sock *ask = alg_sk(sk); |
259 | struct hash_ctx *ctx = ask->private; | 259 | struct hash_ctx *ctx = ask->private; |
260 | 260 | ||
261 | sock_kfree_s(sk, ctx->result, | 261 | sock_kzfree_s(sk, ctx->result, |
262 | crypto_ahash_digestsize(crypto_ahash_reqtfm(&ctx->req))); | 262 | crypto_ahash_digestsize(crypto_ahash_reqtfm(&ctx->req))); |
263 | sock_kfree_s(sk, ctx, ctx->len); | 263 | sock_kfree_s(sk, ctx, ctx->len); |
264 | af_alg_release_parent(sk); | 264 | af_alg_release_parent(sk); |
265 | } | 265 | } |
diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c index 4f45dab24648..c12207c8dde9 100644 --- a/crypto/algif_skcipher.c +++ b/crypto/algif_skcipher.c | |||
@@ -251,6 +251,7 @@ static int skcipher_sendmsg(struct kiocb *unused, struct socket *sock, | |||
251 | struct af_alg_control con = {}; | 251 | struct af_alg_control con = {}; |
252 | long copied = 0; | 252 | long copied = 0; |
253 | bool enc = 0; | 253 | bool enc = 0; |
254 | bool init = 0; | ||
254 | int err; | 255 | int err; |
255 | int i; | 256 | int i; |
256 | 257 | ||
@@ -259,6 +260,7 @@ static int skcipher_sendmsg(struct kiocb *unused, struct socket *sock, | |||
259 | if (err) | 260 | if (err) |
260 | return err; | 261 | return err; |
261 | 262 | ||
263 | init = 1; | ||
262 | switch (con.op) { | 264 | switch (con.op) { |
263 | case ALG_OP_ENCRYPT: | 265 | case ALG_OP_ENCRYPT: |
264 | enc = 1; | 266 | enc = 1; |
@@ -280,7 +282,7 @@ static int skcipher_sendmsg(struct kiocb *unused, struct socket *sock, | |||
280 | if (!ctx->more && ctx->used) | 282 | if (!ctx->more && ctx->used) |
281 | goto unlock; | 283 | goto unlock; |
282 | 284 | ||
283 | if (!ctx->used) { | 285 | if (init) { |
284 | ctx->enc = enc; | 286 | ctx->enc = enc; |
285 | if (con.iv) | 287 | if (con.iv) |
286 | memcpy(ctx->iv, con.iv->iv, ivsize); | 288 | memcpy(ctx->iv, con.iv->iv, ivsize); |
@@ -359,8 +361,6 @@ static int skcipher_sendmsg(struct kiocb *unused, struct socket *sock, | |||
359 | err = 0; | 361 | err = 0; |
360 | 362 | ||
361 | ctx->more = msg->msg_flags & MSG_MORE; | 363 | ctx->more = msg->msg_flags & MSG_MORE; |
362 | if (!ctx->more && !list_empty(&ctx->tsgl)) | ||
363 | sgl = list_entry(ctx->tsgl.prev, struct skcipher_sg_list, list); | ||
364 | 364 | ||
365 | unlock: | 365 | unlock: |
366 | skcipher_data_wakeup(sk); | 366 | skcipher_data_wakeup(sk); |
@@ -408,8 +408,6 @@ static ssize_t skcipher_sendpage(struct socket *sock, struct page *page, | |||
408 | 408 | ||
409 | done: | 409 | done: |
410 | ctx->more = flags & MSG_MORE; | 410 | ctx->more = flags & MSG_MORE; |
411 | if (!ctx->more && !list_empty(&ctx->tsgl)) | ||
412 | sgl = list_entry(ctx->tsgl.prev, struct skcipher_sg_list, list); | ||
413 | 411 | ||
414 | unlock: | 412 | unlock: |
415 | skcipher_data_wakeup(sk); | 413 | skcipher_data_wakeup(sk); |
@@ -448,14 +446,13 @@ static int skcipher_recvmsg(struct kiocb *unused, struct socket *sock, | |||
448 | while (!sg->length) | 446 | while (!sg->length) |
449 | sg++; | 447 | sg++; |
450 | 448 | ||
451 | used = ctx->used; | 449 | if (!ctx->used) { |
452 | if (!used) { | ||
453 | err = skcipher_wait_for_data(sk, flags); | 450 | err = skcipher_wait_for_data(sk, flags); |
454 | if (err) | 451 | if (err) |
455 | goto unlock; | 452 | goto unlock; |
456 | } | 453 | } |
457 | 454 | ||
458 | used = min_t(unsigned long, used, seglen); | 455 | used = min_t(unsigned long, ctx->used, seglen); |
459 | 456 | ||
460 | used = af_alg_make_sg(&ctx->rsgl, from, used, 1); | 457 | used = af_alg_make_sg(&ctx->rsgl, from, used, 1); |
461 | err = used; | 458 | err = used; |
@@ -566,7 +563,7 @@ static void skcipher_sock_destruct(struct sock *sk) | |||
566 | struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(&ctx->req); | 563 | struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(&ctx->req); |
567 | 564 | ||
568 | skcipher_free_sgl(sk); | 565 | skcipher_free_sgl(sk); |
569 | sock_kfree_s(sk, ctx->iv, crypto_ablkcipher_ivsize(tfm)); | 566 | sock_kzfree_s(sk, ctx->iv, crypto_ablkcipher_ivsize(tfm)); |
570 | sock_kfree_s(sk, ctx, ctx->len); | 567 | sock_kfree_s(sk, ctx, ctx->len); |
571 | af_alg_release_parent(sk); | 568 | af_alg_release_parent(sk); |
572 | } | 569 | } |
diff --git a/crypto/ansi_cprng.c b/crypto/ansi_cprng.c index 666f1962a160..b4485a108389 100644 --- a/crypto/ansi_cprng.c +++ b/crypto/ansi_cprng.c | |||
@@ -476,4 +476,4 @@ module_param(dbg, int, 0); | |||
476 | MODULE_PARM_DESC(dbg, "Boolean to enable debugging (0/1 == off/on)"); | 476 | MODULE_PARM_DESC(dbg, "Boolean to enable debugging (0/1 == off/on)"); |
477 | module_init(prng_mod_init); | 477 | module_init(prng_mod_init); |
478 | module_exit(prng_mod_fini); | 478 | module_exit(prng_mod_fini); |
479 | MODULE_ALIAS("stdrng"); | 479 | MODULE_ALIAS_CRYPTO("stdrng"); |
diff --git a/crypto/anubis.c b/crypto/anubis.c index 008c8a4fb67c..4bb187c2a902 100644 --- a/crypto/anubis.c +++ b/crypto/anubis.c | |||
@@ -704,3 +704,4 @@ module_exit(anubis_mod_fini); | |||
704 | 704 | ||
705 | MODULE_LICENSE("GPL"); | 705 | MODULE_LICENSE("GPL"); |
706 | MODULE_DESCRIPTION("Anubis Cryptographic Algorithm"); | 706 | MODULE_DESCRIPTION("Anubis Cryptographic Algorithm"); |
707 | MODULE_ALIAS_CRYPTO("anubis"); | ||
diff --git a/crypto/api.c b/crypto/api.c index a2b39c5f3649..2a81e98a0021 100644 --- a/crypto/api.c +++ b/crypto/api.c | |||
@@ -216,11 +216,11 @@ struct crypto_alg *crypto_larval_lookup(const char *name, u32 type, u32 mask) | |||
216 | 216 | ||
217 | alg = crypto_alg_lookup(name, type, mask); | 217 | alg = crypto_alg_lookup(name, type, mask); |
218 | if (!alg) { | 218 | if (!alg) { |
219 | request_module("%s", name); | 219 | request_module("crypto-%s", name); |
220 | 220 | ||
221 | if (!((type ^ CRYPTO_ALG_NEED_FALLBACK) & mask & | 221 | if (!((type ^ CRYPTO_ALG_NEED_FALLBACK) & mask & |
222 | CRYPTO_ALG_NEED_FALLBACK)) | 222 | CRYPTO_ALG_NEED_FALLBACK)) |
223 | request_module("%s-all", name); | 223 | request_module("crypto-%s-all", name); |
224 | 224 | ||
225 | alg = crypto_alg_lookup(name, type, mask); | 225 | alg = crypto_alg_lookup(name, type, mask); |
226 | } | 226 | } |
diff --git a/crypto/arc4.c b/crypto/arc4.c index 5a772c3657d5..f1a81925558f 100644 --- a/crypto/arc4.c +++ b/crypto/arc4.c | |||
@@ -166,3 +166,4 @@ module_exit(arc4_exit); | |||
166 | MODULE_LICENSE("GPL"); | 166 | MODULE_LICENSE("GPL"); |
167 | MODULE_DESCRIPTION("ARC4 Cipher Algorithm"); | 167 | MODULE_DESCRIPTION("ARC4 Cipher Algorithm"); |
168 | MODULE_AUTHOR("Jon Oberheide <jon@oberheide.org>"); | 168 | MODULE_AUTHOR("Jon Oberheide <jon@oberheide.org>"); |
169 | MODULE_ALIAS_CRYPTO("arc4"); | ||
diff --git a/crypto/authenc.c b/crypto/authenc.c index e1223559d5df..78fb16cab13f 100644 --- a/crypto/authenc.c +++ b/crypto/authenc.c | |||
@@ -721,3 +721,4 @@ module_exit(crypto_authenc_module_exit); | |||
721 | 721 | ||
722 | MODULE_LICENSE("GPL"); | 722 | MODULE_LICENSE("GPL"); |
723 | MODULE_DESCRIPTION("Simple AEAD wrapper for IPsec"); | 723 | MODULE_DESCRIPTION("Simple AEAD wrapper for IPsec"); |
724 | MODULE_ALIAS_CRYPTO("authenc"); | ||
diff --git a/crypto/authencesn.c b/crypto/authencesn.c index 4be0dd4373a9..024bff2344fc 100644 --- a/crypto/authencesn.c +++ b/crypto/authencesn.c | |||
@@ -814,3 +814,4 @@ module_exit(crypto_authenc_esn_module_exit); | |||
814 | MODULE_LICENSE("GPL"); | 814 | MODULE_LICENSE("GPL"); |
815 | MODULE_AUTHOR("Steffen Klassert <steffen.klassert@secunet.com>"); | 815 | MODULE_AUTHOR("Steffen Klassert <steffen.klassert@secunet.com>"); |
816 | MODULE_DESCRIPTION("AEAD wrapper for IPsec with extended sequence numbers"); | 816 | MODULE_DESCRIPTION("AEAD wrapper for IPsec with extended sequence numbers"); |
817 | MODULE_ALIAS_CRYPTO("authencesn"); | ||
diff --git a/crypto/blowfish_generic.c b/crypto/blowfish_generic.c index 8baf5447d35b..7bd71f02d0dd 100644 --- a/crypto/blowfish_generic.c +++ b/crypto/blowfish_generic.c | |||
@@ -138,4 +138,4 @@ module_exit(blowfish_mod_fini); | |||
138 | 138 | ||
139 | MODULE_LICENSE("GPL"); | 139 | MODULE_LICENSE("GPL"); |
140 | MODULE_DESCRIPTION("Blowfish Cipher Algorithm"); | 140 | MODULE_DESCRIPTION("Blowfish Cipher Algorithm"); |
141 | MODULE_ALIAS("blowfish"); | 141 | MODULE_ALIAS_CRYPTO("blowfish"); |
diff --git a/crypto/camellia_generic.c b/crypto/camellia_generic.c index 26bcd7a2d6b4..1b74c5a3e891 100644 --- a/crypto/camellia_generic.c +++ b/crypto/camellia_generic.c | |||
@@ -1098,4 +1098,4 @@ module_exit(camellia_fini); | |||
1098 | 1098 | ||
1099 | MODULE_DESCRIPTION("Camellia Cipher Algorithm"); | 1099 | MODULE_DESCRIPTION("Camellia Cipher Algorithm"); |
1100 | MODULE_LICENSE("GPL"); | 1100 | MODULE_LICENSE("GPL"); |
1101 | MODULE_ALIAS("camellia"); | 1101 | MODULE_ALIAS_CRYPTO("camellia"); |
diff --git a/crypto/cast5_generic.c b/crypto/cast5_generic.c index 5558f630a0eb..84c86db67ec7 100644 --- a/crypto/cast5_generic.c +++ b/crypto/cast5_generic.c | |||
@@ -549,4 +549,4 @@ module_exit(cast5_mod_fini); | |||
549 | 549 | ||
550 | MODULE_LICENSE("GPL"); | 550 | MODULE_LICENSE("GPL"); |
551 | MODULE_DESCRIPTION("Cast5 Cipher Algorithm"); | 551 | MODULE_DESCRIPTION("Cast5 Cipher Algorithm"); |
552 | MODULE_ALIAS("cast5"); | 552 | MODULE_ALIAS_CRYPTO("cast5"); |
diff --git a/crypto/cast6_generic.c b/crypto/cast6_generic.c index de732528a430..f408f0bd8de2 100644 --- a/crypto/cast6_generic.c +++ b/crypto/cast6_generic.c | |||
@@ -291,4 +291,4 @@ module_exit(cast6_mod_fini); | |||
291 | 291 | ||
292 | MODULE_LICENSE("GPL"); | 292 | MODULE_LICENSE("GPL"); |
293 | MODULE_DESCRIPTION("Cast6 Cipher Algorithm"); | 293 | MODULE_DESCRIPTION("Cast6 Cipher Algorithm"); |
294 | MODULE_ALIAS("cast6"); | 294 | MODULE_ALIAS_CRYPTO("cast6"); |
diff --git a/crypto/cbc.c b/crypto/cbc.c index 61ac42e1e32b..780ee27b2d43 100644 --- a/crypto/cbc.c +++ b/crypto/cbc.c | |||
@@ -289,3 +289,4 @@ module_exit(crypto_cbc_module_exit); | |||
289 | 289 | ||
290 | MODULE_LICENSE("GPL"); | 290 | MODULE_LICENSE("GPL"); |
291 | MODULE_DESCRIPTION("CBC block cipher algorithm"); | 291 | MODULE_DESCRIPTION("CBC block cipher algorithm"); |
292 | MODULE_ALIAS_CRYPTO("cbc"); | ||
diff --git a/crypto/ccm.c b/crypto/ccm.c index 1df84217f7c9..003bbbd21a2b 100644 --- a/crypto/ccm.c +++ b/crypto/ccm.c | |||
@@ -879,5 +879,6 @@ module_exit(crypto_ccm_module_exit); | |||
879 | 879 | ||
880 | MODULE_LICENSE("GPL"); | 880 | MODULE_LICENSE("GPL"); |
881 | MODULE_DESCRIPTION("Counter with CBC MAC"); | 881 | MODULE_DESCRIPTION("Counter with CBC MAC"); |
882 | MODULE_ALIAS("ccm_base"); | 882 | MODULE_ALIAS_CRYPTO("ccm_base"); |
883 | MODULE_ALIAS("rfc4309"); | 883 | MODULE_ALIAS_CRYPTO("rfc4309"); |
884 | MODULE_ALIAS_CRYPTO("ccm"); | ||
diff --git a/crypto/chainiv.c b/crypto/chainiv.c index 9c294c8f9a07..63c17d5992f7 100644 --- a/crypto/chainiv.c +++ b/crypto/chainiv.c | |||
@@ -359,3 +359,4 @@ module_exit(chainiv_module_exit); | |||
359 | 359 | ||
360 | MODULE_LICENSE("GPL"); | 360 | MODULE_LICENSE("GPL"); |
361 | MODULE_DESCRIPTION("Chain IV Generator"); | 361 | MODULE_DESCRIPTION("Chain IV Generator"); |
362 | MODULE_ALIAS_CRYPTO("chainiv"); | ||
diff --git a/crypto/cmac.c b/crypto/cmac.c index 50880cf17fad..7a8bfbd548f6 100644 --- a/crypto/cmac.c +++ b/crypto/cmac.c | |||
@@ -313,3 +313,4 @@ module_exit(crypto_cmac_module_exit); | |||
313 | 313 | ||
314 | MODULE_LICENSE("GPL"); | 314 | MODULE_LICENSE("GPL"); |
315 | MODULE_DESCRIPTION("CMAC keyed hash algorithm"); | 315 | MODULE_DESCRIPTION("CMAC keyed hash algorithm"); |
316 | MODULE_ALIAS_CRYPTO("cmac"); | ||
diff --git a/crypto/crc32.c b/crypto/crc32.c index 9d1c41569898..187ded28cb0b 100644 --- a/crypto/crc32.c +++ b/crypto/crc32.c | |||
@@ -156,3 +156,4 @@ module_exit(crc32_mod_fini); | |||
156 | MODULE_AUTHOR("Alexander Boyko <alexander_boyko@xyratex.com>"); | 156 | MODULE_AUTHOR("Alexander Boyko <alexander_boyko@xyratex.com>"); |
157 | MODULE_DESCRIPTION("CRC32 calculations wrapper for lib/crc32"); | 157 | MODULE_DESCRIPTION("CRC32 calculations wrapper for lib/crc32"); |
158 | MODULE_LICENSE("GPL"); | 158 | MODULE_LICENSE("GPL"); |
159 | MODULE_ALIAS_CRYPTO("crc32"); | ||
diff --git a/crypto/crc32c_generic.c b/crypto/crc32c_generic.c index d9c7beba8e50..2a062025749d 100644 --- a/crypto/crc32c_generic.c +++ b/crypto/crc32c_generic.c | |||
@@ -170,5 +170,5 @@ module_exit(crc32c_mod_fini); | |||
170 | MODULE_AUTHOR("Clay Haapala <chaapala@cisco.com>"); | 170 | MODULE_AUTHOR("Clay Haapala <chaapala@cisco.com>"); |
171 | MODULE_DESCRIPTION("CRC32c (Castagnoli) calculations wrapper for lib/crc32c"); | 171 | MODULE_DESCRIPTION("CRC32c (Castagnoli) calculations wrapper for lib/crc32c"); |
172 | MODULE_LICENSE("GPL"); | 172 | MODULE_LICENSE("GPL"); |
173 | MODULE_ALIAS("crc32c"); | 173 | MODULE_ALIAS_CRYPTO("crc32c"); |
174 | MODULE_SOFTDEP("pre: crc32c"); | 174 | MODULE_SOFTDEP("pre: crc32c"); |
diff --git a/crypto/crct10dif_generic.c b/crypto/crct10dif_generic.c index 877e7114ec5c..08bb4f504520 100644 --- a/crypto/crct10dif_generic.c +++ b/crypto/crct10dif_generic.c | |||
@@ -124,4 +124,4 @@ module_exit(crct10dif_mod_fini); | |||
124 | MODULE_AUTHOR("Tim Chen <tim.c.chen@linux.intel.com>"); | 124 | MODULE_AUTHOR("Tim Chen <tim.c.chen@linux.intel.com>"); |
125 | MODULE_DESCRIPTION("T10 DIF CRC calculation."); | 125 | MODULE_DESCRIPTION("T10 DIF CRC calculation."); |
126 | MODULE_LICENSE("GPL"); | 126 | MODULE_LICENSE("GPL"); |
127 | MODULE_ALIAS("crct10dif"); | 127 | MODULE_ALIAS_CRYPTO("crct10dif"); |
diff --git a/crypto/cryptd.c b/crypto/cryptd.c index e592c90abebb..650afac10fd7 100644 --- a/crypto/cryptd.c +++ b/crypto/cryptd.c | |||
@@ -955,3 +955,4 @@ module_exit(cryptd_exit); | |||
955 | 955 | ||
956 | MODULE_LICENSE("GPL"); | 956 | MODULE_LICENSE("GPL"); |
957 | MODULE_DESCRIPTION("Software async crypto daemon"); | 957 | MODULE_DESCRIPTION("Software async crypto daemon"); |
958 | MODULE_ALIAS_CRYPTO("cryptd"); | ||
diff --git a/crypto/crypto_null.c b/crypto/crypto_null.c index 1dc54bb95a87..a20319132e33 100644 --- a/crypto/crypto_null.c +++ b/crypto/crypto_null.c | |||
@@ -145,9 +145,9 @@ static struct crypto_alg null_algs[3] = { { | |||
145 | .coa_decompress = null_compress } } | 145 | .coa_decompress = null_compress } } |
146 | } }; | 146 | } }; |
147 | 147 | ||
148 | MODULE_ALIAS("compress_null"); | 148 | MODULE_ALIAS_CRYPTO("compress_null"); |
149 | MODULE_ALIAS("digest_null"); | 149 | MODULE_ALIAS_CRYPTO("digest_null"); |
150 | MODULE_ALIAS("cipher_null"); | 150 | MODULE_ALIAS_CRYPTO("cipher_null"); |
151 | 151 | ||
152 | static int __init crypto_null_mod_init(void) | 152 | static int __init crypto_null_mod_init(void) |
153 | { | 153 | { |
diff --git a/crypto/crypto_user.c b/crypto/crypto_user.c index e2a34feec7a4..c5148a35ae0a 100644 --- a/crypto/crypto_user.c +++ b/crypto/crypto_user.c | |||
@@ -201,10 +201,7 @@ static int crypto_report(struct sk_buff *in_skb, struct nlmsghdr *in_nlh, | |||
201 | if (!null_terminated(p->cru_name) || !null_terminated(p->cru_driver_name)) | 201 | if (!null_terminated(p->cru_name) || !null_terminated(p->cru_driver_name)) |
202 | return -EINVAL; | 202 | return -EINVAL; |
203 | 203 | ||
204 | if (!p->cru_driver_name[0]) | 204 | alg = crypto_alg_match(p, 0); |
205 | return -EINVAL; | ||
206 | |||
207 | alg = crypto_alg_match(p, 1); | ||
208 | if (!alg) | 205 | if (!alg) |
209 | return -ENOENT; | 206 | return -ENOENT; |
210 | 207 | ||
@@ -537,3 +534,4 @@ module_exit(crypto_user_exit); | |||
537 | MODULE_LICENSE("GPL"); | 534 | MODULE_LICENSE("GPL"); |
538 | MODULE_AUTHOR("Steffen Klassert <steffen.klassert@secunet.com>"); | 535 | MODULE_AUTHOR("Steffen Klassert <steffen.klassert@secunet.com>"); |
539 | MODULE_DESCRIPTION("Crypto userspace configuration API"); | 536 | MODULE_DESCRIPTION("Crypto userspace configuration API"); |
537 | MODULE_ALIAS("net-pf-16-proto-21"); | ||
diff --git a/crypto/ctr.c b/crypto/ctr.c index f2b94f27bb2c..2386f7313952 100644 --- a/crypto/ctr.c +++ b/crypto/ctr.c | |||
@@ -466,4 +466,5 @@ module_exit(crypto_ctr_module_exit); | |||
466 | 466 | ||
467 | MODULE_LICENSE("GPL"); | 467 | MODULE_LICENSE("GPL"); |
468 | MODULE_DESCRIPTION("CTR Counter block mode"); | 468 | MODULE_DESCRIPTION("CTR Counter block mode"); |
469 | MODULE_ALIAS("rfc3686"); | 469 | MODULE_ALIAS_CRYPTO("rfc3686"); |
470 | MODULE_ALIAS_CRYPTO("ctr"); | ||
diff --git a/crypto/cts.c b/crypto/cts.c index 133f0874c95e..bd9405820e8a 100644 --- a/crypto/cts.c +++ b/crypto/cts.c | |||
@@ -351,3 +351,4 @@ module_exit(crypto_cts_module_exit); | |||
351 | 351 | ||
352 | MODULE_LICENSE("Dual BSD/GPL"); | 352 | MODULE_LICENSE("Dual BSD/GPL"); |
353 | MODULE_DESCRIPTION("CTS-CBC CipherText Stealing for CBC"); | 353 | MODULE_DESCRIPTION("CTS-CBC CipherText Stealing for CBC"); |
354 | MODULE_ALIAS_CRYPTO("cts"); | ||
diff --git a/crypto/deflate.c b/crypto/deflate.c index b57d70eb156b..95d8d37c5021 100644 --- a/crypto/deflate.c +++ b/crypto/deflate.c | |||
@@ -222,4 +222,4 @@ module_exit(deflate_mod_fini); | |||
222 | MODULE_LICENSE("GPL"); | 222 | MODULE_LICENSE("GPL"); |
223 | MODULE_DESCRIPTION("Deflate Compression Algorithm for IPCOMP"); | 223 | MODULE_DESCRIPTION("Deflate Compression Algorithm for IPCOMP"); |
224 | MODULE_AUTHOR("James Morris <jmorris@intercode.com.au>"); | 224 | MODULE_AUTHOR("James Morris <jmorris@intercode.com.au>"); |
225 | 225 | MODULE_ALIAS_CRYPTO("deflate"); | |
diff --git a/crypto/des_generic.c b/crypto/des_generic.c index 298d464ab7d2..42912948776b 100644 --- a/crypto/des_generic.c +++ b/crypto/des_generic.c | |||
@@ -983,7 +983,7 @@ static struct crypto_alg des_algs[2] = { { | |||
983 | .cia_decrypt = des3_ede_decrypt } } | 983 | .cia_decrypt = des3_ede_decrypt } } |
984 | } }; | 984 | } }; |
985 | 985 | ||
986 | MODULE_ALIAS("des3_ede"); | 986 | MODULE_ALIAS_CRYPTO("des3_ede"); |
987 | 987 | ||
988 | static int __init des_generic_mod_init(void) | 988 | static int __init des_generic_mod_init(void) |
989 | { | 989 | { |
diff --git a/crypto/drbg.c b/crypto/drbg.c index 54cfd4820abc..d748a1d0ca24 100644 --- a/crypto/drbg.c +++ b/crypto/drbg.c | |||
@@ -98,6 +98,7 @@ | |||
98 | */ | 98 | */ |
99 | 99 | ||
100 | #include <crypto/drbg.h> | 100 | #include <crypto/drbg.h> |
101 | #include <linux/string.h> | ||
101 | 102 | ||
102 | /*************************************************************** | 103 | /*************************************************************** |
103 | * Backend cipher definitions available to DRBG | 104 | * Backend cipher definitions available to DRBG |
@@ -283,38 +284,6 @@ static inline void drbg_cpu_to_be32(__u32 val, unsigned char *buf) | |||
283 | 284 | ||
284 | conversion->conv = cpu_to_be32(val); | 285 | conversion->conv = cpu_to_be32(val); |
285 | } | 286 | } |
286 | |||
287 | /* | ||
288 | * Increment buffer | ||
289 | * | ||
290 | * @dst buffer to increment | ||
291 | * @add value to add | ||
292 | */ | ||
293 | static inline void drbg_add_buf(unsigned char *dst, size_t dstlen, | ||
294 | const unsigned char *add, size_t addlen) | ||
295 | { | ||
296 | /* implied: dstlen > addlen */ | ||
297 | unsigned char *dstptr; | ||
298 | const unsigned char *addptr; | ||
299 | unsigned int remainder = 0; | ||
300 | size_t len = addlen; | ||
301 | |||
302 | dstptr = dst + (dstlen-1); | ||
303 | addptr = add + (addlen-1); | ||
304 | while (len) { | ||
305 | remainder += *dstptr + *addptr; | ||
306 | *dstptr = remainder & 0xff; | ||
307 | remainder >>= 8; | ||
308 | len--; dstptr--; addptr--; | ||
309 | } | ||
310 | len = dstlen - addlen; | ||
311 | while (len && remainder > 0) { | ||
312 | remainder = *dstptr + 1; | ||
313 | *dstptr = remainder & 0xff; | ||
314 | remainder >>= 8; | ||
315 | len--; dstptr--; | ||
316 | } | ||
317 | } | ||
318 | #endif /* defined(CONFIG_CRYPTO_DRBG_HASH) || defined(CONFIG_CRYPTO_DRBG_CTR) */ | 287 | #endif /* defined(CONFIG_CRYPTO_DRBG_HASH) || defined(CONFIG_CRYPTO_DRBG_CTR) */ |
319 | 288 | ||
320 | /****************************************************************** | 289 | /****************************************************************** |
@@ -323,6 +292,13 @@ static inline void drbg_add_buf(unsigned char *dst, size_t dstlen, | |||
323 | 292 | ||
324 | #ifdef CONFIG_CRYPTO_DRBG_CTR | 293 | #ifdef CONFIG_CRYPTO_DRBG_CTR |
325 | #define CRYPTO_DRBG_CTR_STRING "CTR " | 294 | #define CRYPTO_DRBG_CTR_STRING "CTR " |
295 | MODULE_ALIAS_CRYPTO("drbg_pr_ctr_aes256"); | ||
296 | MODULE_ALIAS_CRYPTO("drbg_nopr_ctr_aes256"); | ||
297 | MODULE_ALIAS_CRYPTO("drbg_pr_ctr_aes192"); | ||
298 | MODULE_ALIAS_CRYPTO("drbg_nopr_ctr_aes192"); | ||
299 | MODULE_ALIAS_CRYPTO("drbg_pr_ctr_aes128"); | ||
300 | MODULE_ALIAS_CRYPTO("drbg_nopr_ctr_aes128"); | ||
301 | |||
326 | static int drbg_kcapi_sym(struct drbg_state *drbg, const unsigned char *key, | 302 | static int drbg_kcapi_sym(struct drbg_state *drbg, const unsigned char *key, |
327 | unsigned char *outval, const struct drbg_string *in); | 303 | unsigned char *outval, const struct drbg_string *in); |
328 | static int drbg_init_sym_kernel(struct drbg_state *drbg); | 304 | static int drbg_init_sym_kernel(struct drbg_state *drbg); |
@@ -522,9 +498,9 @@ static int drbg_ctr_df(struct drbg_state *drbg, | |||
522 | ret = 0; | 498 | ret = 0; |
523 | 499 | ||
524 | out: | 500 | out: |
525 | memset(iv, 0, drbg_blocklen(drbg)); | 501 | memzero_explicit(iv, drbg_blocklen(drbg)); |
526 | memset(temp, 0, drbg_statelen(drbg)); | 502 | memzero_explicit(temp, drbg_statelen(drbg)); |
527 | memset(pad, 0, drbg_blocklen(drbg)); | 503 | memzero_explicit(pad, drbg_blocklen(drbg)); |
528 | return ret; | 504 | return ret; |
529 | } | 505 | } |
530 | 506 | ||
@@ -554,7 +530,6 @@ static int drbg_ctr_update(struct drbg_state *drbg, struct list_head *seed, | |||
554 | unsigned char *temp_p, *df_data_p; /* pointer to iterate over buffers */ | 530 | unsigned char *temp_p, *df_data_p; /* pointer to iterate over buffers */ |
555 | unsigned int len = 0; | 531 | unsigned int len = 0; |
556 | struct drbg_string cipherin; | 532 | struct drbg_string cipherin; |
557 | unsigned char prefix = DRBG_PREFIX1; | ||
558 | 533 | ||
559 | memset(temp, 0, drbg_statelen(drbg) + drbg_blocklen(drbg)); | 534 | memset(temp, 0, drbg_statelen(drbg) + drbg_blocklen(drbg)); |
560 | if (3 > reseed) | 535 | if (3 > reseed) |
@@ -574,7 +549,7 @@ static int drbg_ctr_update(struct drbg_state *drbg, struct list_head *seed, | |||
574 | */ | 549 | */ |
575 | while (len < (drbg_statelen(drbg))) { | 550 | while (len < (drbg_statelen(drbg))) { |
576 | /* 10.2.1.2 step 2.1 */ | 551 | /* 10.2.1.2 step 2.1 */ |
577 | drbg_add_buf(drbg->V, drbg_blocklen(drbg), &prefix, 1); | 552 | crypto_inc(drbg->V, drbg_blocklen(drbg)); |
578 | /* | 553 | /* |
579 | * 10.2.1.2 step 2.2 */ | 554 | * 10.2.1.2 step 2.2 */ |
580 | ret = drbg_kcapi_sym(drbg, drbg->C, temp + len, &cipherin); | 555 | ret = drbg_kcapi_sym(drbg, drbg->C, temp + len, &cipherin); |
@@ -599,9 +574,9 @@ static int drbg_ctr_update(struct drbg_state *drbg, struct list_head *seed, | |||
599 | ret = 0; | 574 | ret = 0; |
600 | 575 | ||
601 | out: | 576 | out: |
602 | memset(temp, 0, drbg_statelen(drbg) + drbg_blocklen(drbg)); | 577 | memzero_explicit(temp, drbg_statelen(drbg) + drbg_blocklen(drbg)); |
603 | if (2 != reseed) | 578 | if (2 != reseed) |
604 | memset(df_data, 0, drbg_statelen(drbg)); | 579 | memzero_explicit(df_data, drbg_statelen(drbg)); |
605 | return ret; | 580 | return ret; |
606 | } | 581 | } |
607 | 582 | ||
@@ -617,7 +592,6 @@ static int drbg_ctr_generate(struct drbg_state *drbg, | |||
617 | int len = 0; | 592 | int len = 0; |
618 | int ret = 0; | 593 | int ret = 0; |
619 | struct drbg_string data; | 594 | struct drbg_string data; |
620 | unsigned char prefix = DRBG_PREFIX1; | ||
621 | 595 | ||
622 | memset(drbg->scratchpad, 0, drbg_blocklen(drbg)); | 596 | memset(drbg->scratchpad, 0, drbg_blocklen(drbg)); |
623 | 597 | ||
@@ -629,7 +603,7 @@ static int drbg_ctr_generate(struct drbg_state *drbg, | |||
629 | } | 603 | } |
630 | 604 | ||
631 | /* 10.2.1.5.2 step 4.1 */ | 605 | /* 10.2.1.5.2 step 4.1 */ |
632 | drbg_add_buf(drbg->V, drbg_blocklen(drbg), &prefix, 1); | 606 | crypto_inc(drbg->V, drbg_blocklen(drbg)); |
633 | drbg_string_fill(&data, drbg->V, drbg_blocklen(drbg)); | 607 | drbg_string_fill(&data, drbg->V, drbg_blocklen(drbg)); |
634 | while (len < buflen) { | 608 | while (len < buflen) { |
635 | int outlen = 0; | 609 | int outlen = 0; |
@@ -643,7 +617,7 @@ static int drbg_ctr_generate(struct drbg_state *drbg, | |||
643 | drbg_blocklen(drbg) : (buflen - len); | 617 | drbg_blocklen(drbg) : (buflen - len); |
644 | if (!drbg_fips_continuous_test(drbg, drbg->scratchpad)) { | 618 | if (!drbg_fips_continuous_test(drbg, drbg->scratchpad)) { |
645 | /* 10.2.1.5.2 step 6 */ | 619 | /* 10.2.1.5.2 step 6 */ |
646 | drbg_add_buf(drbg->V, drbg_blocklen(drbg), &prefix, 1); | 620 | crypto_inc(drbg->V, drbg_blocklen(drbg)); |
647 | continue; | 621 | continue; |
648 | } | 622 | } |
649 | /* 10.2.1.5.2 step 4.3 */ | 623 | /* 10.2.1.5.2 step 4.3 */ |
@@ -651,7 +625,7 @@ static int drbg_ctr_generate(struct drbg_state *drbg, | |||
651 | len += outlen; | 625 | len += outlen; |
652 | /* 10.2.1.5.2 step 6 */ | 626 | /* 10.2.1.5.2 step 6 */ |
653 | if (len < buflen) | 627 | if (len < buflen) |
654 | drbg_add_buf(drbg->V, drbg_blocklen(drbg), &prefix, 1); | 628 | crypto_inc(drbg->V, drbg_blocklen(drbg)); |
655 | } | 629 | } |
656 | 630 | ||
657 | /* 10.2.1.5.2 step 6 */ | 631 | /* 10.2.1.5.2 step 6 */ |
@@ -660,7 +634,7 @@ static int drbg_ctr_generate(struct drbg_state *drbg, | |||
660 | len = ret; | 634 | len = ret; |
661 | 635 | ||
662 | out: | 636 | out: |
663 | memset(drbg->scratchpad, 0, drbg_blocklen(drbg)); | 637 | memzero_explicit(drbg->scratchpad, drbg_blocklen(drbg)); |
664 | return len; | 638 | return len; |
665 | } | 639 | } |
666 | 640 | ||
@@ -685,6 +659,15 @@ static int drbg_fini_hash_kernel(struct drbg_state *drbg); | |||
685 | 659 | ||
686 | #ifdef CONFIG_CRYPTO_DRBG_HMAC | 660 | #ifdef CONFIG_CRYPTO_DRBG_HMAC |
687 | #define CRYPTO_DRBG_HMAC_STRING "HMAC " | 661 | #define CRYPTO_DRBG_HMAC_STRING "HMAC " |
662 | MODULE_ALIAS_CRYPTO("drbg_pr_hmac_sha512"); | ||
663 | MODULE_ALIAS_CRYPTO("drbg_nopr_hmac_sha512"); | ||
664 | MODULE_ALIAS_CRYPTO("drbg_pr_hmac_sha384"); | ||
665 | MODULE_ALIAS_CRYPTO("drbg_nopr_hmac_sha384"); | ||
666 | MODULE_ALIAS_CRYPTO("drbg_pr_hmac_sha256"); | ||
667 | MODULE_ALIAS_CRYPTO("drbg_nopr_hmac_sha256"); | ||
668 | MODULE_ALIAS_CRYPTO("drbg_pr_hmac_sha1"); | ||
669 | MODULE_ALIAS_CRYPTO("drbg_nopr_hmac_sha1"); | ||
670 | |||
688 | /* update function of HMAC DRBG as defined in 10.1.2.2 */ | 671 | /* update function of HMAC DRBG as defined in 10.1.2.2 */ |
689 | static int drbg_hmac_update(struct drbg_state *drbg, struct list_head *seed, | 672 | static int drbg_hmac_update(struct drbg_state *drbg, struct list_head *seed, |
690 | int reseed) | 673 | int reseed) |
@@ -796,6 +779,47 @@ static struct drbg_state_ops drbg_hmac_ops = { | |||
796 | 779 | ||
797 | #ifdef CONFIG_CRYPTO_DRBG_HASH | 780 | #ifdef CONFIG_CRYPTO_DRBG_HASH |
798 | #define CRYPTO_DRBG_HASH_STRING "HASH " | 781 | #define CRYPTO_DRBG_HASH_STRING "HASH " |
782 | MODULE_ALIAS_CRYPTO("drbg_pr_sha512"); | ||
783 | MODULE_ALIAS_CRYPTO("drbg_nopr_sha512"); | ||
784 | MODULE_ALIAS_CRYPTO("drbg_pr_sha384"); | ||
785 | MODULE_ALIAS_CRYPTO("drbg_nopr_sha384"); | ||
786 | MODULE_ALIAS_CRYPTO("drbg_pr_sha256"); | ||
787 | MODULE_ALIAS_CRYPTO("drbg_nopr_sha256"); | ||
788 | MODULE_ALIAS_CRYPTO("drbg_pr_sha1"); | ||
789 | MODULE_ALIAS_CRYPTO("drbg_nopr_sha1"); | ||
790 | |||
791 | /* | ||
792 | * Increment buffer | ||
793 | * | ||
794 | * @dst buffer to increment | ||
795 | * @add value to add | ||
796 | */ | ||
797 | static inline void drbg_add_buf(unsigned char *dst, size_t dstlen, | ||
798 | const unsigned char *add, size_t addlen) | ||
799 | { | ||
800 | /* implied: dstlen > addlen */ | ||
801 | unsigned char *dstptr; | ||
802 | const unsigned char *addptr; | ||
803 | unsigned int remainder = 0; | ||
804 | size_t len = addlen; | ||
805 | |||
806 | dstptr = dst + (dstlen-1); | ||
807 | addptr = add + (addlen-1); | ||
808 | while (len) { | ||
809 | remainder += *dstptr + *addptr; | ||
810 | *dstptr = remainder & 0xff; | ||
811 | remainder >>= 8; | ||
812 | len--; dstptr--; addptr--; | ||
813 | } | ||
814 | len = dstlen - addlen; | ||
815 | while (len && remainder > 0) { | ||
816 | remainder = *dstptr + 1; | ||
817 | *dstptr = remainder & 0xff; | ||
818 | remainder >>= 8; | ||
819 | len--; dstptr--; | ||
820 | } | ||
821 | } | ||
822 | |||
799 | /* | 823 | /* |
800 | * scratchpad usage: as drbg_hash_update and drbg_hash_df are used | 824 | * scratchpad usage: as drbg_hash_update and drbg_hash_df are used |
801 | * interlinked, the scratchpad is used as follows: | 825 | * interlinked, the scratchpad is used as follows: |
@@ -848,7 +872,7 @@ static int drbg_hash_df(struct drbg_state *drbg, | |||
848 | } | 872 | } |
849 | 873 | ||
850 | out: | 874 | out: |
851 | memset(tmp, 0, drbg_blocklen(drbg)); | 875 | memzero_explicit(tmp, drbg_blocklen(drbg)); |
852 | return ret; | 876 | return ret; |
853 | } | 877 | } |
854 | 878 | ||
@@ -892,7 +916,7 @@ static int drbg_hash_update(struct drbg_state *drbg, struct list_head *seed, | |||
892 | ret = drbg_hash_df(drbg, drbg->C, drbg_statelen(drbg), &datalist2); | 916 | ret = drbg_hash_df(drbg, drbg->C, drbg_statelen(drbg), &datalist2); |
893 | 917 | ||
894 | out: | 918 | out: |
895 | memset(drbg->scratchpad, 0, drbg_statelen(drbg)); | 919 | memzero_explicit(drbg->scratchpad, drbg_statelen(drbg)); |
896 | return ret; | 920 | return ret; |
897 | } | 921 | } |
898 | 922 | ||
@@ -927,7 +951,7 @@ static int drbg_hash_process_addtl(struct drbg_state *drbg, | |||
927 | drbg->scratchpad, drbg_blocklen(drbg)); | 951 | drbg->scratchpad, drbg_blocklen(drbg)); |
928 | 952 | ||
929 | out: | 953 | out: |
930 | memset(drbg->scratchpad, 0, drbg_blocklen(drbg)); | 954 | memzero_explicit(drbg->scratchpad, drbg_blocklen(drbg)); |
931 | return ret; | 955 | return ret; |
932 | } | 956 | } |
933 | 957 | ||
@@ -942,7 +966,6 @@ static int drbg_hash_hashgen(struct drbg_state *drbg, | |||
942 | unsigned char *dst = drbg->scratchpad + drbg_statelen(drbg); | 966 | unsigned char *dst = drbg->scratchpad + drbg_statelen(drbg); |
943 | struct drbg_string data; | 967 | struct drbg_string data; |
944 | LIST_HEAD(datalist); | 968 | LIST_HEAD(datalist); |
945 | unsigned char prefix = DRBG_PREFIX1; | ||
946 | 969 | ||
947 | memset(src, 0, drbg_statelen(drbg)); | 970 | memset(src, 0, drbg_statelen(drbg)); |
948 | memset(dst, 0, drbg_blocklen(drbg)); | 971 | memset(dst, 0, drbg_blocklen(drbg)); |
@@ -963,7 +986,7 @@ static int drbg_hash_hashgen(struct drbg_state *drbg, | |||
963 | outlen = (drbg_blocklen(drbg) < (buflen - len)) ? | 986 | outlen = (drbg_blocklen(drbg) < (buflen - len)) ? |
964 | drbg_blocklen(drbg) : (buflen - len); | 987 | drbg_blocklen(drbg) : (buflen - len); |
965 | if (!drbg_fips_continuous_test(drbg, dst)) { | 988 | if (!drbg_fips_continuous_test(drbg, dst)) { |
966 | drbg_add_buf(src, drbg_statelen(drbg), &prefix, 1); | 989 | crypto_inc(src, drbg_statelen(drbg)); |
967 | continue; | 990 | continue; |
968 | } | 991 | } |
969 | /* 10.1.1.4 step hashgen 4.2 */ | 992 | /* 10.1.1.4 step hashgen 4.2 */ |
@@ -971,11 +994,11 @@ static int drbg_hash_hashgen(struct drbg_state *drbg, | |||
971 | len += outlen; | 994 | len += outlen; |
972 | /* 10.1.1.4 hashgen step 4.3 */ | 995 | /* 10.1.1.4 hashgen step 4.3 */ |
973 | if (len < buflen) | 996 | if (len < buflen) |
974 | drbg_add_buf(src, drbg_statelen(drbg), &prefix, 1); | 997 | crypto_inc(src, drbg_statelen(drbg)); |
975 | } | 998 | } |
976 | 999 | ||
977 | out: | 1000 | out: |
978 | memset(drbg->scratchpad, 0, | 1001 | memzero_explicit(drbg->scratchpad, |
979 | (drbg_statelen(drbg) + drbg_blocklen(drbg))); | 1002 | (drbg_statelen(drbg) + drbg_blocklen(drbg))); |
980 | return len; | 1003 | return len; |
981 | } | 1004 | } |
@@ -1024,7 +1047,7 @@ static int drbg_hash_generate(struct drbg_state *drbg, | |||
1024 | drbg_add_buf(drbg->V, drbg_statelen(drbg), u.req, 8); | 1047 | drbg_add_buf(drbg->V, drbg_statelen(drbg), u.req, 8); |
1025 | 1048 | ||
1026 | out: | 1049 | out: |
1027 | memset(drbg->scratchpad, 0, drbg_blocklen(drbg)); | 1050 | memzero_explicit(drbg->scratchpad, drbg_blocklen(drbg)); |
1028 | return len; | 1051 | return len; |
1029 | } | 1052 | } |
1030 | 1053 | ||
diff --git a/crypto/ecb.c b/crypto/ecb.c index 935cfef4aa84..12011aff0971 100644 --- a/crypto/ecb.c +++ b/crypto/ecb.c | |||
@@ -185,3 +185,4 @@ module_exit(crypto_ecb_module_exit); | |||
185 | 185 | ||
186 | MODULE_LICENSE("GPL"); | 186 | MODULE_LICENSE("GPL"); |
187 | MODULE_DESCRIPTION("ECB block cipher algorithm"); | 187 | MODULE_DESCRIPTION("ECB block cipher algorithm"); |
188 | MODULE_ALIAS_CRYPTO("ecb"); | ||
diff --git a/crypto/eseqiv.c b/crypto/eseqiv.c index bf7ab4a89493..f116fae766f8 100644 --- a/crypto/eseqiv.c +++ b/crypto/eseqiv.c | |||
@@ -267,3 +267,4 @@ module_exit(eseqiv_module_exit); | |||
267 | 267 | ||
268 | MODULE_LICENSE("GPL"); | 268 | MODULE_LICENSE("GPL"); |
269 | MODULE_DESCRIPTION("Encrypted Sequence Number IV Generator"); | 269 | MODULE_DESCRIPTION("Encrypted Sequence Number IV Generator"); |
270 | MODULE_ALIAS_CRYPTO("eseqiv"); | ||
diff --git a/crypto/fcrypt.c b/crypto/fcrypt.c index 021d7fec6bc8..77286ea28865 100644 --- a/crypto/fcrypt.c +++ b/crypto/fcrypt.c | |||
@@ -420,3 +420,4 @@ module_exit(fcrypt_mod_fini); | |||
420 | MODULE_LICENSE("Dual BSD/GPL"); | 420 | MODULE_LICENSE("Dual BSD/GPL"); |
421 | MODULE_DESCRIPTION("FCrypt Cipher Algorithm"); | 421 | MODULE_DESCRIPTION("FCrypt Cipher Algorithm"); |
422 | MODULE_AUTHOR("David Howells <dhowells@redhat.com>"); | 422 | MODULE_AUTHOR("David Howells <dhowells@redhat.com>"); |
423 | MODULE_ALIAS_CRYPTO("fcrypt"); | ||
diff --git a/crypto/gcm.c b/crypto/gcm.c index 276cdac567b6..2e403f6138c1 100644 --- a/crypto/gcm.c +++ b/crypto/gcm.c | |||
@@ -1441,6 +1441,7 @@ module_exit(crypto_gcm_module_exit); | |||
1441 | MODULE_LICENSE("GPL"); | 1441 | MODULE_LICENSE("GPL"); |
1442 | MODULE_DESCRIPTION("Galois/Counter Mode"); | 1442 | MODULE_DESCRIPTION("Galois/Counter Mode"); |
1443 | MODULE_AUTHOR("Mikko Herranen <mh1@iki.fi>"); | 1443 | MODULE_AUTHOR("Mikko Herranen <mh1@iki.fi>"); |
1444 | MODULE_ALIAS("gcm_base"); | 1444 | MODULE_ALIAS_CRYPTO("gcm_base"); |
1445 | MODULE_ALIAS("rfc4106"); | 1445 | MODULE_ALIAS_CRYPTO("rfc4106"); |
1446 | MODULE_ALIAS("rfc4543"); | 1446 | MODULE_ALIAS_CRYPTO("rfc4543"); |
1447 | MODULE_ALIAS_CRYPTO("gcm"); | ||
diff --git a/crypto/ghash-generic.c b/crypto/ghash-generic.c index 9d3f0c69a86f..4e97fae9666f 100644 --- a/crypto/ghash-generic.c +++ b/crypto/ghash-generic.c | |||
@@ -172,4 +172,4 @@ module_exit(ghash_mod_exit); | |||
172 | 172 | ||
173 | MODULE_LICENSE("GPL"); | 173 | MODULE_LICENSE("GPL"); |
174 | MODULE_DESCRIPTION("GHASH Message Digest Algorithm"); | 174 | MODULE_DESCRIPTION("GHASH Message Digest Algorithm"); |
175 | MODULE_ALIAS("ghash"); | 175 | MODULE_ALIAS_CRYPTO("ghash"); |
diff --git a/crypto/hmac.c b/crypto/hmac.c index e392219ddc61..72e38c098bb3 100644 --- a/crypto/hmac.c +++ b/crypto/hmac.c | |||
@@ -268,3 +268,4 @@ module_exit(hmac_module_exit); | |||
268 | 268 | ||
269 | MODULE_LICENSE("GPL"); | 269 | MODULE_LICENSE("GPL"); |
270 | MODULE_DESCRIPTION("HMAC hash algorithm"); | 270 | MODULE_DESCRIPTION("HMAC hash algorithm"); |
271 | MODULE_ALIAS_CRYPTO("hmac"); | ||
diff --git a/crypto/khazad.c b/crypto/khazad.c index 60e7cd66facc..873eb5ded6d7 100644 --- a/crypto/khazad.c +++ b/crypto/khazad.c | |||
@@ -880,3 +880,4 @@ module_exit(khazad_mod_fini); | |||
880 | 880 | ||
881 | MODULE_LICENSE("GPL"); | 881 | MODULE_LICENSE("GPL"); |
882 | MODULE_DESCRIPTION("Khazad Cryptographic Algorithm"); | 882 | MODULE_DESCRIPTION("Khazad Cryptographic Algorithm"); |
883 | MODULE_ALIAS_CRYPTO("khazad"); | ||
diff --git a/crypto/krng.c b/crypto/krng.c index a2d2b72fc135..67c88b331210 100644 --- a/crypto/krng.c +++ b/crypto/krng.c | |||
@@ -62,4 +62,4 @@ module_exit(krng_mod_fini); | |||
62 | 62 | ||
63 | MODULE_LICENSE("GPL"); | 63 | MODULE_LICENSE("GPL"); |
64 | MODULE_DESCRIPTION("Kernel Random Number Generator"); | 64 | MODULE_DESCRIPTION("Kernel Random Number Generator"); |
65 | MODULE_ALIAS("stdrng"); | 65 | MODULE_ALIAS_CRYPTO("stdrng"); |
diff --git a/crypto/lrw.c b/crypto/lrw.c index ba42acc4deba..6f9908a7ebcb 100644 --- a/crypto/lrw.c +++ b/crypto/lrw.c | |||
@@ -400,3 +400,4 @@ module_exit(crypto_module_exit); | |||
400 | 400 | ||
401 | MODULE_LICENSE("GPL"); | 401 | MODULE_LICENSE("GPL"); |
402 | MODULE_DESCRIPTION("LRW block cipher mode"); | 402 | MODULE_DESCRIPTION("LRW block cipher mode"); |
403 | MODULE_ALIAS_CRYPTO("lrw"); | ||
diff --git a/crypto/lz4.c b/crypto/lz4.c index 34d072b72a73..aefbceaf3104 100644 --- a/crypto/lz4.c +++ b/crypto/lz4.c | |||
@@ -104,3 +104,4 @@ module_exit(lz4_mod_fini); | |||
104 | 104 | ||
105 | MODULE_LICENSE("GPL"); | 105 | MODULE_LICENSE("GPL"); |
106 | MODULE_DESCRIPTION("LZ4 Compression Algorithm"); | 106 | MODULE_DESCRIPTION("LZ4 Compression Algorithm"); |
107 | MODULE_ALIAS_CRYPTO("lz4"); | ||
diff --git a/crypto/lz4hc.c b/crypto/lz4hc.c index 9218b3fed5e3..a1d3b5bd3d85 100644 --- a/crypto/lz4hc.c +++ b/crypto/lz4hc.c | |||
@@ -104,3 +104,4 @@ module_exit(lz4hc_mod_fini); | |||
104 | 104 | ||
105 | MODULE_LICENSE("GPL"); | 105 | MODULE_LICENSE("GPL"); |
106 | MODULE_DESCRIPTION("LZ4HC Compression Algorithm"); | 106 | MODULE_DESCRIPTION("LZ4HC Compression Algorithm"); |
107 | MODULE_ALIAS_CRYPTO("lz4hc"); | ||
diff --git a/crypto/lzo.c b/crypto/lzo.c index a8ff2f778dc4..4b3e92525dac 100644 --- a/crypto/lzo.c +++ b/crypto/lzo.c | |||
@@ -107,3 +107,4 @@ module_exit(lzo_mod_fini); | |||
107 | 107 | ||
108 | MODULE_LICENSE("GPL"); | 108 | MODULE_LICENSE("GPL"); |
109 | MODULE_DESCRIPTION("LZO Compression Algorithm"); | 109 | MODULE_DESCRIPTION("LZO Compression Algorithm"); |
110 | MODULE_ALIAS_CRYPTO("lzo"); | ||
diff --git a/crypto/mcryptd.c b/crypto/mcryptd.c index b39fbd530102..a8e870444ea9 100644 --- a/crypto/mcryptd.c +++ b/crypto/mcryptd.c | |||
@@ -703,3 +703,4 @@ module_exit(mcryptd_exit); | |||
703 | 703 | ||
704 | MODULE_LICENSE("GPL"); | 704 | MODULE_LICENSE("GPL"); |
705 | MODULE_DESCRIPTION("Software async multibuffer crypto daemon"); | 705 | MODULE_DESCRIPTION("Software async multibuffer crypto daemon"); |
706 | MODULE_ALIAS_CRYPTO("mcryptd"); | ||
diff --git a/crypto/md4.c b/crypto/md4.c index 0477a6a01d58..3515af425cc9 100644 --- a/crypto/md4.c +++ b/crypto/md4.c | |||
@@ -255,4 +255,4 @@ module_exit(md4_mod_fini); | |||
255 | 255 | ||
256 | MODULE_LICENSE("GPL"); | 256 | MODULE_LICENSE("GPL"); |
257 | MODULE_DESCRIPTION("MD4 Message Digest Algorithm"); | 257 | MODULE_DESCRIPTION("MD4 Message Digest Algorithm"); |
258 | 258 | MODULE_ALIAS_CRYPTO("md4"); | |
diff --git a/crypto/md5.c b/crypto/md5.c index 7febeaab923b..36f5e5b103f3 100644 --- a/crypto/md5.c +++ b/crypto/md5.c | |||
@@ -168,3 +168,4 @@ module_exit(md5_mod_fini); | |||
168 | 168 | ||
169 | MODULE_LICENSE("GPL"); | 169 | MODULE_LICENSE("GPL"); |
170 | MODULE_DESCRIPTION("MD5 Message Digest Algorithm"); | 170 | MODULE_DESCRIPTION("MD5 Message Digest Algorithm"); |
171 | MODULE_ALIAS_CRYPTO("md5"); | ||
diff --git a/crypto/michael_mic.c b/crypto/michael_mic.c index 079b761bc70d..46195e0d0f4d 100644 --- a/crypto/michael_mic.c +++ b/crypto/michael_mic.c | |||
@@ -184,3 +184,4 @@ module_exit(michael_mic_exit); | |||
184 | MODULE_LICENSE("GPL v2"); | 184 | MODULE_LICENSE("GPL v2"); |
185 | MODULE_DESCRIPTION("Michael MIC"); | 185 | MODULE_DESCRIPTION("Michael MIC"); |
186 | MODULE_AUTHOR("Jouni Malinen <j@w1.fi>"); | 186 | MODULE_AUTHOR("Jouni Malinen <j@w1.fi>"); |
187 | MODULE_ALIAS_CRYPTO("michael_mic"); | ||
diff --git a/crypto/pcbc.c b/crypto/pcbc.c index d1b8bdfb5855..f654965f0933 100644 --- a/crypto/pcbc.c +++ b/crypto/pcbc.c | |||
@@ -295,3 +295,4 @@ module_exit(crypto_pcbc_module_exit); | |||
295 | 295 | ||
296 | MODULE_LICENSE("GPL"); | 296 | MODULE_LICENSE("GPL"); |
297 | MODULE_DESCRIPTION("PCBC block cipher algorithm"); | 297 | MODULE_DESCRIPTION("PCBC block cipher algorithm"); |
298 | MODULE_ALIAS_CRYPTO("pcbc"); | ||
diff --git a/crypto/pcrypt.c b/crypto/pcrypt.c index 309d345ead95..c305d4112735 100644 --- a/crypto/pcrypt.c +++ b/crypto/pcrypt.c | |||
@@ -565,3 +565,4 @@ module_exit(pcrypt_exit); | |||
565 | MODULE_LICENSE("GPL"); | 565 | MODULE_LICENSE("GPL"); |
566 | MODULE_AUTHOR("Steffen Klassert <steffen.klassert@secunet.com>"); | 566 | MODULE_AUTHOR("Steffen Klassert <steffen.klassert@secunet.com>"); |
567 | MODULE_DESCRIPTION("Parallel crypto wrapper"); | 567 | MODULE_DESCRIPTION("Parallel crypto wrapper"); |
568 | MODULE_ALIAS_CRYPTO("pcrypt"); | ||
diff --git a/crypto/rmd128.c b/crypto/rmd128.c index 8a0f68b7f257..049486ede938 100644 --- a/crypto/rmd128.c +++ b/crypto/rmd128.c | |||
@@ -327,3 +327,4 @@ module_exit(rmd128_mod_fini); | |||
327 | MODULE_LICENSE("GPL"); | 327 | MODULE_LICENSE("GPL"); |
328 | MODULE_AUTHOR("Adrian-Ken Rueegsegger <ken@codelabs.ch>"); | 328 | MODULE_AUTHOR("Adrian-Ken Rueegsegger <ken@codelabs.ch>"); |
329 | MODULE_DESCRIPTION("RIPEMD-128 Message Digest"); | 329 | MODULE_DESCRIPTION("RIPEMD-128 Message Digest"); |
330 | MODULE_ALIAS_CRYPTO("rmd128"); | ||
diff --git a/crypto/rmd160.c b/crypto/rmd160.c index 525d7bb752cf..de585e51d455 100644 --- a/crypto/rmd160.c +++ b/crypto/rmd160.c | |||
@@ -371,3 +371,4 @@ module_exit(rmd160_mod_fini); | |||
371 | MODULE_LICENSE("GPL"); | 371 | MODULE_LICENSE("GPL"); |
372 | MODULE_AUTHOR("Adrian-Ken Rueegsegger <ken@codelabs.ch>"); | 372 | MODULE_AUTHOR("Adrian-Ken Rueegsegger <ken@codelabs.ch>"); |
373 | MODULE_DESCRIPTION("RIPEMD-160 Message Digest"); | 373 | MODULE_DESCRIPTION("RIPEMD-160 Message Digest"); |
374 | MODULE_ALIAS_CRYPTO("rmd160"); | ||
diff --git a/crypto/rmd256.c b/crypto/rmd256.c index 69293d9b56e0..4ec02a754e09 100644 --- a/crypto/rmd256.c +++ b/crypto/rmd256.c | |||
@@ -346,3 +346,4 @@ module_exit(rmd256_mod_fini); | |||
346 | MODULE_LICENSE("GPL"); | 346 | MODULE_LICENSE("GPL"); |
347 | MODULE_AUTHOR("Adrian-Ken Rueegsegger <ken@codelabs.ch>"); | 347 | MODULE_AUTHOR("Adrian-Ken Rueegsegger <ken@codelabs.ch>"); |
348 | MODULE_DESCRIPTION("RIPEMD-256 Message Digest"); | 348 | MODULE_DESCRIPTION("RIPEMD-256 Message Digest"); |
349 | MODULE_ALIAS_CRYPTO("rmd256"); | ||
diff --git a/crypto/rmd320.c b/crypto/rmd320.c index 09f97dfdfbba..770f2cb369f8 100644 --- a/crypto/rmd320.c +++ b/crypto/rmd320.c | |||
@@ -395,3 +395,4 @@ module_exit(rmd320_mod_fini); | |||
395 | MODULE_LICENSE("GPL"); | 395 | MODULE_LICENSE("GPL"); |
396 | MODULE_AUTHOR("Adrian-Ken Rueegsegger <ken@codelabs.ch>"); | 396 | MODULE_AUTHOR("Adrian-Ken Rueegsegger <ken@codelabs.ch>"); |
397 | MODULE_DESCRIPTION("RIPEMD-320 Message Digest"); | 397 | MODULE_DESCRIPTION("RIPEMD-320 Message Digest"); |
398 | MODULE_ALIAS_CRYPTO("rmd320"); | ||
diff --git a/crypto/salsa20_generic.c b/crypto/salsa20_generic.c index 9a4770c02284..3d0f9df30ac9 100644 --- a/crypto/salsa20_generic.c +++ b/crypto/salsa20_generic.c | |||
@@ -248,4 +248,4 @@ module_exit(salsa20_generic_mod_fini); | |||
248 | 248 | ||
249 | MODULE_LICENSE("GPL"); | 249 | MODULE_LICENSE("GPL"); |
250 | MODULE_DESCRIPTION ("Salsa20 stream cipher algorithm"); | 250 | MODULE_DESCRIPTION ("Salsa20 stream cipher algorithm"); |
251 | MODULE_ALIAS("salsa20"); | 251 | MODULE_ALIAS_CRYPTO("salsa20"); |
diff --git a/crypto/seed.c b/crypto/seed.c index 9c904d6d2151..c6ba8438be43 100644 --- a/crypto/seed.c +++ b/crypto/seed.c | |||
@@ -476,3 +476,4 @@ module_exit(seed_fini); | |||
476 | MODULE_DESCRIPTION("SEED Cipher Algorithm"); | 476 | MODULE_DESCRIPTION("SEED Cipher Algorithm"); |
477 | MODULE_LICENSE("GPL"); | 477 | MODULE_LICENSE("GPL"); |
478 | MODULE_AUTHOR("Hye-Shik Chang <perky@FreeBSD.org>, Kim Hyun <hkim@kisa.or.kr>"); | 478 | MODULE_AUTHOR("Hye-Shik Chang <perky@FreeBSD.org>, Kim Hyun <hkim@kisa.or.kr>"); |
479 | MODULE_ALIAS_CRYPTO("seed"); | ||
diff --git a/crypto/seqiv.c b/crypto/seqiv.c index ee190fcedcd2..9daa854cc485 100644 --- a/crypto/seqiv.c +++ b/crypto/seqiv.c | |||
@@ -362,3 +362,4 @@ module_exit(seqiv_module_exit); | |||
362 | 362 | ||
363 | MODULE_LICENSE("GPL"); | 363 | MODULE_LICENSE("GPL"); |
364 | MODULE_DESCRIPTION("Sequence Number IV Generator"); | 364 | MODULE_DESCRIPTION("Sequence Number IV Generator"); |
365 | MODULE_ALIAS_CRYPTO("seqiv"); | ||
diff --git a/crypto/serpent_generic.c b/crypto/serpent_generic.c index 7ddbd7e88859..a53b5e2af335 100644 --- a/crypto/serpent_generic.c +++ b/crypto/serpent_generic.c | |||
@@ -665,5 +665,5 @@ module_exit(serpent_mod_fini); | |||
665 | MODULE_LICENSE("GPL"); | 665 | MODULE_LICENSE("GPL"); |
666 | MODULE_DESCRIPTION("Serpent and tnepres (kerneli compatible serpent reversed) Cipher Algorithm"); | 666 | MODULE_DESCRIPTION("Serpent and tnepres (kerneli compatible serpent reversed) Cipher Algorithm"); |
667 | MODULE_AUTHOR("Dag Arne Osvik <osvik@ii.uib.no>"); | 667 | MODULE_AUTHOR("Dag Arne Osvik <osvik@ii.uib.no>"); |
668 | MODULE_ALIAS("tnepres"); | 668 | MODULE_ALIAS_CRYPTO("tnepres"); |
669 | MODULE_ALIAS("serpent"); | 669 | MODULE_ALIAS_CRYPTO("serpent"); |
diff --git a/crypto/sha1_generic.c b/crypto/sha1_generic.c index 7bb047432782..039e58cfa155 100644 --- a/crypto/sha1_generic.c +++ b/crypto/sha1_generic.c | |||
@@ -153,4 +153,4 @@ module_exit(sha1_generic_mod_fini); | |||
153 | MODULE_LICENSE("GPL"); | 153 | MODULE_LICENSE("GPL"); |
154 | MODULE_DESCRIPTION("SHA1 Secure Hash Algorithm"); | 154 | MODULE_DESCRIPTION("SHA1 Secure Hash Algorithm"); |
155 | 155 | ||
156 | MODULE_ALIAS("sha1"); | 156 | MODULE_ALIAS_CRYPTO("sha1"); |
diff --git a/crypto/sha256_generic.c b/crypto/sha256_generic.c index 65e7b76b057f..5eb21b120033 100644 --- a/crypto/sha256_generic.c +++ b/crypto/sha256_generic.c | |||
@@ -384,5 +384,5 @@ module_exit(sha256_generic_mod_fini); | |||
384 | MODULE_LICENSE("GPL"); | 384 | MODULE_LICENSE("GPL"); |
385 | MODULE_DESCRIPTION("SHA-224 and SHA-256 Secure Hash Algorithm"); | 385 | MODULE_DESCRIPTION("SHA-224 and SHA-256 Secure Hash Algorithm"); |
386 | 386 | ||
387 | MODULE_ALIAS("sha224"); | 387 | MODULE_ALIAS_CRYPTO("sha224"); |
388 | MODULE_ALIAS("sha256"); | 388 | MODULE_ALIAS_CRYPTO("sha256"); |
diff --git a/crypto/sha512_generic.c b/crypto/sha512_generic.c index 95db67197cd9..8d0b19ed4f4b 100644 --- a/crypto/sha512_generic.c +++ b/crypto/sha512_generic.c | |||
@@ -288,5 +288,5 @@ module_exit(sha512_generic_mod_fini); | |||
288 | MODULE_LICENSE("GPL"); | 288 | MODULE_LICENSE("GPL"); |
289 | MODULE_DESCRIPTION("SHA-512 and SHA-384 Secure Hash Algorithms"); | 289 | MODULE_DESCRIPTION("SHA-512 and SHA-384 Secure Hash Algorithms"); |
290 | 290 | ||
291 | MODULE_ALIAS("sha384"); | 291 | MODULE_ALIAS_CRYPTO("sha384"); |
292 | MODULE_ALIAS("sha512"); | 292 | MODULE_ALIAS_CRYPTO("sha512"); |
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index 890449e6e7ef..1d864e988ea9 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c | |||
@@ -1225,15 +1225,22 @@ static inline int tcrypt_test(const char *alg) | |||
1225 | return ret; | 1225 | return ret; |
1226 | } | 1226 | } |
1227 | 1227 | ||
1228 | static int do_test(int m) | 1228 | static int do_test(const char *alg, u32 type, u32 mask, int m) |
1229 | { | 1229 | { |
1230 | int i; | 1230 | int i; |
1231 | int ret = 0; | 1231 | int ret = 0; |
1232 | 1232 | ||
1233 | switch (m) { | 1233 | switch (m) { |
1234 | case 0: | 1234 | case 0: |
1235 | if (alg) { | ||
1236 | if (!crypto_has_alg(alg, type, | ||
1237 | mask ?: CRYPTO_ALG_TYPE_MASK)) | ||
1238 | ret = -ENOENT; | ||
1239 | break; | ||
1240 | } | ||
1241 | |||
1235 | for (i = 1; i < 200; i++) | 1242 | for (i = 1; i < 200; i++) |
1236 | ret += do_test(i); | 1243 | ret += do_test(NULL, 0, 0, i); |
1237 | break; | 1244 | break; |
1238 | 1245 | ||
1239 | case 1: | 1246 | case 1: |
@@ -1752,6 +1759,11 @@ static int do_test(int m) | |||
1752 | break; | 1759 | break; |
1753 | 1760 | ||
1754 | case 300: | 1761 | case 300: |
1762 | if (alg) { | ||
1763 | test_hash_speed(alg, sec, generic_hash_speed_template); | ||
1764 | break; | ||
1765 | } | ||
1766 | |||
1755 | /* fall through */ | 1767 | /* fall through */ |
1756 | 1768 | ||
1757 | case 301: | 1769 | case 301: |
@@ -1838,6 +1850,11 @@ static int do_test(int m) | |||
1838 | break; | 1850 | break; |
1839 | 1851 | ||
1840 | case 400: | 1852 | case 400: |
1853 | if (alg) { | ||
1854 | test_ahash_speed(alg, sec, generic_hash_speed_template); | ||
1855 | break; | ||
1856 | } | ||
1857 | |||
1841 | /* fall through */ | 1858 | /* fall through */ |
1842 | 1859 | ||
1843 | case 401: | 1860 | case 401: |
@@ -2127,12 +2144,6 @@ static int do_test(int m) | |||
2127 | return ret; | 2144 | return ret; |
2128 | } | 2145 | } |
2129 | 2146 | ||
2130 | static int do_alg_test(const char *alg, u32 type, u32 mask) | ||
2131 | { | ||
2132 | return crypto_has_alg(alg, type, mask ?: CRYPTO_ALG_TYPE_MASK) ? | ||
2133 | 0 : -ENOENT; | ||
2134 | } | ||
2135 | |||
2136 | static int __init tcrypt_mod_init(void) | 2147 | static int __init tcrypt_mod_init(void) |
2137 | { | 2148 | { |
2138 | int err = -ENOMEM; | 2149 | int err = -ENOMEM; |
@@ -2144,10 +2155,7 @@ static int __init tcrypt_mod_init(void) | |||
2144 | goto err_free_tv; | 2155 | goto err_free_tv; |
2145 | } | 2156 | } |
2146 | 2157 | ||
2147 | if (alg) | 2158 | err = do_test(alg, type, mask, mode); |
2148 | err = do_alg_test(alg, type, mask); | ||
2149 | else | ||
2150 | err = do_test(mode); | ||
2151 | 2159 | ||
2152 | if (err) { | 2160 | if (err) { |
2153 | printk(KERN_ERR "tcrypt: one or more tests failed!\n"); | 2161 | printk(KERN_ERR "tcrypt: one or more tests failed!\n"); |
diff --git a/crypto/tea.c b/crypto/tea.c index 0a572323ee4a..495be2d0077d 100644 --- a/crypto/tea.c +++ b/crypto/tea.c | |||
@@ -270,8 +270,8 @@ static void __exit tea_mod_fini(void) | |||
270 | crypto_unregister_algs(tea_algs, ARRAY_SIZE(tea_algs)); | 270 | crypto_unregister_algs(tea_algs, ARRAY_SIZE(tea_algs)); |
271 | } | 271 | } |
272 | 272 | ||
273 | MODULE_ALIAS("xtea"); | 273 | MODULE_ALIAS_CRYPTO("xtea"); |
274 | MODULE_ALIAS("xeta"); | 274 | MODULE_ALIAS_CRYPTO("xeta"); |
275 | 275 | ||
276 | module_init(tea_mod_init); | 276 | module_init(tea_mod_init); |
277 | module_exit(tea_mod_fini); | 277 | module_exit(tea_mod_fini); |
diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 29a0cbdd0d19..037368d34586 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c | |||
@@ -3708,8 +3708,7 @@ test_done: | |||
3708 | panic("%s: %s alg self test failed in fips mode!\n", driver, alg); | 3708 | panic("%s: %s alg self test failed in fips mode!\n", driver, alg); |
3709 | 3709 | ||
3710 | if (fips_enabled && !rc) | 3710 | if (fips_enabled && !rc) |
3711 | pr_info(KERN_INFO "alg: self-tests for %s (%s) passed\n", | 3711 | pr_info("alg: self-tests for %s (%s) passed\n", driver, alg); |
3712 | driver, alg); | ||
3713 | 3712 | ||
3714 | return rc; | 3713 | return rc; |
3715 | 3714 | ||
diff --git a/crypto/tgr192.c b/crypto/tgr192.c index 3c7af0d1ff7a..6e5651c66cf8 100644 --- a/crypto/tgr192.c +++ b/crypto/tgr192.c | |||
@@ -676,8 +676,8 @@ static void __exit tgr192_mod_fini(void) | |||
676 | crypto_unregister_shashes(tgr_algs, ARRAY_SIZE(tgr_algs)); | 676 | crypto_unregister_shashes(tgr_algs, ARRAY_SIZE(tgr_algs)); |
677 | } | 677 | } |
678 | 678 | ||
679 | MODULE_ALIAS("tgr160"); | 679 | MODULE_ALIAS_CRYPTO("tgr160"); |
680 | MODULE_ALIAS("tgr128"); | 680 | MODULE_ALIAS_CRYPTO("tgr128"); |
681 | 681 | ||
682 | module_init(tgr192_mod_init); | 682 | module_init(tgr192_mod_init); |
683 | module_exit(tgr192_mod_fini); | 683 | module_exit(tgr192_mod_fini); |
diff --git a/crypto/twofish_generic.c b/crypto/twofish_generic.c index 2d5000552d0f..523ad8c4e359 100644 --- a/crypto/twofish_generic.c +++ b/crypto/twofish_generic.c | |||
@@ -211,4 +211,4 @@ module_exit(twofish_mod_fini); | |||
211 | 211 | ||
212 | MODULE_LICENSE("GPL"); | 212 | MODULE_LICENSE("GPL"); |
213 | MODULE_DESCRIPTION ("Twofish Cipher Algorithm"); | 213 | MODULE_DESCRIPTION ("Twofish Cipher Algorithm"); |
214 | MODULE_ALIAS("twofish"); | 214 | MODULE_ALIAS_CRYPTO("twofish"); |
diff --git a/crypto/vmac.c b/crypto/vmac.c index d84c24bd7ff7..df76a816cfb2 100644 --- a/crypto/vmac.c +++ b/crypto/vmac.c | |||
@@ -713,3 +713,4 @@ module_exit(vmac_module_exit); | |||
713 | 713 | ||
714 | MODULE_LICENSE("GPL"); | 714 | MODULE_LICENSE("GPL"); |
715 | MODULE_DESCRIPTION("VMAC hash algorithm"); | 715 | MODULE_DESCRIPTION("VMAC hash algorithm"); |
716 | MODULE_ALIAS_CRYPTO("vmac"); | ||
diff --git a/crypto/wp512.c b/crypto/wp512.c index ec64e7762fbb..0de42eb3d040 100644 --- a/crypto/wp512.c +++ b/crypto/wp512.c | |||
@@ -1167,8 +1167,8 @@ static void __exit wp512_mod_fini(void) | |||
1167 | crypto_unregister_shashes(wp_algs, ARRAY_SIZE(wp_algs)); | 1167 | crypto_unregister_shashes(wp_algs, ARRAY_SIZE(wp_algs)); |
1168 | } | 1168 | } |
1169 | 1169 | ||
1170 | MODULE_ALIAS("wp384"); | 1170 | MODULE_ALIAS_CRYPTO("wp384"); |
1171 | MODULE_ALIAS("wp256"); | 1171 | MODULE_ALIAS_CRYPTO("wp256"); |
1172 | 1172 | ||
1173 | module_init(wp512_mod_init); | 1173 | module_init(wp512_mod_init); |
1174 | module_exit(wp512_mod_fini); | 1174 | module_exit(wp512_mod_fini); |
diff --git a/crypto/xcbc.c b/crypto/xcbc.c index a5fbdf3738cf..df90b332554c 100644 --- a/crypto/xcbc.c +++ b/crypto/xcbc.c | |||
@@ -286,3 +286,4 @@ module_exit(crypto_xcbc_module_exit); | |||
286 | 286 | ||
287 | MODULE_LICENSE("GPL"); | 287 | MODULE_LICENSE("GPL"); |
288 | MODULE_DESCRIPTION("XCBC keyed hash algorithm"); | 288 | MODULE_DESCRIPTION("XCBC keyed hash algorithm"); |
289 | MODULE_ALIAS_CRYPTO("xcbc"); | ||
diff --git a/crypto/xts.c b/crypto/xts.c index ca1608f44cb5..f6fd43f100c8 100644 --- a/crypto/xts.c +++ b/crypto/xts.c | |||
@@ -362,3 +362,4 @@ module_exit(crypto_module_exit); | |||
362 | 362 | ||
363 | MODULE_LICENSE("GPL"); | 363 | MODULE_LICENSE("GPL"); |
364 | MODULE_DESCRIPTION("XTS block cipher mode"); | 364 | MODULE_DESCRIPTION("XTS block cipher mode"); |
365 | MODULE_ALIAS_CRYPTO("xts"); | ||
diff --git a/crypto/zlib.c b/crypto/zlib.c index c9ee681d57fd..0eefa9d237ac 100644 --- a/crypto/zlib.c +++ b/crypto/zlib.c | |||
@@ -378,3 +378,4 @@ module_exit(zlib_mod_fini); | |||
378 | MODULE_LICENSE("GPL"); | 378 | MODULE_LICENSE("GPL"); |
379 | MODULE_DESCRIPTION("Zlib Compression Algorithm"); | 379 | MODULE_DESCRIPTION("Zlib Compression Algorithm"); |
380 | MODULE_AUTHOR("Sony Corporation"); | 380 | MODULE_AUTHOR("Sony Corporation"); |
381 | MODULE_ALIAS_CRYPTO("zlib"); | ||