diff options
author | Bodo Möller <bodo@openssl.org> | 2002-02-14 14:41:13 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2002-02-14 14:41:13 +0000 |
commit | 8f06b003736c957c6e693d3b5dd1393f91a530cd (patch) | |
tree | 8af453608f8adaaf420394bcd729348620ae8b80 /crypto/ecdsa/ecdsatest.c | |
parent | 1dea1f45097b044a59dbfeae6c667775410b24b0 (diff) | |
download | openssl-8f06b003736c957c6e693d3b5dd1393f91a530cd.tar.gz |
make it possible to disable memory checking for timings
Diffstat (limited to 'crypto/ecdsa/ecdsatest.c')
-rw-r--r-- | crypto/ecdsa/ecdsatest.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/crypto/ecdsa/ecdsatest.c b/crypto/ecdsa/ecdsatest.c index 339f654516..ff9338c4c9 100644 --- a/crypto/ecdsa/ecdsatest.c +++ b/crypto/ecdsa/ecdsatest.c @@ -330,17 +330,25 @@ int main(void) double time_d; EVP_MD_CTX *md_ctx=NULL; + /* enable memory leak checking unless explicitly disabled */ + if (!((getenv("OPENSSL_DEBUG_MEMORY") != NULL) && (0 == strcmp(getenv("OPENSSL_DEBUG_MEMORY"), "off")))) + { + CRYPTO_malloc_debug_init(); + CRYPTO_set_mem_debug_options(V_CRYPTO_MDEBUG_ALL); + } + else + { + /* OPENSSL_DEBUG_MEMORY=off */ + CRYPTO_set_mem_debug_functions(0, 0, 0, 0, 0); + } + CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON); - RAND_seed(rnd_seed, sizeof(rnd_seed)); + ERR_load_crypto_strings(); if (bio_err == NULL) bio_err=BIO_new_fp(stderr, BIO_NOCLOSE); - CRYPTO_malloc_debug_init(); - CRYPTO_dbg_set_options(V_CRYPTO_MDEBUG_ALL); - CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON); - - ERR_load_crypto_strings(); + RAND_seed(rnd_seed, sizeof(rnd_seed)); if ((ecdsa = ECDSA_new()) == NULL) goto err; |