summaryrefslogtreecommitdiffstats
path: root/recipes-connectivity/openssl/openssl-fsl/0011-RSA-Keygen-Fix.patch
diff options
context:
space:
mode:
authorTing Liu <b28495@freescale.com>2014-06-14 13:25:20 +0800
committerZhenhua Luo <zhenhua.luo@freescale.com>2014-07-11 13:35:09 +0800
commit6153043bfeefce698a08231a2ed1a52e442574fc (patch)
tree4256e31a741a7d658f55cb7c2d64b50316b76ff0 /recipes-connectivity/openssl/openssl-fsl/0011-RSA-Keygen-Fix.patch
parentc4524b65fbfdacbad625c749e191e8e62be6593c (diff)
downloadmeta-fsl-ppc-6153043bfeefce698a08231a2ed1a52e442574fc.tar.gz
openssl: use fsl maintained source
add bbappend to use fsl own openssl source code which was tested Signed-off-by: Ting Liu <b28495@freescale.com>
Diffstat (limited to 'recipes-connectivity/openssl/openssl-fsl/0011-RSA-Keygen-Fix.patch')
-rw-r--r--recipes-connectivity/openssl/openssl-fsl/0011-RSA-Keygen-Fix.patch64
1 files changed, 64 insertions, 0 deletions
diff --git a/recipes-connectivity/openssl/openssl-fsl/0011-RSA-Keygen-Fix.patch b/recipes-connectivity/openssl/openssl-fsl/0011-RSA-Keygen-Fix.patch
new file mode 100644
index 0000000..b2d636a
--- /dev/null
+++ b/recipes-connectivity/openssl/openssl-fsl/0011-RSA-Keygen-Fix.patch
@@ -0,0 +1,64 @@
1From f44fc935d5bc601cd625a64a366e64b19f2bb730 Mon Sep 17 00:00:00 2001
2From: Yashpal Dutta <yashpal.dutta@freescale.com>
3Date: Wed, 16 Apr 2014 22:53:04 +0545
4Subject: [PATCH][fsl 11/15] RSA Keygen Fix
5
6Upstream-status: Pending
7
8If Kernel driver doesn't support RSA Keygen or same returns
9error handling the keygen operation, the keygen is gracefully
10handled by software supported rsa_keygen handler
11
12Signed-off-by: Yashpal Dutta <yashpal.dutta@freescale.com>
13Tested-by: Cristian Stoica <cristian.stoica@freescale.com>
14---
15 crypto/engine/eng_cryptodev.c | 12 +++++++-----
16 1 file changed, 7 insertions(+), 5 deletions(-)
17
18diff --git a/crypto/engine/eng_cryptodev.c b/crypto/engine/eng_cryptodev.c
19index 0a6567c..5d54f7e 100644
20--- a/crypto/engine/eng_cryptodev.c
21+++ b/crypto/engine/eng_cryptodev.c
22@@ -1921,7 +1921,7 @@ static int cryptodev_rsa_keygen(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb)
23 int i;
24
25 if ((fd = get_asym_dev_crypto()) < 0)
26- return fd;
27+ goto sw_try;
28
29 if(!rsa->n && ((rsa->n=BN_new()) == NULL)) goto err;
30 if(!rsa->d && ((rsa->d=BN_new()) == NULL)) goto err;
31@@ -1942,7 +1942,7 @@ static int cryptodev_rsa_keygen(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb)
32 /* p length */
33 kop.crk_param[kop.crk_iparams].crp_p = calloc(p_len + 1, sizeof(char));
34 if (!kop.crk_param[kop.crk_iparams].crp_p)
35- goto err;
36+ goto sw_try;
37 kop.crk_param[kop.crk_iparams].crp_nbits = p_len * 8;
38 memset(kop.crk_param[kop.crk_iparams].crp_p, 0xff, p_len + 1);
39 kop.crk_iparams++;
40@@ -1950,7 +1950,7 @@ static int cryptodev_rsa_keygen(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb)
41 /* q length */
42 kop.crk_param[kop.crk_iparams].crp_p = calloc(q_len + 1, sizeof(char));
43 if (!kop.crk_param[kop.crk_iparams].crp_p)
44- goto err;
45+ goto sw_try;
46 kop.crk_param[kop.crk_iparams].crp_nbits = q_len * 8;
47 memset(kop.crk_param[kop.crk_iparams].crp_p, 0xff, q_len + 1);
48 kop.crk_iparams++;
49@@ -2015,8 +2015,10 @@ static int cryptodev_rsa_keygen(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb)
50 }
51 sw_try:
52 {
53- const RSA_METHOD *meth = RSA_PKCS1_SSLeay();
54- ret = (meth->rsa_keygen)(rsa, bits, e, cb);
55+ const RSA_METHOD *meth = rsa->meth;
56+ rsa->meth = RSA_PKCS1_SSLeay();
57+ ret = RSA_generate_key_ex(rsa, bits, e, cb);
58+ rsa->meth = meth;
59 }
60 return ret;
61
62--
631.7.9.7
64