From af6e4745ef34351dea11bcd40bd4afbc322bf8c9 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 13 Feb 2025 19:44:33 -0500 Subject: [PATCH] Fix compilation with --disable-module-relay --- src/app/main/main.c | 4 ++-- src/feature/relay/router.c | 2 ++ src/feature/relay/routerkeys.h | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/app/main/main.c b/src/app/main/main.c index 285113c4f2..3dc34abce7 100644 --- a/src/app/main/main.c +++ b/src/app/main/main.c @@ -187,8 +187,8 @@ do_hup(void) generate_ed_link_cert(options, now, new_signing_key > 0)) { log_warn(LD_OR, "Problem reloading Ed25519 keys; still using old keys."); } - const networkstatus_t *ns = networkstatus_get_latest_consensus(); - if (load_family_id_keys(options, ns)) { + if (load_family_id_keys(options, + networkstatus_get_latest_consensus())) { log_warn(LD_OR, "Problem reloading family ID keys; " "still using old keys."); } diff --git a/src/feature/relay/router.c b/src/feature/relay/router.c index d6898ba3cf..d9adc638c4 100644 --- a/src/feature/relay/router.c +++ b/src/feature/relay/router.c @@ -876,6 +876,7 @@ router_initialize_tls_context(void) STATIC void router_announce_bridge_status_page(void) { +#ifdef ENABLE_MODULE_RELAY char fingerprint[FINGERPRINT_LEN + 1]; if (crypto_pk_get_hashed_fingerprint(get_server_identity_key(), @@ -889,6 +890,7 @@ router_announce_bridge_status_page(void) log_notice(LD_GENERAL, "You can check the status of your bridge relay at " "https://bridges.torproject.org/status?id=%s", fingerprint); +#endif } /** Compute fingerprint (or hashed fingerprint if hashed is 1) and write diff --git a/src/feature/relay/routerkeys.h b/src/feature/relay/routerkeys.h index f00c6836ad..70fc2ec225 100644 --- a/src/feature/relay/routerkeys.h +++ b/src/feature/relay/routerkeys.h @@ -89,6 +89,10 @@ relay_key_is_unavailable_(void) ((void)(options), (void)(now), (void)(force), 0) #define should_make_new_ed_keys(options, now) \ ((void)(options), (void)(now), 0) +#define warn_about_family_id_config(options,ns) \ + ((void)(options), (void)(ns)) +#define get_current_family_id_keys() \ + (smartlist_new()) // These can get removed once router.c becomes relay-only. static inline struct tor_cert_st * @@ -129,6 +133,8 @@ make_tap_onion_key_crosscert(const crypto_pk_t *onion_key, (puts("Not available: Tor has been compiled without relay support"), 0) #define load_family_id_keys(x,y) \ (puts("Not available: Tor has been compiled without relay support"), 0) +#define create_family_id_key(x) \ + (puts("Not available: Tor has been compiled without relay support"), -1) #endif /* defined(HAVE_MODULE_RELAY) */ -- 2.47.3