aboutsummaryrefslogtreecommitdiffstats
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 @@
+From ea4abc255c6c5feec01cb1e30c6082cfe47860e2 Mon Sep 17 00:00:00 2001
+From: Cristian Stoica <cristian.stoica@freescale.com>
+Date: Thu, 19 Feb 2015 16:11:53 +0200
+Subject: [PATCH 21/26] cryptodev: drop redundant function
+
+get_dev_crypto already caches the result. Another cache in-between is
+useless.
+
+Change-Id: Ibd162529d3fb7a561a17f1a707d5d287c1586a3a
+Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
+Reviewed-on: http://git.am.freescale.net:8181/34216
+---
+ crypto/engine/eng_cryptodev.c | 18 +++---------------
+ 1 file changed, 3 insertions(+), 15 deletions(-)
+
+diff --git a/crypto/engine/eng_cryptodev.c b/crypto/engine/eng_cryptodev.c
+index fa5fe1b..1ab5551 100644
+--- a/crypto/engine/eng_cryptodev.c
++++ b/crypto/engine/eng_cryptodev.c
+@@ -96,7 +96,6 @@ struct dev_crypto_state {
+
+ static u_int32_t cryptodev_asymfeat = 0;
+
+-static int get_asym_dev_crypto(void);
+ static int open_dev_crypto(void);
+ static int get_dev_crypto(void);
+ static int get_cryptodev_ciphers(const int **cnids);
+@@ -357,17 +356,6 @@ static void put_dev_crypto(int fd)
+ #endif
+ }
+
+-/* Caching version for asym operations */
+-static int
+-get_asym_dev_crypto(void)
+-{
+- static int fd = -1;
+-
+- if (fd == -1)
+- fd = get_dev_crypto();
+- return fd;
+-}
+-
+ /*
+ * Find out what ciphers /dev/crypto will let us have a session for.
+ * XXX note, that some of these openssl doesn't deal with yet!
+@@ -1796,7 +1784,7 @@ cryptodev_asym(struct crypt_kop *kop, int rlen, BIGNUM *r, int slen, BIGNUM *s)
+ {
+ int fd, ret = -1;
+
+- if ((fd = get_asym_dev_crypto()) < 0)
++ if ((fd = get_dev_crypto()) < 0)
+ return (ret);
+
+ if (r) {
+@@ -2374,7 +2362,7 @@ static int cryptodev_rsa_keygen(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb)
+ int p_len, q_len;
+ int i;
+
+- if ((fd = get_asym_dev_crypto()) < 0)
++ if ((fd = get_dev_crypto()) < 0)
+ goto sw_try;
+
+ if(!rsa->n && ((rsa->n=BN_new()) == NULL)) goto err;
+@@ -3928,7 +3916,7 @@ cryptodev_dh_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh)
+ BIGNUM *temp = NULL;
+ unsigned char *padded_pub_key = NULL, *p = NULL;
+
+- if ((fd = get_asym_dev_crypto()) < 0)
++ if ((fd = get_dev_crypto()) < 0)
+ goto sw_try;
+
+ memset(&kop, 0, sizeof kop);
+--
+2.3.5
+