Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1511788

[PATCH 4.8 058/125] crypto: arm/ghash-ce - add missing async import/export

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 4.8 058/125] crypto: arm/ghash-ce - add missing async import/export
Date 2016-10-29 16:20 +0200
Message-ID <sxCEj-7jv-79@gated-at.bofh.it> (permalink)
References <sxCkV-6TH-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


4.8-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ard Biesheuvel <ard.biesheuvel@linaro.org>

commit ed4767d612fd2c39e2c4c69eba484c1219dcddb6 upstream.

Since commit 8996eafdcbad ("crypto: ahash - ensure statesize is non-zero"),
all ahash drivers are required to implement import()/export(), and must have
a non-zero statesize. Fix this for the ARM Crypto Extensions GHASH
implementation.

Fixes: 8996eafdcbad ("crypto: ahash - ensure statesize is non-zero")
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/arm/crypto/ghash-ce-glue.c |   24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

--- a/arch/arm/crypto/ghash-ce-glue.c
+++ b/arch/arm/crypto/ghash-ce-glue.c
@@ -220,6 +220,27 @@ static int ghash_async_digest(struct aha
 	}
 }
 
+static int ghash_async_import(struct ahash_request *req, const void *in)
+{
+	struct ahash_request *cryptd_req = ahash_request_ctx(req);
+	struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
+	struct ghash_async_ctx *ctx = crypto_ahash_ctx(tfm);
+	struct shash_desc *desc = cryptd_shash_desc(cryptd_req);
+
+	desc->tfm = cryptd_ahash_child(ctx->cryptd_tfm);
+	desc->flags = req->base.flags;
+
+	return crypto_shash_import(desc, in);
+}
+
+static int ghash_async_export(struct ahash_request *req, void *out)
+{
+	struct ahash_request *cryptd_req = ahash_request_ctx(req);
+	struct shash_desc *desc = cryptd_shash_desc(cryptd_req);
+
+	return crypto_shash_export(desc, out);
+}
+
 static int ghash_async_setkey(struct crypto_ahash *tfm, const u8 *key,
 			      unsigned int keylen)
 {
@@ -268,7 +289,10 @@ static struct ahash_alg ghash_async_alg
 	.final			= ghash_async_final,
 	.setkey			= ghash_async_setkey,
 	.digest			= ghash_async_digest,
+	.import			= ghash_async_import,
+	.export			= ghash_async_export,
 	.halg.digestsize	= GHASH_DIGEST_SIZE,
+	.halg.statesize		= sizeof(struct ghash_desc_ctx),
 	.halg.base		= {
 		.cra_name	= "ghash",
 		.cra_driver_name = "ghash-ce",

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4.8 000/125] 4.8.6-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-29 16:20 +0200
  [PATCH 4.8 051/125] ath10k: Add WMI_SERVICE_PERIODIC_CHAN_STAT_SUPPORT wmi service Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-29 16:20 +0200
  [PATCH 4.8 017/125] drm/amd/powerplay: fix mclk not switching back after multi-head was disabled Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-29 16:20 +0200
  [PATCH 4.8 058/125] crypto: arm/ghash-ce - add missing async import/export Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-29 16:20 +0200
  [PATCH 4.8 024/125] drm/i915/gen9: fix the WaWmMemoryReadLatency implementation Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-29 16:30 +0200
  Re: [PATCH 4.8 000/125] 4.8.6-stable review Shuah Khan <shuah.kh@samsung.com> - 2016-10-30 01:10 +0200
    Re: [PATCH 4.8 000/125] 4.8.6-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-30 11:30 +0100
  Re: [PATCH 4.8 000/125] 4.8.6-stable review Guenter Roeck <linux@roeck-us.net> - 2016-10-30 02:50 +0200
    Re: [PATCH 4.8 000/125] 4.8.6-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-30 11:30 +0100

csiph-web