Don't crash on startup of a dormant relay

If a relay is dormant at startup, it will call init_keys before
crypto_set_tls_dh_prime.  This is bad.  Let's make it not so bad, because
someday it *will* happen again.
This commit is contained in:
Robert Ransom 2011-12-12 11:25:55 -08:00
parent e4cebb76c5
commit d688a40a0e
2 changed files with 11 additions and 2 deletions

6
changes/bug4702 Normal file
View File

@ -0,0 +1,6 @@
o Minor bugfixes:
- Fix an assertion failure when a relay with accounting enabled
starts up while dormant. Fixes bug 4702; bugfix on
0.2.3.9-alpha.

View File

@ -2089,8 +2089,11 @@ init_dh_param(void)
dh_param_p = circuit_dh_prime; dh_param_p = circuit_dh_prime;
dh_param_g = generator; dh_param_g = generator;
/* Should be already set by config.c. */ /* Ensure that we have TLS DH parameters set up, too, even if we're
tor_assert(dh_param_p_tls); going to change them soon. */
if (!dh_param_p_tls) {
crypto_set_tls_dh_prime(NULL);
}
} }
/** Number of bits to use when choosing the x or y value in a Diffie-Hellman /** Number of bits to use when choosing the x or y value in a Diffie-Hellman