summaryrefslogtreecommitdiff
path: root/lib/libcrypto/dsa/dsa_gen.c
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2002-05-15 02:29:22 +0000
committerBob Beck <beck@cvs.openbsd.org>2002-05-15 02:29:22 +0000
commit4df88d25cb3419048d1bcf9740d37d4c459aef22 (patch)
tree97858aa44644bc9b64d1775a8bbccfb5baca24d3 /lib/libcrypto/dsa/dsa_gen.c
parent998d0d156e423800e9a2fa1a482c0726f14201c2 (diff)
OpenSSL 0.9.7 stable 2002 05 08 merge
Diffstat (limited to 'lib/libcrypto/dsa/dsa_gen.c')
-rw-r--r--lib/libcrypto/dsa/dsa_gen.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/libcrypto/dsa/dsa_gen.c b/lib/libcrypto/dsa/dsa_gen.c
index 2294a362d99..dc9c2493103 100644
--- a/lib/libcrypto/dsa/dsa_gen.c
+++ b/lib/libcrypto/dsa/dsa_gen.c
@@ -61,25 +61,27 @@
#ifdef GENUINE_DSA
/* Parameter generation follows the original release of FIPS PUB 186,
* Appendix 2.2 (i.e. use SHA as defined in FIPS PUB 180) */
-#define HASH SHA
+#define HASH EVP_sha()
#else
/* Parameter generation follows the updated Appendix 2.2 for FIPS PUB 186,
* also Appendix 2.2 of FIPS PUB 186-1 (i.e. use SHA as defined in
* FIPS PUB 180-1) */
-#define HASH SHA1
+#define HASH EVP_sha1()
#endif
-#ifndef NO_SHA
+#ifndef OPENSSL_NO_SHA
#include <stdio.h>
#include <time.h>
#include "cryptlib.h"
-#include <openssl/sha.h>
+#include <openssl/evp.h>
#include <openssl/bn.h>
#include <openssl/dsa.h>
#include <openssl/rand.h>
+#include <openssl/sha.h>
-DSA *DSA_generate_parameters(int bits, unsigned char *seed_in, int seed_len,
+DSA *DSA_generate_parameters(int bits,
+ unsigned char *seed_in, int seed_len,
int *counter_ret, unsigned long *h_ret,
void (*callback)(int, int, void *),
void *cb_arg)
@@ -157,8 +159,8 @@ DSA *DSA_generate_parameters(int bits, unsigned char *seed_in, int seed_len,
}
/* step 2 */
- HASH(seed,SHA_DIGEST_LENGTH,md);
- HASH(buf,SHA_DIGEST_LENGTH,buf2);
+ EVP_Digest(seed,SHA_DIGEST_LENGTH,md,NULL,HASH, NULL);
+ EVP_Digest(buf,SHA_DIGEST_LENGTH,buf2,NULL,HASH, NULL);
for (i=0; i<SHA_DIGEST_LENGTH; i++)
md[i]^=buf2[i];
@@ -205,7 +207,7 @@ DSA *DSA_generate_parameters(int bits, unsigned char *seed_in, int seed_len,
if (buf[i] != 0) break;
}
- HASH(buf,SHA_DIGEST_LENGTH,md);
+ EVP_Digest(buf,SHA_DIGEST_LENGTH,md,NULL,HASH, NULL);
/* step 8 */
if (!BN_bin2bn(md,SHA_DIGEST_LENGTH,r0))