aboutsummaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-11-21 04:19:04 +0000
committerNick Mathewson <nickm@torproject.org>2004-11-21 04:19:04 +0000
commit36f4e15e815afa386014de2f624299623cfd889f (patch)
tree57df00da809a7a1e14c1ae92ab530c61d6f50caa /src/or/router.c
parentbfc2e952300a1f0e7bc8cd849eddec88d5a32f5b (diff)
downloadtor-36f4e15e815afa386014de2f624299623cfd889f.tar.gz
tor-36f4e15e815afa386014de2f624299623cfd889f.zip
Call init_keys() where needed; fix hibernate bug.
svn:r2924
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/or/router.c b/src/or/router.c
index a7cb473fc0..3b6c569ee7 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -91,6 +91,12 @@ crypto_pk_env_t *get_identity_key(void) {
return identitykey;
}
+/** Return truf iff the identity key has been set. */
+int identity_key_is_set(void) {
+ return identitykey != NULL;
+}
+
+
/** Replace the previous onion key with the current onion key, and generate
* a new previous onion key. Immediately after calling this function,
* the OR should:
@@ -228,6 +234,12 @@ crypto_pk_env_t *init_key_from_file(const char *fname)
* On OPs, this only initializes the tls context.
*/
int init_keys(void) {
+ /* XXX009 Two problems with how this is called:
+ * 1. It should be idempotent for servers, so we can call init_keys
+ * as much as we need to.
+ * 2. Clients should rotate their identity keys at least whenever
+ * their IPs change.
+ */
char keydir[512];
char keydir2[512];
char fingerprint[FINGERPRINT_LEN+MAX_NICKNAME_LEN+3];