projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cvs update
[oweals/openssl.git]
/
crypto
/
dsa
/
dsa_key.c
diff --git
a/crypto/dsa/dsa_key.c
b/crypto/dsa/dsa_key.c
index d51ed9395f14a6e7f13226007666c5f21fb899e7..5aef2d5fcffb6541a62f279c88d7ba1a2b43aab6 100644
(file)
--- a/
crypto/dsa/dsa_key.c
+++ b/
crypto/dsa/dsa_key.c
@@
-56,16
+56,16
@@
* [including the GNU Public Licence.]
*/
* [including the GNU Public Licence.]
*/
+#ifndef NO_SHA
#include <stdio.h>
#include <time.h>
#include "cryptlib.h"
#include <stdio.h>
#include <time.h>
#include "cryptlib.h"
-#include
"sha.h"
-#include
"bn.h"
-#include
"dsa.h"
-#include
"rand.h"
+#include
<openssl/sha.h>
+#include
<openssl/bn.h>
+#include
<openssl/dsa.h>
+#include
<openssl/rand.h>
-int DSA_generate_key(dsa)
-DSA *dsa;
+int DSA_generate_key(DSA *dsa)
{
int ok=0;
unsigned int i;
{
int ok=0;
unsigned int i;
@@
-84,7
+84,8
@@
DSA *dsa;
i=BN_num_bits(dsa->q);
for (;;)
{
i=BN_num_bits(dsa->q);
for (;;)
{
- BN_rand(priv_key,i,1,0);
+ if (!BN_rand(priv_key,i,1,0))
+ goto err;
if (BN_cmp(priv_key,dsa->q) >= 0)
BN_sub(priv_key,priv_key,dsa->q);
if (!BN_is_zero(priv_key)) break;
if (BN_cmp(priv_key,dsa->q) >= 0)
BN_sub(priv_key,priv_key,dsa->q);
if (!BN_is_zero(priv_key)) break;
@@
-109,4
+110,4
@@
err:
if (ctx != NULL) BN_CTX_free(ctx);
return(ok);
}
if (ctx != NULL) BN_CTX_free(ctx);
return(ok);
}
-
+#endif