summaryrefslogtreecommitdiffstats
path: root/recipes-connectivity/openssl/openssl-qoriq/qoriq/0021-cryptodev-drop-redundant-function.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-connectivity/openssl/openssl-qoriq/qoriq/0021-cryptodev-drop-redundant-function.patch')
-rw-r--r--recipes-connectivity/openssl/openssl-qoriq/qoriq/0021-cryptodev-drop-redundant-function.patch75
1 files changed, 75 insertions, 0 deletions
diff --git a/recipes-connectivity/openssl/openssl-qoriq/qoriq/0021-cryptodev-drop-redundant-function.patch b/recipes-connectivity/openssl/openssl-qoriq/qoriq/0021-cryptodev-drop-redundant-function.patch
new file mode 100644
index 0000000..16cc688
--- /dev/null
+++ b/recipes-connectivity/openssl/openssl-qoriq/qoriq/0021-cryptodev-drop-redundant-function.patch
@@ -0,0 +1,75 @@
1From ea4abc255c6c5feec01cb1e30c6082cfe47860e2 Mon Sep 17 00:00:00 2001
2From: Cristian Stoica <cristian.stoica@freescale.com>
3Date: Thu, 19 Feb 2015 16:11:53 +0200
4Subject: [PATCH 21/26] cryptodev: drop redundant function
5
6get_dev_crypto already caches the result. Another cache in-between is
7useless.
8
9Change-Id: Ibd162529d3fb7a561a17f1a707d5d287c1586a3a
10Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
11Reviewed-on: http://git.am.freescale.net:8181/34216
12---
13 crypto/engine/eng_cryptodev.c | 18 +++---------------
14 1 file changed, 3 insertions(+), 15 deletions(-)
15
16diff --git a/crypto/engine/eng_cryptodev.c b/crypto/engine/eng_cryptodev.c
17index fa5fe1b..1ab5551 100644
18--- a/crypto/engine/eng_cryptodev.c
19+++ b/crypto/engine/eng_cryptodev.c
20@@ -96,7 +96,6 @@ struct dev_crypto_state {
21
22 static u_int32_t cryptodev_asymfeat = 0;
23
24-static int get_asym_dev_crypto(void);
25 static int open_dev_crypto(void);
26 static int get_dev_crypto(void);
27 static int get_cryptodev_ciphers(const int **cnids);
28@@ -357,17 +356,6 @@ static void put_dev_crypto(int fd)
29 #endif
30 }
31
32-/* Caching version for asym operations */
33-static int
34-get_asym_dev_crypto(void)
35-{
36- static int fd = -1;
37-
38- if (fd == -1)
39- fd = get_dev_crypto();
40- return fd;
41-}
42-
43 /*
44 * Find out what ciphers /dev/crypto will let us have a session for.
45 * XXX note, that some of these openssl doesn't deal with yet!
46@@ -1796,7 +1784,7 @@ cryptodev_asym(struct crypt_kop *kop, int rlen, BIGNUM *r, int slen, BIGNUM *s)
47 {
48 int fd, ret = -1;
49
50- if ((fd = get_asym_dev_crypto()) < 0)
51+ if ((fd = get_dev_crypto()) < 0)
52 return (ret);
53
54 if (r) {
55@@ -2374,7 +2362,7 @@ static int cryptodev_rsa_keygen(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb)
56 int p_len, q_len;
57 int i;
58
59- if ((fd = get_asym_dev_crypto()) < 0)
60+ if ((fd = get_dev_crypto()) < 0)
61 goto sw_try;
62
63 if(!rsa->n && ((rsa->n=BN_new()) == NULL)) goto err;
64@@ -3928,7 +3916,7 @@ cryptodev_dh_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh)
65 BIGNUM *temp = NULL;
66 unsigned char *padded_pub_key = NULL, *p = NULL;
67
68- if ((fd = get_asym_dev_crypto()) < 0)
69+ if ((fd = get_dev_crypto()) < 0)
70 goto sw_try;
71
72 memset(&kop, 0, sizeof kop);
73--
742.3.5
75