62 #ifndef OPENSSL_NO_SHA
68 #include <openssl/fips.h>
71 static int dsa_builtin_keygen(
DSA *dsa);
87 return FIPS_dsa_generate_key(dsa);
89 return dsa_builtin_keygen(dsa);
92 static int dsa_builtin_keygen(
DSA *dsa)
96 BIGNUM *pub_key=NULL,*priv_key=NULL;
102 if ((priv_key=
BN_new()) == NULL)
goto err;
113 if ((pub_key=
BN_new()) == NULL)
goto err;
131 if (!
BN_mod_exp(pub_key,dsa->
g,prk,dsa->
p,ctx))
goto err;
139 if ((pub_key != NULL) && (dsa->
pub_key == NULL))
BN_free(pub_key);