diff options
author | 2002-05-15 02:29:01 +0000 | |
---|---|---|
committer | 2002-05-15 02:29:01 +0000 | |
commit | da347917d3d3e5d3ece379d298f4e183b4828151 (patch) | |
tree | 4667bec6fb5a5191ed165d4bf727adbb97475bcb /lib/libssl/src/crypto/dsa/dsa_gen.c | |
parent | OpenSSL 0.9.7 (diff) | |
download | wireguard-openbsd-da347917d3d3e5d3ece379d298f4e183b4828151.tar.xz wireguard-openbsd-da347917d3d3e5d3ece379d298f4e183b4828151.zip |
OpenSSL 0.9.7 stable 2002 05 08 merge
Diffstat (limited to 'lib/libssl/src/crypto/dsa/dsa_gen.c')
-rw-r--r-- | lib/libssl/src/crypto/dsa/dsa_gen.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/libssl/src/crypto/dsa/dsa_gen.c b/lib/libssl/src/crypto/dsa/dsa_gen.c index 2294a362d99..dc9c2493103 100644 --- a/lib/libssl/src/crypto/dsa/dsa_gen.c +++ b/lib/libssl/src/crypto/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)) |