diff options
author | Roger Dingledine <arma@torproject.org> | 2022-09-04 00:48:42 -0400 |
---|---|---|
committer | Micah Elizabeth Scott <beth@torproject.org> | 2023-05-10 07:37:11 -0700 |
commit | a5b0c7b4045d02acc15375a7d8bbad727b36e0de (patch) | |
tree | 01858c7b45d0b8935d8e911ac334c953ce74f97c /src/core | |
parent | 0716cd7cb203f21876bf6fe1e1acdc438d8e2031 (diff) | |
download | tor-a5b0c7b4045d02acc15375a7d8bbad727b36e0de.tar.gz tor-a5b0c7b4045d02acc15375a7d8bbad727b36e0de.zip |
start the cpuworkers always, even for clients
prepares the way for client-side pow cpuworkers
also happens to resolve bug https://bugs.torproject.org/tpo/core/tor/40617
(which went into 0.4.7.4-alpha) because now we survive initing the
cpuworker subsystem when we're not a relay.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/crypto/onion_crypto.c | 3 | ||||
-rw-r--r-- | src/core/mainloop/cpuworker.c | 2 | ||||
-rw-r--r-- | src/core/mainloop/cpuworker.h | 4 |
3 files changed, 5 insertions, 4 deletions
diff --git a/src/core/crypto/onion_crypto.c b/src/core/crypto/onion_crypto.c index 81e4e1b078..0839d8903f 100644 --- a/src/core/crypto/onion_crypto.c +++ b/src/core/crypto/onion_crypto.c @@ -64,6 +64,9 @@ static const size_t NTOR3_CIRC_VERIFICATION_LEN = 14; server_onion_keys_t * server_onion_keys_new(void) { + if (!get_master_identity_key()) + return NULL; + server_onion_keys_t *keys = tor_malloc_zero(sizeof(server_onion_keys_t)); memcpy(keys->my_identity, router_get_my_id_digest(), DIGEST_LEN); ed25519_pubkey_copy(&keys->my_ed_identity, get_master_identity_key()); diff --git a/src/core/mainloop/cpuworker.c b/src/core/mainloop/cpuworker.c index 9ad8939e4d..4a22790b44 100644 --- a/src/core/mainloop/cpuworker.c +++ b/src/core/mainloop/cpuworker.c @@ -117,7 +117,7 @@ cpuworker_consensus_has_changed(const networkstatus_t *ns) * during Tor's lifetime. */ void -cpu_init(void) +cpuworker_init(void) { if (!replyqueue) { replyqueue = replyqueue_new(0); diff --git a/src/core/mainloop/cpuworker.h b/src/core/mainloop/cpuworker.h index 9eee287c1f..7821f5612f 100644 --- a/src/core/mainloop/cpuworker.h +++ b/src/core/mainloop/cpuworker.h @@ -12,9 +12,7 @@ #ifndef TOR_CPUWORKER_H #define TOR_CPUWORKER_H -#include "feature/nodelist/networkstatus_st.h" - -void cpu_init(void); +void cpuworker_init(void); void cpuworkers_rotate_keyinfo(void); void cpuworker_consensus_has_changed(const networkstatus_t *ns); |