summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-03-26 06:47:51 +0000
committerRoger Dingledine <arma@torproject.org>2006-03-26 06:47:51 +0000
commit0543900fbf8b69b6b7c0e5640cd2bfb5f6653d96 (patch)
treeb226906a4ad52ec64a460d02546e53c98ffaeba8
parent7871ad911673ae9387e152103e00ea37b7b666f9 (diff)
downloadtor-0543900fbf8b69b6b7c0e5640cd2bfb5f6653d96.tar.gz
tor-0543900fbf8b69b6b7c0e5640cd2bfb5f6653d96.zip
clean up the traces from tracking the 0.1.1.9-alpha stack-smashing bug.
svn:r6240
-rw-r--r--src/common/crypto.c15
-rw-r--r--src/common/crypto.h5
2 files changed, 3 insertions, 17 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 789c1fb6b7..4cdc814641 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -215,9 +215,7 @@ crypto_global_init(int useAccel)
void
crypto_thread_cleanup(void)
{
-#ifndef ENABLE_0119_PARANOIA_B1
ERR_remove_state(0);
-#endif
}
/** Uninitialize the crypto library. Return 0 on success, -1 on failure.
@@ -226,17 +224,13 @@ int
crypto_global_cleanup(void)
{
EVP_cleanup();
-#ifndef ENABLE_0119_PARANOIA_C
ERR_remove_state(0);
-#endif
ERR_free_strings();
#ifndef NO_ENGINES
ENGINE_cleanup();
-#ifndef ENABLE_0119_PARANOIA_C
CONF_modules_unload(1);
CRYPTO_cleanup_all_ex_data();
#endif
-#endif
#ifdef TOR_IS_MULTITHREADED
if (_n_openssl_mutexes) {
int n = _n_openssl_mutexes;
@@ -1368,9 +1362,7 @@ crypto_dh_new(void)
if (!(res->dh->g = BN_dup(dh_param_g)))
goto err;
-#ifndef ENABLE_0119_PARANOIA_A
res->dh->length = DH_PRIVATE_KEY_BITS;
-#endif
return res;
err:
@@ -1598,11 +1590,10 @@ crypto_dh_free(crypto_dh_env_t *dh)
/* Use RAND_poll if openssl is 0.9.6 release or later. (The "f" means
"release".) */
-#ifndef ENABLE_0119_PARANOIA_B2
-#define USE_RAND_POLL (OPENSSL_VERSION_NUMBER >= 0x0090600fl)
-#else
+//#define USE_RAND_POLL (OPENSSL_VERSION_NUMBER >= 0x0090600fl)
#define USE_RAND_POLL 0
-#endif
+/* XXX Somehow setting USE_RAND_POLL on causes stack smashes. We're
+ * not sure where. This was the big bug with Tor 0.1.1.9-alpha. */
/** Seed OpenSSL's random number generator with bytes from the
* operating system. Return 0 on success, -1 on failure.
diff --git a/src/common/crypto.h b/src/common/crypto.h
index 160cc5d57c..df112a1d8e 100644
--- a/src/common/crypto.h
+++ b/src/common/crypto.h
@@ -16,11 +16,6 @@
#include <stdio.h>
-#undef ENABLE_0119_PARANOIA_A
-#undef ENABLE_0119_PARANOIA_B1
-#define ENABLE_0119_PARANOIA_B2
-#undef ENABLE_0119_PARANOIA_C
-
/** Length of the output of our message digest. */
#define DIGEST_LEN 20
/** Length of our symmetric cipher's keys. */