summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/dsa/dsa_key.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/dsa/dsa_key.c')
-rw-r--r--src/lib/libcrypto/dsa/dsa_key.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/lib/libcrypto/dsa/dsa_key.c b/src/lib/libcrypto/dsa/dsa_key.c
index c4aa86bc6d..980b6dc2d3 100644
--- a/src/lib/libcrypto/dsa/dsa_key.c
+++ b/src/lib/libcrypto/dsa/dsa_key.c
@@ -56,25 +56,17 @@
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59#ifndef OPENSSL_NO_SHA
59#include <stdio.h> 60#include <stdio.h>
60#include <time.h> 61#include <time.h>
61#include "cryptlib.h" 62#include "cryptlib.h"
62#ifndef OPENSSL_NO_SHA
63#include <openssl/bn.h> 63#include <openssl/bn.h>
64#include <openssl/dsa.h> 64#include <openssl/dsa.h>
65#include <openssl/rand.h> 65#include <openssl/rand.h>
66 66
67static int dsa_builtin_keygen(DSA *dsa); 67#ifndef OPENSSL_FIPS
68
69int DSA_generate_key(DSA *dsa) 68int DSA_generate_key(DSA *dsa)
70 { 69 {
71 if(dsa->meth->dsa_keygen)
72 return dsa->meth->dsa_keygen(dsa);
73 return dsa_builtin_keygen(dsa);
74 }
75
76static int dsa_builtin_keygen(DSA *dsa)
77 {
78 int ok=0; 70 int ok=0;
79 BN_CTX *ctx=NULL; 71 BN_CTX *ctx=NULL;
80 BIGNUM *pub_key=NULL,*priv_key=NULL; 72 BIGNUM *pub_key=NULL,*priv_key=NULL;
@@ -107,7 +99,7 @@ static int dsa_builtin_keygen(DSA *dsa)
107 { 99 {
108 BN_init(&local_prk); 100 BN_init(&local_prk);
109 prk = &local_prk; 101 prk = &local_prk;
110 BN_with_flags(prk, priv_key, BN_FLG_CONSTTIME); 102 BN_with_flags(prk, priv_key, BN_FLG_EXP_CONSTTIME);
111 } 103 }
112 else 104 else
113 prk = priv_key; 105 prk = priv_key;
@@ -126,3 +118,4 @@ err:
126 return(ok); 118 return(ok);
127 } 119 }
128#endif 120#endif
121#endif