From 6dac11b0320e3f2694d954147704e88e00d68d8f Mon Sep 17 00:00:00 2001 From: Jim Toth Date: Mon, 13 Oct 2025 21:15:44 -0400 Subject: [PATCH 1/8] WIP: Initial pass of changing .anon -> .anyone --- src/app/config/config.c | 6 +++--- src/core/or/connection_edge.c | 28 ++++++++++++++-------------- src/core/or/connection_edge.h | 2 +- src/feature/control/control.c | 2 +- src/feature/control/control_cmd.c | 2 +- src/feature/control/control_fmt.c | 2 +- src/feature/hs/hs_client.c | 2 +- src/feature/hs/hs_common.c | 4 ++-- src/feature/hs/hs_common.h | 8 ++++---- src/feature/hs/hs_descriptor.h | 4 ++-- src/feature/hs/hs_ob.c | 12 ++++++------ src/feature/hs/hs_service.h | 2 +- src/test/hs_build_address.py | 6 +++--- src/test/test_addr.c | 8 ++++---- src/test/test_crypto_rng.c | 14 +++++++------- src/tools/anon-resolve.c | 4 ++-- 16 files changed, 53 insertions(+), 53 deletions(-) diff --git a/src/app/config/config.c b/src/app/config/config.c index 591dd02089..22b8091ba9 100644 --- a/src/app/config/config.c +++ b/src/app/config/config.c @@ -344,7 +344,7 @@ static const config_var_t option_vars_[] = { OBSOLETE("AuthDirMaxServersPerAuthAddr"), VAR("AuthoritativeDirectory", BOOL, AuthoritativeDir, "0"), V(AutomapHostsOnResolve, BOOL, "0"), - V(AutomapHostsSuffixes, CSV, ".anon,.exit"), + V(AutomapHostsSuffixes, CSV, ".anyone,.exit"), V(AvoidDiskWrites, BOOL, "0"), V(BandwidthBurst, MEMUNIT, "1 GB"), V(BandwidthRate, MEMUNIT, "1 GB"), @@ -6378,7 +6378,7 @@ port_parse_config(smartlist_t *out, cfg->entry_cfg.onion_traffic = ! no; continue; } else if (!strcasecmp(elt, "OnionTrafficOnly")) { - /* Only connect to .anon addresses. Equivalent to + /* Only connect to .anyone addresses. Equivalent to * NoDNSRequest, NoIPv4Traffic, NoIPv6Traffic. The option * NoOnionTrafficOnly is not supported, it's too confusing. */ if (no) { @@ -6475,7 +6475,7 @@ port_parse_config(smartlist_t *out, cfg->entry_cfg.onion_traffic == 0 && listener_type != CONN_TYPE_AP_DNS_LISTENER) { log_warn(LD_CONFIG, "You have a %sPort entry with all of IPv4 and " - "IPv6 and .anon disabled; that won't work.", portname); + "IPv6 and .anyone disabled; that won't work.", portname); goto err; } if (cfg->entry_cfg.dns_request == 1 && diff --git a/src/core/or/connection_edge.c b/src/core/or/connection_edge.c index 58b1347083..f7d8bc4d91 100644 --- a/src/core/or/connection_edge.c +++ b/src/core/or/connection_edge.c @@ -1252,7 +1252,7 @@ connection_ap_expire_beginning(void) if (seconds_idle >= options->SocksTimeout) { log_fn(severity, LD_REND, "Rend stream is %d seconds late. Giving up on address" - " '%s.anon'.", + " '%s.anyone'.", seconds_idle, safe_str_client(entry_conn->socks_request->address)); /* Roll back path bias use state so that we probe the circuit @@ -1683,15 +1683,15 @@ consider_plaintext_ports(entry_connection_t *conn, uint16_t port) * * The possible recognized forms are (where true is returned): * - * If address is of the form "y.anon" with a well-formed handle y: + * If address is of the form "y.anyone" with a well-formed handle y: * Put a NUL after y, lower-case it, and return ONION_V3_HOSTNAME * depending on the HS version. * - * If address is of the form "x.y.anon" with a well-formed handle x: + * If address is of the form "x.y.anyone" with a well-formed handle x: * Drop "x.", put a NUL after y, lower-case it, and return * ONION_V3_HOSTNAME depending on the HS version. * - * If address is of the form "y.anon" with a badly-formed handle y: + * If address is of the form "y.anyone" with a badly-formed handle y: * Return BAD_HOSTNAME and log a message. * * If address is of the form "y.exit": @@ -1717,7 +1717,7 @@ parse_extended_hostname(char *address, hostname_type_t *type_out) goto success; } if (strcmp(s+1,"anon")) { - *type_out = NORMAL_HOSTNAME; /* neither .exit nor .anon, thus normal */ + *type_out = NORMAL_HOSTNAME; /* neither .exit nor .anyone, thus normal */ goto success; } @@ -1729,7 +1729,7 @@ parse_extended_hostname(char *address, hostname_type_t *type_out) s = strrchr(address,'.'); } - /* so it is .anon */ + /* so it is .anyone */ *s = 0; /* NUL-terminate it */ /* locate a 'sub-domain' component, in order to remove it */ q = strrchr(address, '.'); @@ -1914,7 +1914,7 @@ connection_ap_handshake_rewrite(entry_connection_t *conn, /* First, apply MapAddress and MAPADDRESS mappings. We need to do * these only for non-reverse lookups, since they don't exist for those. * We also need to do this before we consider automapping, since we might - * e.g. resolve irc.oftc.net into irconionaddress.anon, at which point + * e.g. resolve irc.oftc.net into irconionaddress.anyone, at which point * we'd need to automap it. */ if (socks->command != SOCKS_COMMAND_RESOLVE_PTR) { const unsigned rewrite_flags = AMR_FLAG_USE_MAPADDRESS; @@ -1929,7 +1929,7 @@ connection_ap_handshake_rewrite(entry_connection_t *conn, * automapping. Automapping happens when we're asked to resolve a * hostname, and AutomapHostsOnResolve is set, and the hostname has a * suffix listed in AutomapHostsSuffixes. It's a handy feature - * that lets you have Tor assign e.g. IPv6 addresses for .anon + * that lets you have Tor assign e.g. IPv6 addresses for .anyone * names, and return them safely from DNSPort. */ if (socks->command == SOCKS_COMMAND_RESOLVE && @@ -2071,9 +2071,9 @@ connection_ap_handle_onion(entry_connection_t *conn, time_t now = approx_time(); connection_t *base_conn = ENTRY_TO_CONN(conn); - /* If .anon address requests are disabled, refuse the request */ + /* If .anyone address requests are disabled, refuse the request */ if (!conn->entry_cfg.onion_traffic) { - log_warn(LD_APP, "Onion address %s requested from a port with .anon " + log_warn(LD_APP, "Onion address %s requested from a port with .anyone " "disabled", safe_str_client(socks->address)); connection_mark_unattached_ap(conn, END_STREAM_REASON_ENTRYPOLICY); return -1; @@ -2094,11 +2094,11 @@ connection_ap_handle_onion(entry_connection_t *conn, return -1; } - /* If we were passed a circuit, then we need to fail. .anon addresses + /* If we were passed a circuit, then we need to fail. .anyone addresses * only work when we launch our own circuits for now. */ if (circ) { log_warn(LD_CONTROL, "Attachstream to a circuit is not " - "supported for .anon addresses currently. Failing."); + "supported for .anyone addresses currently. Failing."); connection_mark_unattached_ap(conn, END_STREAM_REASON_TORPROTOCOL); return -1; } @@ -2358,7 +2358,7 @@ connection_ap_handshake_rewrite_and_attach(entry_connection_t *conn, implies no. */ } - /* Now, we handle everything that isn't a .anon address. */ + /* Now, we handle everything that isn't a .anyone address. */ if (addresstype != ONION_V3_HOSTNAME) { /* Not a hidden-service request. It's either a hostname or an IP, * possibly with a .exit that we stripped off. We're going to check @@ -2643,7 +2643,7 @@ connection_ap_handshake_rewrite_and_attach(entry_connection_t *conn, return 0; } else { - /* If we get here, it's a request for a .anon address! */ + /* If we get here, it's a request for a .anyone address! */ tor_assert(addresstype == ONION_V3_HOSTNAME); tor_assert(!automap); return connection_ap_handle_onion(conn, socks, circ); diff --git a/src/core/or/connection_edge.h b/src/core/or/connection_edge.h index a5f5a7dae4..3c6e4f02f0 100644 --- a/src/core/or/connection_edge.h +++ b/src/core/or/connection_edge.h @@ -40,7 +40,7 @@ const entry_connection_t *CONST_EDGE_TO_ENTRY_CONN(const edge_connection_t *); #define AP_CONN_STATE_MIN_ 5 /** State for a SOCKS connection: waiting for SOCKS request. */ #define AP_CONN_STATE_SOCKS_WAIT 5 -/** State for a SOCKS connection: got a y.anon URL; waiting to receive +/** State for a SOCKS connection: got a y.anyone URL; waiting to receive * rendezvous descriptor. */ #define AP_CONN_STATE_RENDDESC_WAIT 6 /** The controller will attach this connection to a circuit; it isn't our diff --git a/src/feature/control/control.c b/src/feature/control/control.c index 5a73870ca3..013c2d3a1f 100644 --- a/src/feature/control/control.c +++ b/src/feature/control/control.c @@ -243,7 +243,7 @@ connection_control_closed(control_connection_t *conn) if (hs_address_is_valid(cp)) { hs_service_del_ephemeral(cp); } else { - /* An invalid .anon in our list should NEVER happen */ + /* An invalid .anyone in our list should NEVER happen */ tor_fragile_assert(); } } SMARTLIST_FOREACH_END(cp); diff --git a/src/feature/control/control_cmd.c b/src/feature/control/control_cmd.c index 32e438ee12..a535d950c4 100644 --- a/src/feature/control/control_cmd.c +++ b/src/feature/control/control_cmd.c @@ -1571,7 +1571,7 @@ handle_control_hspost(control_connection_t *conn, * The ownership of that list is transferred to the service. * * On success (RSAE_OKAY), the address_out points to a newly allocated string - * containing the onion address without the .anon part. On error, address_out + * containing the onion address without the .anyone part. On error, address_out * is untouched. */ STATIC hs_service_add_ephemeral_status_t add_onion_helper_add_service(int hs_version, diff --git a/src/feature/control/control_fmt.c b/src/feature/control/control_fmt.c index 6e32f037fa..170d2705b9 100644 --- a/src/feature/control/control_fmt.c +++ b/src/feature/control/control_fmt.c @@ -41,7 +41,7 @@ write_stream_target_to_buf(entry_connection_t *conn, char *buf, size_t len) conn->socks_request->address, conn->chosen_exit_name ? buf2 : "", !conn->chosen_exit_name && connection_edge_is_rendezvous_stream( - ENTRY_TO_EDGE_CONN(conn)) ? ".anon" : "", + ENTRY_TO_EDGE_CONN(conn)) ? ".anyone" : "", conn->socks_request->port)<0) return -1; return 0; diff --git a/src/feature/hs/hs_client.c b/src/feature/hs/hs_client.c index 5ea15f2eae..d7d37d754c 100644 --- a/src/feature/hs/hs_client.c +++ b/src/feature/hs/hs_client.c @@ -305,7 +305,7 @@ close_all_socks_conns_waiting_for_desc(const ed25519_public_key_t *identity_pk, if (count > 0) { char onion_address[HS_SERVICE_ADDR_LEN_BASE32 + 1]; hs_build_address(identity_pk, HS_VERSION_THREE, onion_address); - log_notice(LD_REND, "Closed %u streams for service %s.anon " + log_notice(LD_REND, "Closed %u streams for service %s.anyone " "for reason %s. Fetch status: %s.", count, safe_str_client(onion_address), stream_end_reason_to_string(reason), diff --git a/src/feature/hs/hs_common.c b/src/feature/hs/hs_common.c index d808d40389..84f98a21e0 100644 --- a/src/feature/hs/hs_common.c +++ b/src/feature/hs/hs_common.c @@ -478,7 +478,7 @@ build_blinded_key_param(const ed25519_public_key_t *pubkey, /** Using an ed25519 public key and version to build the checksum of an * address. Put in checksum_out. Format is: - * SHA3-256(".anon checksum" || PUBKEY || VERSION) + * SHA3-256(".anyone checksum" || PUBKEY || VERSION) * * checksum_out must be large enough to receive 32 bytes (DIGEST256_LEN). */ static void @@ -895,7 +895,7 @@ hs_address_is_valid(const char *address) * * Format is as follows: * base32(PUBKEY || CHECKSUM || VERSION) - * CHECKSUM = H(".anon checksum" || PUBKEY || VERSION) + * CHECKSUM = H(".anyone checksum" || PUBKEY || VERSION) * */ void hs_build_address(const ed25519_public_key_t *key, uint8_t version, diff --git a/src/feature/hs/hs_common.h b/src/feature/hs/hs_common.h index 477d7cac6f..4aa94671c1 100644 --- a/src/feature/hs/hs_common.h +++ b/src/feature/hs/hs_common.h @@ -57,13 +57,13 @@ struct ed25519_keypair_t; #define HS_TIME_PERIOD_LENGTH_MAX (60 * 24 * 10) /* 10 days or 14400 minutes */ /** Prefix of the onion address checksum. */ -#define HS_SERVICE_ADDR_CHECKSUM_PREFIX ".anon checksum" +#define HS_SERVICE_ADDR_CHECKSUM_PREFIX ".anyone checksum" /** Length of the checksum prefix minus the NUL terminated byte. */ #define HS_SERVICE_ADDR_CHECKSUM_PREFIX_LEN \ (sizeof(HS_SERVICE_ADDR_CHECKSUM_PREFIX) - 1) /** Length of the resulting checksum of the address. The construction of this * checksum looks like: - * CHECKSUM = ".anon checksum" || PUBKEY || VERSION + * CHECKSUM = ".anyone checksum" || PUBKEY || VERSION * where VERSION is 1 byte. This is pre-hashing. */ #define HS_SERVICE_ADDR_CHECKSUM_INPUT_LEN \ (HS_SERVICE_ADDR_CHECKSUM_PREFIX_LEN + ED25519_PUBKEY_LEN + sizeof(uint8_t)) @@ -75,12 +75,12 @@ struct ed25519_keypair_t; * with 1 byte VERSION and 2 bytes CHECKSUM. The following is 35 bytes. */ #define HS_SERVICE_ADDR_LEN \ (ED25519_PUBKEY_LEN + HS_SERVICE_ADDR_CHECKSUM_LEN_USED + sizeof(uint8_t)) -/** Length of 'y' portion of 'y.anon' URL. This is base32 encoded and the +/** Length of 'y' portion of 'y.anyone' URL. This is base32 encoded and the * length ends up to 56 bytes (not counting the terminated NUL byte.) */ #define HS_SERVICE_ADDR_LEN_BASE32 \ (CEIL_DIV(HS_SERVICE_ADDR_LEN * 8, 5)) -#define HS_SERVICE_ADDR_SUFFIX ".anon" +#define HS_SERVICE_ADDR_SUFFIX ".anyone" /** Length of the suffix minus the NUL terminated byte. */ #define HS_SERVICE_ADDR_SUFFIX_LENGTH (sizeof(HS_SERVICE_ADDR_SUFFIX) - 1) #define HS_SERVICE_ADDR_LENGTH_WITH_SUFFIX (HS_SERVICE_ADDR_LEN_BASE32 + HS_SERVICE_ADDR_SUFFIX_LENGTH) diff --git a/src/feature/hs/hs_descriptor.h b/src/feature/hs/hs_descriptor.h index a690fe0d78..259c396e54 100644 --- a/src/feature/hs/hs_descriptor.h +++ b/src/feature/hs/hs_descriptor.h @@ -73,11 +73,11 @@ typedef enum { /** Error code when decoding a descriptor. */ typedef enum { - /* The configured client authorization for the requested .anon address + /* The configured client authorization for the requested .anyone address * failed to decode the descriptor. */ HS_DESC_DECODE_BAD_CLIENT_AUTH = -6, - /* The requested .anon address requires a client authorization. */ + /* The requested .anyone address requires a client authorization. */ HS_DESC_DECODE_NEED_CLIENT_AUTH = -5, /* Error during decryption of the encrypted layer. */ diff --git a/src/feature/hs/hs_ob.c b/src/feature/hs/hs_ob.c index 9dafb21b10..b2612a5e4d 100644 --- a/src/feature/hs/hs_ob.c +++ b/src/feature/hs/hs_ob.c @@ -95,7 +95,7 @@ ob_option_new(void) } /** Helper function: From the configuration line value which is an onion - * address with the ".anon" extension, find the public key and put it in + * address with the ".anyone" extension, find the public key and put it in * pkey_out. * * On success, true is returned. Else, false and pkey is untouched. */ @@ -107,22 +107,22 @@ get_onion_public_key(const char *value, ed25519_public_key_t *pkey_out) tor_assert(value); tor_assert(pkey_out); - if (strcmpend(value, ".anon")) { - /* Not a .anon extension, bad format. */ + if (strcmpend(value, ".anyone")) { + /* Not a .anyone extension, bad format. */ return false; } /* Length validation. The -1 is because sizeof() counts the NUL byte. */ if (strlen(value) > - (HS_SERVICE_ADDR_LEN_BASE32 + sizeof(".anon") - 1)) { + (HS_SERVICE_ADDR_LEN_BASE32 + sizeof(".anyone") - 1)) { /* Too long, bad format. */ return false; } - /* We don't want the .anon so we add 2 because size - 1 is copied with + /* We don't want the .anyone so we add 2 because size - 1 is copied with * strlcpy() in order to accommodate the NUL byte and sizeof() counts the NUL * byte so we need to remove them from the equation. */ - strlcpy(address, value, strlen(value) - sizeof(".anon") + 2); + strlcpy(address, value, strlen(value) - sizeof(".anyone") + 2); if (hs_parse_address_no_log(address, pkey_out, NULL, NULL, NULL) < 0) { return false; diff --git a/src/feature/hs/hs_service.h b/src/feature/hs/hs_service.h index 28ac749e34..47acf7a6a5 100644 --- a/src/feature/hs/hs_service.h +++ b/src/feature/hs/hs_service.h @@ -272,7 +272,7 @@ typedef struct hs_service_config_t { uint32_t pow_queue_burst; /** If set, contains the Onion Balance master ed25519 public key (taken from - * an .anon addresses) that this tor instance serves as backend. */ + * an .anyone addresses) that this tor instance serves as backend. */ smartlist_t *ob_master_pubkeys; } hs_service_config_t; diff --git a/src/test/hs_build_address.py b/src/test/hs_build_address.py index edcae3c430..d0fda88d42 100644 --- a/src/test/hs_build_address.py +++ b/src/test/hs_build_address.py @@ -28,8 +28,8 @@ sys.exit(1) # Checksum is built like so: -# CHECKSUM = SHA3(".anon checksum" || PUBKEY || VERSION) -PREFIX = ".anon checksum".encode() +# CHECKSUM = SHA3(".anyone checksum" || PUBKEY || VERSION) +PREFIX = ".anyone checksum".encode() # 32 bytes ed25519 pubkey from first test vector of # https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-02#section-6 PUBKEY_STRING = "d75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a" @@ -44,7 +44,7 @@ checksum = hashlib.sha3_256(data).digest() # Onion address is built like so: -# onion_address = base32(PUBKEY || CHECKSUM || VERSION) + ".anon" +# onion_address = base32(PUBKEY || CHECKSUM || VERSION) + ".anyone" address = struct.pack('!32s2sb', PUBKEY, checksum, VERSION) onion_addr = base64.b32encode(address).decode().lower() diff --git a/src/test/test_addr.c b/src/test/test_addr.c index c94c9ff492..15a98aec96 100644 --- a/src/test/test_addr.c +++ b/src/test/test_addr.c @@ -1413,9 +1413,9 @@ test_virtaddrmap_persist(void *data) testing_enable_prefilled_rng(canned_data, canned_data_len); a = addressmap_register_virtual_address(RESOLVED_TYPE_IPV4, - tor_strdup("wumble.anon")); + tor_strdup("wumble.anyone")); b = addressmap_register_virtual_address(RESOLVED_TYPE_IPV4, - tor_strdup("wumpus.anon")); + tor_strdup("wumpus.anyone")); tt_str_op(a, OP_EQ, "192.168.3.4"); tt_str_op(b, OP_EQ, "192.168.7.240"); testing_disable_prefilled_rng(); @@ -1467,7 +1467,7 @@ test_virtaddrmap_persist(void *data) // There is some chance this one will fail if a previous random // allocation gave out the address already. a = addressmap_register_virtual_address(RESOLVED_TYPE_IPV4, - tor_strdup("might-work.anon")); + tor_strdup("might-work.anyone")); if (a) { tt_str_op(a, OP_EQ, "192.168.1.1"); } @@ -1475,7 +1475,7 @@ test_virtaddrmap_persist(void *data) // This one will definitely fail, since we've set up the RNG to hand // out "1" forever. b = addressmap_register_virtual_address(RESOLVED_TYPE_IPV4, - tor_strdup("wont-work.anon")); + tor_strdup("wont-work.anyone")); tt_assert(b == NULL); expect_single_log_msg_containing("Ran out of virtual addresses!"); diff --git a/src/test/test_crypto_rng.c b/src/test/test_crypto_rng.c index 2765210a34..ac17eb67d7 100644 --- a/src/test/test_crypto_rng.c +++ b/src/test/test_crypto_rng.c @@ -43,20 +43,20 @@ test_crypto_rng(void *arg) d = crypto_rand_double(); tt_assert(d >= 0); tt_assert(d < 1.0); - host = crypto_random_hostname(3,7,"www.",".anon"); + host = crypto_random_hostname(3,9,"www.",".anyone"); if (strcmpstart(host,"www.") || - strcmpend(host,".anon") || - strlen(host) < 12 || - strlen(host) > 17) + strcmpend(host,".anyone") || + strlen(host) < 14 || + strlen(host) > 19) allok = 0; tor_free(host); } /* Make sure crypto_random_hostname clips its inputs properly. */ - h = crypto_random_hostname(20000, 9000, "www.", ".anon"); + h = crypto_random_hostname(20000, 9000, "www.", ".anyone"); tt_assert(! strcmpstart(h,"www.")); - tt_assert(! strcmpend(h,".anon")); - tt_int_op(63+4+5, OP_EQ, strlen(h)); + tt_assert(! strcmpend(h,".anyone")); + tt_int_op(63+4+7, OP_EQ, strlen(h)); tt_assert(allok); done: diff --git a/src/tools/anon-resolve.c b/src/tools/anon-resolve.c index 773a93f362..c91690297a 100644 --- a/src/tools/anon-resolve.c +++ b/src/tools/anon-resolve.c @@ -314,7 +314,7 @@ parse_socks4a_resolve_response(const char *hostname, status = socks4_server_reply_get_status(reply); if (status != 90) { log_warn(LD_NET,"Got status response '%d': socks request failed.", status); - if (!strcasecmpend(hostname, ".anon")) { + if (!strcasecmpend(hostname, ".anyone")) { onion_hs_warning(hostname); result = -1; goto cleanup; } @@ -507,7 +507,7 @@ do_resolve(const char *hostname, log_warn(LD_NET,"Got SOCKS5 status response '%u': %s", (unsigned)reply_field, socks5_reason_to_string(reply_field)); - if (reply_field == 4 && !strcasecmpend(hostname, ".anon")) { + if (reply_field == 4 && !strcasecmpend(hostname, ".anyone")) { onion_hs_warning(hostname); } From 2cdac78d3cade469425531c4100378659cf69cd8 Mon Sep 17 00:00:00 2001 From: Jim Toth Date: Mon, 13 Oct 2025 21:16:47 -0400 Subject: [PATCH 2/8] WIP: Initial pass of changing .anon -> .anyone --- src/test/conf_examples/large_1/anonrc | 2 +- src/test/conf_examples/large_1/expected | 2 +- .../conf_examples/large_1/expected_no_dirauth | 2 +- src/test/test_entryconn.c | 42 +++++++++---------- src/test/test_hs_client.c | 6 +-- src/test/test_hs_common.c | 25 ++++++----- src/test/test_hs_ob.c | 8 ++-- src/test/test_hs_service.c | 2 +- 8 files changed, 44 insertions(+), 45 deletions(-) diff --git a/src/test/conf_examples/large_1/anonrc b/src/test/conf_examples/large_1/anonrc index 955bcc15d3..9c5d879fa6 100644 --- a/src/test/conf_examples/large_1/anonrc +++ b/src/test/conf_examples/large_1/anonrc @@ -4,7 +4,7 @@ AccountingStart day 05:15 Address 128.66.8.8 AllowNonRFC953Hostnames 1 AutomapHostsOnResolve 1 -AutomapHostsSuffixes .anons +AutomapHostsSuffixes .anyones AvoidDiskWrites 1 BandwidthBurst 2 GB BandwidthRate 1.5 GB diff --git a/src/test/conf_examples/large_1/expected b/src/test/conf_examples/large_1/expected index b74f474331..6bb45f91e1 100644 --- a/src/test/conf_examples/large_1/expected +++ b/src/test/conf_examples/large_1/expected @@ -4,7 +4,7 @@ AccountingStart day 05:15 Address 128.66.8.8 AllowNonRFC953Hostnames 1 AutomapHostsOnResolve 1 -AutomapHostsSuffixes .anons +AutomapHostsSuffixes .anyones AvoidDiskWrites 1 BandwidthBurst 2147483647 BandwidthRate 1610612736 diff --git a/src/test/conf_examples/large_1/expected_no_dirauth b/src/test/conf_examples/large_1/expected_no_dirauth index 336457850b..dd24e6f997 100644 --- a/src/test/conf_examples/large_1/expected_no_dirauth +++ b/src/test/conf_examples/large_1/expected_no_dirauth @@ -4,7 +4,7 @@ AccountingStart day 05:15 Address 128.66.8.8 AllowNonRFC953Hostnames 1 AutomapHostsOnResolve 1 -AutomapHostsSuffixes .anons +AutomapHostsSuffixes .anyones AvoidDiskWrites 1 BandwidthBurst 2147483647 BandwidthRate 1610612736 diff --git a/src/test/test_entryconn.c b/src/test/test_entryconn.c index adfa4f2d00..cde8c409c0 100644 --- a/src/test/test_entryconn.c +++ b/src/test/test_entryconn.c @@ -542,7 +542,7 @@ test_entryconn_rewrite_mapaddress_exit(void *arg) ; } -/* Map foo.anon to longthing.anon, and also automap. */ +/* Map foo.anyone to longthing.anyone, and also automap. */ static void test_entryconn_rewrite_mapaddress_automap_onion(void *arg) { @@ -559,14 +559,14 @@ test_entryconn_rewrite_mapaddress_automap_onion(void *arg) get_options_mutable()->AutomapHostsOnResolve = 1; smartlist_add_strdup(get_options_mutable()->AutomapHostsSuffixes, - ".anon"); + ".anyone"); parse_virtual_addr_network("192.168.0.0/16", AF_INET, 0, &msg); config_line_append(&get_options_mutable()->AddressMap, - "MapAddress", "foo.anon abcdefghijklmnop.anon"); + "MapAddress", "foo.anyone abcdefghijklmnop.anyone"); config_register_addressmaps(get_options()); - /* Connect to foo.anon. */ - strlcpy(ec->socks_request->address, "foo.anon", + /* Connect to foo.anyone. */ + strlcpy(ec->socks_request->address, "foo.anyone", sizeof(ec->socks_request->address)); ec->socks_request->command = SOCKS_COMMAND_CONNECT; connection_ap_handshake_rewrite(ec, &rr); @@ -576,11 +576,11 @@ test_entryconn_rewrite_mapaddress_automap_onion(void *arg) tt_int_op(rr.end_reason, OP_EQ, 0); tt_i64_op(rr.map_expires, OP_EQ, TIME_MAX); tt_int_op(rr.exit_source, OP_EQ, ADDRMAPSRC_NONE); - tt_str_op(rr.orig_address, OP_EQ, "foo.anon"); - tt_str_op(ec->socks_request->address, OP_EQ, "abcdefghijklmnop.anon"); + tt_str_op(rr.orig_address, OP_EQ, "foo.anyone"); + tt_str_op(ec->socks_request->address, OP_EQ, "abcdefghijklmnop.anyone"); - /* Okay, resolve foo.anon */ - strlcpy(ec2->socks_request->address, "foo.anon", + /* Okay, resolve foo.anyone */ + strlcpy(ec2->socks_request->address, "foo.anyone", sizeof(ec2->socks_request->address)); ec2->socks_request->command = SOCKS_COMMAND_RESOLVE; connection_ap_handshake_rewrite(ec2, &rr); @@ -590,7 +590,7 @@ test_entryconn_rewrite_mapaddress_automap_onion(void *arg) tt_int_op(rr.end_reason, OP_EQ, 0); tt_i64_op(rr.map_expires, OP_EQ, TIME_MAX); tt_int_op(rr.exit_source, OP_EQ, ADDRMAPSRC_NONE); - tt_str_op(rr.orig_address, OP_EQ, "foo.anon"); + tt_str_op(rr.orig_address, OP_EQ, "foo.anyone"); tt_assert(!strcmpstart(ec2->socks_request->address, "192.168.")); /* Now connect */ @@ -602,10 +602,10 @@ test_entryconn_rewrite_mapaddress_automap_onion(void *arg) tt_int_op(rr.should_close, OP_EQ, 0); tt_int_op(rr.end_reason, OP_EQ, 0); tt_assert(!strcmpstart(ec3->socks_request->address, - "abcdefghijklmnop.anon")); + "abcdefghijklmnop.anyone")); - /* Now resolve abcefghijklmnop.anon. */ - strlcpy(ec4->socks_request->address, "abcdefghijklmnop.anon", + /* Now resolve abcefghijklmnop.anyone. */ + strlcpy(ec4->socks_request->address, "abcdefghijklmnop.anyone", sizeof(ec4->socks_request->address)); ec4->socks_request->command = SOCKS_COMMAND_RESOLVE; connection_ap_handshake_rewrite(ec4, &rr); @@ -615,7 +615,7 @@ test_entryconn_rewrite_mapaddress_automap_onion(void *arg) tt_int_op(rr.end_reason, OP_EQ, 0); tt_i64_op(rr.map_expires, OP_EQ, TIME_MAX); tt_int_op(rr.exit_source, OP_EQ, ADDRMAPSRC_NONE); - tt_str_op(rr.orig_address, OP_EQ, "abcdefghijklmnop.anon"); + tt_str_op(rr.orig_address, OP_EQ, "abcdefghijklmnop.anyone"); tt_assert(!strcmpstart(ec4->socks_request->address, "192.168.")); /* XXXX doesn't work tt_str_op(ec4->socks_request->address, OP_EQ, ec2->socks_request->address); @@ -652,7 +652,7 @@ test_entryconn_rewrite_mapaddress_automap_onion_common(entry_connection_t *ec, tt_int_op(rr.exit_source, OP_EQ, ADDRMAPSRC_NONE); tt_str_op(rr.orig_address, OP_EQ, "irc.example.com"); tt_str_op(ec->socks_request->address, OP_EQ, - map_to_onion ? "abcdefghijklmnop.anon" : "irc.example.com"); + map_to_onion ? "abcdefghijklmnop.anyone" : "irc.example.com"); /* Okay, resolve irc.example.com */ strlcpy(ec2->socks_request->address, "irc.example.com", @@ -679,7 +679,7 @@ test_entryconn_rewrite_mapaddress_automap_onion_common(entry_connection_t *ec, tt_int_op(rr.end_reason, OP_EQ, 0); if (map_to_onion) tt_assert(!strcmpstart(ec3->socks_request->address, - "abcdefghijklmnop.anon")); + "abcdefghijklmnop.anyone")); done: connection_free_minimal(ENTRY_TO_CONN(ec2)); @@ -694,10 +694,10 @@ test_entryconn_rewrite_mapaddress_automap_onion2(void *arg) char *msg = NULL; get_options_mutable()->AutomapHostsOnResolve = 1; smartlist_add_strdup(get_options_mutable()->AutomapHostsSuffixes, - ".anon"); + ".anyone"); parse_virtual_addr_network("192.168.0.0/16", AF_INET, 0, &msg); config_line_append(&get_options_mutable()->AddressMap, - "MapAddress", "irc.example.com abcdefghijklmnop.anon"); + "MapAddress", "irc.example.com abcdefghijklmnop.anyone"); config_register_addressmaps(get_options()); test_entryconn_rewrite_mapaddress_automap_onion_common(arg, 1, 1); @@ -708,7 +708,7 @@ static void test_entryconn_rewrite_mapaddress_automap_onion3(void *arg) { config_line_append(&get_options_mutable()->AddressMap, - "MapAddress", "irc.example.com abcdefghijklmnop.anon"); + "MapAddress", "irc.example.com abcdefghijklmnop.anyone"); config_register_addressmaps(get_options()); test_entryconn_rewrite_mapaddress_automap_onion_common(arg, 1, 0); @@ -721,7 +721,7 @@ test_entryconn_rewrite_mapaddress_automap_onion4(void *arg) char *msg = NULL; get_options_mutable()->AutomapHostsOnResolve = 1; smartlist_add_strdup(get_options_mutable()->AutomapHostsSuffixes, - ".anon"); + ".anyone"); parse_virtual_addr_network("192.168.0.0/16", AF_INET, 0, &msg); test_entryconn_rewrite_mapaddress_automap_onion_common(arg, 0, 1); @@ -741,7 +741,7 @@ test_entryconn_rewrite_onion_v3(void *arg) /* Make a SOCKS request */ conn->socks_request->command = SOCKS_COMMAND_CONNECT; strlcpy(conn->socks_request->address, - "git.25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenc2hqd.anon", + "git.25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenc2hqd.anyone", sizeof(conn->socks_request->address)); /* Make an onion connection using the SOCKS request */ diff --git a/src/test/test_hs_client.c b/src/test/test_hs_client.c index 2ab4e898a1..1300896afb 100644 --- a/src/test/test_hs_client.c +++ b/src/test/test_hs_client.c @@ -757,7 +757,7 @@ static void test_desc_has_arrived_cleanup(void *arg) { /* The goal of this test is to make sure we clean up everything in between - * two descriptors from the same .anon. Because intro points can change + * two descriptors from the same .anyone. Because intro points can change * from one descriptor to another, once we received a new descriptor, we * need to cleanup the remaining circuits so they aren't used or selected * when establishing a connection with the newly stored descriptor. @@ -791,7 +791,7 @@ test_desc_has_arrived_cleanup(void *arg) parse_rfc1123_time("Sat, 26 Oct 1985 14:00:00 UTC", &mock_ns.fresh_until); parse_rfc1123_time("Sat, 26 Oct 1985 16:00:00 UTC", &mock_ns.valid_until); - /* Build a descriptor for a specific .anon. */ + /* Build a descriptor for a specific .anyone. */ ret = ed25519_keypair_generate(&signing_kp, 0); tt_int_op(ret, OP_EQ, 0); desc = hs_helper_build_hs_desc_with_ip(&signing_kp); @@ -806,7 +806,7 @@ test_desc_has_arrived_cleanup(void *arg) tt_assert(cached_desc); hs_helper_desc_equal(desc, cached_desc); - /* Create two SOCKS connection for the same .anon both in the waiting for a + /* Create two SOCKS connection for the same .anyone both in the waiting for a * descriptor state. */ socks1 = helper_build_socks_connection(&signing_kp.pubkey, AP_CONN_STATE_RENDDESC_WAIT); diff --git a/src/test/test_hs_common.c b/src/test/test_hs_common.c index 007c1256c8..29d0f57cd4 100644 --- a/src/test/test_hs_common.c +++ b/src/test/test_hs_common.c @@ -101,7 +101,7 @@ mock_write_str_to_file(const char *path, const char *str, int bin) (void)bin; tt_str_op(path, OP_EQ, "/double/five"PATH_SEPARATOR"squared"); tt_str_op(str, OP_EQ, - "25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenc2hqd.anon\n"); + "25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenc2hqd.anyone\n"); done: return 0; @@ -799,23 +799,22 @@ test_parse_extended_hostname(void *arg) (void) arg; hostname_type_t type; - char address1[] = "fooaddress.anon"; + char address1[] = "fooaddress.anyone"; char address3[] = "fooaddress.exit"; char address4[] = "www.torproject.org"; - char address5[] = "foo.abcdefghijklmnop.anon"; - char address6[] = "foo.bar.abcdefghijklmnop.anon"; - char address7[] = ".abcdefghijklmnop.anon"; + char address5[] = "foo.abcdefghijklmnop.anyone"; + char address6[] = "foo.bar.abcdefghijklmnop.anyone"; + char address7[] = ".abcdefghijklmnop.anyone"; char address8[] = - "www.25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenc2hqd.anon"; + "www.25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenc2hqd.anyone"; char address9[] = - "www.15njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenl5sid.anon"; + "www.15njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenl5sid.anyone"; char address10[] = - "15njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenl5sid7jdl.anon"; - char address11[] = "anyone.anon"; - char address12[] = ".anon"; - - char *path = get_datadir_fname("anons"); - write_str_to_file(path, "anyone.anon 25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenc2hqd.anon\n", 0); + "15njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenl5sid7jdl.anyone"; + char address11[] = "anyone.anyone"; + char address12[] = ".anyone"; + char *path = get_datadir_fname("anyones"); + write_str_to_file(path, "anyone.anyone 25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenc2hqd.anyone\n", 0); tt_assert(!parse_extended_hostname(address1, &type)); tt_int_op(type, OP_EQ, BAD_HOSTNAME); diff --git a/src/test/test_hs_ob.c b/src/test/test_hs_ob.c index 0d3bf096f2..c3fd33e17b 100644 --- a/src/test/test_hs_ob.c +++ b/src/test/test_hs_ob.c @@ -60,11 +60,11 @@ mock_read_file_to_str(const char *filename, int flags, struct stat *stat_out) if (!strcmp(filename, get_fname("hs3" PATH_SEPARATOR "ob_config"))) { if (config_is_good) { - tor_asprintf(&ret, "MasterOnionAddress %s.anon\n" - "MasterOnionAddress %s.anon\n", + tor_asprintf(&ret, "MasterOnionAddress %s.anyone\n" + "MasterOnionAddress %s.anyone\n", onion_addr_1, onion_addr_2); } else { - tor_asprintf(&ret, "MasterOnionAddress JUNKJUNKJUNK.anon\n" + tor_asprintf(&ret, "MasterOnionAddress JUNKJUNKJUNK.anyone\n" "UnknownOption BLAH\n"); } goto done; @@ -154,7 +154,7 @@ test_parse_config_file_bad(void *arg) tor_free(conf); tt_int_op(ret, OP_EQ, -1); expect_log_msg_containing("OnionBalance: MasterOnionAddress " - "JUNKJUNKJUNK.anon is invalid"); + "JUNKJUNKJUNK.anyone is invalid"); expect_log_msg_containing("Found unrecognized option \'UnknownOption\'; " "saving it."); teardown_capture_of_logs(); diff --git a/src/test/test_hs_service.c b/src/test/test_hs_service.c index a2d23008c3..f7309684b3 100644 --- a/src/test/test_hs_service.c +++ b/src/test/test_hs_service.c @@ -1940,7 +1940,7 @@ test_rendezvous1_parsing(void *arg) { int retval; static const char *test_addr = - "4acth47i6kxnvkewtm6q7ib2s3ufpo5sqbsnzjpbi7utijcltosqemad.anon"; + "4acth47i6kxnvkewtm6q7ib2s3ufpo5sqbsnzjpbi7utijcltosqemad.anyone"; hs_service_t *service = NULL; origin_circuit_t *service_circ = NULL; origin_circuit_t *client_circ = NULL; From 3ce5b272436a1ec09f1090ebe0c38028e678405f Mon Sep 17 00:00:00 2001 From: Jim Toth Date: Mon, 13 Oct 2025 21:31:01 -0400 Subject: [PATCH 3/8] WIP: More .anon -> .anyone updates --- src/core/or/connection_edge.c | 2 +- src/feature/hs/hs_service.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/or/connection_edge.c b/src/core/or/connection_edge.c index f7d8bc4d91..fcdbf2018a 100644 --- a/src/core/or/connection_edge.c +++ b/src/core/or/connection_edge.c @@ -1716,7 +1716,7 @@ parse_extended_hostname(char *address, hostname_type_t *type_out) *type_out = EXIT_HOSTNAME; /* .exit */ goto success; } - if (strcmp(s+1,"anon")) { + if (strcmp(s+1,"anyone")) { *type_out = NORMAL_HOSTNAME; /* neither .exit nor .anyone, thus normal */ goto success; } diff --git a/src/feature/hs/hs_service.c b/src/feature/hs/hs_service.c index 8e6add2fc3..e38cf29c95 100644 --- a/src/feature/hs/hs_service.c +++ b/src/feature/hs/hs_service.c @@ -100,7 +100,7 @@ static const char fname_keyfile_prefix[] = "hs_ed25519"; static const char dname_client_pubkeys[] = "authorized_clients"; static const char fname_hostname[] = "hostname"; -static const char address_tld[] = "anon"; +static const char address_tld[] = "anyone"; /** Staging list of service object. When configuring service, we add them to * this list considered a staging area and they will get added to our global From c67460ba782063cee0dc22ae3f7ea1c62edfc5e0 Mon Sep 17 00:00:00 2001 From: Jim Toth Date: Wed, 15 Oct 2025 10:53:31 -0400 Subject: [PATCH 4/8] Fixes remaining anyone dns issues failing unit tests --- src/app/config/config.c | 4 +-- src/app/config/config.h | 2 +- src/core/or/connection_edge.c | 14 ++++----- src/test/hs_build_address.py | 2 +- src/test/test_crypto_rng.c | 2 +- src/test/test_entryconn.c | 4 +-- src/test/test_hs_client.c | 4 +-- src/test/test_hs_common.c | 15 ++++----- src/test/test_hs_control.c | 58 +++++++++++++++++------------------ 9 files changed, 53 insertions(+), 52 deletions(-) diff --git a/src/app/config/config.c b/src/app/config/config.c index 22b8091ba9..5985042728 100644 --- a/src/app/config/config.c +++ b/src/app/config/config.c @@ -4595,10 +4595,10 @@ options_init_from_torrc(int argc, char **argv) } } - char *anons_fname = get_datadir_fname("anons"); + char *anons_fname = get_datadir_fname("anyones"); file_status_t anons_status = file_status(anons_fname); if (anons_status != FN_FILE) { - log_info(LD_CONFIG, "Creating anons file with default mapping"); + log_info(LD_CONFIG, "Creating anyones file with default mapping"); write_str_to_file(anons_fname, DEFAULT_ANON_DNS_MAPPING, 0); } diff --git a/src/app/config/config.h b/src/app/config/config.h index e770b123e9..b518270c67 100644 --- a/src/app/config/config.h +++ b/src/app/config/config.h @@ -47,7 +47,7 @@ int get_protocol_warning_severity_level(void); /** Pattern for backing up configuration files */ #define CONFIG_BACKUP_PATTERN "%s.orig.1" -#define DEFAULT_ANON_DNS_MAPPING "anyone.anon 6zctvi63m7xxbd34hxn2uvnaw5ao7sec4l3k4bflzeqtve5jlehz6tyd.anon" +#define DEFAULT_ANON_DNS_MAPPING "anyone.anyone 6zctvi63m7xxbd34hxn2uvnaw5ao7sec4l3k4bflzeqtve5jleh6ddyd.anyone" /** An error from options_trial_assign() or options_init_from_string(). */ typedef enum setopt_err_t { diff --git a/src/core/or/connection_edge.c b/src/core/or/connection_edge.c index fcdbf2018a..b306864cec 100644 --- a/src/core/or/connection_edge.c +++ b/src/core/or/connection_edge.c @@ -1721,10 +1721,10 @@ parse_extended_hostname(char *address, hostname_type_t *type_out) goto success; } - log_info(LD_APP, "Anon dns address lookup for: %s",address); + log_info(LD_APP, "Anyone dns address lookup for: %s",address); char onion_address[HS_SERVICE_ADDR_LENGTH_WITH_SUFFIX_WITH_NULL_TERMINATOR]; if (lookup_anon_dns_mapping(address,onion_address,HS_SERVICE_ADDR_LENGTH_WITH_SUFFIX_WITH_NULL_TERMINATOR)) { - log_notice(LD_APP, "Anon dns address mapping found: %s -> %s",address,onion_address); + log_notice(LD_APP, "Anyone dns address mapping found: %s -> %s",address,onion_address); strlcpy(address,onion_address,HS_SERVICE_ADDR_LENGTH_WITH_SUFFIX_WITH_NULL_TERMINATOR); s = strrchr(address,'.'); } @@ -1795,10 +1795,10 @@ bool lookup_anon_dns_mapping(const char *anon_address, char *onion_address_out, } // Check if the file exists using `file_status` - char *dns_fname = get_datadir_fname("anons"); - file_status_t terms_status = file_status(dns_fname); - if (terms_status != FN_FILE) { - log_notice(LD_APP,"DNS mapping file 'anons' is not found in data dir."); + char *dns_fname = get_datadir_fname("anyones"); + file_status_t dns_file_status = file_status(dns_fname); + if (dns_file_status != FN_FILE) { + log_notice(LD_APP,"DNS mapping file 'anyones' is not found in data dir."); return false; } @@ -1815,7 +1815,7 @@ bool lookup_anon_dns_mapping(const char *anon_address, char *onion_address_out, char anon[HS_SERVICE_DNS_MAX_ADDRESS_LENGTH_WITH_SUFFIX_WITH_NULL_TERMINATOR]; char onion[HS_SERVICE_ADDR_LENGTH_WITH_SUFFIX_WITH_NULL_TERMINATOR]; // Parse each line into anon and onion components - if (sscanf(line, "%260s %61s", anon, onion) == 2) { + if (sscanf(line, "%262s %63s", anon, onion) == 2) { if (strcmp(anon, anon_address) == 0) { if (strlen(onion) != HS_SERVICE_ADDR_LENGTH_WITH_SUFFIX) { log_warn(LD_APP, "Invalid onion address length"); diff --git a/src/test/hs_build_address.py b/src/test/hs_build_address.py index d0fda88d42..706bf93181 100644 --- a/src/test/hs_build_address.py +++ b/src/test/hs_build_address.py @@ -40,7 +40,7 @@ # Version 3 is proposal224 VERSION = 3 -data = struct.pack('14s32sb', PREFIX, PUBKEY, VERSION) +data = struct.pack('16s32sb', PREFIX, PUBKEY, VERSION) checksum = hashlib.sha3_256(data).digest() # Onion address is built like so: diff --git a/src/test/test_crypto_rng.c b/src/test/test_crypto_rng.c index ac17eb67d7..290bafcf3c 100644 --- a/src/test/test_crypto_rng.c +++ b/src/test/test_crypto_rng.c @@ -43,7 +43,7 @@ test_crypto_rng(void *arg) d = crypto_rand_double(); tt_assert(d >= 0); tt_assert(d < 1.0); - host = crypto_random_hostname(3,9,"www.",".anyone"); + host = crypto_random_hostname(3,8,"www.",".anyone"); if (strcmpstart(host,"www.") || strcmpend(host,".anyone") || strlen(host) < 14 || diff --git a/src/test/test_entryconn.c b/src/test/test_entryconn.c index cde8c409c0..9cd6d339ab 100644 --- a/src/test/test_entryconn.c +++ b/src/test/test_entryconn.c @@ -741,7 +741,7 @@ test_entryconn_rewrite_onion_v3(void *arg) /* Make a SOCKS request */ conn->socks_request->command = SOCKS_COMMAND_CONNECT; strlcpy(conn->socks_request->address, - "git.25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenc2hqd.anyone", + "git.25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenctcid.anyone", sizeof(conn->socks_request->address)); /* Make an onion connection using the SOCKS request */ @@ -758,7 +758,7 @@ test_entryconn_rewrite_onion_v3(void *arg) tt_int_op(ENTRY_TO_CONN(conn)->state, OP_EQ, AP_CONN_STATE_RENDDESC_WAIT); /* check that the address got rewritten */ tt_str_op(conn->socks_request->address, OP_EQ, - "25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenc2hqd"); + "25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenctcid"); /* check that HS information got attached to the connection */ tt_assert(ENTRY_TO_EDGE_CONN(conn)->hs_ident); diff --git a/src/test/test_hs_client.c b/src/test/test_hs_client.c index 1300896afb..d4efd528e3 100644 --- a/src/test/test_hs_client.c +++ b/src/test/test_hs_client.c @@ -664,7 +664,7 @@ mock_read_file_to_str(const char *filename, int flags, struct stat *stat_out) if (!strcmp(filename, get_fname("auth_keys" PATH_SEPARATOR "client2.auth_private"))) { ret = tor_strdup( - "25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenc2hqd:descriptor:" + "25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenctcid:descriptor:" "x25519:fdreqzjqso7d2ac7qscrxfl5qfpamdvgy5d6cxejcgzc3hvhurmq"); goto done; } @@ -728,7 +728,7 @@ test_config_client_authorization(void *arg) hs_parse_address("4acth47i6kxnvkewtm6q7ib2s3ufpo5sqbsnzjpbi7utijcltosqemad", &pk1, NULL, NULL); - hs_parse_address("25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenc2hqd", + hs_parse_address("25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenctcid", &pk2, NULL, NULL); tt_assert(digest256map_get(global_map, pk1.pubkey)); diff --git a/src/test/test_hs_common.c b/src/test/test_hs_common.c index 29d0f57cd4..1d309b6b2d 100644 --- a/src/test/test_hs_common.c +++ b/src/test/test_hs_common.c @@ -88,7 +88,7 @@ test_validate_address(void *arg) /* Valid address. */ ret = hs_address_is_valid( - "25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenc2hqd"); + "25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenctcid"); tt_int_op(ret, OP_EQ, 1); done: @@ -101,7 +101,7 @@ mock_write_str_to_file(const char *path, const char *str, int bin) (void)bin; tt_str_op(path, OP_EQ, "/double/five"PATH_SEPARATOR"squared"); tt_str_op(str, OP_EQ, - "25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenc2hqd.anyone\n"); + "25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenctcid.anyone\n"); done: return 0; @@ -127,7 +127,7 @@ test_build_address(void *arg) /* The following has been created with hs_build_address.py script that * follows proposal 224 specification to build an onion address. */ static const char *test_addr = - "25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenc2hqd"; + "25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenctcid"; /* Let's try to build the same onion address as the script */ base16_decode((char*)pubkey.pubkey, sizeof(pubkey.pubkey), @@ -806,15 +806,16 @@ test_parse_extended_hostname(void *arg) char address6[] = "foo.bar.abcdefghijklmnop.anyone"; char address7[] = ".abcdefghijklmnop.anyone"; char address8[] = - "www.25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenc2hqd.anyone"; + "www.25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenctcid.anyone"; char address9[] = "www.15njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenl5sid.anyone"; char address10[] = "15njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenl5sid7jdl.anyone"; char address11[] = "anyone.anyone"; char address12[] = ".anyone"; + char *path = get_datadir_fname("anyones"); - write_str_to_file(path, "anyone.anyone 25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenc2hqd.anyone\n", 0); + write_str_to_file(path, "anyone.anyone 25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenctcid.anyone\n", 0); tt_assert(!parse_extended_hostname(address1, &type)); tt_int_op(type, OP_EQ, BAD_HOSTNAME); @@ -837,7 +838,7 @@ test_parse_extended_hostname(void *arg) tt_assert(parse_extended_hostname(address8, &type)); tt_int_op(type, OP_EQ, ONION_V3_HOSTNAME); tt_str_op(address8, OP_EQ, - "25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenc2hqd"); + "25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenctcid"); /* Invalid v3 address. */ tt_assert(!parse_extended_hostname(address9, &type)); @@ -850,7 +851,7 @@ test_parse_extended_hostname(void *arg) tt_assert(parse_extended_hostname(address11, &type)); tt_int_op(type, OP_EQ, ONION_V3_HOSTNAME); tt_str_op(address11, OP_EQ, - "25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenc2hqd"); + "25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenctcid"); tt_assert(!parse_extended_hostname(address12, &type)); tt_int_op(type, OP_EQ, BAD_HOSTNAME); diff --git a/src/test/test_hs_control.c b/src/test/test_hs_control.c index 4a061cfa39..51373e490d 100644 --- a/src/test/test_hs_control.c +++ b/src/test/test_hs_control.c @@ -232,19 +232,19 @@ test_hs_control_good_onion_client_auth_add(void *arg) { /* Setup the services */ retval = hs_parse_address( - "2fvhjskjet3n5syd6yfg5lhvwcs62bojmthr35ko5bllr3iqdb4de3id", + "2fvhjskjet3n5syd6yfg5lhvwcs62bojmthr35ko5bllr3iqdb4aldqd", &service_identity_pk_2fv, NULL, NULL); tt_int_op(retval, OP_EQ, 0); retval = hs_parse_address( - "jt4grrjwzyz3pjkylwfau5xnjaj23vxmhskqaeyfhrfylelw4hvsshad", + "jt4grrjwzyz3pjkylwfau5xnjaj23vxmhskqaeyfhrfylelw4hvtvhid", &service_identity_pk_jt4, NULL, NULL); tt_int_op(retval, OP_EQ, 0); retval = hs_parse_address( - "jamie3vkiwibfiwucd6vxijskbhpjdyajmzeor4mc4i7yopvpo4cpvyd", + "jamie3vkiwibfiwucd6vxijskbhpjdyajmzeor4mc4i7yopvpo4mwdqd", &service_identity_pk_jam, NULL, NULL); tt_int_op(retval, OP_EQ, 0); @@ -254,7 +254,7 @@ test_hs_control_good_onion_client_auth_add(void *arg) tt_assert(!client_auths); /* Register first service */ - args = tor_strdup("2fvhjskjet3n5syd6yfg5lhvwcs62bojmthr35ko5bllr3iqdb4de3id " + args = tor_strdup("2fvhjskjet3n5syd6yfg5lhvwcs62bojmthr35ko5bllr3iqdb4aldqd " "x25519:iJ1tjKCrMAbiFT2bVrCjhbfMDnE1fpaRbIS5ZHKUvEQ= "); retval = handle_control_command(&conn, (uint32_t) strlen(args), args); @@ -268,7 +268,7 @@ test_hs_control_good_onion_client_auth_add(void *arg) tor_free(args); /* Register second service (even with an unrecognized argument) */ - args = tor_strdup("jt4grrjwzyz3pjkylwfau5xnjaj23vxmhskqaeyfhrfylelw4hvsshad " + args = tor_strdup("jt4grrjwzyz3pjkylwfau5xnjaj23vxmhskqaeyfhrfylelw4hvtvhid " "x25519:eIIdIGoSZwI2Q/lSzpf92akGki5I+PZIDz37MA5BhlA= DropSound=No"); retval = handle_control_command(&conn, (uint32_t) strlen(args), args); @@ -281,7 +281,7 @@ test_hs_control_good_onion_client_auth_add(void *arg) tor_free(args); /* Register second service (even with an unrecognized argument) */ - args = tor_strdup("jamie3vkiwibfiwucd6vxijskbhpjdyajmzeor4mc4i7yopvpo4cpvyd " + args = tor_strdup("jamie3vkiwibfiwucd6vxijskbhpjdyajmzeor4mc4i7yopvpo4mwdqd " "x25519:FCV0c0ELDKKDpSFgVIB8Yow8Evj5iD+GoiTtK878NkQ= " "ClientName=MeganNicole "); @@ -321,12 +321,12 @@ test_hs_control_good_onion_client_auth_add(void *arg) args = tor_strdup(""); #define VIEW_CORRECT_REPLY_NO_ADDR "250-ONION_CLIENT_AUTH_VIEW\r\n" \ - "250-CLIENT 2fvhjskjet3n5syd6yfg5lhvwcs62bojmthr35ko5bllr3iqdb4de3id " \ + "250-CLIENT 2fvhjskjet3n5syd6yfg5lhvwcs62bojmthr35ko5bllr3iqdb4aldqd " \ "x25519:iJ1tjKCrMAbiFT2bVrCjhbfMDnE1fpaRbIS5ZHKUvEQ=\r\n" \ - "250-CLIENT jamie3vkiwibfiwucd6vxijskbhpjdyajmzeor4mc4i7yopvpo4cpvyd " \ + "250-CLIENT jamie3vkiwibfiwucd6vxijskbhpjdyajmzeor4mc4i7yopvpo4mwdqd " \ "x25519:FCV0c0ELDKKDpSFgVIB8Yow8Evj5iD+GoiTtK878NkQ= " \ "ClientName=MeganNicole\r\n" \ - "250-CLIENT jt4grrjwzyz3pjkylwfau5xnjaj23vxmhskqaeyfhrfylelw4hvsshad " \ + "250-CLIENT jt4grrjwzyz3pjkylwfau5xnjaj23vxmhskqaeyfhrfylelw4hvtvhid " \ "x25519:eIIdIGoSZwI2Q/lSzpf92akGki5I+PZIDz37MA5BhlA=\r\n" \ "250 OK\r\n" @@ -339,11 +339,11 @@ test_hs_control_good_onion_client_auth_add(void *arg) /* Now specify an HS addr, and see that we only view those creds */ tor_free(args); args = - tor_strdup("jt4grrjwzyz3pjkylwfau5xnjaj23vxmhskqaeyfhrfylelw4hvsshad"); + tor_strdup("jt4grrjwzyz3pjkylwfau5xnjaj23vxmhskqaeyfhrfylelw4hvtvhid"); #define VIEW_CORRECT_REPLY_JT4 "250-ONION_CLIENT_AUTH_VIEW " \ - "jt4grrjwzyz3pjkylwfau5xnjaj23vxmhskqaeyfhrfylelw4hvsshad\r\n" \ - "250-CLIENT jt4grrjwzyz3pjkylwfau5xnjaj23vxmhskqaeyfhrfylelw4hvsshad " \ + "jt4grrjwzyz3pjkylwfau5xnjaj23vxmhskqaeyfhrfylelw4hvtvhid\r\n" \ + "250-CLIENT jt4grrjwzyz3pjkylwfau5xnjaj23vxmhskqaeyfhrfylelw4hvtvhid " \ "x25519:eIIdIGoSZwI2Q/lSzpf92akGki5I+PZIDz37MA5BhlA=\r\n" \ "250 OK\r\n" @@ -372,7 +372,7 @@ test_hs_control_good_onion_client_auth_add(void *arg) /* Now actually remove them. */ tor_free(args); - args =tor_strdup("jt4grrjwzyz3pjkylwfau5xnjaj23vxmhskqaeyfhrfylelw4hvsshad"); + args =tor_strdup("jt4grrjwzyz3pjkylwfau5xnjaj23vxmhskqaeyfhrfylelw4hvtvhid"); retval = handle_control_command(&conn, (uint32_t) strlen(args), args); tt_int_op(retval, OP_EQ, 0); @@ -388,7 +388,7 @@ test_hs_control_good_onion_client_auth_add(void *arg) tt_int_op(retval, OP_EQ, 0); cp1 = buf_get_contents(TO_CONN(&conn)->outbuf, &sz); tt_str_op(cp1, OP_EQ, "251 No credentials for " - "\"jt4grrjwzyz3pjkylwfau5xnjaj23vxmhskqaeyfhrfylelw4hvsshad\"\r\n"); + "\"jt4grrjwzyz3pjkylwfau5xnjaj23vxmhskqaeyfhrfylelw4hvtvhid\"\r\n"); tor_free(cp1); client_jt4 = digest256map_get(client_auths, service_identity_pk_jt4.pubkey); @@ -397,7 +397,7 @@ test_hs_control_good_onion_client_auth_add(void *arg) /* Now also remove the other one */ tor_free(args); args = - tor_strdup("2fvhjskjet3n5syd6yfg5lhvwcs62bojmthr35ko5bllr3iqdb4de3id"); + tor_strdup("2fvhjskjet3n5syd6yfg5lhvwcs62bojmthr35ko5bllr3iqdb4aldqd"); retval = handle_control_command(&conn, (uint32_t) strlen(args), args); tt_int_op(retval, OP_EQ, 0); @@ -408,7 +408,7 @@ test_hs_control_good_onion_client_auth_add(void *arg) /* Now also remove the other one */ tor_free(args); args = - tor_strdup("jamie3vkiwibfiwucd6vxijskbhpjdyajmzeor4mc4i7yopvpo4cpvyd"); + tor_strdup("jamie3vkiwibfiwucd6vxijskbhpjdyajmzeor4mc4i7yopvpo4mwdqd"); retval = handle_control_command(&conn, (uint32_t) strlen(args), args); tt_int_op(retval, OP_EQ, 0); @@ -487,7 +487,7 @@ test_hs_control_bad_onion_client_auth_add(void *arg) tor_free(args); /* Register second service (even with an unrecognized argument) */ - args = tor_strdup("jt4grrjwzyz3pjkylwfau5xnjaj23vxmhskqaeyfhrfylelw4hvsshad " + args = tor_strdup("jt4grrjwzyz3pjkylwfau5xnjaj23vxmhskqaeyfhrfylelw4hvtvhid " "love:eIIdIGoSZwI2Q/lSzpf92akGki5I+PZIDz37MA5BhlA="); retval = handle_control_command(&conn, (uint32_t) strlen(args), args); @@ -501,7 +501,7 @@ test_hs_control_bad_onion_client_auth_add(void *arg) tor_free(args); /* Register second service (even with an unrecognized argument) */ - args = tor_strdup("jt4grrjwzyz3pjkylwfau5xnjaj23vxmhskqaeyfhrfylelw4hvsshad " + args = tor_strdup("jt4grrjwzyz3pjkylwfau5xnjaj23vxmhskqaeyfhrfylelw4hvtvhid " "x25519:QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUEK"); retval = handle_control_command(&conn, (uint32_t) strlen(args), args); @@ -515,7 +515,7 @@ test_hs_control_bad_onion_client_auth_add(void *arg) tor_free(args); /* Register with an all zero client key */ - args = tor_strdup("jt4grrjwzyz3pjkylwfau5xnjaj23vxmhskqaeyfhrfylelw4hvsshad " + args = tor_strdup("jt4grrjwzyz3pjkylwfau5xnjaj23vxmhskqaeyfhrfylelw4hvtvhid " "x25519:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="); retval = handle_control_command(&conn, (uint32_t) strlen(args), args); tt_int_op(retval, OP_EQ, 0); @@ -565,7 +565,7 @@ test_hs_control_store_permanent_creds(void *arg) { /* Setup the services */ retval = hs_parse_address( - "2fvhjskjet3n5syd6yfg5lhvwcs62bojmthr35ko5bllr3iqdb4de3id", + "2fvhjskjet3n5syd6yfg5lhvwcs62bojmthr35ko5bllr3iqdb4aldqd", &service_identity_pk_2fv, NULL, NULL); tt_int_op(retval, OP_EQ, 0); @@ -575,7 +575,7 @@ test_hs_control_store_permanent_creds(void *arg) tt_assert(!client_auths); /* Try registering first service with no ClientOnionAuthDir set */ - args = tor_strdup("2fvhjskjet3n5syd6yfg5lhvwcs62bojmthr35ko5bllr3iqdb4de3id " + args = tor_strdup("2fvhjskjet3n5syd6yfg5lhvwcs62bojmthr35ko5bllr3iqdb4aldqd " "x25519:iJ1tjKCrMAbiFT2bVrCjhbfMDnE1fpaRbIS5ZHKUvEQ= " "Flags=Permanent"); @@ -585,7 +585,7 @@ test_hs_control_store_permanent_creds(void *arg) /* Check control port response. This one should fail. */ cp1 = buf_get_contents(TO_CONN(&conn)->outbuf, &sz); tt_str_op(cp1, OP_EQ, "553 Unable to store creds for " - "\"2fvhjskjet3n5syd6yfg5lhvwcs62bojmthr35ko5bllr3iqdb4de3id\"\r\n"); + "\"2fvhjskjet3n5syd6yfg5lhvwcs62bojmthr35ko5bllr3iqdb4aldqd\"\r\n"); { /* Setup ClientOnionAuthDir */ int ret; @@ -604,7 +604,7 @@ test_hs_control_store_permanent_creds(void *arg) tor_free(cp1); /* Try the control port command again. This time it should work! */ - args = tor_strdup("2fvhjskjet3n5syd6yfg5lhvwcs62bojmthr35ko5bllr3iqdb4de3id " + args = tor_strdup("2fvhjskjet3n5syd6yfg5lhvwcs62bojmthr35ko5bllr3iqdb4aldqd " "x25519:iJ1tjKCrMAbiFT2bVrCjhbfMDnE1fpaRbIS5ZHKUvEQ= " "Flags=Permanent"); retval = handle_control_command(&conn, (uint32_t) strlen(args), args); @@ -616,12 +616,12 @@ test_hs_control_store_permanent_creds(void *arg) /* Check file contents! */ creds_fname = tor_strdup(get_fname("permanent_credentials/" - "2fvhjskjet3n5syd6yfg5lhvwcs62bojmthr35ko5bllr3iqdb4de3id.auth_private")); + "2fvhjskjet3n5syd6yfg5lhvwcs62bojmthr35ko5bllr3iqdb4aldqd.auth_private")); creds_file_str = read_file_to_str(creds_fname, RFTS_BIN, NULL); tt_assert(creds_file_str); tt_str_op(creds_file_str, OP_EQ, - "2fvhjskjet3n5syd6yfg5lhvwcs62bojmthr35ko5bllr3iqdb4de3id:descriptor:" + "2fvhjskjet3n5syd6yfg5lhvwcs62bojmthr35ko5bllr3iqdb4aldqd:descriptor:" /* base32 representation of the base64 iJ1t... key above */ "x25519:rcow3dfavmyanyqvhwnvnmfdqw34ydtrgv7jnelmqs4wi4uuxrca"); @@ -629,7 +629,7 @@ test_hs_control_store_permanent_creds(void *arg) tor_free(cp1); /* Overwrite the credentials and check that they got overwritten. */ - args = tor_strdup("2fvhjskjet3n5syd6yfg5lhvwcs62bojmthr35ko5bllr3iqdb4de3id " + args = tor_strdup("2fvhjskjet3n5syd6yfg5lhvwcs62bojmthr35ko5bllr3iqdb4aldqd " "x25519:UDRvZLvcJo0QRLvDfkpgbtsqbkhIUQZyeo2FNBrgS18= " "Flags=Permanent"); retval = handle_control_command(&conn, (uint32_t) strlen(args), args); @@ -645,7 +645,7 @@ test_hs_control_store_permanent_creds(void *arg) creds_file_str = read_file_to_str(creds_fname, RFTS_BIN, NULL); tt_assert(creds_file_str); tt_str_op(creds_file_str, OP_EQ, - "2fvhjskjet3n5syd6yfg5lhvwcs62bojmthr35ko5bllr3iqdb4de3id:descriptor:" + "2fvhjskjet3n5syd6yfg5lhvwcs62bojmthr35ko5bllr3iqdb4aldqd:descriptor:" /* base32 representation of the base64 UDRv... key above */ "x25519:ka2g6zf33qti2ecexpbx4stan3nsu3sijbiqm4t2rwctigxajnpq"); @@ -675,7 +675,7 @@ test_hs_control_store_permanent_creds(void *arg) /* Do the REMOVE */ conn.current_cmd = tor_strdup("ONION_CLIENT_AUTH_REMOVE"); - args =tor_strdup("2fvhjskjet3n5syd6yfg5lhvwcs62bojmthr35ko5bllr3iqdb4de3id"); + args =tor_strdup("2fvhjskjet3n5syd6yfg5lhvwcs62bojmthr35ko5bllr3iqdb4aldqd"); retval = handle_control_command(&conn, (uint32_t) strlen(args), args); tt_int_op(retval, OP_EQ, 0); cp1 = buf_get_contents(TO_CONN(&conn)->outbuf, &sz); @@ -760,7 +760,7 @@ test_hs_control_add_auth_onion_service(void *arg) handle_control_command(&conn, (uint32_t) strlen(args), args); cp1 = buf_get_contents(TO_CONN(&conn)->outbuf, &sz); tt_str_op(cp1, OP_EQ, - "250-ServiceID=n35etu3yjxrqjpntmfziom5sjwspoydchmelc4xleoy4jk2u4lzev6id\r\n" + "250-ServiceID=n35etu3yjxrqjpntmfziom5sjwspoydchmelc4xleoy4jk2u4lzfwwqd\r\n" "250-ClientAuthV3=dz4q5xqlb4ldnbs72iarrml4ephk3du4i7o2cgiva5lwr6wkquja\r\n" "250 OK\r\n"); tor_free(args); From 25b7a68f2e9461a8b3388fb060c586492baeed51 Mon Sep 17 00:00:00 2001 From: Jim Toth Date: Wed, 22 Oct 2025 10:54:55 -0400 Subject: [PATCH 5/8] Renames anyones dns file to anyone_hosts --- src/app/config/config.c | 4 ++-- src/core/or/connection_edge.c | 4 ++-- src/test/test_hs_common.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/config/config.c b/src/app/config/config.c index 5985042728..4421f408a8 100644 --- a/src/app/config/config.c +++ b/src/app/config/config.c @@ -4595,10 +4595,10 @@ options_init_from_torrc(int argc, char **argv) } } - char *anons_fname = get_datadir_fname("anyones"); + char *anons_fname = get_datadir_fname("anyone_hosts"); file_status_t anons_status = file_status(anons_fname); if (anons_status != FN_FILE) { - log_info(LD_CONFIG, "Creating anyones file with default mapping"); + log_info(LD_CONFIG, "Creating anyone_hosts file with default mapping"); write_str_to_file(anons_fname, DEFAULT_ANON_DNS_MAPPING, 0); } diff --git a/src/core/or/connection_edge.c b/src/core/or/connection_edge.c index b306864cec..6436a04d21 100644 --- a/src/core/or/connection_edge.c +++ b/src/core/or/connection_edge.c @@ -1795,10 +1795,10 @@ bool lookup_anon_dns_mapping(const char *anon_address, char *onion_address_out, } // Check if the file exists using `file_status` - char *dns_fname = get_datadir_fname("anyones"); + char *dns_fname = get_datadir_fname("anyone_hosts"); file_status_t dns_file_status = file_status(dns_fname); if (dns_file_status != FN_FILE) { - log_notice(LD_APP,"DNS mapping file 'anyones' is not found in data dir."); + log_notice(LD_APP,"DNS mapping file 'anyone_hosts' is not found in data dir."); return false; } diff --git a/src/test/test_hs_common.c b/src/test/test_hs_common.c index 1d309b6b2d..8af1bbd83a 100644 --- a/src/test/test_hs_common.c +++ b/src/test/test_hs_common.c @@ -814,7 +814,7 @@ test_parse_extended_hostname(void *arg) char address11[] = "anyone.anyone"; char address12[] = ".anyone"; - char *path = get_datadir_fname("anyones"); + char *path = get_datadir_fname("anyone_hosts"); write_str_to_file(path, "anyone.anyone 25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenctcid.anyone\n", 0); tt_assert(!parse_extended_hostname(address1, &type)); From b114044d47afcab3df7cd0ee28213186b144dc56 Mon Sep 17 00:00:00 2001 From: Jim Toth Date: Wed, 22 Oct 2025 12:40:01 -0400 Subject: [PATCH 6/8] Fix test config examples suffixes -> .anyone --- src/test/conf_examples/large_1/anonrc | 2 +- src/test/conf_examples/large_1/expected | 2 +- src/test/conf_examples/large_1/expected_no_dirauth | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/conf_examples/large_1/anonrc b/src/test/conf_examples/large_1/anonrc index 9c5d879fa6..4fa4ef1f94 100644 --- a/src/test/conf_examples/large_1/anonrc +++ b/src/test/conf_examples/large_1/anonrc @@ -4,7 +4,7 @@ AccountingStart day 05:15 Address 128.66.8.8 AllowNonRFC953Hostnames 1 AutomapHostsOnResolve 1 -AutomapHostsSuffixes .anyones +AutomapHostsSuffixes .anyone AvoidDiskWrites 1 BandwidthBurst 2 GB BandwidthRate 1.5 GB diff --git a/src/test/conf_examples/large_1/expected b/src/test/conf_examples/large_1/expected index 6bb45f91e1..ccd8c3157b 100644 --- a/src/test/conf_examples/large_1/expected +++ b/src/test/conf_examples/large_1/expected @@ -4,7 +4,7 @@ AccountingStart day 05:15 Address 128.66.8.8 AllowNonRFC953Hostnames 1 AutomapHostsOnResolve 1 -AutomapHostsSuffixes .anyones +AutomapHostsSuffixes .anyone AvoidDiskWrites 1 BandwidthBurst 2147483647 BandwidthRate 1610612736 diff --git a/src/test/conf_examples/large_1/expected_no_dirauth b/src/test/conf_examples/large_1/expected_no_dirauth index dd24e6f997..1f7922a0de 100644 --- a/src/test/conf_examples/large_1/expected_no_dirauth +++ b/src/test/conf_examples/large_1/expected_no_dirauth @@ -4,7 +4,7 @@ AccountingStart day 05:15 Address 128.66.8.8 AllowNonRFC953Hostnames 1 AutomapHostsOnResolve 1 -AutomapHostsSuffixes .anyones +AutomapHostsSuffixes .anyone AvoidDiskWrites 1 BandwidthBurst 2147483647 BandwidthRate 1610612736 From e47705b0c68c507ce1909983160eccb8bb8d6b7c Mon Sep 17 00:00:00 2001 From: Jim Toth Date: Wed, 22 Oct 2025 18:09:00 -0400 Subject: [PATCH 7/8] Adds dev docker container, fixes docker anonrc-example header filepath, updates docker README to notify about ANON_ENV using dummy relays in dev builds --- docker/Dockerfile.dev | 52 ++++++++++++++++++++++++++++++++++++ docker/README.md | 9 ++++--- docker/config/anonrc-example | 2 +- 3 files changed, 59 insertions(+), 4 deletions(-) create mode 100644 docker/Dockerfile.dev diff --git a/docker/Dockerfile.dev b/docker/Dockerfile.dev new file mode 100644 index 0000000000..939f95ed6c --- /dev/null +++ b/docker/Dockerfile.dev @@ -0,0 +1,52 @@ +# +# Development Dockerfile for building and testing Anyone Protocol Client +# + +FROM debian:bookworm + +# Makes the default apt answers be used for all questions +ARG DEBIAN_FRONTEND=noninteractive + +# Install build dependencies and development tools +RUN apt-get update && \ + apt-get -y --no-install-recommends install \ + build-essential \ + automake \ + git \ + libssl-dev \ + zlib1g-dev \ + libevent-dev \ + ca-certificates \ + dh-apparmor \ + libseccomp-dev \ + debhelper \ + pkg-config \ + python3 \ + python3-pip \ + lcov \ + gcc \ + valgrind \ + gdb \ + vim \ + less \ + curl \ + && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +WORKDIR /workspace +COPY . /workspace/ + +# Set up build environment with test support +RUN ./autogen.sh && \ + ./configure \ + --enable-unittests \ + --enable-coverage \ + --enable-asserts-in-tests \ + --disable-asciidoc + +# Build the project +RUN make -j$(nproc) + +# Default command to show help +CMD [ "bash", "-c", "echo 'Anyone Protocol Client Development Container'; echo ''; echo 'Available commands:'; echo ' make check - Run all tests'; echo ' make test - Run unit tests'; echo ' make test-network - Run network tests (requires Chutney)'; echo ' ./src/test/test - Run unit tests directly'; echo ' bash - Interactive shell'; echo ''; exec bash" ] \ No newline at end of file diff --git a/docker/README.md b/docker/README.md index d07c4e7b47..c53d65f3a0 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,9 +1,12 @@ # ATOR Protocol Docker +This directory contains configs to build and run ATOR protocol binaries using +docker -This directory contains configs to build and run ATOR protocol binaries using docker +**Important!** -**Important!** -`This docker image will be built with dummy directory authorities, production ready DAs will be introduced later.` +This docker image will be built with dummy directory authorities. To build with +live directory authorities, run with `--build-arg ANON_ENV=blah` or any value +other than `stage` (default) or `dev`. ## Building Docker Image diff --git a/docker/config/anonrc-example b/docker/config/anonrc-example index 98e496f4c6..06170fd06f 100644 --- a/docker/config/anonrc-example +++ b/docker/config/anonrc-example @@ -1,4 +1,4 @@ -##=================== /etc/anonrc =====================## +##=================== /etc/anon/anonrc =====================## # Run Tor as a regular user (do not change this) User anond From 1c1eb285e6dba8b8169cf16e2e9bbb5d84ae09a7 Mon Sep 17 00:00:00 2001 From: Jim Toth Date: Thu, 23 Oct 2025 12:38:37 -0400 Subject: [PATCH 8/8] Push dev container images to ghcr --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 099aa319f2..3010f6f9f7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,4 +31,4 @@ jobs: docker-platform: ${{ matrix.platform.name }} version: ${{ github.sha }} environment: dev - push: false + push: true