aboutsummaryrefslogtreecommitdiff
path: root/src/feature
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2019-10-18 14:16:24 +1000
committerteor <teor@torproject.org>2019-10-20 19:26:55 +1000
commite2280d6f849ea6e00fccc704e91d48a2f6924135 (patch)
tree3bd8d2501310a5d3d079b74ee1276d62bd278b2b /src/feature
parent57e86a6d749f487d81787439ac84d9bed8a70941 (diff)
downloadtor-e2280d6f849ea6e00fccc704e91d48a2f6924135.tar.gz
tor-e2280d6f849ea6e00fccc704e91d48a2f6924135.zip
relay: Silence compiler warnings when relay mode is disabled
Part of 32123.
Diffstat (limited to 'src/feature')
-rw-r--r--src/feature/relay/router.c4
-rw-r--r--src/feature/relay/router.h6
2 files changed, 10 insertions, 0 deletions
diff --git a/src/feature/relay/router.c b/src/feature/relay/router.c
index ab0762e17e..92803f88a9 100644
--- a/src/feature/relay/router.c
+++ b/src/feature/relay/router.c
@@ -372,6 +372,8 @@ assert_identity_keys_ok(void)
}
}
+#ifdef HAVE_MODULE_RELAY
+
/** Returns the current server identity key; requires that the key has
* been set, and that we are running as a Tor server.
*/
@@ -384,6 +386,8 @@ get_server_identity_key,(void))
return server_identitykey;
}
+#endif
+
/** Return true iff we are a server and the server identity key
* has been set. */
int
diff --git a/src/feature/relay/router.h b/src/feature/relay/router.h
index 55b9ef9e68..a708b24889 100644
--- a/src/feature/relay/router.h
+++ b/src/feature/relay/router.h
@@ -28,7 +28,13 @@ struct ed25519_keypair_t;
MOCK_DECL(crypto_pk_t *,get_onion_key,(void));
time_t get_onion_key_set_at(void);
void set_server_identity_key(crypto_pk_t *k);
+/* Some compilers are clever enough to know that when relay mode is disabled,
+ * this function never returns. */
+#ifdef HAVE_MODULE_RELAY
MOCK_DECL(crypto_pk_t *,get_server_identity_key,(void));
+#else
+#define get_server_identity_key() (tor_abort_(),NULL)
+#endif
int server_identity_key_is_set(void);
void set_client_identity_key(crypto_pk_t *k);
crypto_pk_t *get_tlsclient_identity_key(void);