aboutsummaryrefslogtreecommitdiff
path: root/src/common/crypto.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@gmail.com>2011-11-24 00:22:31 +0100
committerGeorge Kadianakis <desnacked@gmail.com>2011-11-24 22:13:44 +0100
commit8a726dd0dd28c4550a7f6f7d9aa5f72507d4716b (patch)
treeaff61b52c21fb9bcd8faa1bd5242cbb09f060a13 /src/common/crypto.c
parent42bda231ee10db0136cf2ffb56a38ce290891794 (diff)
downloadtor-8a726dd0dd28c4550a7f6f7d9aa5f72507d4716b.tar
tor-8a726dd0dd28c4550a7f6f7d9aa5f72507d4716b.tar.gz
Implement dynamic prime reading and storing to disk.
Diffstat (limited to 'src/common/crypto.c')
-rw-r--r--src/common/crypto.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c
index bef62651f..484366297 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -1849,6 +1849,12 @@ crypto_generate_dynamic_prime(void)
return dynamic_prime;
}
+BIGNUM *
+crypto_get_tls_dh_prime(void)
+{
+ return dh_param_p_tls;
+}
+
/** Set the global TLS Diffie-Hellman modulus.
* If <b>use_dynamic_primes</b> is <em>not</em> set, use the prime
* modulus of mod_ssl.
@@ -1858,6 +1864,7 @@ void
crypto_set_tls_dh_prime(int use_dynamic_primes, BIGNUM *stored_dynamic_prime)
{
BIGNUM *tls_prime = NULL;
+ int r;
/* If the space is occupied, free the previous TLS DH prime */
if (dh_param_p_tls) {
@@ -1867,7 +1874,7 @@ crypto_set_tls_dh_prime(int use_dynamic_primes, BIGNUM *stored_dynamic_prime)
if (use_dynamic_primes) { /* use dynamic primes: */
if (stored_dynamic_prime) {
- log_notice(LD_OR, "Using stored dynamic prime.");
+ log_warn(LD_OR, "Using stored dynamic prime.");
tls_prime = stored_dynamic_prime;
} else {
log_notice(LD_OR, "Generating fresh dynamic prime.");