diff options
| author | Herbert Xu <herbert@gondor.apana.org.au> | 2016-07-12 01:17:43 -0400 |
|---|---|---|
| committer | Herbert Xu <herbert@gondor.apana.org.au> | 2016-07-18 05:35:42 -0400 |
| commit | 0e8bff47f6d3e863bf1829e020000c249c59ecd2 (patch) | |
| tree | 342ac414f0c79813ab4c846410b0ea0ebeb7bf3d | |
| parent | ca0494c093371b1ca3cd4c8e14e1e7a19e6e21b6 (diff) | |
crypto: echainiv - Use skcipher
This patch replaces use of the obsolete blkcipher with skcipher.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
| -rw-r--r-- | crypto/echainiv.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/crypto/echainiv.c b/crypto/echainiv.c index b96a84560b67..1b01fe98e91f 100644 --- a/crypto/echainiv.c +++ b/crypto/echainiv.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | 20 | ||
| 21 | #include <crypto/internal/geniv.h> | 21 | #include <crypto/internal/geniv.h> |
| 22 | #include <crypto/scatterwalk.h> | 22 | #include <crypto/scatterwalk.h> |
| 23 | #include <crypto/skcipher.h> | ||
| 23 | #include <linux/err.h> | 24 | #include <linux/err.h> |
| 24 | #include <linux/init.h> | 25 | #include <linux/init.h> |
| 25 | #include <linux/kernel.h> | 26 | #include <linux/kernel.h> |
| @@ -112,13 +113,16 @@ static int echainiv_encrypt(struct aead_request *req) | |||
| 112 | info = req->iv; | 113 | info = req->iv; |
| 113 | 114 | ||
| 114 | if (req->src != req->dst) { | 115 | if (req->src != req->dst) { |
| 115 | struct blkcipher_desc desc = { | 116 | SKCIPHER_REQUEST_ON_STACK(nreq, ctx->sknull); |
| 116 | .tfm = ctx->null, | ||
| 117 | }; | ||
| 118 | 117 | ||
| 119 | err = crypto_blkcipher_encrypt( | 118 | skcipher_request_set_tfm(nreq, ctx->sknull); |
| 120 | &desc, req->dst, req->src, | 119 | skcipher_request_set_callback(nreq, req->base.flags, |
| 121 | req->assoclen + req->cryptlen); | 120 | NULL, NULL); |
| 121 | skcipher_request_set_crypt(nreq, req->src, req->dst, | ||
| 122 | req->assoclen + req->cryptlen, | ||
| 123 | NULL); | ||
| 124 | |||
| 125 | err = crypto_skcipher_encrypt(nreq); | ||
| 122 | if (err) | 126 | if (err) |
| 123 | return err; | 127 | return err; |
| 124 | } | 128 | } |
