]> code.ossystems Code Review - meta-freescale.git/blob
13aea0156605300afc89ed605b6b2de62d0563ee
[meta-freescale.git] /
1 From f9d9da58818740334ef356d0384d4e88da865dca Mon Sep 17 00:00:00 2001
2 From: Yashpal Dutta <yashpal.dutta@freescale.com>
3 Date: Tue, 22 Apr 2014 22:58:33 +0545
4 Subject: [PATCH 11/48] Modulus parameter is not populated by dhparams
5
6 Upstream-status: Pending
7
8 When dhparams are created, modulus parameter required for
9 private key generation is not populated. So, falling back
10 to software for proper population of modulus parameters followed
11 by private key generation
12
13 Signed-off-by: Yashpal Dutta <yashpal.dutta@freescale.com>
14 Tested-by: Cristian Stoica <cristian.stoica@freescale.com>
15 ---
16  crypto/engine/eng_cryptodev.c | 4 ++--
17  1 file changed, 2 insertions(+), 2 deletions(-)
18
19 diff --git a/crypto/engine/eng_cryptodev.c b/crypto/engine/eng_cryptodev.c
20 index 151774c..1f1f307 100644
21 --- a/crypto/engine/eng_cryptodev.c
22 +++ b/crypto/engine/eng_cryptodev.c
23 @@ -3502,7 +3502,7 @@ static int cryptodev_dh_keygen_async(DH *dh, struct pkc_cookie_s *cookie)
24      kop->crk_op = CRK_DH_GENERATE_KEY;
25      if (bn2crparam(dh->p, &kop->crk_param[0]))
26          goto sw_try;
27 -    if (bn2crparam(dh->q, &kop->crk_param[1]))
28 +    if (!dh->q || bn2crparam(dh->q, &kop->crk_param[1]))
29          goto sw_try;
30      kop->crk_param[2].crp_p = g;
31      kop->crk_param[2].crp_nbits = g_len * 8;
32 @@ -3557,7 +3557,7 @@ static int cryptodev_dh_keygen(DH *dh)
33      kop.crk_op = CRK_DH_GENERATE_KEY;
34      if (bn2crparam(dh->p, &kop.crk_param[0]))
35          goto sw_try;
36 -    if (bn2crparam(dh->q, &kop.crk_param[1]))
37 +    if (!dh->q || bn2crparam(dh->q, &kop.crk_param[1]))
38          goto sw_try;
39      kop.crk_param[2].crp_p = g;
40      kop.crk_param[2].crp_nbits = g_len * 8;
41 -- 
42 2.7.0
43