diff options
author | George Kadianakis <desnacked@gmail.com> | 2011-11-24 22:59:01 +0100 |
---|---|---|
committer | George Kadianakis <desnacked@gmail.com> | 2011-11-24 22:59:01 +0100 |
commit | 94076d9e3b74ad1f6aee8a96f51eb4af5f5bdb64 (patch) | |
tree | c7bfbe7c9cd9fc6de220259ce84b966e712e48a7 /src/or/config.c | |
parent | 2ef68980a778666bcc9b3b492c4acbd7af27fc28 (diff) | |
download | tor-94076d9e3b74ad1f6aee8a96f51eb4af5f5bdb64.tar.gz tor-94076d9e3b74ad1f6aee8a96f51eb4af5f5bdb64.zip |
Move crypto_get_stored_dynamic_prime() to crypto.c
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/or/config.c b/src/or/config.c index 78e91bbe11..e1e71b0593 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -1365,17 +1365,19 @@ options_act(const or_options_t *old_options) /* If needed, generate a new TLS DH prime according to the current torrc. */ if (!old_options) { if (options->DynamicPrimes) { - crypto_set_tls_dh_prime(1, router_get_stored_dynamic_prime()); + char *fname = get_datadir_fname2("keys", "dynamic_prime"); + crypto_set_tls_dh_prime(fname); + tor_free(fname); } else { - crypto_set_tls_dh_prime(0, NULL); + crypto_set_tls_dh_prime(NULL); } } else { if (options->DynamicPrimes && !old_options->DynamicPrimes) { - crypto_set_tls_dh_prime(1, router_get_stored_dynamic_prime()); + char *fname = get_datadir_fname2("keys", "dynamic_prime"); + crypto_set_tls_dh_prime(fname); + tor_free(fname); } else if (!options->DynamicPrimes && old_options->DynamicPrimes) { - crypto_set_tls_dh_prime(0, NULL); - } else { - tor_assert(crypto_get_tls_dh_prime()); + crypto_set_tls_dh_prime(NULL); } } |