diff options
author | George Kadianakis <desnacked@gmail.com> | 2011-11-22 13:55:07 +0100 |
---|---|---|
committer | George Kadianakis <desnacked@gmail.com> | 2011-11-24 22:13:00 +0100 |
commit | fb38e58d14e2557a07f0ea34568f8966946c4316 (patch) | |
tree | 98ef6f796934470753f4fbbb1d620f5c0d14d00f /src/common/crypto.c | |
parent | 1797e0a39e85f81e773304d7121e1f5f36fe9de9 (diff) | |
download | tor-fb38e58d14e2557a07f0ea34568f8966946c4316.tar.gz tor-fb38e58d14e2557a07f0ea34568f8966946c4316.zip |
Improve logging.
Diffstat (limited to 'src/common/crypto.c')
-rw-r--r-- | src/common/crypto.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c index 647d634fa7..81690b26d7 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -1829,24 +1829,27 @@ crypto_generate_dynamic_prime(void) DH *dh_parameters; int r; int dh_codes; + char *s; dh_parameters = DH_new(); dynamic_prime = BN_new(); misc = BN_new(); tor_assert(dynamic_prime); - log_notice(LD_OR, "Generating Dynamic prime; this will take a while..."); dh_parameters = DH_generate_parameters(DH_BYTES*8, DH_GENERATOR, NULL, NULL); // XXX Do we want a pretty call back? tor_assert(dh_parameters); - log_notice(LD_OR, "Dynamic prime generated!"); - log_notice(LD_OR, "Testing our Dynamic prime; this will take a while..."); r = DH_check(dh_parameters, &dh_codes); tor_assert(r); - log_notice(LD_OR, "Dynamic prime seems probabilistically reasonable!"); misc = BN_copy(dynamic_prime, dh_parameters->p); tor_assert(misc); DH_free(dh_parameters); + { + s = BN_bn2hex(dynamic_prime); + log_notice(LD_OR, "Dynamic prime generated: [%s]", s); + OPENSSL_free(s); + } + return dynamic_prime; } @@ -1875,6 +1878,7 @@ init_dh_param(void) /* This implements the prime number strategy outlined in prop 179 */ if (use_dynamic_primes) { + log_notice(LD_OR, "Generating fresh dynamic prime."); dynamic_prime = crypto_generate_dynamic_prime(); } |