summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crypto/algif_aead.c12
-rw-r--r--crypto/authenc.c8
-rw-r--r--crypto/authencesn.c8
-rw-r--r--crypto/crypto_null.c11
-rw-r--r--crypto/echainiv.c4
-rw-r--r--crypto/gcm.c8
-rw-r--r--crypto/seqiv.c4
-rw-r--r--include/crypto/internal/geniv.h2
-rw-r--r--include/crypto/null.h2
9 files changed, 29 insertions, 30 deletions
diff --git a/crypto/algif_aead.c b/crypto/algif_aead.c
index c40a8c7ee8ae..eb100a04ce9f 100644
--- a/crypto/algif_aead.c
+++ b/crypto/algif_aead.c
@@ -42,7 +42,7 @@
42 42
43struct aead_tfm { 43struct aead_tfm {
44 struct crypto_aead *aead; 44 struct crypto_aead *aead;
45 struct crypto_skcipher *null_tfm; 45 struct crypto_sync_skcipher *null_tfm;
46}; 46};
47 47
48static inline bool aead_sufficient_data(struct sock *sk) 48static inline bool aead_sufficient_data(struct sock *sk)
@@ -75,13 +75,13 @@ static int aead_sendmsg(struct socket *sock, struct msghdr *msg, size_t size)
75 return af_alg_sendmsg(sock, msg, size, ivsize); 75 return af_alg_sendmsg(sock, msg, size, ivsize);
76} 76}
77 77
78static int crypto_aead_copy_sgl(struct crypto_skcipher *null_tfm, 78static int crypto_aead_copy_sgl(struct crypto_sync_skcipher *null_tfm,
79 struct scatterlist *src, 79 struct scatterlist *src,
80 struct scatterlist *dst, unsigned int len) 80 struct scatterlist *dst, unsigned int len)
81{ 81{
82 SKCIPHER_REQUEST_ON_STACK(skreq, null_tfm); 82 SYNC_SKCIPHER_REQUEST_ON_STACK(skreq, null_tfm);
83 83
84 skcipher_request_set_tfm(skreq, null_tfm); 84 skcipher_request_set_sync_tfm(skreq, null_tfm);
85 skcipher_request_set_callback(skreq, CRYPTO_TFM_REQ_MAY_BACKLOG, 85 skcipher_request_set_callback(skreq, CRYPTO_TFM_REQ_MAY_BACKLOG,
86 NULL, NULL); 86 NULL, NULL);
87 skcipher_request_set_crypt(skreq, src, dst, len, NULL); 87 skcipher_request_set_crypt(skreq, src, dst, len, NULL);
@@ -99,7 +99,7 @@ static int _aead_recvmsg(struct socket *sock, struct msghdr *msg,
99 struct af_alg_ctx *ctx = ask->private; 99 struct af_alg_ctx *ctx = ask->private;
100 struct aead_tfm *aeadc = pask->private; 100 struct aead_tfm *aeadc = pask->private;
101 struct crypto_aead *tfm = aeadc->aead; 101 struct crypto_aead *tfm = aeadc->aead;
102 struct crypto_skcipher *null_tfm = aeadc->null_tfm; 102 struct crypto_sync_skcipher *null_tfm = aeadc->null_tfm;
103 unsigned int i, as = crypto_aead_authsize(tfm); 103 unsigned int i, as = crypto_aead_authsize(tfm);
104 struct af_alg_async_req *areq; 104 struct af_alg_async_req *areq;
105 struct af_alg_tsgl *tsgl, *tmp; 105 struct af_alg_tsgl *tsgl, *tmp;
@@ -478,7 +478,7 @@ static void *aead_bind(const char *name, u32 type, u32 mask)
478{ 478{
479 struct aead_tfm *tfm; 479 struct aead_tfm *tfm;
480 struct crypto_aead *aead; 480 struct crypto_aead *aead;
481 struct crypto_skcipher *null_tfm; 481 struct crypto_sync_skcipher *null_tfm;
482 482
483 tfm = kzalloc(sizeof(*tfm), GFP_KERNEL); 483 tfm = kzalloc(sizeof(*tfm), GFP_KERNEL);
484 if (!tfm) 484 if (!tfm)
diff --git a/crypto/authenc.c b/crypto/authenc.c
index 4fa8d40d947b..37f54d1b2f66 100644
--- a/crypto/authenc.c
+++ b/crypto/authenc.c
@@ -33,7 +33,7 @@ struct authenc_instance_ctx {
33struct crypto_authenc_ctx { 33struct crypto_authenc_ctx {
34 struct crypto_ahash *auth; 34 struct crypto_ahash *auth;
35 struct crypto_skcipher *enc; 35 struct crypto_skcipher *enc;
36 struct crypto_skcipher *null; 36 struct crypto_sync_skcipher *null;
37}; 37};
38 38
39struct authenc_request_ctx { 39struct authenc_request_ctx {
@@ -185,9 +185,9 @@ static int crypto_authenc_copy_assoc(struct aead_request *req)
185{ 185{
186 struct crypto_aead *authenc = crypto_aead_reqtfm(req); 186 struct crypto_aead *authenc = crypto_aead_reqtfm(req);
187 struct crypto_authenc_ctx *ctx = crypto_aead_ctx(authenc); 187 struct crypto_authenc_ctx *ctx = crypto_aead_ctx(authenc);
188 SKCIPHER_REQUEST_ON_STACK(skreq, ctx->null); 188 SYNC_SKCIPHER_REQUEST_ON_STACK(skreq, ctx->null);
189 189
190 skcipher_request_set_tfm(skreq, ctx->null); 190 skcipher_request_set_sync_tfm(skreq, ctx->null);
191 skcipher_request_set_callback(skreq, aead_request_flags(req), 191 skcipher_request_set_callback(skreq, aead_request_flags(req),
192 NULL, NULL); 192 NULL, NULL);
193 skcipher_request_set_crypt(skreq, req->src, req->dst, req->assoclen, 193 skcipher_request_set_crypt(skreq, req->src, req->dst, req->assoclen,
@@ -318,7 +318,7 @@ static int crypto_authenc_init_tfm(struct crypto_aead *tfm)
318 struct crypto_authenc_ctx *ctx = crypto_aead_ctx(tfm); 318 struct crypto_authenc_ctx *ctx = crypto_aead_ctx(tfm);
319 struct crypto_ahash *auth; 319 struct crypto_ahash *auth;
320 struct crypto_skcipher *enc; 320 struct crypto_skcipher *enc;
321 struct crypto_skcipher *null; 321 struct crypto_sync_skcipher *null;
322 int err; 322 int err;
323 323
324 auth = crypto_spawn_ahash(&ictx->auth); 324 auth = crypto_spawn_ahash(&ictx->auth);
diff --git a/crypto/authencesn.c b/crypto/authencesn.c
index 50b804747e20..80a25cc04aec 100644
--- a/crypto/authencesn.c
+++ b/crypto/authencesn.c
@@ -36,7 +36,7 @@ struct crypto_authenc_esn_ctx {
36 unsigned int reqoff; 36 unsigned int reqoff;
37 struct crypto_ahash *auth; 37 struct crypto_ahash *auth;
38 struct crypto_skcipher *enc; 38 struct crypto_skcipher *enc;
39 struct crypto_skcipher *null; 39 struct crypto_sync_skcipher *null;
40}; 40};
41 41
42struct authenc_esn_request_ctx { 42struct authenc_esn_request_ctx {
@@ -183,9 +183,9 @@ static int crypto_authenc_esn_copy(struct aead_request *req, unsigned int len)
183{ 183{
184 struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req); 184 struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req);
185 struct crypto_authenc_esn_ctx *ctx = crypto_aead_ctx(authenc_esn); 185 struct crypto_authenc_esn_ctx *ctx = crypto_aead_ctx(authenc_esn);
186 SKCIPHER_REQUEST_ON_STACK(skreq, ctx->null); 186 SYNC_SKCIPHER_REQUEST_ON_STACK(skreq, ctx->null);
187 187
188 skcipher_request_set_tfm(skreq, ctx->null); 188 skcipher_request_set_sync_tfm(skreq, ctx->null);
189 skcipher_request_set_callback(skreq, aead_request_flags(req), 189 skcipher_request_set_callback(skreq, aead_request_flags(req),
190 NULL, NULL); 190 NULL, NULL);
191 skcipher_request_set_crypt(skreq, req->src, req->dst, len, NULL); 191 skcipher_request_set_crypt(skreq, req->src, req->dst, len, NULL);
@@ -341,7 +341,7 @@ static int crypto_authenc_esn_init_tfm(struct crypto_aead *tfm)
341 struct crypto_authenc_esn_ctx *ctx = crypto_aead_ctx(tfm); 341 struct crypto_authenc_esn_ctx *ctx = crypto_aead_ctx(tfm);
342 struct crypto_ahash *auth; 342 struct crypto_ahash *auth;
343 struct crypto_skcipher *enc; 343 struct crypto_skcipher *enc;
344 struct crypto_skcipher *null; 344 struct crypto_sync_skcipher *null;
345 int err; 345 int err;
346 346
347 auth = crypto_spawn_ahash(&ictx->auth); 347 auth = crypto_spawn_ahash(&ictx->auth);
diff --git a/crypto/crypto_null.c b/crypto/crypto_null.c
index 0959b268966c..0bae59922a80 100644
--- a/crypto/crypto_null.c
+++ b/crypto/crypto_null.c
@@ -26,7 +26,7 @@
26#include <linux/string.h> 26#include <linux/string.h>
27 27
28static DEFINE_MUTEX(crypto_default_null_skcipher_lock); 28static DEFINE_MUTEX(crypto_default_null_skcipher_lock);
29static struct crypto_skcipher *crypto_default_null_skcipher; 29static struct crypto_sync_skcipher *crypto_default_null_skcipher;
30static int crypto_default_null_skcipher_refcnt; 30static int crypto_default_null_skcipher_refcnt;
31 31
32static int null_compress(struct crypto_tfm *tfm, const u8 *src, 32static int null_compress(struct crypto_tfm *tfm, const u8 *src,
@@ -152,16 +152,15 @@ MODULE_ALIAS_CRYPTO("compress_null");
152MODULE_ALIAS_CRYPTO("digest_null"); 152MODULE_ALIAS_CRYPTO("digest_null");
153MODULE_ALIAS_CRYPTO("cipher_null"); 153MODULE_ALIAS_CRYPTO("cipher_null");
154 154
155struct crypto_skcipher *crypto_get_default_null_skcipher(void) 155struct crypto_sync_skcipher *crypto_get_default_null_skcipher(void)
156{ 156{
157 struct crypto_skcipher *tfm; 157 struct crypto_sync_skcipher *tfm;
158 158
159 mutex_lock(&crypto_default_null_skcipher_lock); 159 mutex_lock(&crypto_default_null_skcipher_lock);
160 tfm = crypto_default_null_skcipher; 160 tfm = crypto_default_null_skcipher;
161 161
162 if (!tfm) { 162 if (!tfm) {
163 tfm = crypto_alloc_skcipher("ecb(cipher_null)", 163 tfm = crypto_alloc_sync_skcipher("ecb(cipher_null)", 0, 0);
164 0, CRYPTO_ALG_ASYNC);
165 if (IS_ERR(tfm)) 164 if (IS_ERR(tfm))
166 goto unlock; 165 goto unlock;
167 166
@@ -181,7 +180,7 @@ void crypto_put_default_null_skcipher(void)
181{ 180{
182 mutex_lock(&crypto_default_null_skcipher_lock); 181 mutex_lock(&crypto_default_null_skcipher_lock);
183 if (!--crypto_default_null_skcipher_refcnt) { 182 if (!--crypto_default_null_skcipher_refcnt) {
184 crypto_free_skcipher(crypto_default_null_skcipher); 183 crypto_free_sync_skcipher(crypto_default_null_skcipher);
185 crypto_default_null_skcipher = NULL; 184 crypto_default_null_skcipher = NULL;
186 } 185 }
187 mutex_unlock(&crypto_default_null_skcipher_lock); 186 mutex_unlock(&crypto_default_null_skcipher_lock);
diff --git a/crypto/echainiv.c b/crypto/echainiv.c
index 45819e6015bf..77e607fdbfb7 100644
--- a/crypto/echainiv.c
+++ b/crypto/echainiv.c
@@ -47,9 +47,9 @@ static int echainiv_encrypt(struct aead_request *req)
47 info = req->iv; 47 info = req->iv;
48 48
49 if (req->src != req->dst) { 49 if (req->src != req->dst) {
50 SKCIPHER_REQUEST_ON_STACK(nreq, ctx->sknull); 50 SYNC_SKCIPHER_REQUEST_ON_STACK(nreq, ctx->sknull);
51 51
52 skcipher_request_set_tfm(nreq, ctx->sknull); 52 skcipher_request_set_sync_tfm(nreq, ctx->sknull);
53 skcipher_request_set_callback(nreq, req->base.flags, 53 skcipher_request_set_callback(nreq, req->base.flags,
54 NULL, NULL); 54 NULL, NULL);
55 skcipher_request_set_crypt(nreq, req->src, req->dst, 55 skcipher_request_set_crypt(nreq, req->src, req->dst,
diff --git a/crypto/gcm.c b/crypto/gcm.c
index 0ad879e1f9b2..e438492db2ca 100644
--- a/crypto/gcm.c
+++ b/crypto/gcm.c
@@ -50,7 +50,7 @@ struct crypto_rfc4543_instance_ctx {
50 50
51struct crypto_rfc4543_ctx { 51struct crypto_rfc4543_ctx {
52 struct crypto_aead *child; 52 struct crypto_aead *child;
53 struct crypto_skcipher *null; 53 struct crypto_sync_skcipher *null;
54 u8 nonce[4]; 54 u8 nonce[4];
55}; 55};
56 56
@@ -1067,9 +1067,9 @@ static int crypto_rfc4543_copy_src_to_dst(struct aead_request *req, bool enc)
1067 unsigned int authsize = crypto_aead_authsize(aead); 1067 unsigned int authsize = crypto_aead_authsize(aead);
1068 unsigned int nbytes = req->assoclen + req->cryptlen - 1068 unsigned int nbytes = req->assoclen + req->cryptlen -
1069 (enc ? 0 : authsize); 1069 (enc ? 0 : authsize);
1070 SKCIPHER_REQUEST_ON_STACK(nreq, ctx->null); 1070 SYNC_SKCIPHER_REQUEST_ON_STACK(nreq, ctx->null);
1071 1071
1072 skcipher_request_set_tfm(nreq, ctx->null); 1072 skcipher_request_set_sync_tfm(nreq, ctx->null);
1073 skcipher_request_set_callback(nreq, req->base.flags, NULL, NULL); 1073 skcipher_request_set_callback(nreq, req->base.flags, NULL, NULL);
1074 skcipher_request_set_crypt(nreq, req->src, req->dst, nbytes, NULL); 1074 skcipher_request_set_crypt(nreq, req->src, req->dst, nbytes, NULL);
1075 1075
@@ -1093,7 +1093,7 @@ static int crypto_rfc4543_init_tfm(struct crypto_aead *tfm)
1093 struct crypto_aead_spawn *spawn = &ictx->aead; 1093 struct crypto_aead_spawn *spawn = &ictx->aead;
1094 struct crypto_rfc4543_ctx *ctx = crypto_aead_ctx(tfm); 1094 struct crypto_rfc4543_ctx *ctx = crypto_aead_ctx(tfm);
1095 struct crypto_aead *aead; 1095 struct crypto_aead *aead;
1096 struct crypto_skcipher *null; 1096 struct crypto_sync_skcipher *null;
1097 unsigned long align; 1097 unsigned long align;
1098 int err = 0; 1098 int err = 0;
1099 1099
diff --git a/crypto/seqiv.c b/crypto/seqiv.c
index 39dbf2f7e5f5..64a412be255e 100644
--- a/crypto/seqiv.c
+++ b/crypto/seqiv.c
@@ -73,9 +73,9 @@ static int seqiv_aead_encrypt(struct aead_request *req)
73 info = req->iv; 73 info = req->iv;
74 74
75 if (req->src != req->dst) { 75 if (req->src != req->dst) {
76 SKCIPHER_REQUEST_ON_STACK(nreq, ctx->sknull); 76 SYNC_SKCIPHER_REQUEST_ON_STACK(nreq, ctx->sknull);
77 77
78 skcipher_request_set_tfm(nreq, ctx->sknull); 78 skcipher_request_set_sync_tfm(nreq, ctx->sknull);
79 skcipher_request_set_callback(nreq, req->base.flags, 79 skcipher_request_set_callback(nreq, req->base.flags,
80 NULL, NULL); 80 NULL, NULL);
81 skcipher_request_set_crypt(nreq, req->src, req->dst, 81 skcipher_request_set_crypt(nreq, req->src, req->dst,
diff --git a/include/crypto/internal/geniv.h b/include/crypto/internal/geniv.h
index 2bcfb931bc5b..71be24cd59bd 100644
--- a/include/crypto/internal/geniv.h
+++ b/include/crypto/internal/geniv.h
@@ -20,7 +20,7 @@
20struct aead_geniv_ctx { 20struct aead_geniv_ctx {
21 spinlock_t lock; 21 spinlock_t lock;
22 struct crypto_aead *child; 22 struct crypto_aead *child;
23 struct crypto_skcipher *sknull; 23 struct crypto_sync_skcipher *sknull;
24 u8 salt[] __attribute__ ((aligned(__alignof__(u32)))); 24 u8 salt[] __attribute__ ((aligned(__alignof__(u32))));
25}; 25};
26 26
diff --git a/include/crypto/null.h b/include/crypto/null.h
index 15aeef6e30ef..0ef577cc00e3 100644
--- a/include/crypto/null.h
+++ b/include/crypto/null.h
@@ -9,7 +9,7 @@
9#define NULL_DIGEST_SIZE 0 9#define NULL_DIGEST_SIZE 0
10#define NULL_IV_SIZE 0 10#define NULL_IV_SIZE 0
11 11
12struct crypto_skcipher *crypto_get_default_null_skcipher(void); 12struct crypto_sync_skcipher *crypto_get_default_null_skcipher(void);
13void crypto_put_default_null_skcipher(void); 13void crypto_put_default_null_skcipher(void);
14 14
15#endif 15#endif