diff options
| author | Cristian Stoica <cristian.stoica@freescale.com> | 2015-01-07 17:55:00 +0800 |
|---|---|---|
| committer | Zhenhua Luo <zhenhua.luo@freescale.com> | 2015-01-08 18:15:01 +0800 |
| commit | 9d9bfaf710bc0648e9259ec9d7e7cc9eb9219cf7 (patch) | |
| tree | 92c40ee2bf59ea0ef299adb289cf275dadeecba5 /meta-fsl-ppc/recipes-connectivity/openssl/openssl-fsl/0012-RSA-Keygen-Fix.patch | |
| parent | 58ca1838e372a60781b6b03c7b7a12dce2270e50 (diff) | |
| download | meta-freescale-9d9bfaf710bc0648e9259ec9d7e7cc9eb9219cf7.tar.gz | |
openssl: upgrade to 1.0.1i plus Freescale patches
- include fixes for algorithm registration and 32-bit application hanging
on E5500 cores.
- add offloading suport for aes-gcm
- upstream patches are kept except for the documentation patch which is
no longer necessary
Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
Diffstat (limited to 'meta-fsl-ppc/recipes-connectivity/openssl/openssl-fsl/0012-RSA-Keygen-Fix.patch')
| -rw-r--r-- | meta-fsl-ppc/recipes-connectivity/openssl/openssl-fsl/0012-RSA-Keygen-Fix.patch | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/meta-fsl-ppc/recipes-connectivity/openssl/openssl-fsl/0012-RSA-Keygen-Fix.patch b/meta-fsl-ppc/recipes-connectivity/openssl/openssl-fsl/0012-RSA-Keygen-Fix.patch new file mode 100644 index 000000000..448997332 --- /dev/null +++ b/meta-fsl-ppc/recipes-connectivity/openssl/openssl-fsl/0012-RSA-Keygen-Fix.patch | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | From ac777f046da7151386d667391362ecb553ceee90 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Yashpal Dutta <yashpal.dutta@freescale.com> | ||
| 3 | Date: Wed, 16 Apr 2014 22:53:04 +0545 | ||
| 4 | Subject: [PATCH 12/17] RSA Keygen Fix | ||
| 5 | |||
| 6 | Upstream-status: Pending | ||
| 7 | |||
| 8 | If Kernel driver doesn't support RSA Keygen or same returns | ||
| 9 | error handling the keygen operation, the keygen is gracefully | ||
| 10 | handled by software supported rsa_keygen handler | ||
| 11 | |||
| 12 | Signed-off-by: Yashpal Dutta <yashpal.dutta@freescale.com> | ||
| 13 | Tested-by: Cristian Stoica <cristian.stoica@freescale.com> | ||
| 14 | --- | ||
| 15 | crypto/engine/eng_cryptodev.c | 12 +++++++----- | ||
| 16 | 1 file changed, 7 insertions(+), 5 deletions(-) | ||
| 17 | |||
| 18 | diff --git a/crypto/engine/eng_cryptodev.c b/crypto/engine/eng_cryptodev.c | ||
| 19 | index b2919a8..ed5f20f 100644 | ||
| 20 | --- a/crypto/engine/eng_cryptodev.c | ||
| 21 | +++ b/crypto/engine/eng_cryptodev.c | ||
| 22 | @@ -1915,7 +1915,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 | @@ -1936,7 +1936,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 | @@ -1944,7 +1944,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 | @@ -2009,8 +2009,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 | -- | ||
| 63 | 1.8.3.1 | ||
| 64 | |||
