From 41d1478e1294d06f0cce58fe847c0b0f1706b808 Mon Sep 17 00:00:00 2001 From: Cristian Stoica Date: Mon, 25 Jan 2016 11:19:43 +0200 Subject: cryptodev-qoriq: upgrade to 1.8 plus fsl patches upstream commit: 87b56e04b24c6d4be145483477eff7d3153290e9 Also: - move all fsl patches on top of cryptodev-1.8 - add CIOCHASH ioctl - fix incorrect tests initializations - modify yocto patches to match updated Makefiles Signed-off-by: Cristian Stoica --- ...e-code-duplication-in-cryptodev_hash_init.patch | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 recipes-kernel/cryptodev/sdk_patches/0030-remove-code-duplication-in-cryptodev_hash_init.patch (limited to 'recipes-kernel/cryptodev/sdk_patches/0030-remove-code-duplication-in-cryptodev_hash_init.patch') diff --git a/recipes-kernel/cryptodev/sdk_patches/0030-remove-code-duplication-in-cryptodev_hash_init.patch b/recipes-kernel/cryptodev/sdk_patches/0030-remove-code-duplication-in-cryptodev_hash_init.patch new file mode 100644 index 0000000..1e3ebf3 --- /dev/null +++ b/recipes-kernel/cryptodev/sdk_patches/0030-remove-code-duplication-in-cryptodev_hash_init.patch @@ -0,0 +1,59 @@ +From f4534df637b078fce275763bd8bc2a83bfad25e0 Mon Sep 17 00:00:00 2001 +From: Cristian Stoica +Date: Mon, 11 Jan 2016 18:01:06 +0200 +Subject: [PATCH 30/38] remove code duplication in cryptodev_hash_init + +cryptodev_hash_init is concerned mostly with allocating data structures +for hash operations. +This patch replaces the call it makes to crypto_ahash_init with +one to cryptodev_hash_reset to avoid code duplication. This call is made +now outside of the original function to increase modularity. + +Signed-off-by: Cristian Stoica +--- + cryptlib.c | 9 --------- + ioctl.c | 5 +++++ + 2 files changed, 5 insertions(+), 9 deletions(-) + +diff --git a/cryptlib.c b/cryptlib.c +index eba4616..4fd29eb 100644 +--- a/cryptlib.c ++++ b/cryptlib.c +@@ -362,18 +362,9 @@ int cryptodev_hash_init(struct hash_data *hdata, const char *alg_name, + + ahash_request_set_callback(hdata->async.request, 0, + cryptodev_complete, hdata->async.result); +- +- ret = crypto_ahash_init(hdata->async.request); +- if (unlikely(ret)) { +- derr(0, "error in crypto_hash_init()"); +- goto error_request; +- } +- + hdata->init = 1; + return 0; + +-error_request: +- ahash_request_free(hdata->async.request); + error: + kfree(hdata->async.result); + crypto_free_ahash(hdata->async.s); +diff --git a/ioctl.c b/ioctl.c +index b36dd03..a537886 100644 +--- a/ioctl.c ++++ b/ioctl.c +@@ -338,6 +338,11 @@ crypto_create_session(struct fcrypt *fcr, struct session_op *sop) + ret = -EINVAL; + goto session_error; + } ++ ++ ret = cryptodev_hash_reset(&ses_new->hdata); ++ if (ret != 0) { ++ goto session_error; ++ } + } + + ses_new->alignmask = max(ses_new->cdata.alignmask, +-- +2.7.0 + -- cgit v1.2.3-54-g00ecf