summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorRobert Ransom <rransom.8774@gmail.com>2010-10-01 14:06:57 -0700
committerRobert Ransom <rransom.8774@gmail.com>2010-10-04 17:57:29 -0700
commitd3879dbd16ccc7b6bc8393f92343f8669f8e0dc4 (patch)
treeb06e23d4df5cbfeaca04ef4c064db52edf148074 /src/or
parent89dffade8da372e296ae2d564dda102e9a7d566b (diff)
downloadtor-d3879dbd16ccc7b6bc8393f92343f8669f8e0dc4.tar.gz
tor-d3879dbd16ccc7b6bc8393f92343f8669f8e0dc4.zip
Refactor tor_tls_context_new:
* Make tor_tls_context_new internal to tortls.c, and return the new tor_tls_context_t from it. * Add a public tor_tls_context_init wrapper function to replace it.
Diffstat (limited to 'src/or')
-rw-r--r--src/or/main.c2
-rw-r--r--src/or/router.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/or/main.c b/src/or/main.c
index 582a1c287b..5091e2072a 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -930,7 +930,7 @@ run_scheduled_events(time_t now)
last_rotated_x509_certificate = now;
if (last_rotated_x509_certificate+MAX_SSL_KEY_LIFETIME < now) {
log_info(LD_GENERAL,"Rotating tls context.");
- if (tor_tls_context_new(get_identity_key(), MAX_SSL_KEY_LIFETIME) < 0) {
+ if (tor_tls_context_init(get_identity_key(), MAX_SSL_KEY_LIFETIME) < 0) {
log_warn(LD_BUG, "Error reinitializing TLS context");
/* XXX is it a bug here, that we just keep going? -RD */
}
diff --git a/src/or/router.c b/src/or/router.c
index bc0e67c9b8..bde6e25a77 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -472,7 +472,7 @@ init_keys(void)
}
set_identity_key(prkey);
/* Create a TLS context; default the client nickname to "client". */
- if (tor_tls_context_new(get_identity_key(), MAX_SSL_KEY_LIFETIME) < 0) {
+ if (tor_tls_context_init(get_identity_key(), MAX_SSL_KEY_LIFETIME) < 0) {
log_err(LD_GENERAL,"Error creating TLS context for Tor client.");
return -1;
}
@@ -550,7 +550,7 @@ init_keys(void)
tor_free(keydir);
/* 3. Initialize link key and TLS context. */
- if (tor_tls_context_new(get_identity_key(), MAX_SSL_KEY_LIFETIME) < 0) {
+ if (tor_tls_context_init(get_identity_key(), MAX_SSL_KEY_LIFETIME) < 0) {
log_err(LD_GENERAL,"Error initializing TLS context");
return -1;
}