diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/dsa/dsatest.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/lib/libcrypto/dsa/dsatest.c b/src/lib/libcrypto/dsa/dsatest.c index 309a7cda89..12da64f9f4 100644 --- a/src/lib/libcrypto/dsa/dsatest.c +++ b/src/lib/libcrypto/dsa/dsatest.c | |||
| @@ -65,11 +65,12 @@ | |||
| 65 | #include <openssl/rand.h> | 65 | #include <openssl/rand.h> |
| 66 | #include <openssl/bio.h> | 66 | #include <openssl/bio.h> |
| 67 | #include <openssl/err.h> | 67 | #include <openssl/err.h> |
| 68 | #ifdef WINDOWS | 68 | #include <openssl/engine.h> |
| 69 | #ifdef OPENSSL_SYS_WINDOWS | ||
| 69 | #include "../bio/bss_file.c" | 70 | #include "../bio/bss_file.c" |
| 70 | #endif | 71 | #endif |
| 71 | 72 | ||
| 72 | #ifdef NO_DSA | 73 | #ifdef OPENSSL_NO_DSA |
| 73 | int main(int argc, char *argv[]) | 74 | int main(int argc, char *argv[]) |
| 74 | { | 75 | { |
| 75 | printf("No DSA support\n"); | 76 | printf("No DSA support\n"); |
| @@ -78,7 +79,7 @@ int main(int argc, char *argv[]) | |||
| 78 | #else | 79 | #else |
| 79 | #include <openssl/dsa.h> | 80 | #include <openssl/dsa.h> |
| 80 | 81 | ||
| 81 | #ifdef WIN16 | 82 | #ifdef OPENSSL_SYS_WIN16 |
| 82 | #define MS_CALLBACK _far _loadds | 83 | #define MS_CALLBACK _far _loadds |
| 83 | #else | 84 | #else |
| 84 | #define MS_CALLBACK | 85 | #define MS_CALLBACK |
| @@ -136,14 +137,16 @@ int main(int argc, char **argv) | |||
| 136 | unsigned char sig[256]; | 137 | unsigned char sig[256]; |
| 137 | unsigned int siglen; | 138 | unsigned int siglen; |
| 138 | 139 | ||
| 139 | ERR_load_crypto_strings(); | ||
| 140 | RAND_seed(rnd_seed, sizeof rnd_seed); | ||
| 141 | |||
| 142 | if (bio_err == NULL) | 140 | if (bio_err == NULL) |
| 143 | bio_err=BIO_new_fp(stderr,BIO_NOCLOSE); | 141 | bio_err=BIO_new_fp(stderr,BIO_NOCLOSE); |
| 144 | 142 | ||
| 143 | CRYPTO_malloc_debug_init(); | ||
| 144 | CRYPTO_dbg_set_options(V_CRYPTO_MDEBUG_ALL); | ||
| 145 | CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON); | 145 | CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON); |
| 146 | 146 | ||
| 147 | ERR_load_crypto_strings(); | ||
| 148 | RAND_seed(rnd_seed, sizeof rnd_seed); | ||
| 149 | |||
| 147 | BIO_printf(bio_err,"test generation of DSA parameters\n"); | 150 | BIO_printf(bio_err,"test generation of DSA parameters\n"); |
| 148 | 151 | ||
| 149 | dsa=DSA_generate_parameters(512,seed,20,&counter,&h,dsa_cb,bio_err); | 152 | dsa=DSA_generate_parameters(512,seed,20,&counter,&h,dsa_cb,bio_err); |
| @@ -200,7 +203,9 @@ end: | |||
| 200 | if (!ret) | 203 | if (!ret) |
| 201 | ERR_print_errors(bio_err); | 204 | ERR_print_errors(bio_err); |
| 202 | if (dsa != NULL) DSA_free(dsa); | 205 | if (dsa != NULL) DSA_free(dsa); |
| 206 | CRYPTO_cleanup_all_ex_data(); | ||
| 203 | ERR_remove_state(0); | 207 | ERR_remove_state(0); |
| 208 | ERR_free_strings(); | ||
| 204 | CRYPTO_mem_leaks(bio_err); | 209 | CRYPTO_mem_leaks(bio_err); |
| 205 | if (bio_err != NULL) | 210 | if (bio_err != NULL) |
| 206 | { | 211 | { |
