diff options
author | Cristian Stoica <cristian.stoica@nxp.com> | 2016-01-25 11:19:43 +0200 |
---|---|---|
committer | Zhenhua Luo <zhenhua.luo@nxp.com> | 2016-06-23 10:58:51 +0800 |
commit | 41d1478e1294d06f0cce58fe847c0b0f1706b808 (patch) | |
tree | 8c6c5e2887cc30435ee40e764bb2ede58278d0ac /recipes-kernel/cryptodev/sdk_patches/0030-remove-code-duplication-in-cryptodev_hash_init.patch | |
parent | e3956ffbc217e468e26c9ce2e8932d3720fabca4 (diff) | |
download | meta-fsl-ppc-41d1478e1294d06f0cce58fe847c0b0f1706b808.tar.gz |
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 <cristian.stoica@nxp.com>
Diffstat (limited to 'recipes-kernel/cryptodev/sdk_patches/0030-remove-code-duplication-in-cryptodev_hash_init.patch')
-rw-r--r-- | recipes-kernel/cryptodev/sdk_patches/0030-remove-code-duplication-in-cryptodev_hash_init.patch | 59 |
1 files changed, 59 insertions, 0 deletions
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 @@ | |||
1 | From f4534df637b078fce275763bd8bc2a83bfad25e0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Cristian Stoica <cristian.stoica@nxp.com> | ||
3 | Date: Mon, 11 Jan 2016 18:01:06 +0200 | ||
4 | Subject: [PATCH 30/38] remove code duplication in cryptodev_hash_init | ||
5 | |||
6 | cryptodev_hash_init is concerned mostly with allocating data structures | ||
7 | for hash operations. | ||
8 | This patch replaces the call it makes to crypto_ahash_init with | ||
9 | one to cryptodev_hash_reset to avoid code duplication. This call is made | ||
10 | now outside of the original function to increase modularity. | ||
11 | |||
12 | Signed-off-by: Cristian Stoica <cristian.stoica@nxp.com> | ||
13 | --- | ||
14 | cryptlib.c | 9 --------- | ||
15 | ioctl.c | 5 +++++ | ||
16 | 2 files changed, 5 insertions(+), 9 deletions(-) | ||
17 | |||
18 | diff --git a/cryptlib.c b/cryptlib.c | ||
19 | index eba4616..4fd29eb 100644 | ||
20 | --- a/cryptlib.c | ||
21 | +++ b/cryptlib.c | ||
22 | @@ -362,18 +362,9 @@ int cryptodev_hash_init(struct hash_data *hdata, const char *alg_name, | ||
23 | |||
24 | ahash_request_set_callback(hdata->async.request, 0, | ||
25 | cryptodev_complete, hdata->async.result); | ||
26 | - | ||
27 | - ret = crypto_ahash_init(hdata->async.request); | ||
28 | - if (unlikely(ret)) { | ||
29 | - derr(0, "error in crypto_hash_init()"); | ||
30 | - goto error_request; | ||
31 | - } | ||
32 | - | ||
33 | hdata->init = 1; | ||
34 | return 0; | ||
35 | |||
36 | -error_request: | ||
37 | - ahash_request_free(hdata->async.request); | ||
38 | error: | ||
39 | kfree(hdata->async.result); | ||
40 | crypto_free_ahash(hdata->async.s); | ||
41 | diff --git a/ioctl.c b/ioctl.c | ||
42 | index b36dd03..a537886 100644 | ||
43 | --- a/ioctl.c | ||
44 | +++ b/ioctl.c | ||
45 | @@ -338,6 +338,11 @@ crypto_create_session(struct fcrypt *fcr, struct session_op *sop) | ||
46 | ret = -EINVAL; | ||
47 | goto session_error; | ||
48 | } | ||
49 | + | ||
50 | + ret = cryptodev_hash_reset(&ses_new->hdata); | ||
51 | + if (ret != 0) { | ||
52 | + goto session_error; | ||
53 | + } | ||
54 | } | ||
55 | |||
56 | ses_new->alignmask = max(ses_new->cdata.alignmask, | ||
57 | -- | ||
58 | 2.7.0 | ||
59 | |||