diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2001-06-19 22:30:40 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2001-06-19 22:30:40 +0000 |
commit | 323f289c480b0a8eb15ed3be2befbcc0f86e8904 (patch) | |
tree | a8f18dde28ce3c77b7bff50c2b45a44c556dfed4 /crypto/dsa/dsa_gen.c | |
parent | a45e4a5537e009761652db0d9aa1ef28b1ce8937 (diff) |
Change all calls to low level digest routines in the library and
applications to use EVP. Add missing calls to HMAC_cleanup() and
don't assume HMAC_CTX can be copied using memcpy().
Note: this is almost identical to the patch submitted to openssl-dev
by Verdon Walker <VWalker@novell.com> except some redundant
EVP_add_digest_()/EVP_cleanup() calls were removed and some changes
made to avoid compiler warnings.
Diffstat (limited to 'crypto/dsa/dsa_gen.c')
-rw-r--r-- | crypto/dsa/dsa_gen.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crypto/dsa/dsa_gen.c b/crypto/dsa/dsa_gen.c index 0b61177515..7440e917a5 100644 --- a/crypto/dsa/dsa_gen.c +++ b/crypto/dsa/dsa_gen.c @@ -61,12 +61,12 @@ #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 OPENSSL_NO_SHA @@ -74,7 +74,7 @@ #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> @@ -158,8 +158,8 @@ DSA *DSA_generate_parameters(int bits, } /* step 2 */ - HASH(seed,SHA_DIGEST_LENGTH,md); - HASH(buf,SHA_DIGEST_LENGTH,buf2); + EVP_Digest(seed,SHA_DIGEST_LENGTH,md,NULL,HASH); + EVP_Digest(buf,SHA_DIGEST_LENGTH,buf2,NULL,HASH); for (i=0; i<SHA_DIGEST_LENGTH; i++) md[i]^=buf2[i]; @@ -206,7 +206,7 @@ DSA *DSA_generate_parameters(int bits, if (buf[i] != 0) break; } - HASH(buf,SHA_DIGEST_LENGTH,md); + EVP_Digest(buf,SHA_DIGEST_LENGTH,md,NULL,HASH); /* step 8 */ if (!BN_bin2bn(md,SHA_DIGEST_LENGTH,r0)) |