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