From f20f5a4e376d254e069fed66a321bc9cdd537096 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 16 Apr 2021 17:26:59 -0400 Subject: Stop calling evdns_set_random_bytes_fn() This function has been a no-op since Libevent 2.0.4-alpha, when libevent got an arc4random() implementation. Libevent has finally removed it, which will break our compilation unless we stop calling it. (This is currently breaking compilation in OSS-fuzz.) Closes #40371. --- changes/bug40371 | 6 ++++++ src/feature/relay/dns.c | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 changes/bug40371 diff --git a/changes/bug40371 b/changes/bug40371 new file mode 100644 index 0000000000..8cc7117f9f --- /dev/null +++ b/changes/bug40371 @@ -0,0 +1,6 @@ + o Minor bugfixes (compatibility): + - Fix compatibility with the most recent Libevent versions, which + no longer have an evdns_set_random_bytes() function. Because + this function has been a no-op since Libevent 2.0.4-alpha, + it is safe for us to just stop calling it. Fixes bug 40371; + bugfix on 0.2.1.7-alpha. diff --git a/src/feature/relay/dns.c b/src/feature/relay/dns.c index e20a39482f..075d7d7063 100644 --- a/src/feature/relay/dns.c +++ b/src/feature/relay/dns.c @@ -224,7 +224,6 @@ int dns_init(void) { init_cache_map(); - evdns_set_random_bytes_fn(dns_randfn_); if (server_mode(get_options())) { int r = configure_nameservers(1); return r; -- cgit v1.2.3-54-g00ecf From 5a043825d0b208343da4864ec9e071118b83cd06 Mon Sep 17 00:00:00 2001 From: Alexander Færøy Date: Mon, 10 May 2021 13:07:24 +0000 Subject: Remove unused function: dns_randfn_() in dns.c. This patch unbreaks the current build after tor!369 landed. See: https://bugs.torproject.org/tpo/core/tor/40371 --- src/feature/relay/dns.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/feature/relay/dns.c b/src/feature/relay/dns.c index 075d7d7063..49ed8bd790 100644 --- a/src/feature/relay/dns.c +++ b/src/feature/relay/dns.c @@ -211,14 +211,6 @@ evdns_log_cb(int warn, const char *msg) tor_log(severity, LD_EXIT, "eventdns: %s", msg); } -/** Helper: passed to eventdns.c as a callback so it can generate random - * numbers for transaction IDs and 0x20-hack coding. */ -static void -dns_randfn_(char *b, size_t n) -{ - crypto_rand(b,n); -} - /** Initialize the DNS subsystem; called by the OR process. */ int dns_init(void) -- cgit v1.2.3-54-g00ecf