aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--Makefile.am2
-rw-r--r--changes/175733
-rw-r--r--changes/178265
-rw-r--r--changes/179263
-rw-r--r--changes/179443
-rw-r--r--changes/74197
-rw-r--r--changes/bug156382
-rw-r--r--changes/bug16794_ed3
-rw-r--r--changes/bug170033
-rw-r--r--changes/bug174194
-rw-r--r--changes/bug176754
-rw-r--r--changes/bug178433
-rw-r--r--changes/bug178876
-rw-r--r--changes/bug178886
-rw-r--r--changes/bug178924
-rw-r--r--changes/bug178934
-rw-r--r--changes/bug179064
-rw-r--r--changes/bug179234
-rw-r--r--changes/bug179244
-rw-r--r--changes/bug180356
-rw-r--r--changes/bug180507
-rw-r--r--changes/bug180896
-rw-r--r--changes/feature125386
-rw-r--r--changes/feature167743
-rw-r--r--changes/feature170763
-rw-r--r--changes/feature177966
-rw-r--r--changes/feature179505
-rw-r--r--changes/feature179516
-rw-r--r--changes/feature179863
-rw-r--r--changes/geoip-january20164
-rw-r--r--changes/log_heartbeat_test6
-rw-r--r--changes/ticket159899
-rw-r--r--changes/ticket171587
-rw-r--r--configure.ac7
-rw-r--r--doc/include.am2
-rw-r--r--doc/tor.1.txt15
-rw-r--r--scripts/maint/fallback.blacklist22
-rw-r--r--scripts/maint/fallback.whitelist87
-rwxr-xr-xscripts/maint/updateFallbackDirs.py108
-rw-r--r--src/common/address.c81
-rw-r--r--src/common/address.h15
-rw-r--r--src/common/backtrace.c7
-rw-r--r--src/common/compat.c6
-rw-r--r--src/common/compat.h2
-rw-r--r--src/common/compat_openssl.h9
-rw-r--r--src/common/crypto.c249
-rw-r--r--src/common/crypto.h14
-rw-r--r--src/common/crypto_ed25519.c22
-rw-r--r--src/common/crypto_ed25519.h5
-rw-r--r--src/common/di_ops.c4
-rw-r--r--src/common/include.am3
-rw-r--r--src/common/tortls.c16
-rw-r--r--src/config/geoip1734
-rw-r--r--src/config/geoip6881
-rw-r--r--src/ext/README4
-rw-r--r--src/ext/include.am13
-rw-r--r--src/ext/keccak-tiny/README.markdown82
-rw-r--r--src/ext/keccak-tiny/do.sh5
-rw-r--r--src/ext/keccak-tiny/keccak-tiny-unrolled.c368
-rw-r--r--src/ext/keccak-tiny/keccak-tiny.c163
-rw-r--r--src/ext/keccak-tiny/keccak-tiny.h66
-rw-r--r--src/or/buffers.c2
-rw-r--r--src/or/circuituse.c28
-rw-r--r--src/or/config.c158
-rw-r--r--src/or/config.h23
-rw-r--r--src/or/connection.c14
-rw-r--r--src/or/connection_edge.c27
-rw-r--r--src/or/connection_or.c4
-rw-r--r--src/or/directory.c33
-rw-r--r--src/or/directory.h28
-rw-r--r--src/or/dirserv.c21
-rw-r--r--src/or/dirvote.c3
-rw-r--r--src/or/dirvote.h1
-rw-r--r--src/or/entrynodes.c2
-rw-r--r--src/or/ext_orport.c2
-rw-r--r--src/or/fallback_dirs.inc207
-rw-r--r--src/or/geoip.c2
-rw-r--r--src/or/hibernate.c20
-rw-r--r--src/or/hibernate.h1
-rw-r--r--src/or/include.am7
-rw-r--r--src/or/main.c21
-rw-r--r--src/or/networkstatus.c32
-rw-r--r--src/or/networkstatus.h4
-rw-r--r--src/or/nodelist.c17
-rw-r--r--src/or/or.h64
-rw-r--r--src/or/relay.c2
-rw-r--r--src/or/rendclient.c15
-rw-r--r--src/or/rendmid.c9
-rw-r--r--src/or/rendservice.c4
-rw-r--r--src/or/router.c140
-rw-r--r--src/or/router.h1
-rw-r--r--src/or/routerlist.c29
-rw-r--r--src/or/routerlist.h3
-rw-r--r--src/or/routerparse.c15
-rw-r--r--src/or/status.c22
-rw-r--r--src/or/transports.c2
-rw-r--r--src/test/bench.c40
-rwxr-xr-xsrc/test/bt_test.py9
-rw-r--r--src/test/include.am17
-rw-r--r--src/test/test_accounting.c26
-rw-r--r--src/test/test_addr.c1
-rw-r--r--src/test/test_address.c11
-rw-r--r--src/test/test_bt_cl.c1
-rw-r--r--src/test/test_config.c865
-rw-r--r--src/test/test_connection.c10
-rw-r--r--src/test/test_crypto.c460
-rw-r--r--src/test/test_dir.c768
-rw-r--r--src/test/test_dir_common.c425
-rw-r--r--src/test/test_dir_common.h52
-rw-r--r--src/test/test_dns.c3
-rw-r--r--src/test/test_nodelist.c41
-rw-r--r--src/test/test_options.c4136
-rw-r--r--src/test/test_policy.c2
-rw-r--r--src/test/test_routerlist.c284
-rw-r--r--src/test/test_status.c15
-rw-r--r--src/test/test_switch_id.c16
-rw-r--r--src/test/test_tortls.c13
-rw-r--r--src/test/test_util.c117
-rw-r--r--src/test/test_util_format.c40
-rw-r--r--src/tools/include.am3
121 files changed, 11121 insertions, 1340 deletions
diff --git a/.gitignore b/.gitignore
index c71dc026b2..b141e80e89 100644
--- a/.gitignore
+++ b/.gitignore
@@ -154,6 +154,8 @@ uptime-*.json
/src/ext/ed25519/ref10/libed25519_ref10.lib
/src/ext/ed25519/donna/libed25519_donna.a
/src/ext/ed25519/donna/libed25519_donna.lib
+/src/ext/keccak-tiny/libkeccak-tiny.a
+/src/ext/keccak-tiny/libkeccak-tiny.lib
# /src/or/
/src/or/Makefile
diff --git a/Makefile.am b/Makefile.am
index beea69d95e..fc9f7b27ba 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -73,8 +73,6 @@ dist-rpm: dist-gzip
echo "RPM build finished"; \
#end of dist-rpm
-dist: check
-
doxygen:
doxygen && cd doc/doxygen/latex && make
diff --git a/changes/17573 b/changes/17573
new file mode 100644
index 0000000000..fe1fd1c027
--- /dev/null
+++ b/changes/17573
@@ -0,0 +1,3 @@
+ o Minor bigfixes (IPv6):
+ - Update the limits in max_dl_per_request for IPv6 address
+ length. Closes ticket 17573.
diff --git a/changes/17826 b/changes/17826
new file mode 100644
index 0000000000..7d0a17afee
--- /dev/null
+++ b/changes/17826
@@ -0,0 +1,5 @@
+ o Minor bugfixes (build):
+ - Mark all object files that include micro-revision.i as depending on
+ it, so as to make our build more reliable with parallel builds.
+ Fixes bug 17826; bugfix on 0.2.5.1-alpha.
+
diff --git a/changes/17926 b/changes/17926
new file mode 100644
index 0000000000..09bdbbeae7
--- /dev/null
+++ b/changes/17926
@@ -0,0 +1,3 @@
+ o Removed code:
+ - Remove code for OpenSSL dynamic locks; OpenSSL doesn't use them.
+ Closes ticket 17926.
diff --git a/changes/17944 b/changes/17944
new file mode 100644
index 0000000000..0d8ed0a362
--- /dev/null
+++ b/changes/17944
@@ -0,0 +1,3 @@
+ o Minor features (portability):
+ - Use timingsafe_memcmp() where available. Closes ticket 17944;
+ patch from <logan@hackers.mu>.
diff --git a/changes/7419 b/changes/7419
new file mode 100644
index 0000000000..b792e8f6a0
--- /dev/null
+++ b/changes/7419
@@ -0,0 +1,7 @@
+ o Minor enhancement (security):
+ - Use explicit_bzero when present
+ from <logan@hackers.mu>.
+ - Use memset_s when present
+ from <selven@hackers.mu>
+
+ 625538405474972d627b26d7a250ea36 (:
diff --git a/changes/bug15638 b/changes/bug15638
new file mode 100644
index 0000000000..cf5d46983f
--- /dev/null
+++ b/changes/bug15638
@@ -0,0 +1,2 @@
+ o Documentation:
+ - Document the minimum HeartbeatPeriod value. Closes ticket 15638.
diff --git a/changes/bug16794_ed b/changes/bug16794_ed
new file mode 100644
index 0000000000..a43c401ed4
--- /dev/null
+++ b/changes/bug16794_ed
@@ -0,0 +1,3 @@
+ o Testing:
+ - Always test both ed25519 backends, so that we can be sure that
+ our batch-open replacement code works. Part of ticket 16794.
diff --git a/changes/bug17003 b/changes/bug17003
new file mode 100644
index 0000000000..8125f0e402
--- /dev/null
+++ b/changes/bug17003
@@ -0,0 +1,3 @@
+ o Testing:
+ - New tests for directory.c functions. Closes ticket 17003. Patch
+ from Ola Bini.
diff --git a/changes/bug17419 b/changes/bug17419
new file mode 100644
index 0000000000..8ad8edd37b
--- /dev/null
+++ b/changes/bug17419
@@ -0,0 +1,4 @@
+
+ o Minor bugfixes:
+ - When logging a malformed hostname received through socks4, scrub it
+ if SafeLogging says we should. Fixes bug 17419; bugfix on 0.1.1.16-rc.
diff --git a/changes/bug17675 b/changes/bug17675
new file mode 100644
index 0000000000..8326a0b9e8
--- /dev/null
+++ b/changes/bug17675
@@ -0,0 +1,4 @@
+ o Minor bugfixes (linux seccomp2 sandbox):
+ - Fix a crash when using offline master ed25519 keys with the
+ Linux seccomp2 sandbox enabled. Fixes bug 17675; bugfix on
+ 0.2.7.3-alpha.
diff --git a/changes/bug17843 b/changes/bug17843
new file mode 100644
index 0000000000..6cb16a0b6a
--- /dev/null
+++ b/changes/bug17843
@@ -0,0 +1,3 @@
+ o Minor bugfixes (logging):
+ - Remove needless quotes from a log message about unparseable addresses.
+ Fixes bug 17843; bugfix on 0.2.3.3-alpha.
diff --git a/changes/bug17887 b/changes/bug17887
new file mode 100644
index 0000000000..423c298bd5
--- /dev/null
+++ b/changes/bug17887
@@ -0,0 +1,6 @@
+ o Minor fixes (fallback directories):
+ - Allow cached or outdated Onionoo data to be used to choose
+ fallback directories, as long as it's less than a day old.
+ Modify last modified date checks in preparation for Onionoo change
+ #16907. Closes ticket #17887. Patch by "teor". Not in any released
+ version of tor.
diff --git a/changes/bug17888 b/changes/bug17888
new file mode 100644
index 0000000000..04e40b1556
--- /dev/null
+++ b/changes/bug17888
@@ -0,0 +1,6 @@
+ o Minor fixes (fallback directories):
+ - When selecting exits as fallback directories, don't reduce
+ their weights. (Several operators report having exits with
+ spare capacity.)
+ Closes ticket #17888. Patch by "teor". Not in any released
+ version of tor.
diff --git a/changes/bug17892 b/changes/bug17892
new file mode 100644
index 0000000000..73c26e9c94
--- /dev/null
+++ b/changes/bug17892
@@ -0,0 +1,4 @@
+ o Minor features (testing):
+ - Log more information when the backtrace tests fail.
+ Closes ticket 17892. Patch from "cypherpunks."
+
diff --git a/changes/bug17893 b/changes/bug17893
new file mode 100644
index 0000000000..06808c0017
--- /dev/null
+++ b/changes/bug17893
@@ -0,0 +1,4 @@
+ o Minor features (build):
+ - Since our build process now uses 'make distcheck', we no longer force
+ "make dist" to depend on "make check". Closes ticket 17893;
+ patch from "cypherpunks."
diff --git a/changes/bug17906 b/changes/bug17906
new file mode 100644
index 0000000000..fff76d1c59
--- /dev/null
+++ b/changes/bug17906
@@ -0,0 +1,4 @@
+ o Minor features (authorities):
+ - Update the V3 identity key for dannenberg, it was changed on
+ 18 November 2015.
+ Closes task #17906. Patch by "teor".
diff --git a/changes/bug17923 b/changes/bug17923
new file mode 100644
index 0000000000..ea39960711
--- /dev/null
+++ b/changes/bug17923
@@ -0,0 +1,4 @@
+ o Minor bugfixes:
+ - Remove an #endif from configure.ac so that we correctly detect
+ the presence of in6_addr.s6_addr32. Fixes bug 17923; bugfix on
+ 0.2.0.13-alpha.
diff --git a/changes/bug17924 b/changes/bug17924
new file mode 100644
index 0000000000..aa5cf58730
--- /dev/null
+++ b/changes/bug17924
@@ -0,0 +1,4 @@
+ o Minor bugfixes (makefile):
+ - Remove config.log only from make distclean, not from
+ make clean. Fixes bug 17924; bugfix on 0.2.4.1-alpha.
+
diff --git a/changes/bug18035 b/changes/bug18035
new file mode 100644
index 0000000000..31889f5723
--- /dev/null
+++ b/changes/bug18035
@@ -0,0 +1,6 @@
+ o Minor fixes (fallback directories):
+ - Work around an issue where OnionOO supplies the entire history,
+ rather than the requested 120 days. Activate debug logging by
+ default. Fix other minor calculation and compatibility issues.
+ Closes ticket #18035. Patch by "starlight", merge fixes by
+ "teor". Not in any released version of tor.
diff --git a/changes/bug18050 b/changes/bug18050
new file mode 100644
index 0000000000..ce24a7738a
--- /dev/null
+++ b/changes/bug18050
@@ -0,0 +1,7 @@
+ o Minor fixes (relays):
+ - Check that both the ORPort and DirPort (if present) are reachable
+ before publishing a relay descriptor. Otherwise, relays publish a
+ descriptor with DirPort 0 when the DirPort reachability test takes
+ longer than the ORPort reachability test.
+ Closes bug #18050. Reported by "starlight", patch by "teor".
+ Bugfix on 0.1.0.1-rc, commit a1f1fa6ab on 27 Feb 2005.
diff --git a/changes/bug18089 b/changes/bug18089
new file mode 100644
index 0000000000..c1fb342f77
--- /dev/null
+++ b/changes/bug18089
@@ -0,0 +1,6 @@
+ o Minor fixes (security):
+ - Make memwipe() do nothing when passed a NULL pointer
+ or zero size. Check size argument to memwipe() for underflow.
+ Closes bug #18089. Reported by "gk", patch by "teor".
+ Bugfix on 0.2.3.25 and 0.2.4.6-alpha (#7352),
+ commit 49dd5ef3 on 7 Nov 2012.
diff --git a/changes/feature12538 b/changes/feature12538
new file mode 100644
index 0000000000..4e7ea9f41d
--- /dev/null
+++ b/changes/feature12538
@@ -0,0 +1,6 @@
+ o Minor features (directory system):
+ Previously only relays who explicitly opened a directory port (DirPort)
+ accepted directory requests from clients. Now all relays, with and without
+ a DirPort, who do not disable the DirCache option accept and serve
+ directory requests sent (tunnelled) through their ORPort.
+ Closes ticket 12538.
diff --git a/changes/feature16774 b/changes/feature16774
new file mode 100644
index 0000000000..87ba488cc6
--- /dev/null
+++ b/changes/feature16774
@@ -0,0 +1,3 @@
+ o Minor enhancement:
+ - Adds FallbackDir entries to 'GETINFO config/defaults'. Closes ticket
+ #16774 and 17817. Patch by George Tankersley.
diff --git a/changes/feature17076 b/changes/feature17076
new file mode 100644
index 0000000000..50ebc96327
--- /dev/null
+++ b/changes/feature17076
@@ -0,0 +1,3 @@
+ o Testing:
+ - New tests for options_validate. Closes ticket 17076. Patch from
+ Ola Bini.
diff --git a/changes/feature17796 b/changes/feature17796
new file mode 100644
index 0000000000..d96daed262
--- /dev/null
+++ b/changes/feature17796
@@ -0,0 +1,6 @@
+ o Minor features (crypto):
+ - When allocating a digest state object, allocate no more space than we
+ actually need. Previously, we were allocating as much space as the
+ state for the largest algorithm would need. This change saves up to
+ 672 bytes per circuit. Closes ticket 17796.
+
diff --git a/changes/feature17950 b/changes/feature17950
new file mode 100644
index 0000000000..5ea83ecd8e
--- /dev/null
+++ b/changes/feature17950
@@ -0,0 +1,5 @@
+ o Minor features:
+ - Add a family argument to get_interface_addresses_raw() and
+ subfunctions to make network interface address interogation more
+ efficient. Now Tor can specifically ask for IPv4, IPv6 or both
+ types of interfaces from the operating system. Resolves ticket 17950.
diff --git a/changes/feature17951 b/changes/feature17951
new file mode 100644
index 0000000000..42ec32a0dd
--- /dev/null
+++ b/changes/feature17951
@@ -0,0 +1,6 @@
+ o Minor features:
+ - When get_interface_address6_list(.,AF_UNSPEC,.) is called and fails
+ to enumerate interface addresses using the platform-specific API,
+ have it rely on the UDP socket fallback technique to try and find
+ out what IP addresses (both IPv4 and IPv6) our machine has. Resolves
+ ticket 17951.
diff --git a/changes/feature17986 b/changes/feature17986
new file mode 100644
index 0000000000..ef82bd3503
--- /dev/null
+++ b/changes/feature17986
@@ -0,0 +1,3 @@
+ o Minor features:
+ - Use SecureMemoryWipe() function to securely clean memory on
+ Windows. Implements feature 17986.
diff --git a/changes/geoip-january2016 b/changes/geoip-january2016
new file mode 100644
index 0000000000..fe2d5c7dc7
--- /dev/null
+++ b/changes/geoip-january2016
@@ -0,0 +1,4 @@
+ o Minor features:
+ - Update geoip and geoip6 to the January 5 2016 Maxmind GeoLite2
+ Country database.
+
diff --git a/changes/log_heartbeat_test b/changes/log_heartbeat_test
new file mode 100644
index 0000000000..7db97ed03c
--- /dev/null
+++ b/changes/log_heartbeat_test
@@ -0,0 +1,6 @@
+ o Minor bugfix (testing):
+ - The test for log_heartbeat was incorrectly failing in timezones
+ with non-integer offsets. Instead of comparing the end of the
+ time string against a constant, compare it to the output of
+ format_local_iso_time when given the correct input.
+ Fixes bug 18039.
diff --git a/changes/ticket15989 b/changes/ticket15989
new file mode 100644
index 0000000000..e90d0cf8a4
--- /dev/null
+++ b/changes/ticket15989
@@ -0,0 +1,9 @@
+ o Minor enhancement (accounting):
+ - Added two modes to AccountingRule in torrc for
+ limiting just input or just output.
+ Closes ticket 15989; patch from "unixninja92".
+
+ o Minor bugfixe (accounting):
+ - The max bandwidth when using AccountRule sum
+ is now correctly logged. Fixes bug 18024; bugfix on 0.2.6.1-alpha.
+ Patch from "unixninja92".
diff --git a/changes/ticket17158 b/changes/ticket17158
new file mode 100644
index 0000000000..f65053db99
--- /dev/null
+++ b/changes/ticket17158
@@ -0,0 +1,7 @@
+ o Minor fixes (fallback directories):
+ - Fix a display issue in updateFallbackDirs.py output.
+ Patch by "teor". Not in any released version of tor.
+
+ o Minor features (fallback directories):
+ - Add default fallback directories for the 0.2.8 alpha releases.
+ Patch by "teor".
diff --git a/configure.ac b/configure.ac
index 25edbaf1d9..6d2312d159 100644
--- a/configure.ac
+++ b/configure.ac
@@ -376,11 +376,15 @@ AM_CONDITIONAL(THREADS_PTHREADS, test "$bwin32" = "false")
AC_CHECK_FUNCS(
_NSGetEnviron \
+ RtlSecureZeroMemory \
+ SecureZeroMemory \
accept4 \
backtrace \
backtrace_symbols_fd \
clock_gettime \
eventfd \
+ explicit_bzero \
+ timingsafe_memcmp \
flock \
ftime \
getaddrinfo \
@@ -390,6 +394,7 @@ AC_CHECK_FUNCS(
getrlimit \
gettimeofday \
gmtime_r \
+ htonll \
inet_aton \
ioctl \
issetugid \
@@ -397,6 +402,7 @@ AC_CHECK_FUNCS(
localtime_r \
lround \
memmem \
+ memset_s \
pipe \
pipe2 \
prctl \
@@ -1155,7 +1161,6 @@ AC_CHECK_MEMBERS([struct in6_addr.s6_addr32, struct in6_addr.s6_addr16, struct s
#include <winsock2.h>
#include <ws2tcpip.h>
#endif
-#endif
])
AC_CHECK_TYPES([rlim_t], , ,
diff --git a/doc/include.am b/doc/include.am
index 01a5ef2524..7164a4b2a0 100644
--- a/doc/include.am
+++ b/doc/include.am
@@ -90,5 +90,5 @@ doc/tor-gencert.1: doc/tor-gencert.1.in
doc/tor-resolve.1: doc/tor-resolve.1.in
doc/torify.1: doc/torify.1.in
-CLEANFILES+= $(asciidoc_product) config.log
+CLEANFILES+= $(asciidoc_product)
DISTCLEANFILES+= $(html_in) $(man_in)
diff --git a/doc/tor.1.txt b/doc/tor.1.txt
index f201a6169d..87d976b2fa 100644
--- a/doc/tor.1.txt
+++ b/doc/tor.1.txt
@@ -1771,7 +1771,8 @@ is non-zero):
Log a heartbeat message every **HeartbeatPeriod** seconds. This is
a log level __notice__ message, designed to let you know your Tor
server is still alive and doing useful things. Settings this
- to 0 will disable the heartbeat. (Default: 6 hours)
+ to 0 will disable the heartbeat. Otherwise, it must be at least 30
+ minutes. (Default: 6 hours)
[[AccountingMax]] **AccountingMax** __N__ **bytes**|**KBytes**|**MBytes**|**GBytes**|**KBits**|**MBits**|**GBits**|**TBytes**::
Limits the max number of bytes sent and received within a set time period
@@ -1793,12 +1794,14 @@ is non-zero):
of the time, which is more useful than a set of slow servers that are
always "available".
-[[AccountingRule]] **AccountingRule** **sum**|**max**::
+[[AccountingRule]] **AccountingRule** **sum**|**max**|**in**|**out**::
How we determine when our AccountingMax has been reached (when we
should hibernate) during a time interval. Set to "max" to calculate
using the higher of either the sent or received bytes (this is the
default functionality). Set to "sum" to calculate using the sent
- plus received bytes. (Default: max)
+ plus received bytes. Set to "in" to calculate using only the
+ received bytes. Set to "out" to calculate using only the sent bytes.
+ (Default: max)
[[AccountingStart]] **AccountingStart** **day**|**week**|**month** [__day__] __HH:MM__::
Specify how long accounting periods last. If **month** is given, each
@@ -2008,6 +2011,12 @@ if DirPort is non-zero):
except that port specifiers are ignored. Any address not matched by
some entry in the policy is accepted.
+[[DirCache]] **DirCache** **0**|**1**::
+ When this option is set, Tor caches all current directory documents and
+ accepts client requests for them. Setting DirPort is not required for this,
+ because clients connect via the ORPort by default. Setting either DirPort
+ or BridgeRelay and setting DirCache to 0 is not supported. (Default: 1)
+
DIRECTORY AUTHORITY SERVER OPTIONS
----------------------------------
diff --git a/scripts/maint/fallback.blacklist b/scripts/maint/fallback.blacklist
index 919ae33603..3c0f8fc5c6 100644
--- a/scripts/maint/fallback.blacklist
+++ b/scripts/maint/fallback.blacklist
@@ -17,3 +17,25 @@
# If a relay operator doesn't want their relay to be a FallbackDir,
# enter the following information here:
# <IPv4>:<DirPort> orport=<ORPort> id=<ID> ipv6=<IPv6>:<IPv6 ORPort>
+
+# https://lists.torproject.org/pipermail/tor-relays/2015-December/008364.html
+87.181.248.227:9030 orport=443 id=8827944C4BDCBDAC9079803F47823403C11A9B7A
+
+# https://lists.torproject.org/pipermail/tor-relays/2015-December/008368.html
+149.18.2.82:9030 orport=9001 id=953DB709F2A2DECC8D7560661F934E64411444F7
+
+# https://lists.torproject.org/pipermail/tor-relays/2015-December/008384.html
+80.82.215.199:80 orport=443 id=3BEFAB76461B6B99DCF34C285E933562F5712AE4 ipv6=[2001:4ba0:cafe:a18::1]:443
+
+# https://lists.torproject.org/pipermail/tor-relays/2016-January/008515.html
+# later opt-out in
+# https://lists.torproject.org/pipermail/tor-relays/2016-January/008521.html
+5.9.158.75:80 orport=443 id=F1BE15429B3CE696D6807F4D4A58B1BFEC45C822 ipv6=[2a01:4f8:190:514a::2]:443
+
+# Email sent directly to teor, verified using relay contact info
+5.34.183.168:80 orport=443 id=601C92108A568742A7A6D9473FE3A414F7149070
+217.12.199.208:8080 orport=22 id=BCFB0933367D626715DA32A147F417194A5D48D6
+
+# https://lists.torproject.org/pipermail/tor-relays/2016-January/008555.html
+62.210.207.124:9030 orport=9001 id=58938B1A5C4029B4415D38A4F36B7724273F4755 ipv6=[2001:bc8:31eb:100::1]:9001
+62.210.207.124:9130 orport=9101 id=338D0AB6DBAB7B529B9C91B2FD770658000693C4 ipv6=[2001:bc8:31eb:100::1]:9101
diff --git a/scripts/maint/fallback.whitelist b/scripts/maint/fallback.whitelist
index a88dfaaefa..d5ddcd2e82 100644
--- a/scripts/maint/fallback.whitelist
+++ b/scripts/maint/fallback.whitelist
@@ -11,3 +11,90 @@
# If a relay operator wants their relay to be a FallbackDir,
# enter the following information here:
# <IPv4>:<DirPort> orport=<ORPort> id=<ID> [ ipv6=<IPv6>:<IPv6 ORPort> ]
+
+# https://lists.torproject.org/pipermail/tor-relays/2015-December/008362.html
+78.47.18.110:443 orport=80 id=F8D27B163B9247B232A2EEE68DD8B698695C28DE
+131.188.40.188:443 orport=80 id=EBE718E1A49EE229071702964F8DB1F318075FF8
+
+# https://lists.torproject.org/pipermail/tor-relays/2015-December/008363.html
+84.219.173.60:9030 orport=443 id=855BC2DABE24C861CD887DB9B2E950424B49FC34
+
+# https://lists.torproject.org/pipermail/tor-relays/2015-December/008365.html
+81.7.17.171:80 orport=443 id=00C4B4731658D3B4987132A3F77100CFCB190D97 ipv6=[2a02:180:1:1::517:11ab]:443
+
+# https://lists.torproject.org/pipermail/tor-relays/2015-December/008366.html
+5.39.88.19:9030 orport=9001 id=7CB8C31432A796731EA7B6BF4025548DFEB25E0C ipv6=[2001:41d0:8:9a13::1]:9050
+
+# https://lists.torproject.org/pipermail/tor-relays/2015-December/008367.html
+# Email sent directly to teor with intended DirPort settings
+88.198.38.226:22 orport=443 id=4B9E2C56FB42B891794FE2CD2FCAD08A320CC3BB ipv6=[2a01:4f8:a0:1351::2]:80
+213.239.210.204:22 orport=443 id=5BFDECCE9B4A23AE14EC767C5A2C1E10558B00B9 ipv6=[2a01:4f8:a0:9474::2]:80
+213.239.220.25:22 orport=443 id=BEE2317AE127EB681C5AE1551C1EA0630580638A ipv6=[2a01:4f8:a0:710c::2]:80
+85.10.201.38:22 orport=443 id=F6279A203C1950ACF592322A235647A05BFBCF91 ipv6=[2a01:4f8:a0:43cc::2]:80
+
+# https://lists.torproject.org/pipermail/tor-relays/2015-December/008370.html
+# https://lists.torproject.org/pipermail/tor-relays/2016-January/008517.html
+# https://lists.torproject.org/pipermail/tor-relays/2016-January/008555.html
+62.210.124.124:9030 orport=9001 id=86E78DD3720C78DA8673182EF96C54B162CD660C ipv6=[2001:bc8:3f23:100::1]:9001
+62.210.124.124:9130 orport=9101 id=2EBD117806EE43C3CC885A8F1E4DC60F207E7D3E ipv6=[2001:bc8:3f23:100::1]:9101
+# DirPort TBC in next consensus
+212.47.237.95:9030 orport=9001 id=3F5D8A879C58961BB45A3D26AC41B543B40236D6
+212.47.237.95:9130 orport=9101 id=6FB38EB22E57EF7ED5EF00238F6A48E553735D88
+
+# https://lists.torproject.org/pipermail/tor-relays/2015-December/008372.html
+# IPv6 tunnel available on request (is this a good idea?)
+108.53.208.157:80 orport=443 id=4F0DB7E687FC7C0AE55C8F243DA8B0EB27FBF1F2
+
+# https://lists.torproject.org/pipermail/tor-relays/2015-December/008373.html
+167.114.35.28:9030 orport=9001 id=E65D300F11E1DB12C534B0146BDAB6972F1A8A48
+
+# https://lists.torproject.org/pipermail/tor-relays/2015-December/008374.html
+170.130.1.7:9030 orport=9001 id=FA3415659444AE006E7E9E5375E82F29700CFDFD
+
+# https://lists.torproject.org/pipermail/tor-relays/2015-December/008378.html
+144.76.14.145:110 orport=143 id=14419131033443AE6E21DA82B0D307F7CAE42BDB ipv6=[2a01:4f8:190:9490::dead]:443
+
+# https://lists.torproject.org/pipermail/tor-relays/2015-December/008379.html
+85.25.138.93:9030 orport=4029 id=6DE61A6F72C1E5418A66BFED80DFB63E4C77668F
+
+# https://lists.torproject.org/pipermail/tor-relays/2015-December/008380.html
+5.175.233.86:80 orport=443 id=5525D0429BFE5DC4F1B0E9DE47A4CFA169661E33
+
+# https://lists.torproject.org/pipermail/tor-relays/2015-December/008381.html
+# Sent additional email to teor with more relays
+178.254.44.135:9030 orport=9001 id=8FA37B93397015B2BC5A525C908485260BE9F422
+178.254.20.134:80 orport=443 id=9F5068310818ED7C70B0BC4087AB55CB12CB4377
+178.254.20.134:9030 orport=9001 id=2CE96A8A1DA032664C90F574AFFBECE18A6E8DFC
+178.254.44.135:80 orport=443 id=AE6A8C18E7499B586CD36246AC4BCAFFBBF93AB2
+178.254.13.126:80 orport=443 id=F9246DEF2B653807236DA134F2AEAB103D58ABFE
+178.254.13.126:9030 orport=9001 id=0C475BA4D3AA3C289B716F95954CAD616E50C4E5
+
+# https://lists.torproject.org/pipermail/tor-relays/2015-December/008382.html
+51.255.33.237:9091 orport=9001 id=A360C21FA87FFA2046D92C17086A6B47E5C68109
+
+# https://lists.torproject.org/pipermail/tor-relays/2015-December/008383.html
+81.7.14.246:80 orport=443 id=CE75BF0972ADD52AF8807602374E495C815DB304 ipv6=[2a02:180:a:51::dead]:443
+
+# https://lists.torproject.org/pipermail/tor-relays/2015-December/008384.html
+149.202.98.161:80 orport=443 id=54660C671B47E6986B465B80444414BD19E5A34B ipv6=[2001:41d0:8:4528::161]:443
+193.111.136.162:80 orport=443 id=C79552275DFCD486B942510EF663ED36ACA1A84B ipv6=[2001:4ba0:cafe:10d0::1]:443
+
+# https://lists.torproject.org/pipermail/tor-relays/2015-December/008416.html
+185.100.84.212:80 orport=443 id=330CD3DB6AD266DC70CDB512B036957D03D9BC59 ipv6=[2a06:1700:0:7::1]:443
+
+# https://lists.torproject.org/pipermail/tor-relays/2015-December/008417.html
+178.16.208.56:80 orport=443 id=2CDCFED0142B28B002E89D305CBA2E26063FADE2 ipv6=[2a00:1c20:4089:1234:cd49:b58a:9ebe:67ec]:443
+178.16.208.57:80 orport=443 id=92CFD9565B24646CAC2D172D3DB503D69E777B8A ipv6=[2a00:1c20:4089:1234:7825:2c5d:1ecd:c66f]:443
+
+# https://lists.torproject.org/pipermail/tor-relays/2016-January/008513.html
+178.62.173.203:9030 orport=9001 id=DD85503F2D1F52EF9EAD621E942298F46CD2FC10 ipv6=[2a03:b0c0:0:1010::a4:b001]:9001
+
+# https://lists.torproject.org/pipermail/tor-relays/2016-January/008534.html
+5.9.110.236:9030 orport=9001 id=0756B7CD4DFC8182BE23143FAC0642F515182CEB ipv6=[2a01:4f8:162:51e2::2]:9001
+
+# https://lists.torproject.org/pipermail/tor-relays/2016-January/008542.html
+178.62.199.226:80 orport=443 id=CBEFF7BA4A4062045133C053F2D70524D8BBE5BE ipv6=[2a03:b0c0:2:d0::b7:5001]:443
+
+# Email sent directly to teor, verified using relay contact info
+217.12.199.208:80 orport=443 id=DF3AED4322B1824BF5539AE54B2D1B38E080FF05
+217.12.210.214:80 orport=443 id=943C0C6841C1E914B9FCA796C6846620A5AF9BC7
diff --git a/scripts/maint/updateFallbackDirs.py b/scripts/maint/updateFallbackDirs.py
index 8fe234f206..fd7d350c2e 100755
--- a/scripts/maint/updateFallbackDirs.py
+++ b/scripts/maint/updateFallbackDirs.py
@@ -27,7 +27,7 @@ import dateutil.parser
#from bson import json_util
import logging
-logging.basicConfig(level=logging.INFO)
+logging.basicConfig(level=logging.DEBUG)
## Top-Level Configuration
@@ -91,14 +91,14 @@ PERMITTED_BADEXIT = .00
FALLBACK_PROPORTION_OF_GUARDS = None if OUTPUT_CANDIDATES else 0.2
# Limit the number of fallbacks (eliminating lowest by weight)
-MAX_FALLBACK_COUNT = 500
+MAX_FALLBACK_COUNT = None if OUTPUT_CANDIDATES else 500
# Emit a C #error if the number of fallbacks is below
MIN_FALLBACK_COUNT = 100
## Fallback Weight Settings
# Any fallback with the Exit flag has its weight multipled by this fraction
-EXIT_WEIGHT_FRACTION = 0.2
+EXIT_WEIGHT_FRACTION = 1.0
# If True, emit a C #error if we can't satisfy various constraints
# If False, emit a C comment instead
@@ -266,6 +266,17 @@ def load_json_from_file(json_file_name):
## OnionOO Functions
+def datestr_to_datetime(datestr):
+ # Parse datetimes like: Fri, 02 Oct 2015 13:34:14 GMT
+ if datestr is not None:
+ dt = dateutil.parser.parse(datestr)
+ else:
+ # Never modified - use start of epoch
+ dt = datetime.datetime.utcfromtimestamp(0)
+ # strip any timezone out (in case they're supported in future)
+ dt = dt.replace(tzinfo=None)
+ return dt
+
def onionoo_fetch(what, **kwargs):
params = kwargs
params['type'] = 'relay'
@@ -304,37 +315,42 @@ def onionoo_fetch(what, **kwargs):
if last_mod_date is not None:
request.add_header('If-modified-since', last_mod_date)
- # Parse datetimes like: Fri, 02 Oct 2015 13:34:14 GMT
- if last_mod_date is not None:
- last_mod = dateutil.parser.parse(last_mod_date)
- else:
- # Never modified - use start of epoch
- last_mod = datetime.datetime.utcfromtimestamp(0)
- # strip any timezone out (in case they're supported in future)
- last_mod = last_mod.replace(tzinfo=None)
+ # Parse last modified date
+ last_mod = datestr_to_datetime(last_mod_date)
+
+ # Not Modified and still recent enough to be useful
+ # Onionoo / Globe used to use 6 hours, but we can afford a day
+ required_freshness = datetime.datetime.utcnow()
+ # strip any timezone out (to match dateutil.parser)
+ required_freshness = required_freshness.replace(tzinfo=None)
+ required_freshness -= datetime.timedelta(hours=24)
+ # Make the OnionOO request
response_code = 0
try:
response = urllib2.urlopen(request)
response_code = response.getcode()
except urllib2.HTTPError, error:
response_code = error.code
- # strip any timezone out (to match dateutil.parser)
- six_hours_ago = datetime.datetime.utcnow()
- six_hours_ago = six_hours_ago.replace(tzinfo=None)
- six_hours_ago -= datetime.timedelta(hours=6)
- # Not Modified and still recent enough to be useful (Globe uses 6 hours)
- if response_code == 304:
- if last_mod < six_hours_ago:
- raise Exception("Outdated data from " + url + ": "
- + str(error.code) + ": " + error.reason)
- else:
- pass
+ if response_code == 304: # not modified
+ pass
else:
raise Exception("Could not get " + url + ": "
+ str(error.code) + ": " + error.reason)
if response_code == 200: # OK
+ last_mod = datestr_to_datetime(response.info().get('Last-Modified'))
+
+ # Check for freshness
+ if last_mod < required_freshness:
+ if last_mod_date is not None:
+ date_message = "Outdated data: last updated " + last_mod_date
+ else:
+ date_message = "No data: never downloaded "
+ raise Exception(date_message + " from " + url)
+
+ # Process the data
+ if response_code == 200: # OK
response_json = load_possibly_compressed_response_json(response)
@@ -579,9 +595,15 @@ class Candidate(object):
%(p, which))
for v in reversed(h['values']):
if (this_ts <= newest):
+ agt1 = now - this_ts
+ agt2 = interval
+ agetmp1 = (agt1.microseconds + (agt1.seconds + agt1.days * 24 * 3600)
+ * 10**6) / 10**6
+ agetmp2 = (agt2.microseconds + (agt2.seconds + agt2.days * 24 * 3600)
+ * 10**6) / 10**6
generic_history.append(
- { 'age': (now - this_ts).total_seconds(),
- 'length': interval.total_seconds(),
+ { 'age': agetmp1,
+ 'length': agetmp2,
'value': v
})
newest = this_ts
@@ -599,6 +621,8 @@ class Candidate(object):
def _avg_generic_history(generic_history):
a = []
for i in generic_history:
+ if i['age'] > (ADDRESS_AND_PORT_STABLE_DAYS * 24 * 3600):
+ continue
if (i['length'] is not None
and i['age'] is not None
and i['value'] is not None):
@@ -608,7 +632,11 @@ class Candidate(object):
sv = math.fsum(map(lambda x: x[0], a))
sw = math.fsum(map(lambda x: x[1], a))
- return sv/sw
+ if sw == 0.0:
+ svw = 0.0
+ else:
+ svw = sv/sw
+ return svw
def _add_generic_history(self, history):
periods = r['read_history'].keys()
@@ -659,10 +687,6 @@ class Candidate(object):
logging.debug('%s not a candidate: running avg too low (%lf)',
self._fpr, self._running)
return False
- if self._guard < CUTOFF_GUARD:
- logging.debug('%s not a candidate: guard avg too low (%lf)',
- self._fpr, self._guard)
- return False
if self._v2dir < CUTOFF_V2DIR:
logging.debug('%s not a candidate: v2dir avg too low (%lf)',
self._fpr, self._v2dir)
@@ -675,6 +699,10 @@ class Candidate(object):
if (not self._data.has_key('recommended_version')
or not self._data['recommended_version']):
return False
+ if self._guard < CUTOFF_GUARD:
+ logging.debug('%s not a candidate: guard avg too low (%lf)',
+ self._fpr, self._guard)
+ return False
return True
def is_in_whitelist(self, relaylist):
@@ -998,7 +1026,8 @@ class CandidateList(dict):
# starting with the lowest-weighted fallbacks
# total_weight should be recalculated after calling this
def exclude_excess_fallbacks(self):
- self.fallbacks = self.fallbacks[:MAX_FALLBACK_COUNT]
+ if MAX_FALLBACK_COUNT is not None:
+ self.fallbacks = self.fallbacks[:MAX_FALLBACK_COUNT]
# Clamp the weight of all fallbacks to MAX_WEIGHT_FRACTION * total_weight
# fallbacks are kept sorted, but since excessive weights are reduced to
@@ -1069,15 +1098,15 @@ class CandidateList(dict):
else:
fallback_proportion = ' (%d * %f)'%(guard_count,
FALLBACK_PROPORTION_OF_GUARDS)
- s += 'Final Count: %d (Eligible %d, Usable %d, Target %d%s, '%(
+ s += 'Final Count: %d (Eligible %d, Usable %d, Target %d%s'%(
min(max_count, fallback_count),
eligible_count,
fallback_count,
target_count,
fallback_proportion)
- s += 'Clamped to %d)'%(
- MAX_FALLBACK_COUNT)
- s += '\n'
+ if MAX_FALLBACK_COUNT is not None:
+ s += ', Clamped to %d'%(MAX_FALLBACK_COUNT)
+ s += ')\n'
if fallback_count < MIN_FALLBACK_COUNT:
s += '*/'
s += '\n'
@@ -1147,13 +1176,16 @@ def list_fallbacks():
guard_count = candidates.count_guards()
if FALLBACK_PROPORTION_OF_GUARDS is None:
- target_count = MAX_FALLBACK_COUNT
+ target_count = guard_count
else:
target_count = int(guard_count * FALLBACK_PROPORTION_OF_GUARDS)
# the maximum number of fallbacks is the least of:
# - the target fallback count (FALLBACK_PROPORTION_OF_GUARDS * guard count)
# - the maximum fallback count (MAX_FALLBACK_COUNT)
- max_count = min(target_count, MAX_FALLBACK_COUNT)
+ if MAX_FALLBACK_COUNT is None:
+ max_count = guard_count
+ else:
+ max_count = min(target_count, MAX_FALLBACK_COUNT)
candidates.compute_fallbacks()
@@ -1198,8 +1230,8 @@ def list_fallbacks():
max_weight = max_weight_fb.fallback_weight_fraction(total_weight)
if max_weight > TARGET_MAX_WEIGHT_FRACTION:
error_str = 'Maximum fallback weight: %.3f%% exceeds target %.3f%%. '%(
- max_weight,
- TARGET_MAX_WEIGHT_FRACTION)
+ max_weight*100.0,
+ TARGET_MAX_WEIGHT_FRACTION*100.0)
error_str += 'Try decreasing REWEIGHTING_FUDGE_FACTOR.'
if STRICT_FALLBACK_WEIGHTS:
print '#error ' + error_str
diff --git a/src/common/address.c b/src/common/address.c
index 19e9fddd08..f495cad5aa 100644
--- a/src/common/address.c
+++ b/src/common/address.c
@@ -1327,7 +1327,7 @@ typedef ULONG (WINAPI *GetAdaptersAddresses_fn_t)(
* into smartlist of <b>tor_addr_t</b> structures.
*/
STATIC smartlist_t *
-ifaddrs_to_smartlist(const struct ifaddrs *ifa)
+ifaddrs_to_smartlist(const struct ifaddrs *ifa, sa_family_t family)
{
smartlist_t *result = smartlist_new();
const struct ifaddrs *i;
@@ -1341,6 +1341,8 @@ ifaddrs_to_smartlist(const struct ifaddrs *ifa)
if (i->ifa_addr->sa_family != AF_INET &&
i->ifa_addr->sa_family != AF_INET6)
continue;
+ if (family != AF_UNSPEC && i->ifa_addr->sa_family != family)
+ continue;
if (tor_addr_from_sockaddr(&tmp, i->ifa_addr, NULL) < 0)
continue;
smartlist_add(result, tor_memdup(&tmp, sizeof(tmp)));
@@ -1354,7 +1356,7 @@ ifaddrs_to_smartlist(const struct ifaddrs *ifa)
* <b>tor_addr_t</b> structures.
*/
STATIC smartlist_t *
-get_interface_addresses_ifaddrs(int severity)
+get_interface_addresses_ifaddrs(int severity, sa_family_t family)
{
/* Most free Unixy systems provide getifaddrs, which gives us a linked list
@@ -1367,7 +1369,7 @@ get_interface_addresses_ifaddrs(int severity)
return NULL;
}
- result = ifaddrs_to_smartlist(ifa);
+ result = ifaddrs_to_smartlist(ifa, family);
freeifaddrs(ifa);
@@ -1409,7 +1411,7 @@ ip_adapter_addresses_to_smartlist(const IP_ADAPTER_ADDRESSES *addresses)
* <b>tor_addr_t</b> structures.
*/
STATIC smartlist_t *
-get_interface_addresses_win32(int severity)
+get_interface_addresses_win32(int severity, sa_family_t family)
{
/* Windows XP began to provide GetAdaptersAddresses. Windows 2000 had a
@@ -1443,7 +1445,7 @@ get_interface_addresses_win32(int severity)
/* Guess how much space we need. */
size = 15*1024;
addresses = tor_malloc(size);
- res = fn(AF_UNSPEC, FLAGS, NULL, addresses, &size);
+ res = fn(family, FLAGS, NULL, addresses, &size);
if (res == ERROR_BUFFER_OVERFLOW) {
/* we didn't guess that we needed enough space; try again */
tor_free(addresses);
@@ -1517,7 +1519,7 @@ ifreq_to_smartlist(char *buf, size_t buflen)
* <b>tor_addr_t</b> structures.
*/
STATIC smartlist_t *
-get_interface_addresses_ioctl(int severity)
+get_interface_addresses_ioctl(int severity, sa_family_t family)
{
/* Some older unixy systems make us use ioctl(SIOCGIFCONF) */
struct ifconf ifc;
@@ -1526,7 +1528,17 @@ get_interface_addresses_ioctl(int severity)
/* This interface, AFAICT, only supports AF_INET addresses,
* except on AIX. For Solaris, we could use SIOCGLIFCONF. */
- fd = socket(AF_INET, SOCK_DGRAM, 0);
+
+ /* Bail out if family is neither AF_INET nor AF_UNSPEC since
+ * ioctl() technique supports non-IPv4 interface addresses on
+ * a small number of niche systems only. If family is AF_UNSPEC,
+ * fall back to getting AF_INET addresses only. */
+ if (family == AF_UNSPEC)
+ family = AF_INET;
+ else if (family != AF_INET)
+ return NULL;
+
+ fd = socket(family, SOCK_DGRAM, 0);
if (fd < 0) {
tor_log(severity, LD_NET, "socket failed: %s", strerror(errno));
goto done;
@@ -1561,21 +1573,23 @@ get_interface_addresses_ioctl(int severity)
/** Try to ask our network interfaces what addresses they are bound to.
* Return a new smartlist of tor_addr_t on success, and NULL on failure.
* (An empty smartlist indicates that we successfully learned that we have no
- * addresses.) Log failure messages at <b>severity</b>. */
+ * addresses.) Log failure messages at <b>severity</b>. Only return the
+ * interface addresses of requested <b>family</b> and ignore the addresses
+ * of other address families. */
MOCK_IMPL(smartlist_t *,
-get_interface_addresses_raw,(int severity))
+get_interface_addresses_raw,(int severity, sa_family_t family))
{
smartlist_t *result = NULL;
#if defined(HAVE_IFADDRS_TO_SMARTLIST)
- if ((result = get_interface_addresses_ifaddrs(severity)))
+ if ((result = get_interface_addresses_ifaddrs(severity, family)))
return result;
#endif
#if defined(HAVE_IP_ADAPTER_TO_SMARTLIST)
- if ((result = get_interface_addresses_win32(severity)))
+ if ((result = get_interface_addresses_win32(severity, family)))
return result;
#endif
#if defined(HAVE_IFCONF_TO_SMARTLIST)
- if ((result = get_interface_addresses_ioctl(severity)))
+ if ((result = get_interface_addresses_ioctl(severity, family)))
return result;
#endif
(void) severity;
@@ -1600,8 +1614,9 @@ tor_addr_is_multicast(const tor_addr_t *a)
}
/** Attempt to retrieve IP address of current host by utilizing some
- * UDP socket trickery. Only look for address of given <b>family</b>.
- * Set result to *<b>addr</b>. Return 0 on success, -1 on failure.
+ * UDP socket trickery. Only look for address of given <b>family</b>
+ * (only AF_INET and AF_INET6 are supported). Set result to *<b>addr</b>.
+ * Return 0 on success, -1 on failure.
*/
MOCK_IMPL(int,
get_interface_address6_via_udp_socket_hack,(int severity,
@@ -1739,15 +1754,9 @@ MOCK_IMPL(smartlist_t *,get_interface_address6_list,(int severity,
tor_addr_t addr;
/* Try to do this the smart way if possible. */
- if ((addrs = get_interface_addresses_raw(severity))) {
+ if ((addrs = get_interface_addresses_raw(severity, family))) {
SMARTLIST_FOREACH_BEGIN(addrs, tor_addr_t *, a)
{
- if (family != AF_UNSPEC && family != tor_addr_family(a)) {
- SMARTLIST_DEL_CURRENT(addrs, a);
- tor_free(a);
- continue;
- }
-
if (tor_addr_is_loopback(a) ||
tor_addr_is_multicast(a)) {
SMARTLIST_DEL_CURRENT(addrs, a);
@@ -1773,15 +1782,27 @@ MOCK_IMPL(smartlist_t *,get_interface_address6_list,(int severity,
}
/* Okay, the smart way is out. */
- if (get_interface_address6_via_udp_socket_hack(severity,family,&addr))
- return smartlist_new();
- if (!include_internal && tor_addr_is_internal(&addr, 0)) {
- return smartlist_new();
- } else {
- addrs = smartlist_new();
- smartlist_add(addrs, tor_dup_addr(&addr));
- return addrs;
+ addrs = smartlist_new();
+
+ if (family == AF_INET || family == AF_UNSPEC) {
+ if (get_interface_address6_via_udp_socket_hack(severity,AF_INET,
+ &addr) == 0) {
+ if (include_internal || !tor_addr_is_internal(&addr, 0)) {
+ smartlist_add(addrs, tor_dup_addr(&addr));
+ }
+ }
}
+
+ if (family == AF_INET6 || family == AF_UNSPEC) {
+ if (get_interface_address6_via_udp_socket_hack(severity,AF_INET6,
+ &addr) == 0) {
+ if (include_internal || !tor_addr_is_internal(&addr, 0)) {
+ smartlist_add(addrs, tor_dup_addr(&addr));
+ }
+ }
+ }
+
+ return addrs;
}
/* ======
@@ -1837,7 +1858,7 @@ tor_addr_port_parse(int severity, const char *addrport,
}
/** Given an address of the form "host[:port]", try to divide it into its host
- * ane port portions, setting *<b>address_out</b> to a newly allocated string
+ * and port portions, setting *<b>address_out</b> to a newly allocated string
* holding the address portion and *<b>port_out</b> to the port (or 0 if no
* port is given). Return 0 on success, -1 on failure. */
int
diff --git a/src/common/address.h b/src/common/address.h
index 918b024ea6..558eb52b35 100644
--- a/src/common/address.h
+++ b/src/common/address.h
@@ -332,26 +332,31 @@ get_interface_address_list(int severity, int include_internal)
tor_addr_port_t *tor_addr_port_new(const tor_addr_t *addr, uint16_t port);
#ifdef ADDRESS_PRIVATE
-MOCK_DECL(smartlist_t *,get_interface_addresses_raw,(int severity));
+MOCK_DECL(smartlist_t *,get_interface_addresses_raw,(int severity,
+ sa_family_t family));
MOCK_DECL(int,get_interface_address6_via_udp_socket_hack,(int severity,
sa_family_t family,
tor_addr_t *addr));
#ifdef HAVE_IFADDRS_TO_SMARTLIST
-STATIC smartlist_t *ifaddrs_to_smartlist(const struct ifaddrs *ifa);
-STATIC smartlist_t *get_interface_addresses_ifaddrs(int severity);
+STATIC smartlist_t *ifaddrs_to_smartlist(const struct ifaddrs *ifa,
+ sa_family_t family);
+STATIC smartlist_t *get_interface_addresses_ifaddrs(int severity,
+ sa_family_t family);
#endif
#ifdef HAVE_IP_ADAPTER_TO_SMARTLIST
STATIC smartlist_t *ip_adapter_addresses_to_smartlist(
const IP_ADAPTER_ADDRESSES *addresses);
-STATIC smartlist_t *get_interface_addresses_win32(int severity);
+STATIC smartlist_t *get_interface_addresses_win32(int severity,
+ sa_family_t family);
#endif
#ifdef HAVE_IFCONF_TO_SMARTLIST
STATIC smartlist_t *ifreq_to_smartlist(char *ifr,
size_t buflen);
-STATIC smartlist_t *get_interface_addresses_ioctl(int severity);
+STATIC smartlist_t *get_interface_addresses_ioctl(int severity,
+ sa_family_t family);
#endif
#endif // ADDRESS_PRIVATE
diff --git a/src/common/backtrace.c b/src/common/backtrace.c
index bed0442471..94de1eb5ee 100644
--- a/src/common/backtrace.c
+++ b/src/common/backtrace.c
@@ -215,9 +215,10 @@ int
configure_backtrace_handler(const char *tor_version)
{
tor_free(bt_version);
- if (!tor_version)
- tor_version = "";
- tor_asprintf(&bt_version, "Tor %s", tor_version);
+ if (tor_version)
+ tor_asprintf(&bt_version, "Tor %s", tor_version);
+ else
+ tor_asprintf(&bt_version, "Tor");
return install_bt_handler();
}
diff --git a/src/common/compat.c b/src/common/compat.c
index 7e8eec189a..c1d4f89621 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -2207,8 +2207,7 @@ switch_id(const char *user, const unsigned flags)
(void)user;
(void)flags;
- log_warn(LD_CONFIG,
- "User specified but switching users is unsupported on your OS.");
+ log_warn(LD_CONFIG, "Switching users is unsupported on your OS.");
return -1;
#endif
}
@@ -2692,8 +2691,7 @@ static int uname_result_is_set = 0;
/** Return a pointer to a description of our platform.
*/
-const char *
-get_uname(void)
+MOCK_IMPL(const char *, get_uname, (void))
{
#ifdef HAVE_UNAME
struct utsname u;
diff --git a/src/common/compat.h b/src/common/compat.h
index d38adca598..8f35dfd110 100644
--- a/src/common/compat.h
+++ b/src/common/compat.h
@@ -601,7 +601,7 @@ typedef enum {
} socks5_reply_status_t;
/* ===== OS compatibility */
-const char *get_uname(void);
+MOCK_DECL(const char *, get_uname, (void));
uint16_t get_uint16(const void *cp) ATTR_NONNULL((1));
uint32_t get_uint32(const void *cp) ATTR_NONNULL((1));
diff --git a/src/common/compat_openssl.h b/src/common/compat_openssl.h
index 3fcd684c0c..9c98181bdd 100644
--- a/src/common/compat_openssl.h
+++ b/src/common/compat_openssl.h
@@ -19,7 +19,14 @@
#error "We require OpenSSL >= 1.0.0"
#endif
-#if OPENSSL_VERSION_NUMBER < OPENSSL_V_SERIES(1,1,0)
+#if OPENSSL_VERSION_NUMBER >= OPENSSL_V_SERIES(1,1,0) && \
+ ! defined(LIBRESSL_VERSION_NUMBER)
+/* We define this macro if we're trying to build with the majorly refactored
+ * API in OpenSSL 1.1 */
+#define OPENSSL_1_1_API
+#endif
+
+#ifndef OPENSSL_1_1_API
#define OPENSSL_VERSION SSLEAY_VERSION
#define OpenSSL_version(v) SSLeay_version(v)
#define OpenSSL_version_num() SSLeay()
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 7f0f842419..a42c461b14 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -64,6 +64,8 @@
#include "sandbox.h"
#include "util_format.h"
+#include "keccak-tiny/keccak-tiny.h"
+
#ifdef ANDROID
/* Android's OpenSSL seems to have removed all of its Engine support. */
#define DISABLE_ENGINES
@@ -250,7 +252,7 @@ crypto_openssl_get_header_version_str(void)
/** Make sure that openssl is using its default PRNG. Return 1 if we had to
* adjust it; 0 otherwise. */
-static int
+STATIC int
crypto_force_rand_ssleay(void)
{
RAND_METHOD *default_method;
@@ -1616,8 +1618,12 @@ crypto_digest256(char *digest, const char *m, size_t len,
{
tor_assert(m);
tor_assert(digest);
- tor_assert(algorithm == DIGEST_SHA256);
- return (SHA256((const unsigned char*)m,len,(unsigned char*)digest) == NULL);
+ tor_assert(algorithm == DIGEST_SHA256 || algorithm == DIGEST_SHA3_256);
+ if (algorithm == DIGEST_SHA256)
+ return (SHA256((const uint8_t*)m,len,(uint8_t*)digest) == NULL);
+ else
+ return (sha3_256((uint8_t *)digest, DIGEST256_LEN,(const uint8_t *)m, len)
+ == -1);
}
/** Compute a 512-bit digest of <b>len</b> bytes in data stored in <b>m</b>,
@@ -1629,8 +1635,13 @@ crypto_digest512(char *digest, const char *m, size_t len,
{
tor_assert(m);
tor_assert(digest);
- tor_assert(algorithm == DIGEST_SHA512);
- return (SHA512((const unsigned char*)m,len,(unsigned char*)digest) == NULL);
+ tor_assert(algorithm == DIGEST_SHA512 || algorithm == DIGEST_SHA3_512);
+ if (algorithm == DIGEST_SHA512)
+ return (SHA512((const unsigned char*)m,len,(unsigned char*)digest)
+ == NULL);
+ else
+ return (sha3_512((uint8_t*)digest, DIGEST512_LEN, (const uint8_t*)m, len)
+ == -1);
}
/** Set the digests_t in <b>ds_out</b> to contain every digest on the
@@ -1646,11 +1657,13 @@ crypto_digest_all(digests_t *ds_out, const char *m, size_t len)
return -1;
for (i = DIGEST_SHA256; i < N_DIGEST_ALGORITHMS; ++i) {
switch (i) {
- case DIGEST_SHA256:
+ case DIGEST_SHA256: /* FALLSTHROUGH */
+ case DIGEST_SHA3_256:
if (crypto_digest256(ds_out->d[i], m, len, i) < 0)
return -1;
break;
case DIGEST_SHA512:
+ case DIGEST_SHA3_512: /* FALLSTHROUGH */
if (crypto_digest512(ds_out->d[i], m, len, i) < 0)
return -1;
break;
@@ -1672,6 +1685,10 @@ crypto_digest_algorithm_get_name(digest_algorithm_t alg)
return "sha256";
case DIGEST_SHA512:
return "sha512";
+ case DIGEST_SHA3_256:
+ return "sha3-256";
+ case DIGEST_SHA3_512:
+ return "sha3-512";
default:
tor_fragile_assert();
return "??unknown_digest??";
@@ -1689,28 +1706,88 @@ crypto_digest_algorithm_parse_name(const char *name)
return DIGEST_SHA256;
else if (!strcmp(name, "sha512"))
return DIGEST_SHA512;
+ else if (!strcmp(name, "sha3-256"))
+ return DIGEST_SHA3_256;
+ else if (!strcmp(name, "sha3-512"))
+ return DIGEST_SHA3_512;
else
return -1;
}
+/** Given an algorithm, return the digest length in bytes. */
+static inline size_t
+crypto_digest_algorithm_get_length(digest_algorithm_t alg)
+{
+ switch (alg) {
+ case DIGEST_SHA1:
+ return DIGEST_LEN;
+ case DIGEST_SHA256:
+ return DIGEST256_LEN;
+ case DIGEST_SHA512:
+ return DIGEST512_LEN;
+ case DIGEST_SHA3_256:
+ return DIGEST256_LEN;
+ case DIGEST_SHA3_512:
+ return DIGEST512_LEN;
+ default:
+ tor_assert(0);
+ return 0; /* Unreachable */
+ }
+}
+
/** Intermediate information about the digest of a stream of data. */
struct crypto_digest_t {
+ digest_algorithm_t algorithm; /**< Which algorithm is in use? */
+ /** State for the digest we're using. Only one member of the
+ * union is usable, depending on the value of <b>algorithm</b>. Note also
+ * that space for other members might not even be allocated!
+ */
union {
SHA_CTX sha1; /**< state for SHA1 */
SHA256_CTX sha2; /**< state for SHA256 */
SHA512_CTX sha512; /**< state for SHA512 */
- } d; /**< State for the digest we're using. Only one member of the
- * union is usable, depending on the value of <b>algorithm</b>. */
- digest_algorithm_bitfield_t algorithm : 8; /**< Which algorithm is in use? */
+ keccak_state sha3; /**< state for SHA3-[256,512] */
+ } d;
};
+/**
+ * Return the number of bytes we need to malloc in order to get a
+ * crypto_digest_t for <b>alg</b>, or the number of bytes we need to wipe
+ * when we free one.
+ */
+static size_t
+crypto_digest_alloc_bytes(digest_algorithm_t alg)
+{
+ /* Helper: returns the number of bytes in the 'f' field of 'st' */
+#define STRUCT_FIELD_SIZE(st, f) (sizeof( ((st*)0)->f ))
+ /* Gives the length of crypto_digest_t through the end of the field 'd' */
+#define END_OF_FIELD(f) (STRUCT_OFFSET(crypto_digest_t, f) + \
+ STRUCT_FIELD_SIZE(crypto_digest_t, f))
+ switch (alg) {
+ case DIGEST_SHA1:
+ return END_OF_FIELD(d.sha1);
+ case DIGEST_SHA256:
+ return END_OF_FIELD(d.sha2);
+ case DIGEST_SHA512:
+ return END_OF_FIELD(d.sha512);
+ case DIGEST_SHA3_256:
+ case DIGEST_SHA3_512:
+ return END_OF_FIELD(d.sha3);
+ default:
+ tor_assert(0);
+ return 0;
+ }
+#undef END_OF_FIELD
+#undef STRUCT_FIELD_SIZE
+}
+
/** Allocate and return a new digest object to compute SHA1 digests.
*/
crypto_digest_t *
crypto_digest_new(void)
{
crypto_digest_t *r;
- r = tor_malloc(sizeof(crypto_digest_t));
+ r = tor_malloc(crypto_digest_alloc_bytes(DIGEST_SHA1));
SHA1_Init(&r->d.sha1);
r->algorithm = DIGEST_SHA1;
return r;
@@ -1722,9 +1799,12 @@ crypto_digest_t *
crypto_digest256_new(digest_algorithm_t algorithm)
{
crypto_digest_t *r;
- tor_assert(algorithm == DIGEST_SHA256);
- r = tor_malloc(sizeof(crypto_digest_t));
- SHA256_Init(&r->d.sha2);
+ tor_assert(algorithm == DIGEST_SHA256 || algorithm == DIGEST_SHA3_256);
+ r = tor_malloc(crypto_digest_alloc_bytes(algorithm));
+ if (algorithm == DIGEST_SHA256)
+ SHA256_Init(&r->d.sha2);
+ else
+ keccak_digest_init(&r->d.sha3, 256);
r->algorithm = algorithm;
return r;
}
@@ -1735,9 +1815,12 @@ crypto_digest_t *
crypto_digest512_new(digest_algorithm_t algorithm)
{
crypto_digest_t *r;
- tor_assert(algorithm == DIGEST_SHA512);
- r = tor_malloc(sizeof(crypto_digest_t));
- SHA512_Init(&r->d.sha512);
+ tor_assert(algorithm == DIGEST_SHA512 || algorithm == DIGEST_SHA3_512);
+ r = tor_malloc(crypto_digest_alloc_bytes(algorithm));
+ if (algorithm == DIGEST_SHA512)
+ SHA512_Init(&r->d.sha512);
+ else
+ keccak_digest_init(&r->d.sha3, 512);
r->algorithm = algorithm;
return r;
}
@@ -1749,7 +1832,8 @@ crypto_digest_free(crypto_digest_t *digest)
{
if (!digest)
return;
- memwipe(digest, 0, sizeof(crypto_digest_t));
+ size_t bytes = crypto_digest_alloc_bytes(digest->algorithm);
+ memwipe(digest, 0, bytes);
tor_free(digest);
}
@@ -1776,6 +1860,10 @@ crypto_digest_add_bytes(crypto_digest_t *digest, const char *data,
case DIGEST_SHA512:
SHA512_Update(&digest->d.sha512, (void*)data, len);
break;
+ case DIGEST_SHA3_256: /* FALLSTHROUGH */
+ case DIGEST_SHA3_512:
+ keccak_digest_update(&digest->d.sha3, (const uint8_t *)data, len);
+ break;
default:
tor_fragile_assert();
break;
@@ -1794,27 +1882,35 @@ crypto_digest_get_digest(crypto_digest_t *digest,
crypto_digest_t tmpenv;
tor_assert(digest);
tor_assert(out);
+ tor_assert(out_len <= crypto_digest_algorithm_get_length(digest->algorithm));
+
+ /* The SHA-3 code handles copying into a temporary ctx, and also can handle
+ * short output buffers by truncating appropriately. */
+ if (digest->algorithm == DIGEST_SHA3_256 ||
+ digest->algorithm == DIGEST_SHA3_512) {
+ keccak_digest_sum(&digest->d.sha3, (uint8_t *)out, out_len);
+ return;
+ }
+
+ const size_t alloc_bytes = crypto_digest_alloc_bytes(digest->algorithm);
/* memcpy into a temporary ctx, since SHA*_Final clears the context */
- memcpy(&tmpenv, digest, sizeof(crypto_digest_t));
+ memcpy(&tmpenv, digest, alloc_bytes);
switch (digest->algorithm) {
case DIGEST_SHA1:
- tor_assert(out_len <= DIGEST_LEN);
SHA1_Final(r, &tmpenv.d.sha1);
break;
case DIGEST_SHA256:
- tor_assert(out_len <= DIGEST256_LEN);
SHA256_Final(r, &tmpenv.d.sha2);
break;
case DIGEST_SHA512:
- tor_assert(out_len <= DIGEST512_LEN);
SHA512_Final(r, &tmpenv.d.sha512);
break;
+ case DIGEST_SHA3_256: /* FALLSTHROUGH */
+ case DIGEST_SHA3_512:
+ log_warn(LD_BUG, "Handling unexpected algorithm %d", digest->algorithm);
+ tor_assert(0); /* This is fatal, because it should never happen. */
default:
- log_warn(LD_BUG, "Called with unknown algorithm %d", digest->algorithm);
- /* If fragile_assert is not enabled, then we should at least not
- * leak anything. */
- memwipe(r, 0xff, sizeof(r));
- tor_fragile_assert();
+ tor_assert(0); /* Unreachable. */
break;
}
memcpy(out, r, out_len);
@@ -1827,15 +1923,14 @@ crypto_digest_get_digest(crypto_digest_t *digest,
crypto_digest_t *
crypto_digest_dup(const crypto_digest_t *digest)
{
- crypto_digest_t *r;
tor_assert(digest);
- r = tor_malloc(sizeof(crypto_digest_t));
- memcpy(r,digest,sizeof(crypto_digest_t));
- return r;
+ const size_t alloc_bytes = crypto_digest_alloc_bytes(digest->algorithm);
+ return tor_memdup(digest, alloc_bytes);
}
/** Replace the state of the digest object <b>into</b> with the state
- * of the digest object <b>from</b>.
+ * of the digest object <b>from</b>. Requires that 'into' and 'from'
+ * have the same digest type.
*/
void
crypto_digest_assign(crypto_digest_t *into,
@@ -1843,7 +1938,9 @@ crypto_digest_assign(crypto_digest_t *into,
{
tor_assert(into);
tor_assert(from);
- memcpy(into,from,sizeof(crypto_digest_t));
+ tor_assert(into->algorithm == from->algorithm);
+ const size_t alloc_bytes = crypto_digest_alloc_bytes(from->algorithm);
+ memcpy(into,from,alloc_bytes);
}
/** Given a list of strings in <b>lst</b>, set the <b>len_out</b>-byte digest
@@ -1878,10 +1975,12 @@ crypto_digest_smartlist_prefix(char *digest_out, size_t len_out,
case DIGEST_SHA1:
d = crypto_digest_new();
break;
- case DIGEST_SHA256:
+ case DIGEST_SHA256: /* FALLSTHROUGH */
+ case DIGEST_SHA3_256:
d = crypto_digest256_new(alg);
break;
- case DIGEST_SHA512:
+ case DIGEST_SHA512: /* FALLSTHROUGH */
+ case DIGEST_SHA3_512:
d = crypto_digest512_new(alg);
break;
default:
@@ -1923,6 +2022,56 @@ crypto_hmac_sha256(char *hmac_out,
tor_assert(rv);
}
+/** Internal state for a eXtendable-Output Function (XOF). */
+struct crypto_xof_t {
+ keccak_state s;
+};
+
+/** Allocate a new XOF object backed by SHAKE-256. The security level
+ * provided is a function of the length of the output used. Read and
+ * understand FIPS-202 A.2 "Additional Consideration for Extendable-Output
+ * Functions" before using this construct.
+ */
+crypto_xof_t *
+crypto_xof_new(void)
+{
+ crypto_xof_t *xof;
+ xof = tor_malloc(sizeof(crypto_xof_t));
+ keccak_xof_init(&xof->s, 256);
+ return xof;
+}
+
+/** Absorb bytes into a XOF object. Must not be called after a call to
+ * crypto_xof_squeeze_bytes() for the same instance, and will assert
+ * if attempted.
+ */
+void
+crypto_xof_add_bytes(crypto_xof_t *xof, const uint8_t *data, size_t len)
+{
+ int i = keccak_xof_absorb(&xof->s, data, len);
+ tor_assert(i == 0);
+}
+
+/** Squeeze bytes out of a XOF object. Calling this routine will render
+ * the XOF instance ineligible to absorb further data.
+ */
+void
+crypto_xof_squeeze_bytes(crypto_xof_t *xof, uint8_t *out, size_t len)
+{
+ int i = keccak_xof_squeeze(&xof->s, out, len);
+ tor_assert(i == 0);
+}
+
+/** Cleanse and deallocate a XOF object. */
+void
+crypto_xof_free(crypto_xof_t *xof)
+{
+ if (!xof)
+ return;
+ memwipe(xof, 0, sizeof(crypto_xof_t));
+ tor_free(xof);
+}
+
/* DH */
/** Our DH 'g' parameter */
@@ -2790,6 +2939,7 @@ smartlist_shuffle(smartlist_t *sl)
/**
* Destroy the <b>sz</b> bytes of data stored at <b>mem</b>, setting them to
* the value <b>byte</b>.
+ * If <b>mem</b> is NULL or <b>sz</b> is zero, nothing happens.
*
* This function is preferable to memset, since many compilers will happily
* optimize out memset() when they can convince themselves that the data being
@@ -2807,10 +2957,31 @@ smartlist_shuffle(smartlist_t *sl)
void
memwipe(void *mem, uint8_t byte, size_t sz)
{
+ if (sz == 0) {
+ return;
+ }
+ /* If sz is nonzero, then mem must not be NULL. */
+ tor_assert(mem != NULL);
+
+ /* Data this large is likely to be an underflow. */
+ tor_assert(sz < SIZE_T_CEILING);
+
/* Because whole-program-optimization exists, we may not be able to just
* have this function call "memset". A smart compiler could inline it, then
* eliminate dead memsets, and declare itself to be clever. */
+#if defined(SecureZeroMemory) || defined(HAVE_SECUREZEROMEMORY)
+ /* Here's what you do on windows. */
+ SecureZeroMemory(mem,sz);
+#elif defined(HAVE_RTLSECUREZEROMEMORY)
+ RtlSecureZeroMemory(mem,sz);
+#elif defined(HAVE_EXPLICIT_BZERO)
+ /* The BSDs provide this. */
+ explicit_bzero(mem, sz);
+#elif defined(HAVE_MEMSET_S)
+ /* This is in the C99 standard. */
+ memset_s(mem, sz, 0, sz);
+#else
/* This is a slow and ugly function from OpenSSL that fills 'mem' with junk
* based on the pointer value, then uses that junk to update a global
* variable. It's an elaborate ruse to trick the compiler into not
@@ -2821,7 +2992,10 @@ memwipe(void *mem, uint8_t byte, size_t sz)
* ...or maybe not. In practice, there are pure-asm implementations of
* OPENSSL_cleanse() on most platforms, which ought to do the job.
**/
+
OPENSSL_cleanse(mem, sz);
+#endif
+
/* Just in case some caller of memwipe() is relying on getting a buffer
* filled with a particular value, fill the buffer.
*
@@ -2856,6 +3030,10 @@ openssl_locking_cb_(int mode, int n, const char *file, int line)
tor_mutex_release(openssl_mutexes_[n]);
}
+#if 0
+/* This code is disabled, because OpenSSL never actually uses these callbacks.
+ */
+
/** OpenSSL helper type: wraps a Tor mutex so that OpenSSL can use it
* as a lock. */
struct CRYPTO_dynlock_value {
@@ -2900,6 +3078,7 @@ openssl_dynlock_destroy_cb_(struct CRYPTO_dynlock_value *v,
tor_mutex_free(v->lock);
tor_free(v);
}
+#endif
static void
tor_set_openssl_thread_id(CRYPTO_THREADID *threadid)
@@ -2921,9 +3100,11 @@ setup_openssl_threading(void)
openssl_mutexes_[i] = tor_mutex_new();
CRYPTO_set_locking_callback(openssl_locking_cb_);
CRYPTO_THREADID_set_callback(tor_set_openssl_thread_id);
+#if 0
CRYPTO_set_dynlock_create_callback(openssl_dynlock_create_cb_);
CRYPTO_set_dynlock_lock_callback(openssl_dynlock_lock_cb_);
CRYPTO_set_dynlock_destroy_callback(openssl_dynlock_destroy_cb_);
+#endif
return 0;
}
diff --git a/src/common/crypto.h b/src/common/crypto.h
index 0fba958f8d..fa2ed610c7 100644
--- a/src/common/crypto.h
+++ b/src/common/crypto.h
@@ -96,9 +96,10 @@ typedef enum {
DIGEST_SHA1 = 0,
DIGEST_SHA256 = 1,
DIGEST_SHA512 = 2,
+ DIGEST_SHA3_256 = 3,
+ DIGEST_SHA3_512 = 4,
} digest_algorithm_t;
-#define N_DIGEST_ALGORITHMS (DIGEST_SHA512+1)
-#define digest_algorithm_bitfield_t ENUM_BF(digest_algorithm_t)
+#define N_DIGEST_ALGORITHMS (DIGEST_SHA3_512+1)
/** A set of all the digests we know how to compute, taken on a single
* string. Any digests that are shorter than 512 bits are right-padded
@@ -115,6 +116,7 @@ typedef struct {
typedef struct crypto_pk_t crypto_pk_t;
typedef struct crypto_cipher_t crypto_cipher_t;
typedef struct crypto_digest_t crypto_digest_t;
+typedef struct crypto_xof_t crypto_xof_t;
typedef struct crypto_dh_t crypto_dh_t;
/* global state */
@@ -244,6 +246,10 @@ void crypto_digest_assign(crypto_digest_t *into,
void crypto_hmac_sha256(char *hmac_out,
const char *key, size_t key_len,
const char *msg, size_t msg_len);
+crypto_xof_t *crypto_xof_new(void);
+void crypto_xof_add_bytes(crypto_xof_t *xof, const uint8_t *data, size_t len);
+void crypto_xof_squeeze_bytes(crypto_xof_t *xof, uint8_t *out, size_t len);
+void crypto_xof_free(crypto_xof_t *xof);
/* Key negotiation */
#define DH_TYPE_CIRCUIT 1
@@ -307,5 +313,9 @@ struct dh_st *crypto_dh_get_dh_(crypto_dh_t *dh);
void crypto_add_spaces_to_fp(char *out, size_t outlen, const char *in);
+#ifdef CRYPTO_PRIVATE
+STATIC int crypto_force_rand_ssleay(void);
+#endif
+
#endif
diff --git a/src/common/crypto_ed25519.c b/src/common/crypto_ed25519.c
index 41ec486f0a..9df665f66a 100644
--- a/src/common/crypto_ed25519.c
+++ b/src/common/crypto_ed25519.c
@@ -96,6 +96,28 @@ get_ed_impl(void)
return ed25519_impl;
}
+#ifdef TOR_UNIT_TESTS
+static const ed25519_impl_t *saved_ed25519_impl = NULL;
+void
+crypto_ed25519_testing_force_impl(const char *name)
+{
+ tor_assert(saved_ed25519_impl == NULL);
+ saved_ed25519_impl = ed25519_impl;
+ if (! strcmp(name, "donna")) {
+ ed25519_impl = &impl_donna;
+ } else {
+ tor_assert(!strcmp(name, "ref10"));
+ ed25519_impl = &impl_ref10;
+ }
+}
+void
+crypto_ed25519_testing_restore_impl(void)
+{
+ ed25519_impl = saved_ed25519_impl;
+ saved_ed25519_impl = NULL;
+}
+#endif
+
/**
* Initialize a new ed25519 secret key in <b>seckey_out</b>. If
* <b>extra_strong</b>, take the RNG inputs directly from the operating
diff --git a/src/common/crypto_ed25519.h b/src/common/crypto_ed25519.h
index bdac12eb27..4fa7ea11cf 100644
--- a/src/common/crypto_ed25519.h
+++ b/src/common/crypto_ed25519.h
@@ -111,5 +111,10 @@ int ed25519_pubkey_eq(const ed25519_public_key_t *key1,
void ed25519_set_impl_params(int use_donna);
void ed25519_init(void);
+#ifdef TOR_UNIT_TESTS
+void crypto_ed25519_testing_force_impl(const char *name);
+void crypto_ed25519_testing_restore_impl(void);
+#endif
+
#endif
diff --git a/src/common/di_ops.c b/src/common/di_ops.c
index c9d1350880..70f2da7377 100644
--- a/src/common/di_ops.c
+++ b/src/common/di_ops.c
@@ -25,6 +25,9 @@
int
tor_memcmp(const void *a, const void *b, size_t len)
{
+#ifdef HAVE_TIMINGSAFE_MEMCMP
+ return timingsafe_memcmp(a, b, len);
+#else
const uint8_t *x = a;
const uint8_t *y = b;
size_t i = len;
@@ -83,6 +86,7 @@ tor_memcmp(const void *a, const void *b, size_t len)
}
return retval;
+#endif /* timingsafe_memcmp */
}
/**
diff --git a/src/common/include.am b/src/common/include.am
index 2fc92e2ceb..5afb30da6a 100644
--- a/src/common/include.am
+++ b/src/common/include.am
@@ -78,7 +78,8 @@ LIBOR_A_SOURCES = \
$(threads_impl_source) \
$(readpassphrase_source)
-src/common/log.o: micro-revision.i
+src/common/src_common_libor_testing_a-log.$(OBJEXT) \
+ src/common/log.$(OBJEXT): micro-revision.i
LIBOR_CRYPTO_A_SOURCES = \
src/common/aes.c \
diff --git a/src/common/tortls.c b/src/common/tortls.c
index b1d3f6f9e8..6e4cd3d480 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -884,7 +884,7 @@ tor_tls_cert_is_valid(int severity,
EVP_PKEY *cert_key;
int r, key_ok = 0;
- if (!signing_cert)
+ if (!signing_cert || !cert)
goto bad;
EVP_PKEY *signing_key = X509_get_pubkey(signing_cert->cert);
@@ -1310,6 +1310,7 @@ find_cipher_by_id(const SSL *ssl, const SSL_METHOD *m, uint16_t cipher)
{
const SSL_CIPHER *c;
#ifdef HAVE_SSL_CIPHER_FIND
+ (void) m;
{
unsigned char cipherid[3];
tor_assert(ssl);
@@ -1322,7 +1323,9 @@ find_cipher_by_id(const SSL *ssl, const SSL_METHOD *m, uint16_t cipher)
tor_assert((SSL_CIPHER_get_id(c) & 0xffff) == cipher);
return c != NULL;
}
-#elif defined(HAVE_STRUCT_SSL_METHOD_ST_GET_CIPHER_BY_CHAR)
+#else
+
+# if defined(HAVE_STRUCT_SSL_METHOD_ST_GET_CIPHER_BY_CHAR)
if (m && m->get_cipher_by_char) {
unsigned char cipherid[3];
set_uint16(cipherid, htons(cipher));
@@ -1333,9 +1336,9 @@ find_cipher_by_id(const SSL *ssl, const SSL_METHOD *m, uint16_t cipher)
if (c)
tor_assert((c->id & 0xffff) == cipher);
return c != NULL;
- } else
-#endif
-#if OPENSSL_VERSION_NUMBER < OPENSSL_V_SERIES(1,1,0)
+ }
+# endif
+# if OPENSSL_VERSION_NUMBER < OPENSSL_V_SERIES(1,1,0)
if (m && m->get_cipher && m->num_ciphers) {
/* It would seem that some of the "let's-clean-up-openssl" forks have
* removed the get_cipher_by_char function. Okay, so now you get a
@@ -1350,11 +1353,12 @@ find_cipher_by_id(const SSL *ssl, const SSL_METHOD *m, uint16_t cipher)
}
return 0;
}
-#endif
+# endif
(void) ssl;
(void) m;
(void) cipher;
return 1; /* No way to search */
+#endif
}
/** Remove from v2_cipher_list every cipher that we don't support, so that
diff --git a/src/config/geoip b/src/config/geoip
index 221530608d..16f1ada2c9 100644
--- a/src/config/geoip
+++ b/src/config/geoip
@@ -1,4 +1,4 @@
-# Last updated based on December 1 2015 Maxmind GeoLite2 Country
+# Last updated based on January 5 2016 Maxmind GeoLite2 Country
# wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz
# gunzip GeoLite2-Country.mmdb.gz
# python mmdb-convert.py GeoLite2-Country.mmdb
@@ -39,8 +39,7 @@
18219008,18350079,IN
18350080,18874367,CN
18874368,18907135,MY
-18907136,18923519,SG
-18923520,18939903,HK
+18907136,18939903,SG
18939904,19005439,JP
19005440,19005440,CN
19005441,19136511,TW
@@ -750,7 +749,9 @@
88061952,88063999,PL
88064000,88080383,HU
88080384,88604671,GB
-88604672,88866815,RU
+88604672,88670207,RU
+88670208,88670208,IR
+88670209,88866815,RU
88866816,88932351,KZ
88932352,88940543,RU
88940544,88948735,GB
@@ -1708,7 +1709,8 @@
98738176,98740223,NO
98740224,98740479,ES
98740480,98740735,US
-98740736,98741503,DE
+98740736,98741247,DE
+98741248,98741503,ES
98741504,98741759,US
98741760,98742271,DE
98742272,98744319,GB
@@ -1890,7 +1892,9 @@
135441408,135441663,CA
135441664,135556607,US
135556608,135556863,CA
-135556864,135603199,US
+135556864,135558399,US
+135558400,135558655,NL
+135558656,135603199,US
135603200,135604223,CA
135604224,135604479,US
135604480,135604735,CA
@@ -1906,7 +1910,9 @@
135926272,135926783,VI
135926784,135945727,US
135945728,135945983,CA
-135945984,136175615,US
+135945984,136054015,US
+136054016,136054271,GB
+136054272,136175615,US
136175616,136175871,CA
136175872,136237055,US
136237056,136239103,CA
@@ -2017,6 +2023,8 @@
234947584,234950655,JP
234950656,234951679,AU
234951680,234952703,HK
+234952704,234953727,CN
+234953728,234954751,SG
234954752,234971135,NZ
234979328,235012095,MY
235012096,235077631,AU
@@ -2706,6 +2714,7 @@
394296320,394296831,NL
394526720,394526975,US
394788864,394789119,US
+395051008,395051263,CA
395313152,397410303,US
397410304,397410559,CA
397934592,397934847,US
@@ -2859,7 +2868,11 @@
400911616,400911871,CR
400911872,400912127,US
400912128,400912383,SG
-400912384,401129727,US
+400912384,401114367,US
+401114368,401114623,DE
+401114624,401125119,US
+401125120,401125375,DE
+401125376,401129727,US
401129728,401129983,FR
401129984,401130495,US
401130496,401130751,DE
@@ -3171,6 +3184,7 @@
456554496,456555519,PK
456555520,456556543,JP
456556544,456560639,AU
+456560640,456562687,BD
456562688,456564735,CN
456564736,456572927,IN
456572928,456589311,CN
@@ -3704,7 +3718,8 @@
522719232,522721279,UA
522721280,522741759,RU
522741760,522743807,UA
-522743808,522764287,RU
+522743808,522747903,RU
+522747904,522764287,UA
522780672,522782719,RU
522782720,522784767,UA
522784768,522786815,BG
@@ -6763,6 +6778,7 @@
702447616,702449663,EG
702449664,702451711,ZA
702451712,702453759,NG
+702453760,702455807,ZA
702455808,702457855,KE
702457856,702459903,EG
702459904,702461951,TZ
@@ -7006,7 +7022,9 @@
736175104,736176127,MY
736176128,736177151,BN
736177152,736178175,HK
-736178176,736179199,AU
+736178176,736178431,AU
+736178432,736178432,NZ
+736178433,736179199,AU
736179200,736180223,IN
736180224,736181247,HK
736181248,736182271,AU
@@ -7130,13 +7148,10 @@
736432128,736433151,CN
736433152,736434175,ID
736434176,736435199,IN
-736435200,736436223,HK
736436224,736437247,JP
-736437248,736438271,HK
736438272,736439295,CN
736439296,736440319,TH
736440320,736441343,CN
-736441344,736442367,HK
736442368,736443391,CN
736443392,736445439,AU
736446464,736447487,IN
@@ -7259,7 +7274,10 @@
737100800,737101823,IN
737101824,737102847,BD
737102848,737104895,IN
-737104896,737106943,HK
+737104896,737105919,HK
+737105920,737106175,IN
+737106176,737106431,HK
+737106432,737106943,IN
737106944,737108991,NZ
737108992,737110015,SG
737110016,737111039,JP
@@ -7320,7 +7338,9 @@
737209344,737220607,CN
737220608,737222655,IN
737222656,737223679,TW
-737223680,737225727,IN
+737223680,737224703,IN
+737224704,737224959,MY
+737224960,737225727,IN
737225728,737225983,KR
737225984,737226751,HK
737226752,737227775,CN
@@ -7398,6 +7418,7 @@
737376256,737377279,HK
737377280,737378303,PH
737378304,737379327,CN
+737379328,737380351,BD
737380352,737381375,CN
737381376,737382399,ID
737382400,737384447,CN
@@ -7464,9 +7485,7 @@
737514496,737515519,IN
737515520,737516543,AU
737516544,737517567,IN
-737517568,737517823,AU
-737517824,737518079,NZ
-737518080,737520639,AU
+737517568,737520639,AU
737520640,737521663,NZ
737521664,737522687,AU
737522688,737525759,ID
@@ -7553,10 +7572,9 @@
737679360,737680383,ID
737680384,737681407,CN
737681408,737683455,IN
-737683456,737685503,JP
+737683456,737684479,JP
737685504,737686527,CN
737686528,737687551,AU
-737687552,737688575,CN
737688576,737690623,HK
737690624,737692671,IN
737692672,737712127,CN
@@ -7651,7 +7669,7 @@
737846272,737847295,IN
737847296,737850367,CN
737850368,737851391,IN
-737851392,737853439,HK
+737851392,737852415,HK
737853440,737854463,SG
737854464,737855487,JP
737855488,737856511,CN
@@ -7667,7 +7685,8 @@
737866752,737867775,CN
737867776,737868799,AU
737868800,737870847,IN
-737870848,737874431,CN
+737870848,737873919,CN
+737873920,737874431,HK
737874432,737874943,IN
737874944,737876991,HK
737876992,737878015,KR
@@ -7781,7 +7800,7 @@
738078720,738079743,IN
738079744,738080767,CN
738080768,738081791,TL
-738081792,738082815,WS
+738081792,738082815,TW
738082816,738083839,CN
738083840,738084863,ID
738084864,738085887,CN
@@ -8164,8 +8183,7 @@
759193856,759194111,SG
759194112,759195647,ID
759195648,759196671,IN
-759196672,759197695,HK
-759197696,759198207,CN
+759196672,759198207,HK
759198208,759198719,IN
759198720,759199743,NZ
759199744,759200767,PH
@@ -8257,7 +8275,6 @@
762321920,762323967,IN
762323968,762324991,SG
762324992,762330111,IN
-762330112,762331135,JP
762331136,762332159,TH
762332160,762333183,IN
762333184,762334207,BD
@@ -8265,7 +8282,6 @@
762335744,762336255,PH
762336256,762337279,ID
762337280,762345471,KR
-762345472,762346495,JP
762346496,762347519,ID
762347520,762348543,JP
762348544,762349567,CN
@@ -8322,7 +8338,6 @@
762419200,762420223,IN
762420224,762421247,TW
762421248,762422271,HK
-762422272,762423295,JP
762423296,762424319,CN
762424320,762425343,JP
762425344,762426367,CN
@@ -8586,7 +8601,6 @@
762848512,762848767,IN
762848768,762849279,BD
762849280,762850303,IN
-762850304,762851327,JP
762851328,762852351,IN
762852352,762853375,HK
762853376,762855423,IN
@@ -8789,7 +8803,8 @@
763227136,763228159,VN
763228160,763229183,JP
763229184,763229695,NZ
-763229696,763230207,IN
+763229696,763229951,IN
+763229952,763230207,AU
763230208,763231231,PH
763231232,763232255,IN
763232256,763234303,HK
@@ -9544,8 +9559,8 @@
778304306,778304306,SI
778304307,778305535,AL
778305536,778371071,IR
-778371072,778403839,GB
-778403840,778436607,DE
+778371072,778399743,GB
+778399744,778436607,DE
778436608,778461183,RO
778461184,778461439,TR
778461440,778462207,EE
@@ -10042,7 +10057,9 @@
785383424,785448959,GB
785448960,785514495,IR
785514496,785580031,IL
-785580032,785645567,UA
+785580032,785609020,UA
+785609021,785609021,US
+785609022,785645567,UA
785645568,785711103,NO
785711104,785776639,SY
785776640,785842175,RO
@@ -10525,6 +10542,7 @@
797873920,805306367,CA
805306368,822083583,US
822083584,822084607,ID
+822084608,822085631,BD
822085632,822087679,AU
822087680,822089727,JP
822089728,822090751,ID
@@ -10765,13 +10783,23 @@
872344604,872344607,GB
872344608,872346978,FR
872346979,872346979,DE
-872346980,872364863,FR
+872346980,872357423,FR
+872357424,872357427,PT
+872357428,872357429,FR
+872357430,872357433,PT
+872357434,872364863,FR
872364864,872364927,NL
872364928,872374608,FR
872374609,872374618,ES
-872374619,872380607,FR
+872374619,872377297,FR
+872377298,872377299,ES
+872377300,872380607,FR
872380608,872380671,ES
-872380672,872415231,FR
+872380672,872384095,FR
+872384096,872384127,ES
+872384128,872388415,FR
+872388416,872388447,ES
+872388448,872415231,FR
872415232,873463807,US
873463808,873646466,IE
873646467,873646467,US
@@ -10785,15 +10813,19 @@
876216320,876347391,DE
876347392,876478463,US
876478464,876740607,AU
-876740608,876871679,US
+876740608,876806143,US
+876806144,876871679,BR
876871680,877002751,JP
877002752,877264895,US
877264896,877330431,SG
877330432,877395967,US
877395968,877527039,SG
-877527040,877658111,US
+877527040,877592575,US
+877592576,877658111,KR
877658112,877920255,CN
-877920256,878454527,US
+877920256,878444543,US
+878444544,878448639,KR
+878448640,878454527,US
878454528,878454783,BR
878454784,878456831,IE
878456832,878457855,US
@@ -10805,20 +10837,24 @@
878462976,878463999,BR
878464000,878576895,US
878576896,878577151,IE
-878577152,878577663,US
+878577152,878577663,KR
878577664,878577919,BR
878577920,878578175,JP
878578176,878578687,US
878578688,878578943,SG
878578944,878579199,AU
-878579200,878649855,US
+878579200,878648831,US
+878648832,878649343,JP
+878649344,878649855,US
878649856,878650111,JP
878650112,878650367,SG
878650368,878651391,AU
878651392,878655487,US
878655488,878656511,JP
878656512,878657023,IE
-878657024,878695423,US
+878657024,878690303,US
+878690304,878694399,KR
+878694400,878695423,US
878695424,878696447,SG
878696448,878702591,US
878702592,878702847,BR
@@ -10829,7 +10865,9 @@
878703872,878704639,US
878704640,878704895,DE
878704896,878705151,CN
-878705152,878706431,US
+878705152,878705663,US
+878705664,878705919,KR
+878705920,878706431,US
878706432,878706447,BR
878706448,878706463,AU
878706464,878706479,SG
@@ -10840,7 +10878,13 @@
878706576,878706591,CN
878706592,884998143,US
884998144,885129215,JP
-885129216,889192447,US
+885129216,885260287,US
+885260288,885522431,JP
+885522432,886046719,US
+886046720,886571007,IE
+886571008,886833151,US
+886833152,886964223,SG
+886964224,889192447,US
889192448,905969663,DE
905969664,910163967,US
910163968,910197237,JP
@@ -10915,7 +10959,9 @@
921658112,921658879,IE
921658880,921661951,US
921661952,921662207,IE
-921662208,921747455,US
+921662208,921662463,US
+921662464,921665535,KR
+921665536,921747455,US
921747456,921748479,AU
921748480,921748735,US
921748736,921748991,IE
@@ -10930,7 +10976,8 @@
921755904,921756159,JP
921756160,921756671,SG
921756672,921758719,US
-921758720,921759999,DE
+921758720,921759743,KR
+921759744,921759999,DE
921760000,921760767,US
921760768,921761791,BR
921761792,922091519,US
@@ -10973,7 +11020,9 @@
960671744,960676607,DE
960676608,960676863,PL
960676864,960692223,DE
-960692224,960724991,FR
+960692224,960699940,FR
+960699941,960699941,IT
+960699942,960724991,FR
960724992,960726783,NL
960726784,960727039,ZA
960727040,960727295,US
@@ -11221,7 +11270,10 @@
978588672,978590719,IN
978590720,978591743,PK
978591744,978592767,BD
-978592768,978593791,NZ
+978592768,978593023,US
+978593024,978593279,NZ
+978593280,978593535,AU
+978593536,978593791,AE
978593792,978594815,MY
978594816,978595839,KR
978595840,978596863,NZ
@@ -11318,7 +11370,8 @@
999784448,999800831,JP
999800832,999817215,KR
999817216,999821311,BD
-999821312,999825407,CN
+999821312,999827455,CN
+999827456,999828479,IN
999833600,999837695,CN
999837696,999838719,IN
999839744,999845887,BD
@@ -11492,7 +11545,12 @@
1024378880,1024380927,IN
1024380928,1024381951,KR
1024381952,1024385023,CN
-1024393216,1024458751,HK
+1024385024,1024386047,JP
+1024386048,1024387071,IN
+1024387072,1024389119,VN
+1024389120,1024391167,CN
+1024391168,1024392191,ID
+1024392192,1024458751,HK
1024458752,1024491519,SG
1024491520,1024589823,IN
1024589824,1024655359,HK
@@ -11538,7 +11596,21 @@
1026420736,1026422783,JP
1026422784,1026424831,AU
1026424832,1026490367,JP
-1026490368,1026523135,TH
+1026490368,1026492415,TH
+1026492416,1026493439,SG
+1026493440,1026498559,TH
+1026498560,1026501631,SG
+1026501632,1026505727,TH
+1026505728,1026506751,SG
+1026506752,1026507775,TH
+1026507776,1026508799,SG
+1026508800,1026510847,JP
+1026510848,1026512895,SG
+1026512896,1026514943,JP
+1026514944,1026516991,TH
+1026516992,1026518015,SG
+1026518016,1026519039,JP
+1026519040,1026523135,SG
1026523136,1026539519,CN
1026539520,1026555903,KR
1026555904,1027080191,CN
@@ -12724,10 +12796,7 @@
1056473088,1056505855,FI
1056505856,1056514047,PT
1056514048,1056522239,IT
-1056522240,1056522664,DE
-1056522665,1056522665,AT
-1056522666,1056523007,DE
-1056523008,1056538623,AT
+1056522240,1056538623,AT
1056538624,1056546815,RU
1056546816,1056555007,NO
1056555008,1056571391,GB
@@ -12841,7 +12910,9 @@
1066358528,1066369023,JM
1066369024,1066830303,US
1066830304,1066830311,SG
-1066830312,1066831183,US
+1066830312,1066831071,US
+1066831072,1066831079,JP
+1066831080,1066831183,US
1066831184,1066831191,JP
1066831192,1066831335,US
1066831336,1066831343,JP
@@ -13655,7 +13726,9 @@
1082683392,1082687487,CA
1082687488,1082753023,US
1082753024,1082785791,CA
-1082785792,1082790911,US
+1082785792,1082788655,US
+1082788656,1082788663,SG
+1082788664,1082790911,US
1082790912,1082791167,AU
1082791168,1082791423,IN
1082791424,1082945535,US
@@ -13736,7 +13809,9 @@
1087508162,1087508162,JP
1087508163,1087514623,US
1087514624,1087516671,BB
-1087516672,1087593983,US
+1087516672,1087591237,US
+1087591238,1087591238,FR
+1087591239,1087593983,US
1087593984,1087594239,MX
1087594240,1087596031,US
1087596032,1087596287,DE
@@ -14365,9 +14440,9 @@
1114513472,1114513555,US
1114513556,1114513559,SA
1114513560,1114513567,US
-1114513568,1114513663,SA
-1114513664,1114514431,US
-1114514432,1114515455,SA
+1114513568,1114513599,SA
+1114513600,1114514687,US
+1114514688,1114515455,SA
1114515456,1114515463,US
1114515464,1114515471,CA
1114515472,1114517503,US
@@ -14427,7 +14502,12 @@
1116024064,1116024319,PG
1116024320,1116027135,US
1116027136,1116027903,DE
-1116027904,1116033023,US
+1116027904,1116031743,US
+1116031744,1116031999,GB
+1116032000,1116032255,US
+1116032256,1116032511,NL
+1116032512,1116032767,US
+1116032768,1116033023,GB
1116033024,1116037119,HK
1116037120,1116168191,US
1116168192,1116176383,CA
@@ -14471,7 +14551,7 @@
1117823232,1117823487,CA
1117823488,1117823743,CN
1117823744,1117823999,US
-1117824000,1117824511,GR
+1117824000,1117824511,CA
1117824512,1117829375,US
1117829376,1117829631,GR
1117829632,1117978623,US
@@ -14816,7 +14896,9 @@
1123635671,1123635671,RU
1123635672,1123635887,US
1123635888,1123635888,AU
-1123635889,1123651583,US
+1123635889,1123638730,US
+1123638731,1123638731,RE
+1123638732,1123651583,US
1123651584,1123651839,JM
1123651840,1123652095,BB
1123652096,1123653119,JM
@@ -15948,7 +16030,13 @@
1210256128,1210256383,CA
1210256384,1210259967,US
1210259968,1210260223,CA
-1210260224,1210316799,US
+1210260224,1210314751,US
+1210314752,1210315007,GB
+1210315008,1210315775,US
+1210315776,1210316031,GB
+1210316032,1210316287,US
+1210316288,1210316543,NL
+1210316544,1210316799,US
1210316800,1210317823,ID
1210317824,1210420223,US
1210420224,1210420479,IT
@@ -16504,9 +16592,7 @@
1279967232,1279967487,CA
1279967488,1279968127,US
1279968128,1279968255,CA
-1279968256,1279969167,US
-1279969168,1279969183,CA
-1279969184,1279969343,US
+1279968256,1279969343,US
1279969344,1279969407,CA
1279969408,1279969663,US
1279969664,1279969791,CA
@@ -16632,7 +16718,8 @@
1296249024,1296249087,GB
1296249088,1296249279,FR
1296249280,1296249343,DE
-1296249344,1296249599,FR
+1296249344,1296249567,FR
+1296249568,1296249599,NO
1296249600,1296249615,GB
1296249616,1296250367,FR
1296250368,1296250399,CZ
@@ -18097,9 +18184,7 @@
1337241563,1337241563,RO
1337241564,1337458687,IL
1337458688,1337982975,PL
-1337982976,1339416319,DE
-1339416320,1339416575,LU
-1339416576,1342177279,DE
+1337982976,1342177279,DE
1342177280,1342628207,GB
1342628208,1342628223,IE
1342628224,1342701567,GB
@@ -18240,7 +18325,9 @@
1346596864,1346600959,IT
1346600960,1346605055,MU
1346605056,1346609151,CH
-1346609152,1346617343,FR
+1346609152,1346614527,FR
+1346614528,1346614783,BE
+1346614784,1346617343,FR
1346617344,1346621439,SE
1346621440,1346625535,RU
1346625536,1346629631,DE
@@ -18882,6 +18969,7 @@
1348395008,1348399103,BY
1348399104,1348403199,MD
1348403200,1348404223,ZA
+1348405248,1348407295,ZA
1348407296,1348411391,BG
1348411392,1348415487,RU
1348415488,1348419583,GB
@@ -19034,7 +19122,8 @@
1357323520,1357323775,GB
1357323776,1357323791,FI
1357324288,1357324295,RU
-1357324296,1357325311,GB
+1357324296,1357324319,PL
+1357324320,1357325311,GB
1357326336,1357326337,ES
1357326848,1357327103,GB
1357327360,1357327615,FR
@@ -19059,8 +19148,8 @@
1357347840,1357348095,PL
1357348384,1357348415,ES
1357348480,1357348607,ES
-1357350400,1357350623,GB
-1357350656,1357350783,GB
+1357350400,1357350639,GB
+1357350656,1357350847,GB
1357351168,1357351423,PL
1357355520,1357355775,FR
1357360064,1357360383,GB
@@ -19081,7 +19170,7 @@
1357373536,1357373539,ES
1357373540,1357373543,PT
1357373544,1357373555,GB
-1357373568,1357375151,GB
+1357373560,1357375199,GB
1357377536,1357377679,FR
1357377696,1357378623,FR
1357381632,1357414399,NO
@@ -19446,7 +19535,9 @@
1359119360,1359120383,NL
1359120384,1359121407,DK
1359121408,1359122431,ES
-1359122432,1359134719,DE
+1359122432,1359123967,DE
+1359123968,1359124479,ES
+1359124480,1359134719,DE
1359134720,1359151103,CZ
1359151104,1359167487,DE
1359167488,1359183871,GB
@@ -20232,7 +20323,9 @@
1375270400,1375270655,RE
1375270656,1375270911,FR
1375270912,1375271679,RE
-1375271680,1375731711,FR
+1375271680,1375271964,FR
+1375271965,1375271965,RE
+1375271966,1375731711,FR
1375731712,1378877439,GB
1378877440,1379926015,IT
1379926016,1380188159,FR
@@ -20506,7 +20599,9 @@
1386414080,1386438399,GB
1386438400,1386438655,FR
1386438656,1386448895,GB
-1386448896,1386450943,IL
+1386448896,1386449151,IL
+1386449152,1386449407,NL
+1386449408,1386450943,IL
1386450944,1386479615,GB
1386479616,1386545151,NO
1386545152,1386552319,DE
@@ -21415,7 +21510,11 @@
1408172032,1408237567,RU
1408237568,1408270335,CZ
1408270336,1408283135,PT
-1408283136,1408283391,GB
+1408283136,1408283197,GB
+1408283198,1408283198,PT
+1408283199,1408283329,GB
+1408283330,1408283330,PT
+1408283331,1408283391,GB
1408283392,1408303103,PT
1408303104,1408335871,LV
1408335872,1408368639,SE
@@ -21458,9 +21557,13 @@
1409377792,1409378047,RO
1409378048,1409378679,HU
1409378680,1409378687,RO
-1409378688,1409413119,HU
+1409378688,1409391103,HU
+1409391104,1409391359,BG
+1409391360,1409413119,HU
1409413120,1409415167,BG
-1409415168,1409548287,HU
+1409415168,1409436159,HU
+1409436160,1409436415,BG
+1409436416,1409548287,HU
1409548288,1409810431,FR
1409810432,1409941503,GB
1409941504,1410007039,PL
@@ -21696,7 +21799,9 @@
1416953856,1417019391,RO
1417019392,1417150463,DE
1417150464,1417674751,ES
-1417674752,1421869055,DE
+1417674752,1420133375,DE
+1420133376,1420133631,LU
+1420133632,1421869055,DE
1421869056,1422393343,BE
1422393344,1422413567,DE
1422413568,1422413695,AT
@@ -22389,12 +22494,15 @@
1439372032,1439372287,TR
1439372288,1439372543,IT
1439372544,1439372799,JP
-1439372800,1439373311,NL
-1439373312,1439373567,SE
+1439372800,1439373055,MT
+1439373056,1439373311,NL
+1439373312,1439373567,AE
1439373568,1439374335,NL
1439374336,1439375359,IT
1439375360,1439375615,ES
-1439375616,1439376383,NL
+1439375616,1439375871,KW
+1439375872,1439376127,OM
+1439376128,1439376383,SA
1439376384,1439377407,CN
1439377408,1439378431,IT
1439378432,1439383551,NL
@@ -22441,7 +22549,11 @@
1439482880,1439483903,RO
1439483904,1439485951,ES
1439485952,1439490047,IR
-1439490048,1439498239,RO
+1439490048,1439495423,RO
+1439495424,1439495679,GB
+1439495680,1439496959,RO
+1439496960,1439497215,GB
+1439497216,1439498239,RO
1439498240,1439513599,DE
1439513600,1439514623,GB
1439514624,1439516671,IT
@@ -22521,9 +22633,7 @@
1441439744,1441447935,LV
1441447936,1441456127,BE
1441456128,1441464319,NL
-1441464320,1441469439,SE
-1441469440,1441469695,DK
-1441469696,1441472511,SE
+1441464320,1441472511,SE
1441472512,1441480703,RU
1441480704,1441488895,TR
1441488896,1441497087,GB
@@ -22668,9 +22778,11 @@
1449722112,1449722367,IT
1449722368,1449723135,RO
1449723136,1449723391,DE
-1449723392,1449724927,RO
-1449724928,1449725183,GB
-1449725184,1449726463,RO
+1449723392,1449723647,RO
+1449723648,1449723903,GB
+1449723904,1449724927,RO
+1449724928,1449725439,GB
+1449725440,1449726463,RO
1449726464,1449726719,NL
1449726720,1449727999,RO
1449728000,1449728255,MD
@@ -22734,7 +22846,9 @@
1449815296,1449816063,GB
1449816064,1449816575,RO
1449816576,1449817855,GB
-1449817856,1449820927,RO
+1449817856,1449818111,RO
+1449818112,1449818367,DE
+1449818368,1449820927,RO
1449820928,1449821183,DE
1449821184,1449822719,RO
1449822720,1449823743,GB
@@ -22744,7 +22858,9 @@
1449828352,1449830399,SE
1449830400,1449831935,RO
1449831936,1449832447,GB
-1449832448,1449840639,RO
+1449832448,1449834495,RO
+1449834496,1449835519,ES
+1449835520,1449840639,RO
1449840640,1449852927,MD
1449852928,1449857023,IR
1449857024,1449859583,RO
@@ -22778,7 +22894,9 @@
1449902080,1449902335,RO
1449902336,1449903103,GB
1449903104,1449903359,MD
-1449903360,1449906175,RO
+1449903360,1449904127,RO
+1449904128,1449905151,NL
+1449905152,1449906175,RO
1449906176,1449910271,IR
1449910272,1449918463,RO
1449918464,1449951231,JO
@@ -23066,9 +23184,9 @@
1475338240,1475340287,RO
1475340288,1475342335,GR
1475342336,1475344383,PL
-1475344384,1475344639,RO
+1475344384,1475344639,ES
1475344640,1475345919,NL
-1475345920,1475346431,RO
+1475345920,1475346431,GB
1475346432,1475362815,RU
1475362816,1475379199,FR
1475379200,1475395583,RU
@@ -23107,7 +23225,9 @@
1475657728,1475674111,SK
1475674112,1475690495,DE
1475690496,1475693055,CH
-1475693056,1475693311,DE
+1475693056,1475693069,DE
+1475693070,1475693070,CH
+1475693071,1475693311,DE
1475693312,1475706879,CH
1475706880,1475723263,RU
1475723264,1475723839,GB
@@ -23734,7 +23854,9 @@
1495376384,1495376639,GB
1495376640,1495376895,RO
1495376896,1495377407,GB
-1495377408,1495385599,RO
+1495377408,1495382015,RO
+1495382016,1495384063,ES
+1495384064,1495385599,RO
1495385600,1495386623,GB
1495386624,1495387135,RO
1495387136,1495387647,IR
@@ -23908,7 +24030,9 @@
1495647744,1495648255,IR
1495648256,1495652863,RO
1495652864,1495653375,IR
-1495653376,1495658495,RO
+1495653376,1495656959,RO
+1495656960,1495657215,GB
+1495657216,1495658495,RO
1495658496,1495662591,IR
1495662592,1495668735,RO
1495668736,1495669247,IR
@@ -23925,7 +24049,9 @@
1495683072,1495687167,IR
1495687168,1495688703,RO
1495688704,1495689215,IR
-1495689216,1495723519,RO
+1495689216,1495700308,RO
+1495700309,1495700309,GB
+1495700310,1495723519,RO
1495723520,1495724031,FR
1495724032,1495724543,RO
1495724544,1495725055,IR
@@ -23994,7 +24120,7 @@
1495816704,1495817215,IR
1495817216,1495820799,RO
1495820800,1495821311,IR
-1495821312,1495821823,RO
+1495821312,1495821823,DE
1495821824,1495822335,IR
1495822336,1495826431,RO
1495826432,1495826943,IR
@@ -24117,7 +24243,8 @@
1496078336,1496079359,MD
1496079360,1496082175,RO
1496082176,1496082431,GB
-1496082432,1496084479,RO
+1496082432,1496083967,RO
+1496083968,1496084479,FR
1496084480,1496084991,IR
1496084992,1496085247,MD
1496085248,1496086015,RO
@@ -24151,7 +24278,9 @@
1496150016,1496152063,IR
1496152064,1496153599,RO
1496153600,1496154111,IR
-1496154112,1496179199,RO
+1496154112,1496177663,RO
+1496177664,1496178687,ES
+1496178688,1496179199,RO
1496179200,1496179711,SE
1496179712,1496180223,RO
1496180224,1496180735,IR
@@ -24690,7 +24819,9 @@
1506445136,1506445151,DE
1506445152,1506445167,GB
1506445168,1506445183,DE
-1506445184,1506446143,GB
+1506445184,1506445199,GB
+1506445200,1506445215,DE
+1506445216,1506446143,GB
1506446144,1506446151,FR
1506446152,1506446823,GB
1506446824,1506446831,NL
@@ -24710,7 +24841,9 @@
1506456960,1506456975,IT
1506456976,1506458244,GB
1506458245,1506458245,CH
-1506458246,1506459207,GB
+1506458246,1506458359,GB
+1506458360,1506458367,CH
+1506458368,1506459207,GB
1506459208,1506459247,BE
1506459248,1506459295,GB
1506459296,1506459327,BE
@@ -25390,9 +25523,7 @@
1522532352,1524629503,GB
1524629504,1525678079,SE
1525678080,1526726655,GB
-1526726656,1527519999,DE
-1527520000,1527520255,LU
-1527520256,1531183103,DE
+1526726656,1531183103,DE
1531183104,1531445247,FR
1531445248,1531707391,AE
1531707392,1531969535,RU
@@ -27868,7 +27999,7 @@
1540657664,1540657919,RU
1540657920,1540658175,FR
1540658176,1540658431,RO
-1540658432,1540659199,RU
+1540658688,1540659199,RU
1540659200,1540659455,FR
1540659712,1540659967,UA
1540659968,1540660223,PL
@@ -27878,7 +28009,6 @@
1540660992,1540661247,RO
1540661248,1540661503,GB
1540661760,1540662015,RO
-1540662016,1540662271,BG
1540662272,1540662527,RO
1540662528,1540662783,PL
1540662784,1540663039,GB
@@ -27934,8 +28064,7 @@
1540677888,1540678143,GE
1540678400,1540678655,RO
1540678656,1540678911,SE
-1540678912,1540679167,GB
-1540679168,1540679423,RU
+1540678912,1540679423,RU
1540679680,1540679935,LT
1540679936,1540680191,BG
1540680192,1540680447,CH
@@ -28324,7 +28453,7 @@
1540896512,1540896767,GB
1540897024,1540897279,GB
1540897280,1540897535,FR
-1540897536,1540897791,RU
+1540897536,1540897791,SC
1540897792,1540898047,HU
1540898048,1540898303,UA
1540898304,1540898559,SE
@@ -29697,7 +29826,7 @@
1541623296,1541623551,GB
1541623552,1541623807,RU
1541623808,1541624831,PL
-1541624832,1541625855,RU
+1541624832,1541625855,IR
1541625856,1541626367,PL
1541626368,1541626623,RO
1541626624,1541627903,RU
@@ -31236,7 +31365,8 @@
1542522112,1542522367,PL
1542522368,1542522879,NL
1542522880,1542523903,CZ
-1542523904,1542525951,RU
+1542523904,1542524415,RU
+1542524928,1542525951,RU
1542525952,1542526463,IR
1542526464,1542526719,RU
1542526720,1542526975,CZ
@@ -31475,7 +31605,9 @@
1546006528,1546008575,UA
1546008576,1546014719,BY
1546014720,1546015743,RU
-1546015744,1546018815,CZ
+1546015744,1546017791,CZ
+1546017792,1546018303,RU
+1546018304,1546018815,FR
1546018816,1546027007,UA
1546027008,1546059775,RU
1546059776,1546063871,SE
@@ -31809,7 +31941,9 @@
1551630336,1551892479,RU
1551892480,1555696895,FR
1555696896,1555697151,ES
-1555697152,1555760639,FR
+1555697152,1555739841,FR
+1555739842,1555739842,ES
+1555739843,1555760639,FR
1555760640,1555760895,ES
1555760896,1556086783,FR
1556086784,1557069823,DE
@@ -31883,7 +32017,9 @@
1558150144,1558150655,DE
1558150656,1558151167,NL
1558151168,1558172927,IT
-1558172928,1558173183,US
+1558172928,1558173099,US
+1558173100,1558173100,IT
+1558173101,1558173183,US
1558173184,1558179839,IT
1558179840,1558179955,NL
1558179956,1558179959,IT
@@ -32418,8 +32554,7 @@
1571422464,1571422719,UA
1571422720,1571423231,RU
1571423232,1571423487,UA
-1571423488,1571423999,RU
-1571424000,1571424255,KZ
+1571423488,1571424255,RU
1571424256,1571424511,KG
1571424512,1571424767,AM
1571424768,1571425023,CZ
@@ -32493,7 +32628,8 @@
1571469824,1571470335,CZ
1571470336,1571470847,UA
1571470848,1571475455,RU
-1571475456,1571476479,CZ
+1571475456,1571475967,UA
+1571475968,1571476479,CZ
1571476480,1571479551,RU
1571479552,1571483647,CZ
1571483648,1571484159,RU
@@ -32963,7 +33099,9 @@
1578592200,1578592207,CH
1578592208,1578592295,FR
1578592296,1578592303,NL
-1578592304,1578592783,FR
+1578592304,1578592539,FR
+1578592540,1578592543,ES
+1578592544,1578592783,FR
1578592784,1578592799,BE
1578592800,1578593023,FR
1578593024,1578593279,DE
@@ -33050,9 +33188,17 @@
1580048384,1580064767,RU
1580064768,1580072959,GB
1580072960,1580083199,PT
-1580083200,1580089343,US
+1580083200,1580087565,US
+1580087566,1580087566,SE
+1580087567,1580089102,US
+1580089103,1580089103,SE
+1580089104,1580089343,US
1580089344,1580097535,PT
-1580097536,1580105727,GB
+1580097536,1580101955,GB
+1580101956,1580101956,SE
+1580101957,1580105007,GB
+1580105008,1580105008,SE
+1580105009,1580105727,GB
1580105728,1580109567,PT
1580109568,1580109823,SE
1580109824,1580113919,US
@@ -33366,6 +33512,7 @@
1586233344,1586241535,FR
1586241536,1586249727,SE
1586249728,1586257919,SI
+1586257920,1586266111,LV
1586266112,1586274303,RU
1586274304,1586282495,BE
1586282496,1586298879,RU
@@ -33484,7 +33631,9 @@
1588659200,1588659711,NL
1588659712,1588661247,RO
1588661248,1588661503,NL
-1588661504,1588664319,RO
+1588661504,1588663807,RO
+1588663808,1588664063,GB
+1588664064,1588664319,RO
1588664320,1588664575,TH
1588664576,1588664831,VG
1588664832,1588673535,RO
@@ -33815,7 +33964,8 @@
1596456960,1596588031,PL
1596588032,1596719103,BG
1596719104,1596850175,IE
-1596850176,1596851199,CZ
+1596850176,1596850687,CZ
+1596850688,1596851199,UA
1596851200,1596851455,RU
1596851456,1596851711,CZ
1596851712,1596851967,UA
@@ -33828,12 +33978,15 @@
1596862464,1596876799,RU
1596876800,1596877055,CZ
1596877056,1596877311,RU
-1596877312,1596878079,CZ
-1596878080,1596878335,RU
-1596878336,1596880895,CZ
+1596877312,1596877823,CZ
+1596877824,1596878847,RU
+1596878848,1596879871,CZ
+1596879872,1596880895,RU
1596880896,1596881407,UA
1596881408,1596881919,CZ
-1596881920,1596887295,RU
+1596881920,1596886015,RU
+1596886016,1596886527,UA
+1596886528,1596887295,RU
1596887296,1596887551,KZ
1596887552,1596888063,UA
1596888064,1596889087,RU
@@ -33898,8 +34051,8 @@
1596967936,1596968959,UA
1596968960,1596973055,BA
1596973056,1596975103,BY
-1596975104,1596975615,CZ
-1596975616,1596978431,RU
+1596975104,1596975359,CZ
+1596975360,1596978431,RU
1596978432,1596978944,CZ
1596978945,1596978945,RU
1596978946,1596981247,CZ
@@ -35347,11 +35500,12 @@
1728673792,1728674815,JP
1728674816,1728675839,ID
1728675840,1728676863,KR
-1728677888,1728678911,BD
+1728676864,1728678911,BD
1728678912,1728679935,PG
1728679936,1728680959,ID
1728680960,1728681983,MY
1728681984,1728683007,CN
+1728683008,1728684031,VN
1728684032,1728685055,AU
1728685056,1728686079,JP
1728686080,1728687103,AU
@@ -35388,6 +35542,7 @@
1728716800,1728717823,AU
1728717824,1728718847,JP
1728718848,1728719871,MY
+1728719872,1728720895,VN
1728720896,1728721919,AU
1728721920,1728722943,BD
1728722944,1728723199,ID
@@ -35424,6 +35579,7 @@
1728750592,1728751615,JP
1728751616,1728751871,IN
1728751872,1728752639,ID
+1728752640,1728753663,HK
1728753664,1728754687,PH
1728754688,1728755711,IN
1728755712,1728756735,ID
@@ -35448,10 +35604,12 @@
1728768000,1728768255,AU
1728768256,1728768511,NZ
1728768512,1728769023,IN
+1728769024,1728770047,HK
1728770048,1728772095,JP
1728772096,1728773375,IN
1728773376,1728773631,ID
1728773632,1728774143,PH
+1728774144,1728775167,PK
1728775168,1728776191,JP
1728776192,1728777215,AU
1728777216,1728778239,TH
@@ -35793,11 +35951,7 @@
1729081600,1729082111,AU
1729082112,1729082367,IN
1729082368,1729083391,HK
-1729083392,1729083647,JP
-1729083648,1729084207,HK
-1729084208,1729084215,JP
-1729084216,1729084415,HK
-1729084416,1729085439,JP
+1729083392,1729085439,JP
1729085440,1729087487,HK
1729087488,1729088511,CN
1729088512,1729090559,AU
@@ -36096,11 +36250,13 @@
1729376768,1729377023,SG
1729377024,1729377279,ID
1729377280,1729378303,BD
+1729378304,1729378559,AU
1729378560,1729378815,IN
1729378816,1729379071,KR
1729379072,1729379327,SG
1729379328,1729380351,HK
1729380352,1729381375,IN
+1729381376,1729382399,CN
1729382400,1729383423,JP
1729383424,1729384447,PG
1729384448,1729385471,KH
@@ -36109,10 +36265,8 @@
1729386752,1729387007,BD
1729387008,1729387519,ID
1729387520,1729388543,SG
-1729388544,1729389567,HK
1729390592,1729391103,IN
1729391104,1729391615,ID
-1729391616,1729392639,JP
1729392640,1729393663,CN
1729393664,1729394687,KR
1729394688,1729395711,TH
@@ -36145,14 +36299,13 @@
1729419776,1729420031,IN
1729420288,1729421311,HK
1729421312,1729422335,MY
-1729422336,1729423359,HK
1729423360,1729423871,VU
1729423872,1729424383,AU
1729424384,1729425407,HK
-1729425408,1729426431,JP
1729426432,1729427455,AU
1729427456,1729428479,CN
1729428480,1729430527,AU
+1729431552,1729432575,HK
1729432576,1729433599,PH
1729433600,1729433855,IN
1729433856,1729434111,AU
@@ -36208,9 +36361,9 @@
1729485824,1729486847,HK
1729486848,1729488383,ID
1729488384,1729488895,SB
-1729488896,1729489919,IN
+1729488896,1729490943,IN
1729490944,1729491967,CN
-1729491968,1729492223,HK
+1729491968,1729492223,US
1729492224,1729492479,AU
1729492480,1729492991,US
1729492992,1729494015,SB
@@ -36220,6 +36373,7 @@
1729520640,1729527807,CN
1729527808,1729528831,SG
1729528832,1729530879,ID
+1729530880,1729531903,IN
1729531904,1729532927,AU
1729532928,1729533951,MY
1729533952,1729534975,JP
@@ -36238,9 +36392,10 @@
1729544192,1729545215,IN
1729545216,1729546239,AU
1729546240,1729546495,JP
-1729546496,1729546751,HK
+1729546496,1729546751,SG
1729546752,1729547007,NZ
1729547008,1729547263,HK
+1729547264,1729548287,ID
1729548544,1729549311,AU
1729550336,1729551359,MY
1729551360,1729552383,KR
@@ -36250,6 +36405,7 @@
1729554944,1729555455,NZ
1729555456,1729556479,IN
1729556480,1729557503,ID
+1729557504,1729558527,NZ
1729558528,1729559551,ID
1729559552,1729560575,CN
1729560576,1729561599,AU
@@ -36312,6 +36468,7 @@
1729610072,1729610751,HK
1729610752,1729611775,JP
1729611776,1729612799,ID
+1729612800,1729613823,BD
1729613824,1729614847,SG
1729614848,1729615103,NZ
1729615104,1729615359,KH
@@ -36423,6 +36580,7 @@
1729719296,1729720319,ID
1729720320,1729721087,AU
1729721344,1729722367,NZ
+1729722368,1729723391,BD
1729723392,1729726463,IN
1729726464,1729727487,PK
1729727488,1729728511,KI
@@ -36472,6 +36630,7 @@
1729774592,1729775615,AU
1729775616,1729776127,IN
1729776128,1729776639,MY
+1729776640,1729777663,CN
1729777664,1729779711,PK
1729779712,1729780735,AU
1729780736,1729781503,HK
@@ -36556,6 +36715,7 @@
1729856512,1729857535,AU
1729857536,1729858559,JP
1729858560,1729859583,IN
+1729859584,1729860607,PH
1729860608,1729861631,KR
1729861632,1729862655,AU
1729862656,1729863679,JP
@@ -36731,7 +36891,6 @@
1730022400,1730023423,IN
1730023424,1730024447,HK
1730024448,1730025471,CN
-1730025472,1730026495,HK
1730026496,1730027519,BD
1730027520,1730028543,SG
1730028544,1730029567,VN
@@ -36787,8 +36946,8 @@
1730081792,1730082815,ID
1730082816,1730083839,PW
1730084864,1730085887,CN
-1730085888,1730086143,SG
-1730086144,1730086911,AU
+1730085888,1730086399,SG
+1730086400,1730086911,AU
1730086912,1730087935,HK
1730087936,1730088959,JP
1730088960,1730091007,HK
@@ -37047,7 +37206,6 @@
1730599936,1730604031,CN
1730604032,1730605055,NP
1730605056,1730607103,IN
-1730607104,1730608127,JP
1730608128,1730609151,CN
1730609152,1730610687,IN
1730610688,1730610943,MY
@@ -37082,16 +37240,14 @@
1730638848,1730639871,IN
1730639872,1730640383,AU
1730640384,1730640895,MY
-1730640896,1730641919,JP
1730641920,1730643967,IN
1730643968,1730644735,AU
1730644736,1730644991,IN
1730644992,1730646015,MY
-1730646016,1730647039,CN
1730647040,1730649087,HK
1730649088,1730650111,IN
1730650112,1730658303,CN
-1730658304,1730660351,JP
+1730658304,1730659327,JP
1730660352,1730669567,CN
1730669568,1730670079,IN
1730670080,1730670591,AU
@@ -37128,7 +37284,6 @@
1730706432,1730708479,JP
1730708480,1730713599,TH
1730713600,1730714623,HK
-1730714624,1730715647,JP
1730715648,1730716671,HK
1730716672,1730717183,PH
1730717696,1730718719,IN
@@ -37159,18 +37314,14 @@
1730756608,1730757631,HK
1730757632,1730758655,SG
1730758656,1730759679,JP
-1730759680,1730760703,SG
1730760704,1730761727,HK
1730761728,1730762751,TH
1730762752,1730766847,IN
-1730766848,1730767871,HK
1730767872,1730768127,AU
1730768128,1730768639,ID
1730768640,1730768895,BD
-1730768896,1730769919,JP
1730769920,1730770943,CN
1730770944,1730771967,ID
-1730771968,1730772991,HK
1730772992,1730774015,SG
1730774016,1730775039,HK
1730775040,1730776063,JP
@@ -37186,7 +37337,7 @@
1730784256,1730785279,HK
1730785280,1730785535,NL
1730785536,1730786303,AU
-1730786304,1730788351,HK
+1730786304,1730787327,HK
1730788352,1730790399,ID
1730790400,1730791423,IN
1730791424,1730794495,ID
@@ -37207,12 +37358,10 @@
1730809856,1730810623,IN
1730810624,1730811903,AU
1730811904,1730814975,CN
-1730814976,1730815999,HK
1730816000,1730817023,ID
1730817024,1730818047,JP
1730818048,1730818815,AU
1730818816,1730819071,IN
-1730819072,1730820095,JP
1730820096,1730821119,VN
1730821120,1730822143,HK
1730822144,1730824191,CN
@@ -37245,7 +37394,6 @@
1730854400,1730854655,NZ
1730854656,1730854911,HK
1730854912,1730856959,IN
-1730856960,1730857983,JP
1730857984,1730858239,AU
1730858240,1730858495,ID
1730858496,1730859007,IN
@@ -37257,7 +37405,6 @@
1730864128,1730865151,TW
1730865152,1730866175,CN
1730866176,1730867199,AU
-1730867200,1730868223,JP
1730868224,1730869247,KR
1730869248,1730870271,IN
1730870272,1730871807,ID
@@ -37265,7 +37412,6 @@
1730873344,1730875391,HK
1730875392,1730876415,CN
1730876416,1730877439,AU
-1730877440,1730878463,CN
1730878464,1730879487,HK
1730879488,1730881023,IN
1730881024,1730881535,AU
@@ -38573,7 +38719,9 @@
1740976128,1740976639,BD
1740976640,1740976895,SG
1740976896,1740977151,IN
-1740977152,1740978175,NZ
+1740977152,1740977663,NZ
+1740977664,1740977919,GB
+1740977920,1740978175,NZ
1740978176,1740979199,MY
1740979200,1740980223,NZ
1740980224,1740981247,AU
@@ -38738,7 +38886,7 @@
1741195264,1741210623,CN
1741210624,1741211647,PK
1741211648,1741212671,SG
-1741212672,1741213695,AU
+1741212672,1741213695,IR
1741213696,1741214719,SG
1741214720,1741215743,IN
1741215744,1741216767,SG
@@ -38766,7 +38914,7 @@
1741349376,1741349631,IN
1741349632,1741349887,ID
1741349888,1741350911,CN
-1741350912,1741351935,AU
+1741350912,1741351935,US
1741351936,1741366271,CN
1741366272,1741367295,IN
1741367296,1741368319,HK
@@ -38776,6 +38924,119 @@
1741372416,1741376511,IN
1741376512,1741377535,ID
1741377536,1741380095,IN
+1741380096,1741380351,SG
+1741380352,1741380607,ID
+1741380608,1741381631,BD
+1741381632,1741390847,CN
+1741390848,1741391871,MM
+1741391872,1741392895,IN
+1741392896,1741393919,CN
+1741393920,1741394943,IN
+1741394944,1741395967,HK
+1741395968,1741396991,SG
+1741396992,1741398015,JP
+1741398016,1741398783,ID
+1741398784,1741399039,AU
+1741399040,1741401087,CN
+1741401088,1741402111,IN
+1741402112,1741403135,BD
+1741403136,1741404159,HK
+1741404160,1741405183,IN
+1741405184,1741405439,NZ
+1741405440,1741405695,ID
+1741405696,1741406207,AU
+1741406208,1741407231,CN
+1741407232,1741408255,AU
+1741408256,1741409279,CN
+1741409280,1741411327,IN
+1741411328,1741413375,CN
+1741413376,1741414399,HK
+1741414400,1741423615,IN
+1741423616,1741425663,MY
+1741425664,1741425919,TH
+1741425920,1741426175,JP
+1741426176,1741426687,AU
+1741426688,1741427711,MM
+1741427712,1741428735,IN
+1741428736,1741429759,CN
+1741429760,1741436927,IN
+1741436928,1741437951,JP
+1741437952,1741438975,PH
+1741438976,1741439999,JP
+1741440000,1741440511,SG
+1741440512,1741440767,IN
+1741440768,1741441023,AF
+1741441024,1741442047,CN
+1741442048,1741443071,HK
+1741443072,1741445119,BD
+1741445120,1741446143,CN
+1741446144,1741447167,SG
+1741447168,1741448191,HK
+1741448192,1741449215,MM
+1741449216,1741450239,AU
+1741450240,1741451263,HK
+1741451264,1741452287,CN
+1741452288,1741452543,IN
+1741452544,1741452799,AU
+1741452800,1741453055,ID
+1741453056,1741455359,IN
+1741455360,1741456383,BD
+1741456384,1741457407,IN
+1741457408,1741462527,CN
+1741462528,1741466623,IN
+1741466624,1741467647,JP
+1741467648,1741469695,HK
+1741469696,1741472767,IN
+1741472768,1741473791,CN
+1741473792,1741474815,BD
+1741474816,1741475839,IN
+1741475840,1741476863,BD
+1741476864,1741477887,AU
+1741477888,1741478655,IN
+1741478656,1741478911,AU
+1741478912,1741479935,NP
+1741479936,1741480447,AU
+1741480448,1741480959,NZ
+1741480960,1741481471,AU
+1741481472,1741481727,JP
+1741481728,1741481983,IN
+1741481984,1741484031,CN
+1741484032,1741485055,AU
+1741485056,1741486079,BD
+1741486080,1741487103,NZ
+1741487104,1741489151,HK
+1741489152,1741491199,CN
+1741491200,1741492223,IN
+1741492224,1741493247,LA
+1741493248,1741494271,HK
+1741494272,1741495295,KH
+1741495296,1741497343,AU
+1741497344,1741497855,PH
+1741497856,1741498111,NZ
+1741498112,1741498367,IN
+1741498368,1741500415,CN
+1741500416,1741501439,JP
+1741501440,1741502463,CN
+1741502464,1741502975,ID
+1741502976,1741503487,BD
+1741503488,1741505535,IN
+1741505536,1741506559,BD
+1741506560,1741507583,JP
+1741507584,1741508607,SG
+1741508608,1741508863,AU
+1741508864,1741509119,SG
+1741509120,1741509375,ID
+1741509376,1741509631,IN
+1741509632,1741511679,JP
+1741511680,1741512703,IN
+1741512704,1741515775,VN
+1741515776,1741516799,CN
+1741516800,1741517823,IN
+1741517824,1741519871,CN
+1741519872,1741521919,IN
+1741521920,1741522943,BD
+1741522944,1741523967,CN
+1741523968,1741528063,IN
1742734336,1742735359,IN
1742735360,1742736383,JP
1742736384,1742737407,PK
@@ -39745,6 +40006,7 @@
1743864832,1743865855,TW
1743865856,1743866879,CN
1743866880,1743867903,KR
+1743867904,1743868927,IN
1743868928,1743870975,NZ
1743870976,1743873023,CN
1743873024,1743874047,AU
@@ -39773,7 +40035,7 @@
1743897600,1743899647,AU
1743899648,1743900671,ID
1743900672,1743901695,JP
-1743902720,1743903743,AU
+1743901696,1743903743,AU
1743903744,1743904767,CN
1743904768,1743905791,IN
1743905792,1743906815,HK
@@ -39805,6 +40067,8 @@
1743931392,1743932415,HK
1743932416,1743933439,IN
1743933440,1743934463,AU
+1743934464,1743934975,ID
+1743934976,1743935487,IN
1743935488,1743936511,SG
1743936512,1743937535,AU
1743937536,1743938559,MM
@@ -39816,6 +40080,7 @@
1743944704,1743945215,ID
1743945216,1743945727,TO
1743945728,1743947775,CN
+1743947776,1743948799,IN
1743948800,1743949823,HK
1743949824,1743950847,TH
1743950848,1743951359,HK
@@ -39845,12 +40110,15 @@
1743976448,1743977471,AU
1743977472,1743978495,JP
1743978496,1743979519,HK
-1743980544,1743981567,IN
-1743981568,1743982591,SG
+1743979520,1743981567,IN
+1743981568,1743981823,AU
+1743981824,1743982079,SG
+1743982080,1743982335,HK
+1743982336,1743982591,SG
1743982592,1743983359,AU
1743983360,1743983615,IN
1743983616,1743984639,KR
-1743984640,1743985663,CN
+1743984640,1743985663,HK
1743985664,1743990783,IN
1743991808,1743994879,IN
1743994880,1743995903,AU
@@ -39868,7 +40136,7 @@
1744006656,1744006911,AU
1744006912,1744009215,IN
1744009216,1744010239,JP
-1744011264,1744012287,HK
+1744010240,1744011263,IN
1744012288,1744013311,IN
1744013312,1744014335,CN
1744014336,1744015359,BD
@@ -40075,6 +40343,7 @@
1744221184,1744222207,NZ
1744222208,1744222719,ID
1744222720,1744222975,AU
+1744222976,1744223231,IN
1744223232,1744224255,TH
1744224256,1744226303,IN
1744226304,1744226559,SG
@@ -40187,6 +40456,7 @@
1744324608,1744325631,IN
1744325632,1744326655,HK
1744326656,1744328703,IN
+1744328704,1744329727,HK
1744329728,1744330751,IN
1744330752,1744331263,AU
1744331264,1744331775,SG
@@ -40357,8 +40627,7 @@
1744514048,1744514559,ID
1744514560,1744514815,IN
1744514816,1744515071,AU
-1744515072,1744516095,IN
-1744517120,1744519167,IN
+1744515072,1744519167,IN
1744519168,1744520191,AU
1744520192,1744521215,TH
1744521216,1744523263,JP
@@ -40377,6 +40646,7 @@
1744534528,1744536575,CN
1744536576,1744537087,PW
1744537088,1744538623,AU
+1744538624,1744539647,IN
1744539648,1744540671,AU
1744540672,1744541695,IN
1744541696,1744542719,ID
@@ -40397,6 +40667,7 @@
1744562176,1744563199,BD
1744563200,1744564223,HK
1744564224,1744565247,CN
+1744565248,1744566271,BD
1744566272,1744567295,IN
1744567296,1744568319,JP
1744568320,1744569343,VN
@@ -40429,7 +40700,8 @@
1744594432,1744594943,AU
1744594944,1744595967,CN
1744595968,1744596991,IN
-1744596992,1744597123,SG
+1744596992,1744597023,AU
+1744597024,1744597123,SG
1744597124,1744597124,US
1744597125,1744597151,SG
1744597152,1744597183,IN
@@ -40454,6 +40726,7 @@
1744620544,1744622591,CN
1744622592,1744624639,IN
1744624640,1744625663,NL
+1744625664,1744626687,BD
1744626688,1744627711,KR
1744627712,1744628735,CN
1744628736,1744629759,IN
@@ -40475,6 +40748,7 @@
1744643584,1744644095,BD
1744644096,1744645119,HK
1744645120,1744646143,BD
+1744646144,1744647167,NZ
1744647168,1744648191,IN
1744648192,1744649215,KR
1744649216,1744650239,CN
@@ -40847,7 +41121,9 @@
1753483520,1753483775,IL
1753483776,1753484607,US
1753484608,1753484655,BR
-1753484656,1753486335,US
+1753484656,1753485567,US
+1753485568,1753485823,GH
+1753485824,1753486335,US
1753486336,1753486591,IN
1753486592,1753487359,US
1753487360,1753487615,CH
@@ -40864,7 +41140,11 @@
1753517568,1753517823,NO
1753517824,1753522431,US
1753522432,1753522687,FR
-1753522688,1753735167,US
+1753522688,1753529087,US
+1753529088,1753529343,NZ
+1753529344,1753547007,US
+1753547008,1753547263,DE
+1753547264,1753735167,US
1753735168,1753743359,IE
1753743360,1754136575,US
1754136576,1754169343,CA
@@ -41801,11 +42081,20 @@
1805171608,1805171615,CA
1805171616,1805190399,US
1805190400,1805190655,ES
-1805190656,1805194239,US
+1805190656,1805190911,DE
+1805190912,1805194239,US
1805194240,1805194495,AU
-1805194496,1805210623,US
+1805194496,1805196287,US
+1805196288,1805196543,DE
+1805196544,1805197823,US
+1805197824,1805198079,DE
+1805198080,1805210623,US
1805210624,1805210879,EG
-1805210880,1805251583,US
+1805210880,1805217279,US
+1805217280,1805217535,DE
+1805217536,1805221375,US
+1805221376,1805221631,DE
+1805221632,1805251583,US
1805251584,1805251839,DE
1805251840,1805252095,GB
1805252096,1805252351,DE
@@ -41839,11 +42128,18 @@
1806172416,1806172671,GB
1806172672,1806172927,DE
1806172928,1806173183,GB
-1806173184,1806174207,US
+1806173184,1806173695,CN
+1806173696,1806174207,US
1806174208,1806174463,BR
1806174464,1806180351,US
1806180352,1806180607,AU
-1806180608,1806198271,US
+1806180608,1806184447,US
+1806184448,1806184959,AU
+1806184960,1806186239,US
+1806186240,1806186751,GB
+1806186752,1806190079,US
+1806190080,1806190591,JP
+1806190592,1806198271,US
1806198272,1806198527,JP
1806198528,1806203391,US
1806203392,1806203647,AU
@@ -41978,15 +42274,22 @@
1822553856,1822554111,HK
1822554112,1822572543,US
1822572544,1822605311,CA
-1822605312,1822614015,US
-1822614016,1822614271,JP
-1822614272,1822614527,US
+1822605312,1822609407,US
+1822609408,1822609663,SG
+1822609664,1822612991,US
+1822612992,1822613503,HK
+1822613504,1822613759,US
+1822613760,1822614015,SG
+1822614016,1822614527,JP
1822614528,1822615039,FR
-1822615040,1822617855,US
-1822617856,1822618367,CA
-1822618368,1822619647,US
-1822619648,1822620415,AU
-1822620416,1822654463,US
+1822615040,1822615551,DE
+1822615552,1822617343,US
+1822617344,1822618367,CA
+1822618368,1822619391,US
+1822619392,1822620415,AU
+1822620416,1822620927,US
+1822620928,1822621439,DE
+1822621440,1822654463,US
1822654464,1822662143,CA
1822662144,1822662399,US
1822662400,1822670847,CA
@@ -43010,7 +43313,7 @@
1843871744,1843888127,GB
1843888128,1843904511,CZ
1843904512,1843920895,GB
-1843920896,1843922943,KZ
+1843920896,1843922943,IR
1843922944,1843924991,NL
1843924992,1843927039,ES
1843927040,1843929087,PL
@@ -43204,8 +43507,7 @@
1845029888,1845030143,KZ
1845030144,1845030911,RU
1845030912,1845031935,GE
-1845031936,1845034751,RU
-1845034752,1845035007,BY
+1845031936,1845035007,RU
1845035008,1845100543,GB
1845100544,1845166079,DE
1845166080,1845231615,UA
@@ -43254,6 +43556,10 @@
1847812096,1847853055,KR
1847853056,1848115199,PK
1848115200,1848377343,CN
+1848377344,1848378367,BD
+1848378368,1848379391,HK
+1848379392,1848380415,IN
+1848380416,1848381439,CN
1848381440,1848382463,NZ
1848382464,1848383487,JP
1848383488,1848385535,AU
@@ -43452,6 +43758,7 @@
1868341248,1868345343,ID
1868345344,1868346367,GU
1868346368,1868347391,TH
+1868347392,1868348415,HK
1868348416,1868349439,KR
1868349440,1868357631,SG
1868357632,1868361727,HK
@@ -43887,7 +44194,7 @@
1921318912,1921384447,MY
1921384448,1921388543,NZ
1921388544,1921391615,IN
-1921392640,1921400831,JP
+1921391616,1921400831,JP
1921400832,1921404927,ID
1921404928,1921406463,HK
1921406464,1921406719,GB
@@ -43921,7 +44228,9 @@
1921908736,1921943551,JP
1921943552,1921945599,IN
1921945600,1921949695,HK
-1921949696,1921953791,AU
+1921949696,1921949951,AU
+1921950464,1921950719,AU
+1921950976,1921951231,AU
1921953792,1921957887,JP
1921957888,1921974271,GU
1921974272,1922039807,IN
@@ -43935,8 +44244,7 @@
1925640192,1925642239,ID
1925642240,1925644287,CN
1925644288,1925660671,KR
-1925660672,1925661439,TW
-1925661440,1925662463,HK
+1925660672,1925662463,HK
1925662464,1925663743,TW
1925663744,1925664767,HK
1925664768,1925677055,ID
@@ -43948,6 +44256,7 @@
1931354112,1931362303,AU
1931362304,1931378687,TW
1931378688,1931427839,JP
+1931427840,1931431935,CN
1931431936,1931433983,JP
1931433984,1931436031,AU
1931436032,1931444223,KR
@@ -43998,7 +44307,9 @@
1934966784,1934974975,ID
1934974976,1934983167,JP
1934983168,1934983423,MY
-1934983424,1934984959,AU
+1934983424,1934984447,AU
+1934984448,1934984639,US
+1934984640,1934984959,AU
1934984960,1934985215,US
1934985216,1934987263,JP
1934987264,1934991359,TW
@@ -44056,6 +44367,7 @@
1940258816,1940275199,AU
1940275200,1940283391,CN
1940283392,1940291583,ID
+1940291584,1940295679,IN
1940295680,1940324351,JP
1940324352,1940357119,PK
1940357120,1940389887,JP
@@ -44078,6 +44390,7 @@
1941438464,1941569535,IN
1941569536,1941618687,PK
1941618688,1941635071,AU
+1941635072,1941639167,CN
1941639168,1941643263,NP
1941643264,1941651455,IN
1941651456,1941655551,JP
@@ -44103,8 +44416,7 @@
1946175616,1946175999,SG
1946176000,1946176255,JP
1946176256,1946176511,SG
-1946176512,1946176647,AU
-1946176648,1946176767,PH
+1946176512,1946176767,AU
1946176768,1946178047,SG
1946178048,1946178303,HK
1946178304,1946179583,SG
@@ -44550,7 +44862,8 @@
1986762752,1986764799,JP
1986764800,1986768895,KR
1986768896,1986769919,SG
-1986769920,1986772991,AU
+1986769920,1986770943,IR
+1986770944,1986772991,AU
1986772992,1986789375,MY
1986789376,1987051519,JP
1987051520,1988034559,CN
@@ -44759,9 +45072,7 @@
2001829888,2001841247,HK
2001841248,2001841248,SA
2001841249,2001846271,HK
-2001846272,2001854943,SG
-2001854944,2001854951,CN
-2001854952,2001855231,SG
+2001846272,2001855231,SG
2001855232,2001855263,US
2001855264,2001855743,SG
2001855744,2001855999,HK
@@ -44784,7 +45095,9 @@
2001859328,2001860015,SG
2001860016,2001860031,US
2001860032,2001860047,HK
-2001860048,2001860263,SG
+2001860048,2001860143,SG
+2001860144,2001860159,US
+2001860160,2001860263,SG
2001860264,2001860271,US
2001860272,2001860351,SG
2001860352,2001860607,HK
@@ -45786,7 +46099,9 @@
2112880640,2113560063,KR
2113560064,2113560319,SG
2113560320,2113683455,KR
-2113683456,2113685663,JP
+2113683456,2113684607,JP
+2113684608,2113684671,TW
+2113684672,2113685663,JP
2113685664,2113685695,SG
2113685696,2113687295,JP
2113687296,2113687551,AU
@@ -46362,7 +46677,9 @@
2194735104,2194800639,GB
2194800640,2194888509,US
2194888510,2194888510,IE
-2194888511,2195193855,US
+2194888511,2194891198,US
+2194891199,2194891199,BE
+2194891200,2195193855,US
2195193856,2195324927,NZ
2195324928,2195455999,US
2195456000,2195521535,AU
@@ -47186,7 +47503,11 @@
2266431488,2266497023,CA
2266497024,2266694655,US
2266694656,2266694911,SG
-2266694912,2270488575,US
+2266694912,2270482687,US
+2270482688,2270482943,GB
+2270482944,2270483967,US
+2270483968,2270484223,GB
+2270484224,2270488575,US
2270488576,2270490623,MO
2270490624,2270494719,IN
2270494720,2270756863,FR
@@ -47333,7 +47654,7 @@
2304638976,2304704511,CA
2304704512,2304770047,US
2304770048,2304835583,FI
-2304835584,2304901119,US
+2304835584,2304901119,SG
2304901120,2304966655,CZ
2304966656,2305097727,US
2305097728,2305163263,ES
@@ -47453,7 +47774,8 @@
2316042240,2316173311,US
2316173312,2316238847,SE
2316238848,2316500991,US
-2316500992,2316566527,AU
+2316500992,2316533759,AU
+2316533760,2316566527,HK
2316566528,2316613887,US
2316613888,2316614143,GB
2316614144,2316632063,US
@@ -48091,7 +48413,7 @@
2342780928,2342846463,NO
2342846464,2342911999,BE
2342912000,2342977535,GB
-2342977536,2343043071,US
+2342977536,2343043071,SG
2343043072,2343108607,AU
2343108608,2343174143,US
2343174144,2343239679,CN
@@ -48239,7 +48561,8 @@
2366032896,2366033151,GB
2366033152,2366111743,DE
2366111744,2366144511,MT
-2366144512,2366148479,RU
+2366144512,2366148351,RU
+2366148352,2366148479,TR
2366148480,2366148607,US
2366148608,2366149375,RU
2366149376,2366149407,DE
@@ -48282,20 +48605,26 @@
2372075520,2372206591,DE
2372206592,2372214783,UA
2372214784,2372218879,DE
-2372218880,2372222463,FR
-2372222464,2372222975,CH
-2372222977,2372222977,NL
+2372218880,2372222207,FR
+2372222208,2372222975,CH
+2372222976,2372223487,NL
2372223488,2372223999,FR
2372224000,2372224255,IN
-2372224656,2372224671,GB
-2372225280,2372225791,US
-2372225793,2372225793,NL
+2372224256,2372224511,DE
+2372224512,2372225023,GB
+2372225024,2372225791,US
+2372225792,2372226047,NL
+2372226048,2372226303,JP
2372226304,2372226559,SG
-2372227072,2372227327,NO
-2372227840,2372228607,KR
-2372231168,2372231295,HU
+2372226560,2372227583,SE
+2372227584,2372228607,KR
+2372228608,2372229631,PL
+2372229632,2372230655,AT
+2372230656,2372231679,CZ
2372231680,2372232191,GB
-2372233728,2372233983,GB
+2372232192,2372233215,CL
+2372233216,2372233727,NL
+2372233728,2372234239,GB
2372234240,2372235263,CO
2372238730,2372238730,US
2372239360,2372240383,SK
@@ -48764,7 +49093,7 @@
2412789760,2412790783,CO
2412790784,2412807167,BR
2412807168,2412808191,PE
-2412809216,2412815359,BR
+2412808192,2412815359,BR
2412815360,2412816383,DO
2412816384,2412817407,CR
2412817408,2412819455,BR
@@ -48802,6 +49131,8 @@
2415859712,2415860735,CL
2415860736,2415861759,CR
2415861760,2415862783,HN
+2415862784,2415863807,AR
+2415863808,2415864831,MX
2415864832,2415867903,BR
2415867904,2415868927,MX
2415868928,2415875071,BR
@@ -48810,6 +49141,7 @@
2415880192,2415881215,CL
2415881216,2415888383,BR
2415888384,2415889407,AR
+2415889408,2415890431,PY
2415890432,2415892479,BR
2415892480,2415893503,AR
2415893504,2415894527,PA
@@ -49157,7 +49489,9 @@
2449494016,2449496063,UA
2449496064,2449498111,FR
2449498112,2449506303,DE
-2449506304,2449534975,RO
+2449506304,2449532639,RO
+2449532640,2449532655,DE
+2449532656,2449534975,RO
2449534976,2449539071,DE
2449539072,2449604607,US
2449604608,2449670143,NO
@@ -49253,7 +49587,8 @@
2455280128,2455280383,MY
2455280384,2455281663,MO
2455281664,2455285759,IN
-2455285760,2455291903,US
+2455285760,2455290879,US
+2455290880,2455291903,MY
2455291904,2455293951,KH
2455293952,2455371775,US
2455371776,2455437311,GB
@@ -49357,7 +49692,8 @@
2461612032,2461613567,IL
2461613568,2461613823,PS
2461613824,2461614079,IL
-2461614080,2461630463,TR
+2461614080,2461622271,CH
+2461622272,2461630463,TR
2461630464,2461646847,NL
2461646848,2461648895,RU
2461648896,2461649023,BY
@@ -49722,7 +50058,9 @@
2500050944,2500067327,KZ
2500067328,2500132991,US
2500132992,2500133023,NL
-2500133024,2500141055,US
+2500133024,2500138367,US
+2500138368,2500138399,BE
+2500138400,2500141055,US
2500141056,2500141311,IE
2500141312,2500141823,US
2500141824,2500142847,IE
@@ -49772,7 +50110,9 @@
2500221456,2500221459,FR
2500221460,2500225551,US
2500225552,2500225559,ES
-2500225560,2500230041,US
+2500225560,2500226615,US
+2500226616,2500226623,NL
+2500226624,2500230041,US
2500230042,2500230042,GB
2500230043,2500235775,US
2500235776,2500236031,GB
@@ -49860,7 +50200,9 @@
2500567040,2500567295,GB
2500567296,2500568679,US
2500568680,2500568683,GB
-2500568684,2500591615,US
+2500568684,2500569687,US
+2500569688,2500569695,BE
+2500569696,2500591615,US
2500591616,2500595711,GB
2500595712,2500596223,US
2500596224,2500596735,CH
@@ -49897,8 +50239,8 @@
2500739608,2500743215,US
2500743216,2500743223,GB
2500743224,2500984831,US
-2500984832,2501017599,GB
-2501017600,2501574655,US
+2500984832,2501033983,GB
+2501033984,2501574655,US
2501574656,2501640191,KZ
2501640192,2502033407,US
2502033408,2502037503,LU
@@ -49906,7 +50248,9 @@
2502041600,2502045695,ES
2502045696,2503016447,US
2503016448,2503147519,IL
-2503147520,2503671807,US
+2503147520,2503344127,US
+2503344128,2503376895,AF
+2503376896,2503671807,US
2503671808,2503737343,NL
2503737344,2503868415,US
2503868416,2503876607,RU
@@ -49951,7 +50295,9 @@
2504936192,2504936447,IL
2504936448,2504938495,US
2504938496,2504938751,IL
-2504938752,2504943615,US
+2504938752,2504941293,US
+2504941294,2504941294,IL
+2504941295,2504943615,US
2504943616,2504944639,IL
2504944640,2504945151,US
2504945152,2504945407,IL
@@ -50014,7 +50360,9 @@
2508077056,2508079103,BE
2508079104,2508081151,DE
2508081152,2508081407,NL
-2508081408,2508081663,IL
+2508081408,2508081445,IL
+2508081446,2508081446,US
+2508081447,2508081663,IL
2508081664,2508082431,GB
2508082432,2508082943,DE
2508082944,2508083199,GB
@@ -50129,9 +50477,13 @@
2513081936,2513081939,DE
2513081940,2513082561,FR
2513082562,2513082562,GB
-2513082563,2513102899,FR
+2513082563,2513102047,FR
+2513102048,2513102063,ES
+2513102064,2513102899,FR
2513102900,2513102903,CZ
-2513102904,2513108991,FR
+2513102904,2513103935,FR
+2513103936,2513103967,IE
+2513103968,2513108991,FR
2513108992,2513502207,DE
2513502208,2513567743,NO
2513567744,2513600511,GR
@@ -50394,7 +50746,9 @@
2538606044,2538606047,DE
2538606048,2538606403,FR
2538606404,2538606407,GB
-2538606408,2538619359,FR
+2538606408,2538613134,FR
+2538613135,2538613135,NL
+2538613136,2538619359,FR
2538619360,2538619375,ES
2538619376,2538619431,FR
2538619432,2538619435,DE
@@ -50510,8 +50864,9 @@
2545811456,2547187711,US
2547187712,2547318783,GB
2547318784,2547515391,US
-2547523584,2547535871,GB
-2547535872,2547548159,BG
+2547523584,2547524607,GB
+2547524608,2547525631,IR
+2547525632,2547535871,GB
2547548160,2547580927,NO
2548039680,2548563967,GB
2548563968,2548826111,IR
@@ -50935,7 +51290,7 @@
2584763904,2584763967,HK
2584763968,2584763999,DE
2584764000,2584764159,ZA
-2584764160,2584764415,US
+2584764160,2584764415,SG
2584764416,2584764671,ZA
2584764672,2584775423,US
2584775424,2584775679,KE
@@ -51008,7 +51363,9 @@
2586953472,2586953727,ES
2586953728,2586953983,MX
2586953984,2586954239,PE
-2586954240,2587017215,US
+2586954240,2586968127,US
+2586968128,2586968319,FR
+2586968320,2587017215,US
2587017216,2587017471,IE
2587017472,2587017983,US
2587017984,2587018495,IE
@@ -51075,8 +51432,8 @@
2587586560,2587592703,US
2587592704,2587594751,GB
2587594752,2587623423,US
-2587623424,2587627519,BG
-2587627520,2587639807,US
+2587623424,2587631615,BG
+2587631616,2587639807,US
2587639808,2587640063,GB
2587640064,2587926527,US
2587926528,2587930623,BG
@@ -51641,6 +51998,7 @@
2627141632,2627403775,US
2627469312,2627731455,TZ
2627731456,2631925759,EG
+2631925760,2634022911,SC
2634022912,2634088447,CN
2634088448,2634350591,JP
2634416128,2635005951,JP
@@ -52585,7 +52943,11 @@
2708865024,2708930559,JP
2708930560,2709127167,US
2709127168,2709192703,KR
-2709192704,2709242111,ZA
+2709192704,2709225471,ZA
+2709225472,2709225727,ES
+2709225728,2709225983,ZA
+2709225984,2709226239,ES
+2709226240,2709242111,ZA
2709242112,2709242367,US
2709242368,2709242623,ZA
2709242624,2709242879,US
@@ -52717,27 +53079,52 @@
2727411712,2727608319,AU
2727608320,2728132607,US
2728132608,2728263679,CA
-2728263680,2728263935,US
-2728263936,2728264703,AU
-2728264704,2728266495,US
-2728266496,2728266751,QA
-2728266752,2728269823,US
+2728263680,2728264703,AU
+2728264704,2728265727,JP
+2728265728,2728266751,QA
+2728266752,2728267775,KW
+2728267776,2728268799,RO
+2728268800,2728269823,FR
2728269824,2728270847,MY
-2728270848,2728273407,US
-2728273408,2728273663,IE
-2728273664,2728274943,US
-2728274944,2728276991,IN
-2728276992,2728282271,US
-2728282272,2728282303,CA
-2728282304,2728286207,US
-2728286208,2728286463,DE
-2728286464,2728289023,US
-2728289024,2728289279,AE
-2728289280,2728292351,US
+2728270848,2728271871,OM
+2728271872,2728272895,GB
+2728272896,2728273919,IE
+2728273920,2728274943,KE
+2728274944,2728278015,IN
+2728278016,2728284159,US
+2728284160,2728288255,DE
+2728288256,2728289279,AE
+2728289280,2728290303,PL
+2728290304,2728291327,US
+2728291328,2728291839,NL
+2728291840,2728292351,US
2728292352,2728293375,DE
-2728293376,2728328191,US
-2728328192,2728329215,SG
-2728329216,2731543551,US
+2728293376,2728294399,JP
+2728294400,2728295423,US
+2728295424,2728296447,CA
+2728296448,2728297471,EG
+2728297472,2728298495,DK
+2728298496,2728300543,US
+2728300544,2728301567,CA
+2728301568,2728302591,CH
+2728302592,2728303615,GB
+2728303616,2728304639,AT
+2728304640,2728304895,US
+2728304896,2728305407,SG
+2728305408,2728308735,US
+2728308736,2728309759,HK
+2728309760,2728310783,SE
+2728310784,2728311807,US
+2728311808,2728312831,KR
+2728312832,2728313087,FR
+2728313088,2728313855,US
+2728313856,2728314879,IT
+2728314880,2728315903,DE
+2728315904,2728316927,US
+2728316928,2728317951,BG
+2728317952,2728319999,US
+2728320000,2728321023,NO
+2728321024,2731543551,US
2731543552,2731544575,CA
2731544576,2731549695,US
2731549696,2731550719,CA
@@ -52771,7 +53158,8 @@
2731717632,2731718655,CA
2731718656,2731728895,US
2731728896,2731729919,CA
-2731729920,2731761663,US
+2731729920,2731739135,US
+2731740160,2731761663,US
2731761664,2731763711,CA
2731763712,2731765759,US
2731765760,2731767807,CA
@@ -53038,9 +53426,7 @@
2734389248,2734389503,CA
2734389504,2734389535,US
2734389536,2734390271,CA
-2734390272,2734398463,US
-2734398464,2734399487,PR
-2734399488,2734407679,US
+2734390272,2734407679,US
2734407680,2734409727,CA
2734409728,2734435327,US
2734435328,2734436351,CA
@@ -53186,7 +53572,7 @@
2738167808,2738168831,AU
2738168832,2738177023,CN
2738177024,2738178047,AU
-2738179072,2738182143,IN
+2738178048,2738182143,IN
2738182144,2738195455,CN
2738195456,2738196479,BD
2738196480,2738197503,AU
@@ -53460,12 +53846,19 @@
2773286912,2773745663,US
2773745664,2773794815,NZ
2773794816,2773798911,IN
-2773798912,2773805055,NZ
+2773798912,2773803007,NZ
+2773803008,2773803263,GB
+2773803264,2773804031,NZ
+2773804032,2773804287,GB
+2773804288,2773804799,NZ
+2773804800,2773805055,GB
2773805056,2773807103,JP
2773807104,2773811199,IN
2773811200,2773876735,US
2773876736,2773942271,AU
2773942272,2774138879,US
+2774138880,2774147071,KE
+2774147072,2774155263,ZA
2774155264,2774163455,MZ
2774163456,2774171647,CV
2774171648,2774188031,RE
@@ -53727,7 +54120,9 @@
2809282653,2809282653,US
2809282654,2809286975,CA
2809286976,2809286991,US
-2809286992,2809291732,CA
+2809286992,2809287979,CA
+2809287980,2809287983,US
+2809287984,2809291732,CA
2809291733,2809291733,US
2809291734,2809291823,CA
2809291824,2809291824,US
@@ -53831,13 +54226,61 @@
2818115584,2818116607,PE
2818116608,2818118655,BR
2818118656,2818119679,SV
+2818119680,2818121727,BR
2818121728,2818122751,VE
+2818122752,2818123775,BR
2818123776,2818124799,CO
-2818125824,2818134015,BR
+2818124800,2818125823,AR
+2818125824,2818126847,BR
+2818126848,2818127871,AR
+2818127872,2818138111,BR
2818139136,2818143231,BR
+2818143232,2818144255,MX
+2818144256,2818145279,BR
+2818146304,2818162687,BR
+2818162688,2818164735,AR
+2818164736,2818165759,BZ
+2818165760,2818168831,BR
+2818168832,2818169855,AR
+2818169856,2818178047,BR
+2818178048,2818179071,MX
+2818179072,2818180095,BR
+2818180096,2818181119,AR
+2818181120,2818188287,BR
+2818188288,2818189311,PY
+2818189312,2818191359,BR
+2818191360,2818192383,VE
+2818192384,2818193407,CL
+2818193408,2818198527,BR
+2818198528,2818199551,MX
+2818199552,2818206719,BR
+2818206720,2818207743,HN
+2818207744,2818208767,PA
+2818208768,2818209791,AR
+2818209792,2818210815,CO
+2818210816,2818212863,BR
+2818212864,2818213887,CL
+2818213888,2818221055,BR
+2818222080,2818223103,AR
+2818223104,2818228223,BR
+2818228224,2818229247,CR
+2818229248,2818231295,BR
+2818231296,2818232319,PE
+2818232320,2818233343,AR
+2818233344,2818234367,HN
+2818234368,2818235391,BR
+2818235392,2818236415,GT
+2818236416,2818244607,BR
2818244608,2818310143,US
2818310144,2818375679,AR
2818375680,2818572287,US
+2818572288,2818575359,BR
+2818575360,2818576383,PE
+2818576384,2818586623,BR
+2818586624,2818587647,AR
+2818587648,2818593791,BR
+2818593792,2818594815,SX
+2818594816,2818600959,BR
2818637824,2818670591,AU
2818670592,2822592397,US
2822592398,2822592398,IE
@@ -54034,7 +54477,9 @@
2844524544,2844590079,KR
2844590080,2844862975,US
2844862976,2844863231,CA
-2844863232,2845704191,US
+2844863232,2845114367,US
+2845114368,2845179903,SG
+2845179904,2845704191,US
2845704192,2845769727,CU
2845769728,2845786111,GA
2845786112,2845802495,NG
@@ -54089,6 +54534,8 @@
2851052544,2851053567,CD
2851053568,2851054591,KE
2851054592,2851055615,ZA
+2851055616,2851057663,KE
+2851057664,2851059711,ZA
2851078144,2851995647,US
2852061184,2852062207,ZA
2852062208,2852063231,CM
@@ -54876,7 +55323,13 @@
2918477824,2918481919,CA
2918481920,2918527231,US
2918527232,2918527487,FR
-2918527488,2918536719,US
+2918527488,2918527743,US
+2918527744,2918527999,DE
+2918528000,2918528255,US
+2918528256,2918528511,NL
+2918528512,2918530559,US
+2918530560,2918530815,HK
+2918530816,2918536719,US
2918536720,2918536727,CA
2918536728,2918570239,US
2918570240,2918570495,JP
@@ -55063,6 +55516,7 @@
2939002880,2939004927,KR
2939004928,2939006975,JP
2939006976,2939007999,KP
+2939008000,2939009023,IN
2939009024,2939011071,ID
2939011072,2939027455,KR
2939027456,2942304255,CN
@@ -55142,6 +55596,10 @@
2947591184,2947591679,SG
2947591680,2947591695,JP
2947591696,2947592191,SG
+2947592192,2947593215,CN
+2947593216,2947594239,HK
+2947594240,2947595263,IN
+2947595264,2947596287,CN
2947596288,2947597311,IN
2947597312,2947598335,JP
2947598336,2947602431,AU
@@ -56005,7 +56463,8 @@
2961064960,2961065215,HK
2961065216,2961065471,AU
2961065472,2961065727,BR
-2961065728,2961069567,NL
+2961065728,2961065983,HK
+2961065984,2961069567,NL
2961069568,2961069823,IN
2961069824,2961072127,NL
2961072128,2961088511,UA
@@ -56395,7 +56854,9 @@
2988465216,2988465219,ES
2988465220,2988465559,FR
2988465560,2988465563,ES
-2988465564,2988466098,FR
+2988465564,2988466059,FR
+2988466060,2988466063,CZ
+2988466064,2988466098,FR
2988466099,2988466099,BE
2988466100,2988476415,FR
2988476416,2988478463,IT
@@ -56601,7 +57062,9 @@
2988547904,2988548015,FR
2988548016,2988548019,ES
2988548020,2988548095,FR
-2988548096,2988550143,ES
+2988548096,2988548338,ES
+2988548339,2988548339,FR
+2988548340,2988550143,ES
2988550144,2988550359,FR
2988550360,2988550363,ES
2988550364,2988550438,FR
@@ -57131,7 +57594,9 @@
3002003456,3002011647,PL
3002011648,3002015743,BA
3002015744,3002019839,IT
-3002019840,3002023935,NL
+3002019840,3002021271,NL
+3002021272,3002021279,MT
+3002021280,3002023935,NL
3002023936,3002028031,DE
3002028032,3002036223,GB
3002036224,3002040319,BG
@@ -57814,7 +58279,9 @@
3007181632,3007181823,BR
3007181824,3007181855,BE
3007181856,3007181887,NO
-3007181888,3007182591,BR
+3007181888,3007182079,BR
+3007182080,3007182335,US
+3007182336,3007182591,BR
3007182592,3007182623,SE
3007182624,3007182655,NL
3007182656,3007183231,BR
@@ -57892,7 +58359,9 @@
3024879616,3025141759,CN
3025141760,3025403903,KR
3025403904,3025600511,CN
-3025600512,3025602047,IN
+3025600512,3025601663,IN
+3025601664,3025601791,HK
+3025601792,3025602047,IN
3025602048,3025602303,HK
3025602304,3025603071,IN
3025603072,3025603091,HK
@@ -57921,7 +58390,9 @@
3025612816,3025612831,SG
3025612832,3025612895,IN
3025612896,3025613067,SG
-3025613068,3025616895,IN
+3025613068,3025613071,IN
+3025613072,3025613079,SG
+3025613080,3025616895,IN
3025616896,3025617439,SG
3025617440,3025617447,IN
3025617448,3025617455,SG
@@ -58251,6 +58722,10 @@
3035316224,3035324415,CN
3035324416,3035326463,JP
3035326464,3035328511,AU
+3035328512,3035329535,CN
+3035329536,3035330559,MM
+3035330560,3035331583,IN
+3035331584,3035332607,JP
3035332608,3035333631,AU
3035333632,3035334655,HK
3035334656,3035334911,NL
@@ -58830,6 +59305,7 @@
3056664576,3056734207,CN
3056734208,3056746495,KR
3056746496,3056747519,NP
+3056747520,3056748543,IN
3056748544,3056749567,WS
3056749568,3056750591,SG
3056750592,3056754687,TH
@@ -59284,9 +59760,13 @@
3103863808,3103864063,RU
3103864064,3103864319,GB
3103864320,3103864575,DE
+3103864576,3103864831,NO
3103864832,3103865087,BG
3103865088,3103865343,DK
-3103865856,3103866111,DE
+3103865344,3103865599,DE
+3103865600,3103865855,BG
+3103865856,3103866367,DE
+3103866368,3103866879,UA
3103916032,3103917055,CH
3103917056,3103918079,IT
3103918080,3103919103,DE
@@ -59347,7 +59827,8 @@
3103970304,3103971327,UA
3103971328,3103973375,GB
3103973376,3103974399,KZ
-3103974400,3103974911,SE
+3103974400,3103974655,LT
+3103974656,3103974911,SE
3103974912,3103974919,LT
3103974920,3103974943,SE
3103974944,3103975071,LT
@@ -59852,7 +60333,9 @@
3104513024,3104514047,UA
3104514048,3104515071,RU
3104515072,3104516095,GB
-3104516096,3104517119,CY
+3104516096,3104516351,CY
+3104516352,3104516607,LU
+3104516608,3104517119,CY
3104517120,3104518143,IL
3104518144,3104519167,RU
3104519168,3104520191,IT
@@ -61352,7 +61835,8 @@
3106044928,3106045951,GB
3106045952,3106046975,TR
3106046976,3106047999,DK
-3106048000,3106049023,IT
+3106048000,3106048255,NL
+3106048256,3106049023,IT
3106049024,3106050047,FR
3106050048,3106051071,NL
3106051072,3106052095,LI
@@ -61569,7 +62053,11 @@
3106266400,3106266431,SG
3106266432,3106266463,JP
3106266464,3106266527,US
-3106266528,3106266623,FR
+3106266528,3106266543,FR
+3106266544,3106266559,HK
+3106266560,3106266591,FR
+3106266592,3106266607,US
+3106266608,3106266623,FR
3106266624,3106266879,US
3106266880,3106266927,FR
3106266928,3106266943,AU
@@ -62314,11 +62802,15 @@
3107013632,3107014655,DE
3107014656,3107015679,GB
3107015680,3107016703,DE
-3107016704,3107017107,NL
+3107016704,3107016959,NL
+3107016960,3107017087,GB
+3107017088,3107017107,NL
3107017108,3107017108,GB
3107017109,3107017127,NL
3107017128,3107017128,GB
-3107017129,3107017727,NL
+3107017129,3107017151,NL
+3107017152,3107017215,GB
+3107017216,3107017727,NL
3107017728,3107018751,IR
3107018752,3107019775,BG
3107019776,3107020799,GB
@@ -62457,7 +62949,11 @@
3107161088,3107162111,GR
3107162112,3107163135,IT
3107163136,3107164159,RU
-3107164160,3107165183,FR
+3107164160,3107164213,FR
+3107164214,3107164214,SE
+3107164215,3107164777,FR
+3107164778,3107164778,SE
+3107164779,3107165183,FR
3107165184,3107166207,NL
3107166208,3107167231,AE
3107167232,3107168255,RU
@@ -62778,7 +63274,8 @@
3107496192,3107496255,DE
3107496256,3107496287,BS
3107496288,3107496319,VG
-3107496320,3107496447,NL
+3107496320,3107496431,NL
+3107496432,3107496447,UA
3107496448,3107496463,CL
3107496464,3107496479,ES
3107496480,3107496495,RO
@@ -62934,7 +63431,8 @@
3107639296,3107640319,ES
3107640320,3107641343,DK
3107641344,3107643391,RU
-3107643392,3107644415,IT
+3107643392,3107643647,GB
+3107643648,3107644415,IT
3107644416,3107645439,FR
3107645440,3107646463,IE
3107646464,3107647487,NL
@@ -63286,7 +63784,8 @@
3108013056,3108014079,HR
3108014080,3108015103,NL
3108015104,3108015359,GB
-3108015360,3108016127,IE
+3108015360,3108015615,NL
+3108015616,3108016127,IE
3108016128,3108017151,DE
3108017152,3108018175,FR
3108018176,3108019199,AT
@@ -63920,7 +64419,7 @@
3108716544,3108717567,RU
3108717568,3108718591,FR
3108718592,3108719615,DE
-3108719616,3108720639,IT
+3108719616,3108720639,NL
3108720640,3108721663,GI
3108721664,3108723711,RU
3108723712,3108724735,GB
@@ -64851,10 +65350,10 @@
3109669888,3109670911,GB
3109670912,3109671935,DE
3109671936,3109672959,HR
-3109672960,3109673215,GB
+3109672960,3109673215,US
3109673216,3109673471,NL
3109673472,3109673727,SG
-3109673728,3109673983,GB
+3109673728,3109673983,HK
3109673984,3109675007,FR
3109675008,3109677055,DE
3109677056,3109678079,BE
@@ -65352,7 +65851,9 @@
3110170624,3110171647,KZ
3110171648,3110172671,IR
3110172672,3110173695,IT
-3110173696,3110174719,IL
+3110173696,3110173951,IL
+3110173952,3110174207,PS
+3110174208,3110174719,IL
3110174720,3110175743,SE
3110175744,3110176767,PS
3110176768,3110177791,CH
@@ -65486,7 +65987,9 @@
3110304768,3110305791,KZ
3110305792,3110306815,NL
3110306816,3110307327,NZ
-3110307328,3110307839,BY
+3110307328,3110307452,BY
+3110307453,3110307453,NL
+3110307454,3110307839,BY
3110307840,3110308863,IE
3110308864,3110309887,RS
3110309888,3110310911,DE
@@ -65873,7 +66376,9 @@
3110723584,3110724607,RU
3110724608,3110725631,TJ
3110725632,3110726655,ES
-3110726656,3110727679,IR
+3110726656,3110726911,IR
+3110726912,3110726943,AE
+3110726944,3110727679,IR
3110727680,3110728703,IT
3110728704,3110729727,SE
3110729728,3110730751,NL
@@ -65911,7 +66416,6 @@
3110763008,3110763263,RO
3110763264,3110763519,NL
3110763520,3110764543,AD
-3110764544,3110765567,RU
3110765568,3110766591,PL
3110766592,3110767615,IR
3110767616,3110768639,RS
@@ -65934,7 +66438,8 @@
3110785024,3110786047,TR
3110786048,3110787071,AT
3110787072,3110788095,FR
-3110788096,3110790143,NL
+3110788096,3110789119,ES
+3110789120,3110790143,NL
3110790144,3110791167,IR
3110791168,3110792191,DE
3110792192,3110793215,BE
@@ -66290,7 +66795,7 @@
3111182336,3111183359,RU
3111183360,3111184383,FR
3111184384,3111185407,IQ
-3111185408,3111186431,UA
+3111185408,3111186431,RU
3111186432,3111189503,GB
3111189504,3111190527,DE
3111190528,3111191551,GB
@@ -66403,7 +66908,8 @@
3111309312,3111310335,CH
3111310336,3111313407,DE
3111313408,3111313663,GB
-3111313664,3111314431,AT
+3111313664,3111313919,NL
+3111313920,3111314431,AT
3111314432,3111315455,GB
3111315456,3111316479,IT
3111316480,3111317503,NL
@@ -66711,11 +67217,13 @@
3111647232,3111648255,ES
3111648256,3111650559,GB
3111650560,3111650815,NL
-3111650816,3111651327,GB
+3111650816,3111651071,SE
+3111651072,3111651327,GB
3111651328,3111652351,RO
3111652352,3111653375,GB
3111653376,3111654399,RO
-3111654400,3111655423,GB
+3111654400,3111654911,GB
+3111654912,3111655423,FR
3111655424,3111656447,NO
3111656448,3111657471,LB
3111657472,3111658495,GB
@@ -66856,7 +67364,10 @@
3111812096,3111814143,GB
3111814144,3111815167,IE
3111815168,3111816191,PL
-3111816192,3111817215,LT
+3111816192,3111816447,LT
+3111816448,3111816703,GB
+3111816704,3111816959,LT
+3111816960,3111817215,GB
3111817216,3111819263,PL
3111819264,3111821311,NL
3111821312,3111822335,FR
@@ -67175,6 +67686,7 @@
3112171520,3112172543,GB
3112172544,3112173567,NO
3112173568,3112174591,SE
+3112174592,3112175615,RU
3112175616,3112176639,UA
3112176640,3112177663,ES
3112177664,3112178687,FI
@@ -67235,6 +67747,247 @@
3112237056,3112238079,SI
3112238080,3112239103,FI
3112239104,3112240127,AZ
+3112240128,3112241151,IQ
+3112241152,3112242175,GB
+3112242176,3112243199,HR
+3112243200,3112244223,TR
+3112244224,3112245247,GB
+3112245248,3112246271,NO
+3112246272,3112247295,ES
+3112247296,3112248319,PL
+3112248320,3112249343,RO
+3112249344,3112250367,ES
+3112250368,3112251391,FR
+3112251392,3112252415,KZ
+3112252416,3112253439,CH
+3112253440,3112254463,RU
+3112254464,3112255487,DK
+3112255488,3112256511,NO
+3112256512,3112257535,NL
+3112257536,3112258559,GB
+3112258560,3112259583,PL
+3112259584,3112260607,IR
+3112260608,3112261631,DE
+3112261632,3112262655,IT
+3112262656,3112263679,AZ
+3112263680,3112265727,RU
+3112265728,3112266751,ES
+3112266752,3112267775,IR
+3112267776,3112268799,PL
+3112268800,3112269823,IR
+3112269824,3112270847,RS
+3112270848,3112271871,IR
+3112271872,3112272895,UA
+3112272896,3112273919,IE
+3112273920,3112274943,CZ
+3112274944,3112275967,IR
+3112275968,3112276991,RU
+3112276992,3112278015,LV
+3112278016,3112279039,FI
+3112279040,3112280063,NO
+3112280064,3112281087,GB
+3112281088,3112282111,FR
+3112282112,3112283135,IR
+3112283136,3112284159,AT
+3112284160,3112285183,GB
+3112285184,3112286207,DE
+3112286208,3112288255,IR
+3112288256,3112289279,KZ
+3112289280,3112291327,IR
+3112291328,3112292351,RU
+3112292352,3112293375,GB
+3112293376,3112295423,IR
+3112295424,3112297471,GB
+3112297472,3112301567,IR
+3112301568,3112302591,DE
+3112302592,3112303615,ES
+3112303616,3112304639,DE
+3112304640,3112305663,SE
+3112305664,3112306687,LT
+3112306688,3112307711,DE
+3112307712,3112308735,IS
+3112308736,3112309759,HR
+3112309760,3112310783,DE
+3112310784,3112312831,ES
+3112312832,3112313855,DE
+3112313856,3112315903,GB
+3112315904,3112316927,PL
+3112316928,3112317951,IQ
+3112317952,3112318975,UA
+3112318976,3112319999,RU
+3112320000,3112321023,IQ
+3112321024,3112322047,FI
+3112322048,3112323071,NO
+3112323072,3112324095,NL
+3112324096,3112325119,IR
+3112325120,3112326143,RU
+3112326144,3112327167,IL
+3112327168,3112328191,RU
+3112328192,3112329215,GB
+3112329216,3112330239,DK
+3112330240,3112331263,GB
+3112331264,3112332287,RU
+3112332288,3112333311,PL
+3112333312,3112334335,RU
+3112334336,3112335359,FR
+3112335360,3112336383,UA
+3112336384,3112337407,RS
+3112337408,3112338431,BE
+3112338432,3112339455,MK
+3112339456,3112340479,LB
+3112340480,3112341503,CH
+3112341504,3112342527,ES
+3112342528,3112343551,BE
+3112343552,3112344575,ES
+3112344576,3112345599,GB
+3112345600,3112346623,DK
+3112346624,3112347647,SE
+3112347648,3112349695,NL
+3112349696,3112350719,HU
+3112350720,3112351743,PL
+3112351744,3112352767,DE
+3112352768,3112353791,DK
+3112353792,3112354815,DE
+3112354816,3112355839,GB
+3112355840,3112356863,ES
+3112356864,3112357887,DE
+3112357888,3112358911,PL
+3112358912,3112359935,RU
+3112359936,3112360959,ES
+3112360960,3112361983,SK
+3112361984,3112364031,NL
+3112364032,3112365055,RU
+3112365056,3112366079,US
+3112366080,3112367103,NL
+3112367104,3112368127,NO
+3112368128,3112369151,RU
+3112369152,3112370175,AT
+3112370176,3112371199,LU
+3112371200,3112372223,CH
+3112372224,3112373247,GB
+3112373248,3112374271,ES
+3112374272,3112375295,IT
+3112375296,3112376319,SE
+3112376320,3112377343,NL
+3112377344,3112378367,IR
+3112378368,3112379391,PL
+3112379392,3112380415,LB
+3112380416,3112382463,FR
+3112382464,3112383487,TR
+3112383488,3112384511,ES
+3112384512,3112385535,AE
+3112385536,3112386559,CZ
+3112386560,3112387583,NL
+3112387584,3112388607,EE
+3112388608,3112389631,DE
+3112389632,3112390655,SA
+3112390656,3112391679,FR
+3112391680,3112394751,IR
+3112394752,3112395775,SA
+3112395776,3112396799,IR
+3112396800,3112397823,RU
+3112397824,3112400895,IR
+3112400896,3112401919,DE
+3112401920,3112403967,IR
+3112403968,3112404991,ES
+3112404992,3112407039,IR
+3112407040,3112408063,AE
+3112408064,3112411135,IR
+3112411136,3112412159,IT
+3112412160,3112414207,IR
+3112414208,3112415231,RU
+3112415232,3112416255,AE
+3112416256,3112417279,RU
+3112417280,3112418303,ES
+3112418304,3112419327,IQ
+3112419328,3112420351,FR
+3112420352,3112421375,DE
+3112421376,3112423423,GB
+3112423424,3112424447,TR
+3112424448,3112425471,IT
+3112425472,3112426495,FI
+3112426496,3112427519,FR
+3112427520,3112428543,PL
+3112428544,3112430591,GB
+3112430592,3112431615,DE
+3112431616,3112432639,PL
+3112432640,3112433663,CZ
+3112433664,3112435711,IT
+3112435712,3112436735,UA
+3112436736,3112437759,BG
+3112437760,3112439807,GB
+3112439808,3112440831,CH
+3112440832,3112441855,RU
+3112441856,3112442879,DE
+3112442880,3112443903,RU
+3112443904,3112444927,DE
+3112444928,3112446975,GB
+3112446976,3112447999,DE
+3112448000,3112449023,LT
+3112449024,3112450047,PL
+3112450048,3112451071,IT
+3112451072,3112452095,LU
+3112452096,3112453119,FR
+3112453120,3112454143,IT
+3112454144,3112455167,FR
+3112455168,3112456191,GB
+3112456192,3112457215,IR
+3112457216,3112458239,GB
+3112458240,3112459263,ES
+3112459264,3112460287,AL
+3112460288,3112461311,AT
+3112461312,3112462335,FR
+3112462336,3112463359,FI
+3112463360,3112464383,RO
+3112464384,3112465407,CZ
+3112465408,3112466431,FR
+3112466432,3112468479,TR
+3112468480,3112469503,CH
+3112469504,3112470527,AE
+3112470528,3112472575,ES
+3112472576,3112473599,RS
+3112473600,3112474623,LB
+3112474624,3112475647,GB
+3112475648,3112476671,IL
+3112476672,3112477695,ME
+3112477696,3112479743,AE
+3112479744,3112480767,RO
+3112480768,3112481791,AE
+3112481792,3112482815,NL
+3112482816,3112485887,AE
+3112485888,3112486911,RU
+3112486912,3112487935,AE
+3112487936,3112488959,KW
+3112488960,3112489983,DE
+3112489984,3112491007,IR
+3112491008,3112492031,SE
+3112492032,3112494079,DE
+3112494080,3112495103,IT
+3112495104,3112496127,RS
+3112496128,3112497151,NL
+3112497152,3112498175,RU
+3112498176,3112499199,GB
+3112499200,3112500223,PS
+3112500224,3112501247,NL
+3112501248,3112502271,RU
+3112502272,3112503295,ES
+3112503296,3112505343,DE
+3112505344,3112506367,EG
+3112506368,3112507391,BG
+3112507392,3112508415,DE
+3112508416,3112509439,CH
+3112509440,3112511487,NL
+3112511488,3112512511,RU
+3112512512,3112514559,CH
+3112514560,3112515583,FR
+3112515584,3112516607,CZ
+3112516608,3112517631,SK
+3112517632,3112518655,RO
+3112518656,3112519679,SE
+3112519680,3112520703,NL
+3112520704,3112521727,PT
+3112521728,3112522751,FR
+3112522752,3112523775,SA
3113710318,3113710318,CA
3120562176,3120594943,CO
3120594944,3120599039,AR
@@ -67492,7 +68245,9 @@
3154313216,3154378751,TR
3154378752,3154444287,GR
3154444288,3154509823,BE
-3154509824,3154575359,HU
+3154509824,3154571519,HU
+3154571520,3154571775,BG
+3154571776,3154575359,HU
3154575360,3154640895,FR
3154640896,3155165183,IT
3155165184,3155427327,RU
@@ -67515,7 +68270,9 @@
3156928512,3156930559,LU
3156930560,3156933631,US
3156933632,3156933887,SG
-3156933888,3156934143,CN
+3156933888,3156933909,CN
+3156933910,3156933910,SG
+3156933911,3156934143,CN
3156934144,3156934655,SG
3156934656,3157000191,RU
3157000192,3157008383,MK
@@ -67797,9 +68554,11 @@
3161571328,3161587711,UZ
3161587712,3161604095,RU
3161604096,3161612287,PL
-3161613056,3161613311,BR
-3161615360,3161615615,ES
-3161616128,3161616383,ES
+3161612288,3161613311,BR
+3161613312,3161614335,IT
+3161614336,3161614591,US
+3161614848,3161615103,US
+3161615360,3161616383,ES
3161616384,3161618431,GB
3161618432,3161620479,IQ
3161620480,3161636863,DK
@@ -67807,7 +68566,9 @@
3161641216,3161641983,UA
3161641984,3161642239,RU
3161642240,3161645055,UA
-3161645056,3161653247,RU
+3161645056,3161651975,RU
+3161651976,3161651976,SE
+3161651977,3161653247,RU
3161653248,3161669631,LU
3161669632,3161670143,FR
3161670144,3161670399,RE
@@ -68062,7 +68823,9 @@
3164967232,3164967239,ES
3164967240,3164967303,FR
3164967304,3164967307,DE
-3164967308,3164968319,FR
+3164967308,3164968223,FR
+3164968224,3164968255,GB
+3164968256,3164968319,FR
3164968320,3164968447,GB
3164968448,3164968455,FR
3164968456,3164968459,NL
@@ -68097,8 +68860,10 @@
3164976160,3164976295,FR
3164976296,3164976303,IT
3164976304,3164995583,FR
-3164995584,3165052927,NL
-3165052928,3165061119,SG
+3164995584,3165040639,NL
+3165040640,3165044735,SG
+3165044736,3165048831,NL
+3165048832,3165061119,SG
3165061120,3165126655,SK
3165126656,3165192191,RU
3165192192,3165257727,GE
@@ -68167,7 +68932,9 @@
3166699520,3166961663,DE
3166961664,3167223807,SI
3167223808,3167748095,NL
-3167748096,3167758335,RO
+3167748096,3167753215,RO
+3167753216,3167754239,ES
+3167754240,3167758335,RO
3167758336,3167758463,NL
3167758464,3167760383,RO
3167760384,3167762431,GB
@@ -68282,7 +69049,8 @@
3168089088,3168090111,MD
3168090112,3168092159,ES
3168092160,3168096255,IR
-3168096256,3168100351,MD
+3168096256,3168097279,ES
+3168097280,3168100351,MD
3168100352,3168108543,IR
3168108544,3168110335,RO
3168110336,3168110591,GB
@@ -68349,7 +69117,9 @@
3168192000,3168192255,GB
3168192256,3168192511,RO
3168192512,3168194559,MD
-3168194560,3168199679,RO
+3168194560,3168198655,RO
+3168198656,3168199167,ES
+3168199168,3168199679,RO
3168199680,3168200703,MD
3168200704,3168202751,IR
3168202752,3168203775,ES
@@ -69629,8 +70399,8 @@
3210771200,3210771215,TH
3210771216,3210771455,CL
3210771456,3210772479,US
-3210772480,3210772991,CL
-3210772992,3210773247,US
+3210772480,3210772735,CL
+3210772736,3210773247,US
3210773248,3210773503,BR
3210773504,3210773519,PL
3210773520,3210773759,BR
@@ -70279,7 +71049,9 @@
3223390720,3223390975,MU
3223390976,3223391999,US
3223392000,3223392511,NL
-3223392512,3223397375,US
+3223392512,3223395839,US
+3223395840,3223396095,DE
+3223396096,3223397375,US
3223397376,3223397631,NL
3223397632,3223410431,US
3223410432,3223416831,CH
@@ -70455,7 +71227,8 @@
3223868416,3223869439,BM
3223869440,3223869695,NO
3223869696,3223869951,DK
-3223869952,3223871487,US
+3223869952,3223871231,US
+3223871232,3223871487,FI
3223871488,3223873535,CA
3223873536,3223881727,US
3223881728,3223882751,CA
@@ -71626,7 +72399,9 @@
3227449088,3227450111,US
3227450112,3227450367,CA
3227450368,3227451455,US
-3227451456,3227452375,CA
+3227451456,3227451831,CA
+3227451832,3227451835,US
+3227451836,3227452375,CA
3227452376,3227452382,US
3227452383,3227452735,CA
3227452736,3227452767,US
@@ -73957,7 +74732,7 @@
3234320384,3234338815,US
3234338816,3234339071,CN
3234339072,3234339327,MT
-3234339328,3234339583,LB
+3234339328,3234339583,DE
3234339584,3234339839,PA
3234339840,3234340095,US
3234340096,3234340351,IN
@@ -74475,7 +75250,9 @@
3237615616,3237616895,CA
3237616896,3237647103,US
3237647104,3237647359,AU
-3237647360,3237655039,US
+3237647360,3237653503,US
+3237653504,3237653759,IN
+3237653760,3237655039,US
3237655040,3237655551,IN
3237655552,3237675007,US
3237675008,3237675263,CA
@@ -74552,10 +75329,12 @@
3237960192,3237960447,SR
3237960448,3237960703,BZ
3237960704,3237960959,BO
-3237960960,3237961215,DM
+3237960960,3237961215,DE
3237961216,3237961471,SV
3237961472,3237961727,HT
-3237961728,3238002687,US
+3237961728,3237964799,US
+3237964800,3237965055,DE
+3237965056,3238002687,US
3238002688,3238008831,NL
3238008832,3238010879,RO
3238010880,3238017023,CH
@@ -76989,7 +77768,6 @@
3245093888,3245094911,RO
3245094912,3245095935,UA
3245095936,3245096959,IT
-3245096960,3245099007,CZ
3245099008,3245103103,GB
3245105664,3245106175,NL
3245106176,3245106687,AT
@@ -80953,7 +81731,8 @@
3259481088,3259484671,SE
3259484672,3259485183,ES
3259485184,3259490303,SE
-3259490304,3259490815,IN
+3259490304,3259490559,IN
+3259490560,3259490815,NL
3259490816,3259491071,SE
3259491072,3259491327,LI
3259491328,3259495935,SE
@@ -82010,7 +82789,9 @@
3264614912,3264615167,SE
3264615168,3264616263,GB
3264616264,3264616271,CH
-3264616272,3264617983,GB
+3264616272,3264616335,GB
+3264616336,3264616336,CH
+3264616337,3264617983,GB
3264617984,3264618239,US
3264618240,3264619391,GB
3264619392,3264619519,BE
@@ -82198,7 +82979,9 @@
3265069056,3265134591,FI
3265134592,3265134863,CH
3265134864,3265134879,BE
-3265134880,3265135039,CH
+3265134880,3265135017,CH
+3265135018,3265135018,BE
+3265135019,3265135039,CH
3265135040,3265135071,BE
3265135072,3265137983,CH
3265137984,3265138047,NL
@@ -82216,7 +82999,9 @@
3265141552,3265141555,IE
3265141556,3265141759,CH
3265141760,3265142015,GB
-3265142016,3265142783,CH
+3265142016,3265142220,CH
+3265142221,3265142221,GB
+3265142222,3265142783,CH
3265142784,3265150975,MT
3265150976,3265159167,AD
3265159168,3265167359,FR
@@ -82436,7 +83221,9 @@
3266797824,3266798079,ES
3266798080,3266798847,GB
3266798848,3266798879,CZ
-3266798880,3266804639,GB
+3266798880,3266804099,GB
+3266804100,3266804100,NL
+3266804101,3266804639,GB
3266804640,3266804643,NL
3266804644,3266805759,GB
3266805760,3266813951,AT
@@ -82894,8 +83681,7 @@
3270650368,3270650623,DK
3270650624,3270651135,FR
3270651648,3270651903,FR
-3270652416,3270652671,DK
-3270652672,3270652927,CH
+3270652416,3270652927,CH
3270652928,3270653183,PL
3270653184,3270653439,UA
3270653440,3270653695,NL
@@ -84220,7 +85006,6 @@
3275138048,3275138559,DE
3275139072,3275139583,PT
3275140096,3275140607,AT
-3275140608,3275141119,NL
3275141120,3275141631,RU
3275141632,3275142143,GE
3275142144,3275142655,KG
@@ -84882,7 +85667,9 @@
3276886364,3276886367,DE
3276886368,3276886649,GB
3276886650,3276886650,DE
-3276886651,3276890175,GB
+3276886651,3276886911,GB
+3276886912,3276886927,DE
+3276886928,3276890175,GB
3276890176,3276890191,US
3276890192,3276892159,GB
3276892160,3276893183,IT
@@ -84892,7 +85679,9 @@
3276897728,3276897791,BE
3276897792,3276898671,GB
3276898672,3276898687,CH
-3276898688,3276901613,GB
+3276898688,3276898783,GB
+3276898784,3276898799,CH
+3276898800,3276901613,GB
3276901614,3276901614,CH
3276901615,3276902141,GB
3276902142,3276902142,CH
@@ -85555,7 +86344,9 @@
3279586816,3279587327,DE
3279587328,3279587583,GB
3279587584,3279588095,DE
-3279588096,3279590911,GB
+3279588096,3279590399,GB
+3279590400,3279590655,US
+3279590656,3279590911,GB
3279590912,3279591167,DE
3279591168,3279593407,GB
3279593408,3279593440,DE
@@ -85846,7 +86637,9 @@
3280958920,3280958927,DE
3280958928,3280963375,GB
3280963376,3280963383,DE
-3280963384,3280991231,GB
+3280963384,3280985279,GB
+3280985280,3280985343,CH
+3280985344,3280991231,GB
3280991232,3280991743,DE
3280991744,3280994559,GB
3280994560,3280994815,RU
@@ -86893,6 +87686,7 @@
3285924992,3285924995,FR
3285924996,3285924999,CZ
3285925000,3285925007,RU
+3285925008,3285925015,DE
3285925164,3285925171,CH
3285926432,3285926463,CH
3285926592,3285926623,DE
@@ -86901,6 +87695,7 @@
3285931528,3285931551,DE
3285935872,3285936127,GB
3285936136,3285936147,FR
+3285936152,3285936159,FR
3285939136,3285939175,GB
3285939184,3285939191,GB
3285939744,3285939759,GB
@@ -86915,6 +87710,7 @@
3285954560,3285954567,RO
3285954568,3285954575,PL
3285954576,3285954815,GB
+3285961984,3285961991,GB
3285962752,3285963775,DE
3285964800,3285964935,DE
3285965056,3285965823,DE
@@ -87041,7 +87837,9 @@
3286425344,3286425599,IT
3286425600,3286433791,KW
3286433792,3286499327,DE
-3286499328,3286502143,HU
+3286499328,3286499583,HU
+3286499584,3286499839,BG
+3286499840,3286502143,HU
3286502144,3286502399,BG
3286502400,3286510335,HU
3286510336,3286510591,BG
@@ -87647,6 +88445,7 @@
3288428544,3288428799,CU
3288428800,3288429311,IN
3288429312,3288429567,ZA
+3288429568,3288430079,KE
3288430080,3288430335,GH
3288430336,3288430591,EG
3288430592,3288432639,SC
@@ -87801,7 +88600,7 @@
3289089792,3289090047,MZ
3289090048,3289093631,ZA
3289093632,3289094143,NG
-3289096192,3289100031,ZA
+3289094144,3289100031,ZA
3289100032,3289100287,LS
3289102336,3289103359,NG
3289103360,3289103615,ZA
@@ -87983,6 +88782,7 @@
3291004928,3291021311,NG
3291021312,3291029503,ZA
3291029504,3291037695,TZ
+3291037952,3291038207,ZA
3291045888,3291078655,ZA
3291078656,3291086847,DZ
3291086848,3291103231,PR
@@ -88221,6 +89021,7 @@
3301507328,3301507583,MU
3301507584,3301507839,GH
3301507840,3301508095,EG
+3301508096,3301508607,GH
3301508608,3301509119,ZA
3301510144,3301511167,MW
3301511168,3301512191,ZW
@@ -88879,9 +89680,15 @@
3324526592,3324579839,US
3324582912,3324583935,CA
3324583936,3324587775,CL
-3324587776,3324636159,US
+3324587776,3324633087,US
+3324633088,3324634111,PE
+3324634112,3324635135,AR
+3324635136,3324635391,SG
+3324635392,3324635647,US
+3324635648,3324635903,HK
+3324635904,3324636159,US
3324636160,3324637183,NZ
-3324637184,3324638207,US
+3324637184,3324638207,DE
3324638208,3324638719,IN
3324638720,3324642303,US
3324642304,3324642559,CA
@@ -89775,7 +90582,9 @@
3338017792,3338018815,CA
3338018816,3338021887,US
3338021888,3338022911,CA
-3338022912,3338069247,US
+3338022912,3338067711,US
+3338067712,3338067967,SG
+3338067968,3338069247,US
3338069248,3338069759,BB
3338069760,3338207487,US
3338207488,3338207743,CA
@@ -90016,9 +90825,7 @@
3340460032,3340461055,PR
3340461056,3340461311,US
3340461312,3340462079,PR
-3340462080,3340468223,US
-3340468224,3340468991,SG
-3340468992,3340481535,US
+3340462080,3340481535,US
3340481536,3340482559,CA
3340482560,3340490751,US
3340490752,3340492799,CA
@@ -90236,7 +91043,9 @@
3343465472,3343466495,JM
3343466496,3343649791,US
3343649792,3343650815,VI
-3343650816,3343858687,US
+3343650816,3343653631,US
+3343653632,3343653695,CA
+3343653696,3343858687,US
3343858688,3343859199,VG
3343859200,3344116223,US
3344116224,3344116735,CA
@@ -90798,7 +91607,9 @@
3351871488,3351895551,US
3351895552,3351895807,CA
3351895808,3351904255,US
-3351904256,3351927551,CA
+3351904256,3351912703,CA
+3351912704,3351912959,US
+3351912960,3351927551,CA
3351927552,3351927807,US
3351927808,3351933951,CA
3351933952,3351939071,US
@@ -91188,6 +91999,7 @@
3356061696,3356062463,BR
3356062464,3356062719,JM
3356062720,3356063743,CR
+3356063744,3356063999,HN
3356064000,3356064255,BR
3356064256,3356064511,CL
3356064512,3356065791,BR
@@ -91218,7 +92030,7 @@
3356084480,3356084735,CL
3356084736,3356085247,BR
3356085248,3356085759,CL
-3356085760,3356086015,BR
+3356085760,3356086271,BR
3356086272,3356086527,AR
3356086528,3356087295,CR
3356087296,3356087807,AR
@@ -91276,6 +92088,7 @@
3356137728,3356138239,BR
3356138240,3356138495,US
3356138496,3356138751,BR
+3356139008,3356139263,CL
3356139264,3356139519,BR
3356139520,3356139775,US
3356139776,3356140031,AR
@@ -91307,6 +92120,7 @@
3356150528,3356150783,PA
3356150784,3356151039,AR
3356151040,3356151295,NI
+3356151296,3356151551,BR
3356151552,3356151807,AR
3356151808,3356152063,CL
3356152064,3356152575,BR
@@ -91682,6 +92496,7 @@
3357607168,3357613055,MX
3357613056,3357613311,AR
3357613312,3357618943,MX
+3357618944,3357619199,SV
3357619200,3357623039,MX
3357623040,3357623295,AR
3357623296,3357626623,MX
@@ -91827,7 +92642,9 @@
3358534400,3358534655,AR
3358534656,3358534911,VE
3358534912,3358535679,AR
-3358535680,3358539519,VE
+3358535680,3358536447,VE
+3358536448,3358536703,AR
+3358536704,3358539519,VE
3358539520,3358539775,AR
3358539776,3358543871,VE
3358543872,3358544127,MX
@@ -92789,7 +93606,9 @@
3389029888,3389030399,SG
3389030400,3389034495,HK
3389034496,3389035519,PH
+3389035520,3389035775,IN
3389035776,3389036031,SG
+3389036032,3389036287,AU
3389036288,3389036543,NZ
3389037056,3389037567,AU
3389037568,3389038591,NC
@@ -92976,6 +93795,7 @@
3389460480,3389464575,JP
3389464576,3389469695,NZ
3389469696,3389470719,KH
+3389470720,3389471231,AU
3389471232,3389471487,IN
3389471744,3389472767,NZ
3389472768,3389480959,AU
@@ -93616,6 +94436,9 @@
3392499712,3392503807,JP
3392503808,3392505343,HK
3392506880,3392507903,HK
+3392507904,3392508927,KH
+3392508928,3392510975,HK
+3392510976,3392511999,MM
3392512000,3392516095,BD
3392516096,3392519167,AU
3392519168,3392519679,NZ
@@ -93763,6 +94586,14 @@
3392998400,3392999423,AU
3392999424,3393003519,JP
3393003520,3393011711,PK
+3393011712,3393012735,PH
+3393012736,3393013759,CN
+3393013760,3393014783,AU
+3393014784,3393015807,CN
+3393015808,3393016831,IN
+3393016832,3393017855,HK
+3393017856,3393018879,CN
+3393018880,3393019903,AU
3393019904,3393020159,ID
3393020160,3393020415,MN
3393020416,3393021439,ID
@@ -93833,6 +94664,10 @@
3393314816,3393318911,ID
3393318912,3393320959,SG
3393320960,3393363967,HK
+3393363968,3393364991,AU
+3393364992,3393366015,IN
+3393366016,3393367039,CN
+3393367040,3393372159,IN
3393372160,3393374975,HK
3393374976,3393375743,SG
3393375744,3393388543,HK
@@ -93917,6 +94752,7 @@
3393777664,3393779711,MN
3393779712,3393780735,IN
3393780736,3393782783,HK
+3393782784,3393783807,BD
3393783808,3393785855,MY
3393785856,3393789951,ID
3393789952,3393798143,SG
@@ -94523,7 +95359,11 @@
3397715968,3397718015,HK
3397718016,3397722111,KR
3397722112,3397726207,CN
-3397726208,3397730303,IN
+3397726208,3397734399,IN
+3397734400,3397735423,MY
+3397735424,3397736447,MM
+3397736448,3397737471,BD
+3397737472,3397738495,IN
3397738496,3397742591,MY
3397742592,3397746687,JP
3397746688,3397763071,TH
@@ -94560,6 +95400,9 @@
3397910528,3397918719,SG
3397918720,3397922815,AU
3397922816,3397926911,CN
+3397926912,3397933055,IN
+3397933056,3397934079,BD
+3397934080,3397935103,PH
3397935104,3397939199,AU
3397939200,3397951487,KR
3397951488,3397959679,SG
@@ -94593,7 +95436,9 @@
3398074368,3398090751,PH
3398090752,3398098943,AU
3398098944,3398107135,ID
-3398107136,3398156287,AU
+3398107136,3398107586,AU
+3398107587,3398107587,US
+3398107588,3398156287,AU
3398156288,3398164479,TH
3398164480,3398172671,AU
3398172672,3398180863,JP
@@ -94792,6 +95637,14 @@
3399514112,3399515135,SG
3399515136,3399515647,VN
3399515648,3399516159,AU
+3399516160,3399517183,SG
+3399517184,3399518207,IN
+3399518208,3399519231,ID
+3399519232,3399520255,CN
+3399520256,3399521279,IN
+3399521280,3399522303,NZ
+3399522304,3399523327,HK
+3399523328,3399524351,CN
3399524352,3399528447,IN
3399528448,3399532543,CN
3399532544,3399548927,SG
@@ -94801,6 +95654,7 @@
3399581696,3399581951,HK
3399581952,3399589887,US
3399589888,3399593983,HK
+3399593984,3399598079,BD
3399598080,3399614463,JP
3399614464,3399622655,MY
3399622656,3399626751,ID
@@ -94853,6 +95707,8 @@
3399827456,3399835647,AU
3399835648,3399839743,CN
3399839744,3399841791,JP
+3399841792,3399842815,HK
+3399842816,3399843839,AU
3399843840,3399852031,TW
3399852032,3399856127,JP
3399856128,3399860223,CN
@@ -94890,7 +95746,9 @@
3399995392,3399999487,KR
3399999488,3400000255,SG
3400000256,3400000511,AU
-3400000512,3400004607,SG
+3400000512,3400002303,SG
+3400002304,3400002367,HK
+3400002368,3400004607,SG
3400004608,3400004863,AU
3400004864,3400007679,SG
3400007680,3400024063,AU
@@ -94901,6 +95759,11 @@
3400031744,3400031999,IN
3400032000,3400032255,HK
3400032256,3400040447,AU
+3400040448,3400044543,CN
+3400044544,3400045567,IN
+3400045568,3400046591,HK
+3400046592,3400047615,KR
+3400047616,3400048639,IN
3400048640,3400056831,CN
3400056832,3400060927,TW
3400060928,3400062975,HK
@@ -95032,7 +95895,9 @@
3400648678,3400648678,HK
3400648679,3400648815,SG
3400648816,3400648831,HK
-3400648832,3400650409,SG
+3400648832,3400650143,SG
+3400650144,3400650159,HK
+3400650160,3400650409,SG
3400650410,3400650410,AU
3400650411,3400650751,SG
3400650752,3400654847,AU
@@ -95061,6 +95926,13 @@
3400847360,3400849407,CN
3400849408,3400851455,MN
3400851456,3400859647,AU
+3400859648,3400860671,HK
+3400860672,3400861695,IN
+3400861696,3400862719,CN
+3400862720,3400864767,BD
+3400864768,3400865791,AU
+3400865792,3400866815,HK
+3400866816,3400867839,CN
3400867840,3400884223,AU
3400884224,3400888319,JP
3400888320,3400892415,CN
@@ -96759,6 +97631,12 @@
3410804736,3410808831,PH
3410808832,3410811903,CN
3410811904,3410812927,BD
+3410812928,3410813951,AU
+3410813952,3410814975,IN
+3410814976,3410817023,HK
+3410817024,3410819071,CN
+3410819072,3410820095,IN
+3410820096,3410821119,LA
3410821120,3410853887,TW
3410853888,3410862079,HK
3410862080,3410866175,AU
@@ -96986,6 +97864,12 @@
3412004864,3412017151,JP
3412017152,3412025343,SG
3412025344,3412049919,CN
+3412049920,3412050943,HK
+3412050944,3412051967,KH
+3412051968,3412055039,CN
+3412055040,3412056063,HK
+3412056064,3412057087,IN
+3412057088,3412058111,BD
3412058112,3412066303,CN
3412066304,3412213759,NZ
3412213760,3412221951,AU
@@ -97053,7 +97937,9 @@
3412598784,3412602879,CN
3412602880,3412606975,NC
3412606976,3412615167,PH
-3412615168,3412656127,JP
+3412615168,3412631551,JP
+3412631552,3412639743,KR
+3412639744,3412656127,JP
3412656128,3412672511,HK
3412672512,3412680191,JP
3412680192,3412680447,US
@@ -97178,7 +98064,15 @@
3413606400,3413639167,CN
3413639168,3413704703,SG
3413704704,3413737471,MY
-3413737472,3413753855,TH
+3413737472,3413741567,SG
+3413741568,3413742591,TH
+3413742592,3413744127,SG
+3413744128,3413748479,TH
+3413748480,3413749503,SG
+3413749504,3413750271,TH
+3413750272,3413751039,SG
+3413751040,3413753087,TH
+3413753088,3413753855,JP
3413753856,3413762047,AU
3413762048,3413770239,TW
3413770240,3413786623,IN
@@ -97321,6 +98215,7 @@
3415474176,3415495679,CN
3415495680,3415496191,ID
3415496192,3415496703,CN
+3415496704,3415497727,BD
3415497728,3415497983,TW
3415497984,3415498751,AU
3415498752,3415506943,JP
@@ -97330,7 +98225,19 @@
3415564288,3415568383,JP
3415568384,3415572479,KR
3415572480,3415605247,SG
-3415605248,3415752703,TH
+3415605248,3415736319,TH
+3415736320,3415737599,SG
+3415737600,3415737855,TH
+3415737856,3415738879,SG
+3415738880,3415739135,TH
+3415739136,3415740159,SG
+3415740160,3415740415,TH
+3415740416,3415741695,SG
+3415741696,3415747071,TH
+3415747072,3415747839,SG
+3415747840,3415748351,TH
+3415748352,3415749375,SG
+3415749376,3415752703,TH
3415752704,3415760895,CN
3415760896,3415769087,NZ
3415769088,3415777279,CN
@@ -97382,6 +98289,7 @@
3416293376,3416293631,ID
3416293632,3416293887,CN
3416293888,3416294399,PH
+3416294400,3416295423,VN
3416295424,3416295679,IN
3416295680,3416295935,TH
3416295936,3416296447,IN
@@ -97570,6 +98478,7 @@
3417338880,3417339903,PH
3417339904,3417340415,AU
3417340416,3417340927,NZ
+3417340928,3417341951,HK
3417341952,3417346047,KH
3417346048,3417348095,MY
3417348096,3417348351,AU
@@ -97643,7 +98552,7 @@
3418210304,3418218495,CN
3418218496,3418220543,BD
3418220544,3418223615,CN
-3418223616,3418224639,IN
+3418223616,3418226687,IN
3418226688,3418227711,BD
3418227712,3418228735,KR
3418228736,3418230783,BD
@@ -97651,6 +98560,7 @@
3418232832,3418233343,AU
3418233344,3418233855,KR
3418233856,3418234879,JP
+3418234880,3418235903,BD
3418235904,3418236415,ID
3418236416,3418236927,HK
3418236928,3418241023,ID
@@ -97846,6 +98756,7 @@
3419668480,3419672575,CN
3419672576,3419674623,AU
3419674624,3419675647,IN
+3419675648,3419676671,PK
3419676672,3419684863,JP
3419684864,3419688959,IN
3419688960,3419693055,CN
@@ -97899,6 +98810,7 @@
3420034048,3420035071,AU
3420036096,3420037119,JP
3420037120,3420037631,AU
+3420038144,3420039167,CN
3420039168,3420040191,KH
3420040192,3420040703,ID
3420040704,3420040959,IN
@@ -98106,7 +99018,9 @@
3426482688,3426484223,CA
3426484224,3426617855,US
3426617856,3426618367,CA
-3426618368,3426666495,US
+3426618368,3426646527,US
+3426646528,3426646783,GB
+3426646784,3426666495,US
3426666752,3426717695,US
3426719744,3426729471,US
3426729472,3426729983,CA
@@ -99501,7 +100415,13 @@
3455872000,3455872255,ZM
3455872256,3455903967,US
3455903968,3455903983,HK
-3455903984,3456303103,US
+3455903984,3455909887,US
+3455909888,3455962591,SG
+3455962592,3455962599,US
+3455962600,3455963967,SG
+3455963968,3455963975,US
+3455963976,3455975423,SG
+3455975424,3456303103,US
3456303104,3456311295,JP
3456311296,3456360447,US
3456360448,3456364543,BG
@@ -99694,7 +100614,7 @@
3459618001,3459620863,CA
3459620864,3459624959,US
3459624960,3459629055,BM
-3459629056,3459631103,US
+3459629056,3459631359,US
3459633152,3459686399,US
3459686400,3459688479,NL
3459688480,3459689215,US
@@ -100368,7 +101288,9 @@
3470794752,3470802943,PA
3470802944,3470884863,US
3470884864,3470885887,HK
-3470885888,3471057919,US
+3470885888,3470886655,US
+3470886656,3470886911,GB
+3470886912,3471057919,US
3471057920,3471058943,VE
3471058944,3471059455,US
3471059456,3471060223,ES
@@ -100387,7 +101309,9 @@
3471558656,3471560703,CA
3471560704,3471570943,US
3471570944,3471572991,CA
-3471572992,3472375807,US
+3471572992,3472249343,US
+3472249344,3472249599,CA
+3472249600,3472375807,US
3472375808,3472392191,PR
3472392192,3472408575,CA
3472408576,3472721919,US
@@ -100643,8 +101567,8 @@
3481934848,3481958271,US
3481958272,3481958399,NL
3481958400,3481959020,US
-3481959021,3481959021,GB
-3481959022,3481964575,US
+3481959021,3481959022,GB
+3481959023,3481964575,US
3481964576,3481964579,IE
3481964580,3481993791,US
3481993792,3481993799,CA
@@ -101218,7 +102142,9 @@
3491651584,3491659775,VI
3491659776,3491743743,US
3491743744,3491745791,CO
-3491745792,3491969023,US
+3491745792,3491943447,US
+3491943448,3491943455,BR
+3491943456,3491969023,US
3491969024,3491970047,PR
3491970048,3492151295,US
3492151296,3492167679,CA
@@ -101294,7 +102220,8 @@
3493901024,3493901031,HK
3493901032,3493901311,US
3493901312,3493901567,AE
-3493901568,3493936127,US
+3493901568,3493929983,US
+3493931008,3493936127,US
3493936128,3493937151,CA
3493937152,3493939199,US
3493939200,3493941247,CA
@@ -103320,9 +104247,7 @@
3558203392,3558211583,ES
3558211584,3558219775,GB
3558219776,3558227967,ES
-3558227968,3558228479,RU
-3558228480,3558228735,FR
-3558228736,3558232063,RU
+3558227968,3558232063,RU
3558232064,3558232575,LB
3558232576,3558235647,RU
3558235648,3558235903,LB
@@ -103467,9 +104392,13 @@
3559186432,3559194623,RU
3559194624,3559197439,SE
3559197440,3559197567,FI
-3559197568,3559200255,SE
+3559197568,3559200143,SE
+3559200144,3559200151,FI
+3559200152,3559200255,SE
3559200256,3559200511,FI
-3559200512,3559202815,SE
+3559200512,3559200639,SE
+3559200640,3559200671,FI
+3559200672,3559202815,SE
3559202816,3559211007,DE
3559211008,3559219199,SK
3559219200,3559227391,SE
@@ -103857,7 +104786,9 @@
3561609216,3561609471,FR
3561609472,3561610495,GB
3561610496,3561610751,FR
-3561610752,3561612543,GB
+3561610752,3561611519,GB
+3561611520,3561611775,FR
+3561611776,3561612543,GB
3561612544,3561612799,FR
3561612800,3561615871,GB
3561615872,3561616127,FR
@@ -104563,7 +105494,9 @@
3567459936,3567459943,ES
3567459944,3567465983,GB
3567465984,3567466239,ES
-3567466240,3567495679,GB
+3567466240,3567490047,GB
+3567490048,3567490303,ES
+3567490304,3567495679,GB
3567495680,3567495935,ES
3567495936,3567499007,GB
3567499008,3567499135,ES
@@ -105202,8 +106135,8 @@
3580165888,3580166143,NL
3580166144,3580199935,SE
3580199936,3580200447,EE
-3580200448,3580201983,SE
-3580201984,3580203007,LT
+3580200448,3580200959,SE
+3580200960,3580203007,LT
3580203008,3580204543,SE
3580204544,3580205055,NL
3580205056,3580206079,SE
@@ -106292,7 +107225,9 @@
3589947392,3589963775,FI
3589963776,3589980159,ES
3589980160,3589996543,CZ
-3589996544,3590012927,GB
+3589996544,3589998591,GB
+3589998592,3589998607,ES
+3589998608,3590012927,GB
3590012928,3590029311,BE
3590029312,3590045695,FR
3590045696,3590062079,RU
@@ -106316,8 +107251,8 @@
3590234112,3590242303,GB
3590242304,3590244351,US
3590244352,3590244607,DE
-3590244608,3590245263,FR
-3590245264,3590245271,GB
+3590244608,3590245255,FR
+3590245256,3590245271,GB
3590245272,3590245311,FR
3590245312,3590245439,US
3590245440,3590247048,FR
@@ -106900,7 +107835,9 @@
3633975040,3634020351,CA
3634020352,3634037247,US
3634037248,3634037759,CA
-3634037760,3634052863,US
+3634037760,3634046719,US
+3634046720,3634046975,CA
+3634046976,3634052863,US
3634052864,3634053119,CA
3634053120,3634061311,CL
3634061312,3634094079,US
@@ -107158,7 +108095,9 @@
3638874112,3638878207,CA
3638878208,3638880511,US
3638880512,3638880767,CA
-3638880768,3638984703,US
+3638880768,3638898943,US
+3638898944,3638899199,MX
+3638899200,3638984703,US
3638984704,3638992895,GT
3638992896,3638996991,US
3639001088,3639052031,US
@@ -108959,6 +109898,8 @@
3706978304,3707109375,AU
3707109376,3707174911,HK
3707174912,3707207679,JP
+3707207680,3707208703,BD
+3707208704,3707209727,NZ
3707209728,3707211775,CN
3707211776,3707215871,ID
3707215872,3707217919,BD
@@ -108993,10 +109934,21 @@
3715743744,3715760127,JP
3715760128,3715891199,CN
3715891200,3716153343,HK
-3716153344,3716169727,SG
-3716169728,3716175615,JP
-3716175616,3716184575,TH
-3716184576,3716186111,JP
+3716153344,3716170751,SG
+3716170752,3716172287,JP
+3716172288,3716173055,SG
+3716173056,3716174335,JP
+3716174336,3716175359,SG
+3716175360,3716176895,JP
+3716176896,3716178175,SG
+3716178176,3716178943,TH
+3716178944,3716179967,SG
+3716179968,3716180991,JP
+3716180992,3716181759,TH
+3716181760,3716182783,SG
+3716182784,3716184575,TH
+3716184576,3716185087,JP
+3716185088,3716186111,SG
3716186112,3716415487,CN
3716415488,3716431871,VN
3716431872,3716440063,KR
@@ -109066,7 +110018,8 @@
3743006720,3743014911,TH
3743014912,3743016959,AU
3743016960,3743019007,SG
-3743019008,3743023103,MY
+3743019008,3743022079,MY
+3743022080,3743023103,BD
3743023104,3743027199,TW
3743027200,3743031295,SG
3743031296,3743035391,IN
@@ -109103,6 +110056,10 @@
3743252480,3743264767,NC
3743264768,3743268863,JP
3743268864,3743272959,IN
+3743272960,3743273983,CN
+3743273984,3743275007,BD
+3743275008,3743276031,HK
+3743276032,3743277055,IN
3743277056,3743281151,PK
3743281152,3743282175,AU
3743282176,3743283199,JP
@@ -109126,6 +110083,7 @@
3750232064,3750756351,TW
3750756352,3752067071,CN
3752067072,3752132607,ID
+3752132608,3752133631,BD
3752133632,3752134655,ID
3752134656,3752136703,TW
3752136704,3752137727,NZ
diff --git a/src/config/geoip6 b/src/config/geoip6
index c9664e5176..94e13e255c 100644
--- a/src/config/geoip6
+++ b/src/config/geoip6
@@ -1,7 +1,8 @@
-# Last updated based on December 1 2015 Maxmind GeoLite2 Country
+# Last updated based on January 5 2016 Maxmind GeoLite2 Country
# wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz
# gunzip GeoLite2-Country.mmdb.gz
# python mmdb-convert.py GeoLite2-Country.mmdb
+600:8801:9400:580::,600:8801:9400:580::,US
2001:200::,2001:200::7fff:ffff:ffff:ffff:ffff,JP
2001:200:120::,2001:200:120:7fff:ffff:ffff:ffff:ffff,JP
2001:200:148::,2001:200:148:7fff:ffff:ffff:ffff:ffff,JP
@@ -129,7 +130,9 @@
2001:420:5c44::,2001:420:5c44:7fff:ffff:ffff:ffff:ffff,SG
2001:420:5c44:8000::,2001:420:5c46:ffff:ffff:ffff:ffff:ffff,US
2001:420:5c47::,2001:420:5c47:7fff:ffff:ffff:ffff:ffff,SG
-2001:420:5c47:8000::,2001:420:c0c0:ffff:ffff:ffff:ffff:ffff,US
+2001:420:5c47:8000::,2001:420:5e40:11ff:ffff:ffff:ffff:ffff,US
+2001:420:5e40:1200::,2001:420:5e40:12ff:ffff:ffff:ffff:ffff,JP
+2001:420:5e40:1300::,2001:420:c0c0:ffff:ffff:ffff:ffff:ffff,US
2001:420:c0c1::,2001:420:c0c1:7fff:ffff:ffff:ffff:ffff,CH
2001:420:c0c1:8000::,2001:420:c0cf:ffff:ffff:ffff:ffff:ffff,US
2001:420:c0d0::,2001:420:c0d0:7fff:ffff:ffff:ffff:ffff,AU
@@ -156,9 +159,9 @@
2001:468::,2001:468:ffff:ffff:ffff:ffff:ffff:ffff,US
2001:470::,2001:470:0:284::,US
2001:470:0:284::1,2001:470:0:284::1,AT
-2001:470:0:284::2,2001:470:a:6ff:ffff:ffff:ffff:ffff,US
-2001:470:a:700::,2001:470:a:7ff:ffff:ffff:ffff:ffff,CA
-2001:470:a:800::,2001:470:18:ffff:ffff:ffff:ffff:ffff,US
+2001:470:0:284::2,2001:470:17:ffff:ffff:ffff:ffff:ffff,US
+2001:470:18::,2001:470:18:7ff:ffff:ffff:ffff:ffff,CN
+2001:470:18:800::,2001:470:18:ffff:ffff:ffff:ffff:ffff,US
2001:470:19::,2001:470:19:7fff:ffff:ffff:ffff:ffff,HK
2001:470:19:8000::,2001:470:1c:ff:ffff:ffff:ffff:ffff,US
2001:470:1c:100::,2001:470:1c:7ff:ffff:ffff:ffff:ffff,CA
@@ -183,37 +186,37 @@
2001:470:28:a2d::,2001:470:3c:ffff:ffff:ffff:ffff:ffff,US
2001:470:3d::,2001:470:3d:7fff:ffff:ffff:ffff:ffff,PH
2001:470:3d:8000::,2001:470:6d:ffff:ffff:ffff:ffff:ffff,US
-2001:470:6e::,2001:470:6e:7fff:ffff:ffff:ffff:ffff,CZ
-2001:470:6e:8000::,2001:470:6f:49e:ffff:ffff:ffff:ffff,US
+2001:470:6e::,2001:470:6e:3ff:ffff:ffff:ffff:ffff,CZ
+2001:470:6e:400::,2001:470:6f:49e:ffff:ffff:ffff:ffff,US
2001:470:6f:49f::,2001:470:6f:49f:ffff:ffff:ffff:ffff,SK
2001:470:6f:4a0::,2001:470:70:6ff:ffff:ffff:ffff:ffff,US
2001:470:70:700::,2001:470:70:7ff:ffff:ffff:ffff:ffff,RU
-2001:470:70:800::,2001:470:71:5ff:ffff:ffff:ffff:ffff,US
+2001:470:70:800::,2001:470:70:ffff:ffff:ffff:ffff:ffff,US
+2001:470:71::,2001:470:71:5ff:ffff:ffff:ffff:ffff,UA
2001:470:71:600::,2001:470:71:600:ffff:ffff:ffff:ffff,PL
-2001:470:71:601::,2001:470:71:60b:ffff:ffff:ffff:ffff,US
+2001:470:71:601::,2001:470:71:60b:ffff:ffff:ffff:ffff,UA
2001:470:71:60c::,2001:470:71:60c:ffff:ffff:ffff:ffff,PL
-2001:470:71:60d::,2001:470:d2:ffff:ffff:ffff:ffff:ffff,US
+2001:470:71:60d::,2001:470:71:7fff:ffff:ffff:ffff:ffff,UA
+2001:470:71:8000::,2001:470:d2:ffff:ffff:ffff:ffff:ffff,US
2001:470:d3::,2001:470:d3:7fff:ffff:ffff:ffff:ffff,DE
2001:470:d3:8000::,2001:470:1857:ffff:ffff:ffff:ffff:ffff,US
2001:470:1858::,2001:470:1858:7fff:ffff:ffff:ffff:ffff,GB
2001:470:1858:8000::,2001:470:18c1:7fff:ffff:ffff:ffff:ffff,US
2001:470:18c1:8000::,2001:470:18c1:ffff:ffff:ffff:ffff:ffff,GB
-2001:470:18c2::,2001:470:1f08:136:ffff:ffff:ffff:ffff,US
-2001:470:1f08:137::,2001:470:1f08:137:ffff:ffff:ffff:ffff,GB
-2001:470:1f08:138::,2001:470:1f08:415::1,US
+2001:470:18c2::,2001:470:1f07:ffff:ffff:ffff:ffff:ffff,US
+2001:470:1f08::,2001:470:1f08:1ff:ffff:ffff:ffff:ffff,GB
+2001:470:1f08:200::,2001:470:1f08:415::1,US
2001:470:1f08:415::2,2001:470:1f08:415::2,GB
2001:470:1f08:415::3,2001:470:1f08:bff:ffff:ffff:ffff:ffff,US
2001:470:1f08:c00::,2001:470:1f08:dff:ffff:ffff:ffff:ffff,GB
-2001:470:1f08:e00::,2001:470:1f08:eff:ffff:ffff:ffff:ffff,US
-2001:470:1f08:f00::,2001:470:1f08:11ff:ffff:ffff:ffff:ffff,GB
+2001:470:1f08:e00::,2001:470:1f08:fff:ffff:ffff:ffff:ffff,US
+2001:470:1f08:1000::,2001:470:1f08:11ff:ffff:ffff:ffff:ffff,GB
2001:470:1f08:1200::,2001:470:1f08:13ff:ffff:ffff:ffff:ffff,RU
-2001:470:1f08:1400::,2001:470:1f09:2b5:ffff:ffff:ffff:ffff,US
-2001:470:1f09:2b6::,2001:470:1f09:2b6:ffff:ffff:ffff:ffff,GB
-2001:470:1f09:2b7::,2001:470:1f09:414:ffff:ffff:ffff:ffff,US
-2001:470:1f09:415::,2001:470:1f09:415:ffff:ffff:ffff:ffff,GB
-2001:470:1f09:416::,2001:470:1f0a:1ff:ffff:ffff:ffff:ffff,US
-2001:470:1f0a:200::,2001:470:1f0a:3ff:ffff:ffff:ffff:ffff,DE
-2001:470:1f0a:400::,2001:470:1f0a:7ff:ffff:ffff:ffff:ffff,US
+2001:470:1f08:1400::,2001:470:1f08:17ff:ffff:ffff:ffff:ffff,US
+2001:470:1f08:1800::,2001:470:1f08:1fff:ffff:ffff:ffff:ffff,GB
+2001:470:1f08:2000::,2001:470:1f08:ffff:ffff:ffff:ffff:ffff,US
+2001:470:1f09::,2001:470:1f09:7fff:ffff:ffff:ffff:ffff,GB
+2001:470:1f09:8000::,2001:470:1f0a:7ff:ffff:ffff:ffff:ffff,US
2001:470:1f0a:800::,2001:470:1f0a:bff:ffff:ffff:ffff:ffff,RU
2001:470:1f0a:c00::,2001:470:1f0b:30e:ffff:ffff:ffff:ffff,US
2001:470:1f0b:30f::,2001:470:1f0b:30f:ffff:ffff:ffff:ffff,DE
@@ -226,9 +229,7 @@
2001:470:1f0b:786::,2001:470:1f12:bff:ffff:ffff:ffff:ffff,US
2001:470:1f12:c00::,2001:470:1f12:fff:ffff:ffff:ffff:ffff,FR
2001:470:1f12:1000::,2001:470:1f13:7ff:ffff:ffff:ffff:ffff,US
-2001:470:1f13:800::,2001:470:1f13:8ff:ffff:ffff:ffff:ffff,FR
-2001:470:1f13:900::,2001:470:1f13:9ff:ffff:ffff:ffff:ffff,US
-2001:470:1f13:a00::,2001:470:1f13:bff:ffff:ffff:ffff:ffff,FR
+2001:470:1f13:800::,2001:470:1f13:bff:ffff:ffff:ffff:ffff,FR
2001:470:1f13:c00::,2001:470:1f13:fff:ffff:ffff:ffff:ffff,GB
2001:470:1f13:1000::,2001:470:1f13:11ff:ffff:ffff:ffff:ffff,US
2001:470:1f13:1200::,2001:470:1f13:12ff:ffff:ffff:ffff:ffff,FR
@@ -278,7 +279,9 @@
2001:470:532e::,2001:470:532e:7fff:ffff:ffff:ffff:ffff,RU
2001:470:532e:8000::,2001:470:5803:7fff:ffff:ffff:ffff:ffff,US
2001:470:5803:8000::,2001:470:5803:ffff:ffff:ffff:ffff:ffff,CZ
-2001:470:5804::,2001:470:591a:ffff:ffff:ffff:ffff:ffff,US
+2001:470:5804::,2001:470:5853:ffff:ffff:ffff:ffff:ffff,US
+2001:470:5854::,2001:470:5854:7fff:ffff:ffff:ffff:ffff,CZ
+2001:470:5854:8000::,2001:470:591a:ffff:ffff:ffff:ffff:ffff,US
2001:470:591b::,2001:470:591b:7fff:ffff:ffff:ffff:ffff,CZ
2001:470:591b:8000::,2001:470:591c:ffff:ffff:ffff:ffff:ffff,US
2001:470:591d::,2001:470:591d:7fff:ffff:ffff:ffff:ffff,CZ
@@ -338,7 +341,9 @@
2001:470:6b77::,2001:470:6b77:7fff:ffff:ffff:ffff:ffff,GB
2001:470:6b77:8000::,2001:470:6bba:ffff:ffff:ffff:ffff:ffff,US
2001:470:6bbb::,2001:470:6bbb:7fff:ffff:ffff:ffff:ffff,GB
-2001:470:6bbb:8000::,2001:470:6bee:7fff:ffff:ffff:ffff:ffff,US
+2001:470:6bbb:8000::,2001:470:6bd1:ffff:ffff:ffff:ffff:ffff,US
+2001:470:6bd2::,2001:470:6bd2:7fff:ffff:ffff:ffff:ffff,GB
+2001:470:6bd2:8000::,2001:470:6bee:7fff:ffff:ffff:ffff:ffff,US
2001:470:6bee:8000::,2001:470:6bee:ffff:ffff:ffff:ffff:ffff,IN
2001:470:6bef::,2001:470:6c0d:ffff:ffff:ffff:ffff:ffff,US
2001:470:6c0e::,2001:470:6c0e:7fff:ffff:ffff:ffff:ffff,GB
@@ -372,7 +377,9 @@
2001:470:7073:8000::,2001:470:7073:ffff:ffff:ffff:ffff:ffff,DE
2001:470:7074::,2001:470:70a1:7fff:ffff:ffff:ffff:ffff,US
2001:470:70a1:8000::,2001:470:70a1:ffff:ffff:ffff:ffff:ffff,RU
-2001:470:70a2::,2001:470:70aa:ffff:ffff:ffff:ffff:ffff,US
+2001:470:70a2::,2001:470:70a7:ffff:ffff:ffff:ffff:ffff,US
+2001:470:70a8::,2001:470:70a8:7fff:ffff:ffff:ffff:ffff,DE
+2001:470:70a8:8000::,2001:470:70aa:ffff:ffff:ffff:ffff:ffff,US
2001:470:70ab::,2001:470:70ab:7fff:ffff:ffff:ffff:ffff,DE
2001:470:70ab:8000::,2001:470:710f:ffff:ffff:ffff:ffff:ffff,US
2001:470:7110::,2001:470:7110:7fff:ffff:ffff:ffff:ffff,RU
@@ -412,15 +419,11 @@
2001:470:7563:8000::,2001:470:7563:ffff:ffff:ffff:ffff:ffff,UA
2001:470:7564::,2001:470:759e:ffff:ffff:ffff:ffff:ffff,US
2001:470:759f::,2001:470:759f:7fff:ffff:ffff:ffff:ffff,DE
-2001:470:759f:8000::,2001:470:75bf:ffff:ffff:ffff:ffff:ffff,US
-2001:470:75c0::,2001:470:75c0:7fff:ffff:ffff:ffff:ffff,TR
-2001:470:75c0:8000::,2001:470:75c1:ffff:ffff:ffff:ffff:ffff,US
+2001:470:759f:8000::,2001:470:75c1:ffff:ffff:ffff:ffff:ffff,US
2001:470:75c2::,2001:470:75c2:7fff:ffff:ffff:ffff:ffff,DE
2001:470:75c2:8000::,2001:470:75c2:ffff:ffff:ffff:ffff:ffff,US
2001:470:75c3::,2001:470:75c3:7fff:ffff:ffff:ffff:ffff,DE
-2001:470:75c3:8000::,2001:470:75c4:ffff:ffff:ffff:ffff:ffff,US
-2001:470:75c5::,2001:470:75c5:7fff:ffff:ffff:ffff:ffff,DE
-2001:470:75c5:8000::,2001:470:75f0:ffff:ffff:ffff:ffff:ffff,US
+2001:470:75c3:8000::,2001:470:75f0:ffff:ffff:ffff:ffff:ffff,US
2001:470:75f1::,2001:470:75f1:7fff:ffff:ffff:ffff:ffff,DE
2001:470:75f1:8000::,2001:470:7804:ffff:ffff:ffff:ffff:ffff,US
2001:470:7805::,2001:470:7805:7fff:ffff:ffff:ffff:ffff,NL
@@ -430,7 +433,9 @@
2001:470:78ac::,2001:470:78ac:7fff:ffff:ffff:ffff:ffff,NL
2001:470:78ac:8000::,2001:470:78db:ffff:ffff:ffff:ffff:ffff,US
2001:470:78dc::,2001:470:78dc:7fff:ffff:ffff:ffff:ffff,NL
-2001:470:78dc:8000::,2001:470:78e8:ffff:ffff:ffff:ffff:ffff,US
+2001:470:78dc:8000::,2001:470:78e3:ffff:ffff:ffff:ffff:ffff,US
+2001:470:78e4::,2001:470:78e4:7fff:ffff:ffff:ffff:ffff,NL
+2001:470:78e4:8000::,2001:470:78e8:ffff:ffff:ffff:ffff:ffff,US
2001:470:78e9::,2001:470:78e9:7fff:ffff:ffff:ffff:ffff,LV
2001:470:78e9:8000::,2001:470:790c:ffff:ffff:ffff:ffff:ffff,US
2001:470:790d::,2001:470:790d:7fff:ffff:ffff:ffff:ffff,NL
@@ -452,7 +457,9 @@
2001:470:7c15::,2001:470:7c15:7fff:ffff:ffff:ffff:ffff,DE
2001:470:7c15:8000::,2001:470:7c4f:ffff:ffff:ffff:ffff:ffff,US
2001:470:7c50::,2001:470:7c50:7fff:ffff:ffff:ffff:ffff,NL
-2001:470:7c50:8000::,2001:470:7d16:ffff:ffff:ffff:ffff:ffff,US
+2001:470:7c50:8000::,2001:470:7ca1:7fff:ffff:ffff:ffff:ffff,US
+2001:470:7ca1:8000::,2001:470:7ca1:ffff:ffff:ffff:ffff:ffff,NL
+2001:470:7ca2::,2001:470:7d16:ffff:ffff:ffff:ffff:ffff,US
2001:470:7d17::,2001:470:7d17:7fff:ffff:ffff:ffff:ffff,NL
2001:470:7d17:8000::,2001:470:7d59:ffff:ffff:ffff:ffff:ffff,US
2001:470:7d5a::,2001:470:7d5a:7fff:ffff:ffff:ffff:ffff,NL
@@ -490,7 +497,9 @@
2001:470:8c40::,2001:470:8c40:7fff:ffff:ffff:ffff:ffff,CA
2001:470:8c40:8000::,2001:470:8c6b:ffff:ffff:ffff:ffff:ffff,US
2001:470:8c6c::,2001:470:8c6c:7fff:ffff:ffff:ffff:ffff,AU
-2001:470:8c6c:8000::,2001:470:94f2:7fff:ffff:ffff:ffff:ffff,US
+2001:470:8c6c:8000::,2001:470:90a6:ffff:ffff:ffff:ffff:ffff,US
+2001:470:90a7::,2001:470:90a7:7fff:ffff:ffff:ffff:ffff,GB
+2001:470:90a7:8000::,2001:470:94f2:7fff:ffff:ffff:ffff:ffff,US
2001:470:94f2:8000::,2001:470:94f2:ffff:ffff:ffff:ffff:ffff,CZ
2001:470:94f3::,2001:470:9616:ffff:ffff:ffff:ffff:ffff,US
2001:470:9617::,2001:470:9617:7fff:ffff:ffff:ffff:ffff,GB
@@ -530,11 +539,17 @@
2001:470:b24c::,2001:470:b24c:7fff:ffff:ffff:ffff:ffff,DO
2001:470:b24c:8000::,2001:470:b27e:ffff:ffff:ffff:ffff:ffff,US
2001:470:b27f::,2001:470:b27f:7fff:ffff:ffff:ffff:ffff,CA
-2001:470:b27f:8000::,2001:470:b2d9:ffff:ffff:ffff:ffff:ffff,US
+2001:470:b27f:8000::,2001:470:b2a6:ffff:ffff:ffff:ffff:ffff,US
+2001:470:b2a7::,2001:470:b2a7:7fff:ffff:ffff:ffff:ffff,CA
+2001:470:b2a7:8000::,2001:470:b2d4:ffff:ffff:ffff:ffff:ffff,US
+2001:470:b2d5::,2001:470:b2d5:7fff:ffff:ffff:ffff:ffff,CA
+2001:470:b2d5:8000::,2001:470:b2d9:ffff:ffff:ffff:ffff:ffff,US
2001:470:b2da::,2001:470:b2da:7fff:ffff:ffff:ffff:ffff,CA
2001:470:b2da:8000::,2001:470:b30c:ffff:ffff:ffff:ffff:ffff,US
2001:470:b30d::,2001:470:b30d:7fff:ffff:ffff:ffff:ffff,CN
-2001:470:b30d:8000::,2001:470:b336:7fff:ffff:ffff:ffff:ffff,US
+2001:470:b30d:8000::,2001:470:b328:ffff:ffff:ffff:ffff:ffff,US
+2001:470:b329::,2001:470:b329:7fff:ffff:ffff:ffff:ffff,CA
+2001:470:b329:8000::,2001:470:b336:7fff:ffff:ffff:ffff:ffff,US
2001:470:b336:8000::,2001:470:b336:ffff:ffff:ffff:ffff:ffff,CA
2001:470:b337::,2001:470:b34f:ffff:ffff:ffff:ffff:ffff,US
2001:470:b350::,2001:470:b350:7fff:ffff:ffff:ffff:ffff,CA
@@ -562,7 +577,9 @@
2001:470:b626::,2001:470:b626:7fff:ffff:ffff:ffff:ffff,DE
2001:470:b626:8000::,2001:470:b7a4:ffff:ffff:ffff:ffff:ffff,US
2001:470:b7a5::,2001:470:b7a5:7fff:ffff:ffff:ffff:ffff,CH
-2001:470:b7a5:8000::,2001:470:b8e6:ffff:ffff:ffff:ffff:ffff,US
+2001:470:b7a5:8000::,2001:470:b7b6:ffff:ffff:ffff:ffff:ffff,US
+2001:470:b7b7::,2001:470:b7b7:7fff:ffff:ffff:ffff:ffff,AT
+2001:470:b7b7:8000::,2001:470:b8e6:ffff:ffff:ffff:ffff:ffff,US
2001:470:b8e7::,2001:470:b8e7:7fff:ffff:ffff:ffff:ffff,CR
2001:470:b8e7:8000::,2001:470:c17a:ffff:ffff:ffff:ffff:ffff,US
2001:470:c17b::,2001:470:c17b:7fff:ffff:ffff:ffff:ffff,CA
@@ -578,9 +595,7 @@
2001:470:c8f2::,2001:470:c8f2:7fff:ffff:ffff:ffff:ffff,ES
2001:470:c8f2:8000::,2001:470:c9b2:ffff:ffff:ffff:ffff:ffff,US
2001:470:c9b3::,2001:470:c9b3:7fff:ffff:ffff:ffff:ffff,ES
-2001:470:c9b3:8000::,2001:470:cc65:ffff:ffff:ffff:ffff:ffff,US
-2001:470:cc66::,2001:470:cc66:7fff:ffff:ffff:ffff:ffff,NL
-2001:470:cc66:8000::,2001:470:cd93:7fff:ffff:ffff:ffff:ffff,US
+2001:470:c9b3:8000::,2001:470:cd93:7fff:ffff:ffff:ffff:ffff,US
2001:470:cd93:8000::,2001:470:cd93:ffff:ffff:ffff:ffff:ffff,FR
2001:470:cd94::,2001:470:d050:ffff:ffff:ffff:ffff:ffff,US
2001:470:d051::,2001:470:d051:7fff:ffff:ffff:ffff:ffff,NL
@@ -596,7 +611,11 @@
2001:470:d891::,2001:470:d891:7fff:ffff:ffff:ffff:ffff,BR
2001:470:d891:8000::,2001:470:d9cc:ffff:ffff:ffff:ffff:ffff,US
2001:470:d9cd::,2001:470:d9cd:7fff:ffff:ffff:ffff:ffff,DO
-2001:470:d9cd:8000::,2001:470:dc08:ffff:ffff:ffff:ffff:ffff,US
+2001:470:d9cd:8000::,2001:470:db28:ffff:ffff:ffff:ffff:ffff,US
+2001:470:db29::,2001:470:db29:7fff:ffff:ffff:ffff:ffff,DO
+2001:470:db29:8000::,2001:470:dc00:ffff:ffff:ffff:ffff:ffff,US
+2001:470:dc01::,2001:470:dc01:7fff:ffff:ffff:ffff:ffff,SE
+2001:470:dc01:8000::,2001:470:dc08:ffff:ffff:ffff:ffff:ffff,US
2001:470:dc09::,2001:470:dc09:7fff:ffff:ffff:ffff:ffff,SE
2001:470:dc09:8000::,2001:470:dc24:ffff:ffff:ffff:ffff:ffff,US
2001:470:dc25::,2001:470:dc25:7fff:ffff:ffff:ffff:ffff,RU
@@ -825,7 +844,7 @@
2001:504:43::,2001:504:45:ffff:ffff:ffff:ffff:ffff,US
2001:504:46::,2001:504:46:ffff:ffff:ffff:ffff:ffff,CA
2001:504:47::,2001:504:47:ffff:ffff:ffff:ffff:ffff,US
-2001:504:57::,2001:504:57:ffff:ffff:ffff:ffff:ffff,US
+2001:504:57::,2001:504:58:ffff:ffff:ffff:ffff:ffff,US
2001:506::,2001:506:1:ffff:ffff:ffff:ffff:ffff,US
2001:506:8::,2001:506:8:ffff:ffff:ffff:ffff:ffff,US
2001:506:20::,2001:506:20:ffff:ffff:ffff:ffff:ffff,CA
@@ -868,9 +887,7 @@
2001:5a0:3700::,2001:5a0:3700:ff:ffff:ffff:ffff:ffff,CA
2001:5a0:3700:100::,2001:5a0:ffff:ffff:ffff:ffff:ffff:ffff,US
2001:5a8::,2001:5a8:ffff:ffff:ffff:ffff:ffff:ffff,US
-2001:5b0::,2001:5b0:2655:ffff:ffff:ffff:ffff:ffff,US
-2001:5b0:2656::,2001:5b0:2656:7fff:ffff:ffff:ffff:ffff,CA
-2001:5b0:2656:8000::,2001:5b0:ffff:ffff:ffff:ffff:ffff:ffff,US
+2001:5b0::,2001:5b0:ffff:ffff:ffff:ffff:ffff:ffff,US
2001:5b8::,2001:5b8:ffff:ffff:ffff:ffff:ffff:ffff,US
2001:5c0:1000::,2001:5c0:10ff:ffff:ffff:ffff:ffff:ffff,CA
2001:5c0:1100::,2001:5c0:1100::,US
@@ -880,9 +897,7 @@
2001:5c0:1501:8000::,2001:5c0:1501:ffff:ffff:ffff:ffff:ffff,RU
2001:5c0:1502::,2001:5c0:1505:7fff:ffff:ffff:ffff:ffff,CA
2001:5c0:1505:8000::,2001:5c0:1505:ffff:ffff:ffff:ffff:ffff,RU
-2001:5c0:1506::,2001:5c0:1506:ffff:ffff:ffff:ffff:ffff,CA
-2001:5c0:1507::,2001:5c0:1507:7fff:ffff:ffff:ffff:ffff,RU
-2001:5c0:1507:8000::,2001:5c0:1508:7fff:ffff:ffff:ffff:ffff,CA
+2001:5c0:1506::,2001:5c0:1508:7fff:ffff:ffff:ffff:ffff,CA
2001:5c0:1508:8000::,2001:5c0:1508:ffff:ffff:ffff:ffff:ffff,ES
2001:5c0:1509::,2001:5c0:1fff:ffff:ffff:ffff:ffff:ffff,CA
2001:5c8::,2001:5c8:ffff:ffff:ffff:ffff:ffff:ffff,US
@@ -958,7 +973,16 @@
2001:678:9c::,2001:678:9c:ffff:ffff:ffff:ffff:ffff,SK
2001:678:a0::,2001:678:a0:ffff:ffff:ffff:ffff:ffff,FI
2001:678:a4::,2001:678:a4:ffff:ffff:ffff:ffff:ffff,AT
+2001:678:a8::,2001:678:a8:ffff:ffff:ffff:ffff:ffff,NL
+2001:678:ac::,2001:678:ac:ffff:ffff:ffff:ffff:ffff,SE
2001:678:b0::,2001:678:b3:ffff:ffff:ffff:ffff:ffff,IR
+2001:678:c0::,2001:678:c0:ffff:ffff:ffff:ffff:ffff,DE
+2001:678:c4::,2001:678:c4:ffff:ffff:ffff:ffff:ffff,DE
+2001:678:c8::,2001:678:c8:ffff:ffff:ffff:ffff:ffff,UA
+2001:678:cc::,2001:678:cc:ffff:ffff:ffff:ffff:ffff,SA
+2001:678:d0::,2001:678:d0:ffff:ffff:ffff:ffff:ffff,NL
+2001:678:d4::,2001:678:d4:ffff:ffff:ffff:ffff:ffff,IT
+2001:678:d8::,2001:678:d8:ffff:ffff:ffff:ffff:ffff,LV
2001:67c::,2001:67c::ffff:ffff:ffff:ffff:ffff,IE
2001:67c:4::,2001:67c:4:ffff:ffff:ffff:ffff:ffff,DE
2001:67c:8::,2001:67c:8:ffff:ffff:ffff:ffff:ffff,CH
@@ -1330,6 +1354,7 @@
2001:67c:5e8::,2001:67c:5e8:ffff:ffff:ffff:ffff:ffff,UA
2001:67c:5ec::,2001:67c:5ec:ffff:ffff:ffff:ffff:ffff,DE
2001:67c:5f0::,2001:67c:5f0:ffff:ffff:ffff:ffff:ffff,SI
+2001:67c:5f4::,2001:67c:5f4:ffff:ffff:ffff:ffff:ffff,SE
2001:67c:5f8::,2001:67c:5f8:ffff:ffff:ffff:ffff:ffff,NL
2001:67c:5fc::,2001:67c:5fc:ffff:ffff:ffff:ffff:ffff,AT
2001:67c:600::,2001:67c:600:ffff:ffff:ffff:ffff:ffff,PL
@@ -1463,9 +1488,11 @@
2001:67c:1034::,2001:67c:1034:ffff:ffff:ffff:ffff:ffff,RO
2001:67c:1038::,2001:67c:1038:ffff:ffff:ffff:ffff:ffff,RO
2001:67c:103c::,2001:67c:103c:ffff:ffff:ffff:ffff:ffff,CZ
+2001:67c:1040::,2001:67c:1040:ffff:ffff:ffff:ffff:ffff,DE
2001:67c:1044::,2001:67c:1044:ffff:ffff:ffff:ffff:ffff,CH
2001:67c:1048::,2001:67c:1048:ffff:ffff:ffff:ffff:ffff,GB
2001:67c:104c::,2001:67c:104c:ffff:ffff:ffff:ffff:ffff,NL
+2001:67c:1050::,2001:67c:1050:ffff:ffff:ffff:ffff:ffff,SK
2001:67c:1054::,2001:67c:1054:ffff:ffff:ffff:ffff:ffff,DE
2001:67c:1058::,2001:67c:1058:ffff:ffff:ffff:ffff:ffff,NL
2001:67c:105c::,2001:67c:105c:ffff:ffff:ffff:ffff:ffff,GB
@@ -1658,6 +1685,7 @@
2001:67c:1398::,2001:67c:1398:ffff:ffff:ffff:ffff:ffff,SE
2001:67c:139c::,2001:67c:139c:ffff:ffff:ffff:ffff:ffff,AT
2001:67c:13a0::,2001:67c:13a0:ffff:ffff:ffff:ffff:ffff,UA
+2001:67c:13a4::,2001:67c:13a4:ffff:ffff:ffff:ffff:ffff,RO
2001:67c:13a8::,2001:67c:13a8:ffff:ffff:ffff:ffff:ffff,GB
2001:67c:13ac::,2001:67c:13ac:ffff:ffff:ffff:ffff:ffff,FI
2001:67c:13b0::,2001:67c:13b0:ffff:ffff:ffff:ffff:ffff,DE
@@ -1734,6 +1762,7 @@
2001:67c:1570::,2001:67c:1570:ffff:ffff:ffff:ffff:ffff,RU
2001:67c:1574::,2001:67c:1574:ffff:ffff:ffff:ffff:ffff,RU
2001:67c:1578::,2001:67c:1578:ffff:ffff:ffff:ffff:ffff,CZ
+2001:67c:157c::,2001:67c:157c:ffff:ffff:ffff:ffff:ffff,FR
2001:67c:1580::,2001:67c:1580:ffff:ffff:ffff:ffff:ffff,CH
2001:67c:1584::,2001:67c:1584:ffff:ffff:ffff:ffff:ffff,UA
2001:67c:1588::,2001:67c:1588:ffff:ffff:ffff:ffff:ffff,UA
@@ -1859,6 +1888,7 @@
2001:67c:1808::,2001:67c:1809:ffff:ffff:ffff:ffff:ffff,BE
2001:67c:1810::,2001:67c:1810:ffff:ffff:ffff:ffff:ffff,BE
2001:67c:1814::,2001:67c:1814:ffff:ffff:ffff:ffff:ffff,FR
+2001:67c:1818::,2001:67c:1818:ffff:ffff:ffff:ffff:ffff,CH
2001:67c:181c::,2001:67c:181c:ffff:ffff:ffff:ffff:ffff,DE
2001:67c:1820::,2001:67c:1820:ffff:ffff:ffff:ffff:ffff,DE
2001:67c:1824::,2001:67c:1824:ffff:ffff:ffff:ffff:ffff,IS
@@ -2009,6 +2039,7 @@
2001:67c:1ba4::,2001:67c:1ba4:ffff:ffff:ffff:ffff:ffff,SE
2001:67c:1ba8::,2001:67c:1ba8:ffff:ffff:ffff:ffff:ffff,DE
2001:67c:1bac::,2001:67c:1bac:ffff:ffff:ffff:ffff:ffff,GB
+2001:67c:1bb0::,2001:67c:1bb0:ffff:ffff:ffff:ffff:ffff,FI
2001:67c:1bb4::,2001:67c:1bb4:ffff:ffff:ffff:ffff:ffff,RO
2001:67c:1bb8::,2001:67c:1bb8:ffff:ffff:ffff:ffff:ffff,SE
2001:67c:1bbc::,2001:67c:1bbc:ffff:ffff:ffff:ffff:ffff,NL
@@ -2112,6 +2143,7 @@
2001:67c:214c::,2001:67c:214c:ffff:ffff:ffff:ffff:ffff,DE
2001:67c:2150::,2001:67c:2150:ffff:ffff:ffff:ffff:ffff,NL
2001:67c:2154::,2001:67c:2154:ffff:ffff:ffff:ffff:ffff,BG
+2001:67c:2158::,2001:67c:2158:7fff:ffff:ffff:ffff:ffff,PL
2001:67c:2158:8000::,2001:67c:2158:ffff:ffff:ffff:ffff:ffff,RU
2001:67c:215c::,2001:67c:215c:ffff:ffff:ffff:ffff:ffff,RU
2001:67c:2160::,2001:67c:2160:ffff:ffff:ffff:ffff:ffff,FR
@@ -2829,6 +2861,7 @@
2001:67c:2da8::,2001:67c:2da8:ffff:ffff:ffff:ffff:ffff,DE
2001:67c:2dac::,2001:67c:2dac:ffff:ffff:ffff:ffff:ffff,DE
2001:67c:2db0::,2001:67c:2db0:ffff:ffff:ffff:ffff:ffff,IT
+2001:67c:2db4::,2001:67c:2db4:ffff:ffff:ffff:ffff:ffff,PL
2001:67c:2db8::,2001:67c:2db8:ffff:ffff:ffff:ffff:ffff,MD
2001:67c:2dbc::,2001:67c:2dbc:ffff:ffff:ffff:ffff:ffff,IL
2001:67c:2dc0::,2001:67c:2dc0:ffff:ffff:ffff:ffff:ffff,LI
@@ -2840,7 +2873,6 @@
2001:67c:2dd8::,2001:67c:2dd8:ffff:ffff:ffff:ffff:ffff,SI
2001:67c:2ddc::,2001:67c:2ddc:ffff:ffff:ffff:ffff:ffff,PL
2001:67c:2de0::,2001:67c:2de0:ffff:ffff:ffff:ffff:ffff,SI
-2001:67c:2de4::,2001:67c:2de4:ffff:ffff:ffff:ffff:ffff,CH
2001:67c:2de8::,2001:67c:2de8:ffff:ffff:ffff:ffff:ffff,CH
2001:67c:2dec::,2001:67c:2dec:ffff:ffff:ffff:ffff:ffff,RU
2001:67c:2df0::,2001:67c:2df0:ffff:ffff:ffff:ffff:ffff,BG
@@ -2863,6 +2895,7 @@
2001:67c:2e38::,2001:67c:2e38:ffff:ffff:ffff:ffff:ffff,CH
2001:67c:2e3c::,2001:67c:2e3c:ffff:ffff:ffff:ffff:ffff,PL
2001:67c:2e40::,2001:67c:2e40:ffff:ffff:ffff:ffff:ffff,RU
+2001:67c:2e44::,2001:67c:2e44:ffff:ffff:ffff:ffff:ffff,SI
2001:67c:2e48::,2001:67c:2e48:ffff:ffff:ffff:ffff:ffff,SE
2001:67c:2e4c::,2001:67c:2e4c:ffff:ffff:ffff:ffff:ffff,RU
2001:67c:2e50::,2001:67c:2e50:ffff:ffff:ffff:ffff:ffff,PL
@@ -2914,6 +2947,15 @@
2001:67c:2f10::,2001:67c:2f10:ffff:ffff:ffff:ffff:ffff,UA
2001:67c:2f14::,2001:67c:2f14:ffff:ffff:ffff:ffff:ffff,DE
2001:67c:2f18::,2001:67c:2f18:ffff:ffff:ffff:ffff:ffff,CZ
+2001:67c:2f1c::,2001:67c:2f1c:ffff:ffff:ffff:ffff:ffff,GB
+2001:67c:2f20::,2001:67c:2f20:ffff:ffff:ffff:ffff:ffff,DE
+2001:67c:2f24::,2001:67c:2f24:ffff:ffff:ffff:ffff:ffff,HR
+2001:67c:2f28::,2001:67c:2f28:ffff:ffff:ffff:ffff:ffff,PL
+2001:67c:2f2c::,2001:67c:2f2c:ffff:ffff:ffff:ffff:ffff,SE
+2001:67c:2f30::,2001:67c:2f30:ffff:ffff:ffff:ffff:ffff,DE
+2001:67c:2f34::,2001:67c:2f34:ffff:ffff:ffff:ffff:ffff,AT
+2001:67c:2f38::,2001:67c:2f38:ffff:ffff:ffff:ffff:ffff,GB
+2001:67c:2f3c::,2001:67c:2f3c:ffff:ffff:ffff:ffff:ffff,GB
2001:680::,2001:680:ffff:ffff:ffff:ffff:ffff:ffff,DE
2001:688::,2001:688:ffff:ffff:ffff:ffff:ffff:ffff,FR
2001:690::,2001:697:ffff:ffff:ffff:ffff:ffff:ffff,PT
@@ -3013,6 +3055,7 @@
2001:7f8:13::,2001:7f8:13:ffff:ffff:ffff:ffff:ffff,NL
2001:7f8:14::,2001:7f8:14:ffff:ffff:ffff:ffff:ffff,CZ
2001:7f8:15::,2001:7f8:15:ffff:ffff:ffff:ffff:ffff,EE
+2001:7f8:16::,2001:7f8:16:ffff:ffff:ffff:ffff:ffff,LV
2001:7f8:17::,2001:7f8:17:ffff:ffff:ffff:ffff:ffff,GB
2001:7f8:18::,2001:7f8:18:ffff:ffff:ffff:ffff:ffff,IE
2001:7f8:19::,2001:7f8:19:ffff:ffff:ffff:ffff:ffff,DE
@@ -3135,7 +3178,8 @@
2001:7f8:99::,2001:7f8:99:ffff:ffff:ffff:ffff:ffff,FR
2001:7f8:9a::,2001:7f8:9a:ffff:ffff:ffff:ffff:ffff,RU
2001:7f8:9b::,2001:7f8:9b:ffff:ffff:ffff:ffff:ffff,PL
-2001:7f8:9c::,2001:7f8:9c:ffff:ffff:ffff:ffff:ffff,DE
+2001:7f8:9c::,2001:7f8:9e:ffff:ffff:ffff:ffff:ffff,DE
+2001:7f8:9f::,2001:7f8:9f:ffff:ffff:ffff:ffff:ffff,BG
2001:7fa:0:1::,2001:7fa::1:ffff:ffff:ffff:ffff,HK
2001:7fa:0:2::,2001:7fa::2:ffff:ffff:ffff:ffff,KR
2001:7fa:0:3::,2001:7fa::3:ffff:ffff:ffff:ffff,JP
@@ -3170,7 +3214,11 @@
2001:888::,2001:88f:ffff:ffff:ffff:ffff:ffff:ffff,NL
2001:890::,2001:891:ffff:ffff:ffff:ffff:ffff:ffff,AT
2001:898::,2001:89f:ffff:ffff:ffff:ffff:ffff:ffff,NL
-2001:8a0::,2001:8a7:ffff:ffff:ffff:ffff:ffff:ffff,PT
+2001:8a0::,2001:8a0:5f5e:ffff:ffff:ffff:ffff:ffff,PT
+2001:8a0:5f5f::,2001:8a0:5f5f:7fff:ffff:ffff:ffff:ffff,DE
+2001:8a0:5f5f:8000::,2001:8a0:ddae:7fff:ffff:ffff:ffff:ffff,PT
+2001:8a0:ddae:8000::,2001:8a0:ddae:ffff:ffff:ffff:ffff:ffff,AU
+2001:8a0:ddaf::,2001:8a7:ffff:ffff:ffff:ffff:ffff:ffff,PT
2001:8a8::,2001:8a8:ffff:ffff:ffff:ffff:ffff:ffff,CH
2001:8b0::,2001:8b0:ffff:ffff:ffff:ffff:ffff:ffff,GB
2001:8b8::,2001:8bf:ffff:ffff:ffff:ffff:ffff:ffff,FI
@@ -3221,7 +3269,9 @@
2001:978:2300::,2001:978:2300:7fff:ffff:ffff:ffff:ffff,GB
2001:978:2300:8000::,2001:978:29ff:ffff:ffff:ffff:ffff:ffff,DE
2001:978:2a00::,2001:978:2a00:ffff:ffff:ffff:ffff:ffff,IE
-2001:978:2a01::,2001:978:ffff:ffff:ffff:ffff:ffff:ffff,DE
+2001:978:2a01::,2001:978:3bff:ffff:ffff:ffff:ffff:ffff,DE
+2001:978:3c00::,2001:978:3c00:7fff:ffff:ffff:ffff:ffff,NL
+2001:978:3c00:8000::,2001:978:ffff:ffff:ffff:ffff:ffff:ffff,DE
2001:980::,2001:984:645a:ffff:ffff:ffff:ffff:ffff,NL
2001:984:645b::,2001:984:645b:7fff:ffff:ffff:ffff:ffff,US
2001:984:645b:8000::,2001:987:ffff:ffff:ffff:ffff:ffff:ffff,NL
@@ -3345,7 +3395,9 @@
2001:d58::,2001:d58:ffff:ffff:ffff:ffff:ffff:ffff,TW
2001:d68::,2001:d68:ffff:ffff:ffff:ffff:ffff:ffff,ID
2001:d70::,2001:d73:ffff:ffff:ffff:ffff:ffff:ffff,JP
-2001:d80::,2001:d80:ffff:ffff:ffff:ffff:ffff:ffff,JP
+2001:d80::,2001:d80:e07f:ffff:ffff:ffff:ffff:ffff,JP
+2001:d80:e080::,2001:d80:e080:7fff:ffff:ffff:ffff:ffff,CN
+2001:d80:e080:8000::,2001:d80:ffff:ffff:ffff:ffff:ffff:ffff,JP
2001:d88::,2001:d88:ffff:ffff:ffff:ffff:ffff:ffff,JP
2001:d90::,2001:d90:ffff:ffff:ffff:ffff:ffff:ffff,JP
2001:d98::,2001:d98:ffff:ffff:ffff:ffff:ffff:ffff,SG
@@ -3795,17 +3847,27 @@
2001:df0:46a::,2001:df0:46a:ffff:ffff:ffff:ffff:ffff,ID
2001:df0:46b::,2001:df0:46b:ffff:ffff:ffff:ffff:ffff,MY
2001:df0:46c::,2001:df0:46c:ffff:ffff:ffff:ffff:ffff,ID
-2001:df0:500::,2001:df0:5ff:ffff:ffff:ffff:ffff:ffff,AU
+2001:df0:500::,2001:df0:600:ffff:ffff:ffff:ffff:ffff,AU
2001:df0:800::,2001:df0:800:ffff:ffff:ffff:ffff:ffff,ID
+2001:df0:a00::,2001:df0:a00:ffff:ffff:ffff:ffff:ffff,ID
2001:df0:c00::,2001:df0:c00:ffff:ffff:ffff:ffff:ffff,MY
+2001:df0:e00::,2001:df0:e00:ffff:ffff:ffff:ffff:ffff,ID
2001:df0:1000::,2001:df0:1000:ffff:ffff:ffff:ffff:ffff,TH
+2001:df0:1200::,2001:df0:1200:ffff:ffff:ffff:ffff:ffff,IN
2001:df0:1400::,2001:df0:1400:ffff:ffff:ffff:ffff:ffff,SG
+2001:df0:1600::,2001:df0:1600:ffff:ffff:ffff:ffff:ffff,AU
2001:df0:1800::,2001:df0:1800:ffff:ffff:ffff:ffff:ffff,JP
+2001:df0:1a00::,2001:df0:1a00:ffff:ffff:ffff:ffff:ffff,IN
2001:df0:1c00::,2001:df0:1c00:ffff:ffff:ffff:ffff:ffff,AU
+2001:df0:1e00::,2001:df0:1e00:ffff:ffff:ffff:ffff:ffff,AU
2001:df0:2000::,2001:df0:2000:ffff:ffff:ffff:ffff:ffff,AU
+2001:df0:2200::,2001:df0:2200:ffff:ffff:ffff:ffff:ffff,IN
2001:df0:2400::,2001:df0:2400:ffff:ffff:ffff:ffff:ffff,SG
+2001:df0:2600::,2001:df0:2600:ffff:ffff:ffff:ffff:ffff,ID
2001:df0:2800::,2001:df0:2800:ffff:ffff:ffff:ffff:ffff,AU
+2001:df0:2a00::,2001:df0:2a00:ffff:ffff:ffff:ffff:ffff,VN
2001:df0:2c00::,2001:df0:2c00:ffff:ffff:ffff:ffff:ffff,AU
+2001:df0:2e00::,2001:df0:2e00:ffff:ffff:ffff:ffff:ffff,CN
2001:df0:3000::,2001:df0:3000:ffff:ffff:ffff:ffff:ffff,PH
2001:df0:3800::,2001:df0:3800:ffff:ffff:ffff:ffff:ffff,MY
2001:df0:3c00::,2001:df0:3c00:ffff:ffff:ffff:ffff:ffff,AU
@@ -3929,7 +3991,6 @@
2001:df2:3400::,2001:df2:3400:ffff:ffff:ffff:ffff:ffff,NZ
2001:df2:3800::,2001:df2:3800:ffff:ffff:ffff:ffff:ffff,TH
2001:df2:3c00::,2001:df2:3c07:ffff:ffff:ffff:ffff:ffff,AU
-2001:df2:4000::,2001:df2:4000:ffff:ffff:ffff:ffff:ffff,HK
2001:df2:4400::,2001:df2:4400:ffff:ffff:ffff:ffff:ffff,AU
2001:df2:4c00::,2001:df2:4c00:ffff:ffff:ffff:ffff:ffff,ID
2001:df2:5000::,2001:df2:5000:ffff:ffff:ffff:ffff:ffff,IN
@@ -4132,7 +4193,6 @@
2001:df5:8800::,2001:df5:8800:ffff:ffff:ffff:ffff:ffff,IN
2001:df5:8c00::,2001:df5:8c00:ffff:ffff:ffff:ffff:ffff,AU
2001:df5:9000::,2001:df5:9000:ffff:ffff:ffff:ffff:ffff,IN
-2001:df5:9400::,2001:df5:9400:ffff:ffff:ffff:ffff:ffff,CN
2001:df5:9800::,2001:df5:9800:ffff:ffff:ffff:ffff:ffff,SG
2001:df5:9c00::,2001:df5:9c00:ffff:ffff:ffff:ffff:ffff,ID
2001:df5:a000::,2001:df5:a000:ffff:ffff:ffff:ffff:ffff,ID
@@ -4265,14 +4325,23 @@
2001:df7:b000::,2001:df7:b000:ffff:ffff:ffff:ffff:ffff,IN
2001:df7:b400::,2001:df7:b400:ffff:ffff:ffff:ffff:ffff,ID
2001:df7:b800::,2001:df7:b800:ffff:ffff:ffff:ffff:ffff,SG
+2001:df7:bc00::,2001:df7:bc00:ffff:ffff:ffff:ffff:ffff,ID
2001:df7:c000::,2001:df7:c003:ffff:ffff:ffff:ffff:ffff,SG
+2001:df7:c400::,2001:df7:c400:ffff:ffff:ffff:ffff:ffff,NZ
2001:df7:c800::,2001:df7:c800:ffff:ffff:ffff:ffff:ffff,IN
+2001:df7:cc00::,2001:df7:cc00:ffff:ffff:ffff:ffff:ffff,VN
2001:df7:d000::,2001:df7:d000:ffff:ffff:ffff:ffff:ffff,BD
+2001:df7:d400::,2001:df7:d400:ffff:ffff:ffff:ffff:ffff,AU
2001:df7:d800::,2001:df7:d800:ffff:ffff:ffff:ffff:ffff,AU
+2001:df7:dc00::,2001:df7:dc00:ffff:ffff:ffff:ffff:ffff,TH
2001:df7:e000::,2001:df7:e000:ffff:ffff:ffff:ffff:ffff,IN
+2001:df7:e400::,2001:df7:e400:ffff:ffff:ffff:ffff:ffff,IN
2001:df7:e800::,2001:df7:e800:ffff:ffff:ffff:ffff:ffff,AU
+2001:df7:ec00::,2001:df7:ec00:ffff:ffff:ffff:ffff:ffff,AU
2001:df7:f000::,2001:df7:f000:ffff:ffff:ffff:ffff:ffff,JP
+2001:df7:f400::,2001:df7:f400:ffff:ffff:ffff:ffff:ffff,IN
2001:df7:f800::,2001:df7:f800:ffff:ffff:ffff:ffff:ffff,IN
+2001:df7:fc00::,2001:df7:fc00:ffff:ffff:ffff:ffff:ffff,SG
2001:df8::,2001:df8:ffff:ffff:ffff:ffff:ffff:ffff,US
2001:df9::,2001:df9:ffff:ffff:ffff:ffff:ffff:ffff,ID
2001:dfa::,2001:dfa:ffff:ffff:ffff:ffff:ffff:ffff,JP
@@ -4300,7 +4369,6 @@
2001:eb0::,2001:eb0:ffff:ffff:ffff:ffff:ffff:ffff,HK
2001:eb8::,2001:eb8:ffff:ffff:ffff:ffff:ffff:ffff,KR
2001:ec0::,2001:ec0:ffff:ffff:ffff:ffff:ffff:ffff,TH
-2001:ec8::,2001:ec8:ffff:ffff:ffff:ffff:ffff:ffff,PH
2001:ed0::,2001:ed0:ffff:ffff:ffff:ffff:ffff:ffff,KR
2001:ed8::,2001:ed8:ffff:ffff:ffff:ffff:ffff:ffff,TW
2001:ee0::,2001:ee0:ffff:ffff:ffff:ffff:ffff:ffff,VN
@@ -4483,7 +4551,9 @@
2001:15b8::,2001:15b8:ffff:ffff:ffff:ffff:ffff:ffff,NL
2001:15c0::,2001:15c0:65ff:7fff:ffff:ffff:ffff:ffff,SI
2001:15c0:65ff:8000::,2001:15c0:65ff:ffff:ffff:ffff:ffff:ffff,AT
-2001:15c0:6600::,2001:15c0:66a2:ffff:ffff:ffff:ffff:ffff,SI
+2001:15c0:6600::,2001:15c0:665e:ffff:ffff:ffff:ffff:ffff,SI
+2001:15c0:665f::,2001:15c0:665f:7fff:ffff:ffff:ffff:ffff,AT
+2001:15c0:665f:8000::,2001:15c0:66a2:ffff:ffff:ffff:ffff:ffff,SI
2001:15c0:66a3::,2001:15c0:66a3:7fff:ffff:ffff:ffff:ffff,RO
2001:15c0:66a3:8000::,2001:15c0:67cc:ffff:ffff:ffff:ffff:ffff,SI
2001:15c0:67cd::,2001:15c0:67cd:7fff:ffff:ffff:ffff:ffff,AT
@@ -4530,7 +4600,9 @@
2001:16d8:dd00::,2001:16d8:dd00:ffff:ffff:ffff:ffff:ffff,DK
2001:16d8:dd01::,2001:16d8:dd72:ffff:ffff:ffff:ffff:ffff,SE
2001:16d8:dd73::,2001:16d8:dd73:7fff:ffff:ffff:ffff:ffff,DK
-2001:16d8:dd73:8000::,2001:16d8:dda3:ffff:ffff:ffff:ffff:ffff,SE
+2001:16d8:dd73:8000::,2001:16d8:dd84:ffff:ffff:ffff:ffff:ffff,SE
+2001:16d8:dd85::,2001:16d8:dd85:7fff:ffff:ffff:ffff:ffff,DK
+2001:16d8:dd85:8000::,2001:16d8:dda3:ffff:ffff:ffff:ffff:ffff,SE
2001:16d8:dda4::,2001:16d8:dda4:7fff:ffff:ffff:ffff:ffff,DK
2001:16d8:dda4:8000::,2001:16d8:ddc1:ffff:ffff:ffff:ffff:ffff,SE
2001:16d8:ddc2::,2001:16d8:ddc2:7fff:ffff:ffff:ffff:ffff,DK
@@ -4565,9 +4637,7 @@
2001:1868::,2001:1868:ffff:ffff:ffff:ffff:ffff:ffff,US
2001:1878::,2001:1878:ffff:ffff:ffff:ffff:ffff:ffff,US
2001:1888::,2001:1888:ffff:ffff:ffff:ffff:ffff:ffff,US
-2001:1890::,2001:1890:e000:3fff:ffff:ffff:ffff:ffff,US
-2001:1890:e000:4000::,2001:1890:e000:7fff:ffff:ffff:ffff:ffff,CA
-2001:1890:e000:8000::,2001:1898:ffff:ffff:ffff:ffff:ffff:ffff,US
+2001:1890::,2001:1898:ffff:ffff:ffff:ffff:ffff:ffff,US
2001:18a0::,2001:18a0:ffff:ffff:ffff:ffff:ffff:ffff,US
2001:18a8::,2001:18a8:ffff:ffff:ffff:ffff:ffff:ffff,US
2001:18b0::,2001:18b0:ffff:ffff:ffff:ffff:ffff:ffff,US
@@ -4633,7 +4703,7 @@
2001:19f0:7800:4001::,2001:19f0:ffff:ffff:ffff:ffff:ffff:ffff,US
2001:19f8::,2001:19f8:ffff:ffff:ffff:ffff:ffff:ffff,US
2001:1a08::,2001:1a08:ffff:ffff:ffff:ffff:ffff:ffff,GB
-2001:1a10::,2001:1a10:ffff:ffff:ffff:ffff:ffff:ffff,QA
+2001:1a10::,2001:1a17:ffff:ffff:ffff:ffff:ffff:ffff,QA
2001:1a18::,2001:1a18:ffff:ffff:ffff:ffff:ffff:ffff,CY
2001:1a20::,2001:1a20:ffff:ffff:ffff:ffff:ffff:ffff,GB
2001:1a28::,2001:1a28:ffff:ffff:ffff:ffff:ffff:ffff,DE
@@ -4699,37 +4769,34 @@
2001:2002:2f9:8000::,2001:2002:2f9:ffff:ffff:ffff:ffff:ffff,SE
2001:2002:3e14:8000::,2001:2002:3e14:ffff:ffff:ffff:ffff:ffff,SE
2001:2002:4e42::,2001:2002:4e42:7fff:ffff:ffff:ffff:ffff,SE
-2001:2002:4e43:8000::,2001:2002:4e44:7fff:ffff:ffff:ffff:ffff,SE
+2001:2002:4e43::,2001:2002:4e44:7fff:ffff:ffff:ffff:ffff,SE
2001:2002:4e45::,2001:2002:4e45:7fff:ffff:ffff:ffff:ffff,SE
-2001:2002:4e46::,2001:2002:4e46:7fff:ffff:ffff:ffff:ffff,SE
2001:2002:4e48::,2001:2002:4e48:afff:ffff:ffff:ffff:ffff,SE
2001:2002:4e49::,2001:2002:4e49:ffff:ffff:ffff:ffff:ffff,SE
-2001:2002:51e0:8000::,2001:2002:51e2:7fff:ffff:ffff:ffff:ffff,SE
+2001:2002:51e0::,2001:2002:51e1:7fff:ffff:ffff:ffff:ffff,SE
+2001:2002:51e2::,2001:2002:51e2:7fff:ffff:ffff:ffff:ffff,SE
2001:2002:51e3::,2001:2002:51e5:7fff:ffff:ffff:ffff:ffff,SE
2001:2002:51e6::,2001:2002:51e6:7fff:ffff:ffff:ffff:ffff,SE
-2001:2002:51e7::,2001:2002:51e9:7fff:ffff:ffff:ffff:ffff,SE
-2001:2002:51eb::,2001:2002:51eb:7fff:ffff:ffff:ffff:ffff,SE
+2001:2002:51e7::,2001:2002:51e9:ffff:ffff:ffff:ffff:ffff,SE
+2001:2002:51eb::,2001:2002:51eb:ffff:ffff:ffff:ffff:ffff,SE
2001:2002:51ec:8000::,2001:2002:51ec:ffff:ffff:ffff:ffff:ffff,SE
2001:2002:51ed:8000::,2001:2002:51ed:ffff:ffff:ffff:ffff:ffff,SE
-2001:2002:5ae0:8000::,2001:2002:5ae1:7fff:ffff:ffff:ffff:ffff,SE
+2001:2002:5ae0::,2001:2002:5ae1:7fff:ffff:ffff:ffff:ffff,SE
2001:2002:5ae2::,2001:2002:5ae3:ffff:ffff:ffff:ffff:ffff,SE
2001:2002:5ae4:8000::,2001:2002:5ae4:ffff:ffff:ffff:ffff:ffff,SE
-2001:2002:5ae5:8000::,2001:2002:5ae6:7fff:ffff:ffff:ffff:ffff,SE
-2001:2002:5ae7:8000::,2001:2002:5ae7:ffff:ffff:ffff:ffff:ffff,SE
+2001:2002:5ae5:8000::,2001:2002:5ae6:ffff:ffff:ffff:ffff:ffff,SE
2001:2002:c2ec:8000::,2001:2002:c2ec:ffff:ffff:ffff:ffff:ffff,SE
2001:2002:c343:8000::,2001:2002:c343:ffff:ffff:ffff:ffff:ffff,SE
2001:2002:c3c6::,2001:2002:c3c6:7fff:ffff:ffff:ffff:ffff,SE
2001:2002:c3fc::,2001:2002:c3fc:7fff:ffff:ffff:ffff:ffff,SE
-2001:2002:d540::,2001:2002:d540:7fff:ffff:ffff:ffff:ffff,SE
2001:2002:d541::,2001:2002:d541:ffff:ffff:ffff:ffff:ffff,SE
-2001:2002:d542:8000::,2001:2002:d543:7fff:ffff:ffff:ffff:ffff,SE
-2001:2002:d9d0::,2001:2002:d9d0:ffff:ffff:ffff:ffff:ffff,SE
-2001:2002:d9d1:8000::,2001:2002:d9d1:ffff:ffff:ffff:ffff:ffff,SE
-2001:2002:d9d2:8000::,2001:2002:d9d3:ffff:ffff:ffff:ffff:ffff,SE
+2001:2002:d543::,2001:2002:d543:ffff:ffff:ffff:ffff:ffff,SE
+2001:2002:d9d0::,2001:2002:d9d0:7fff:ffff:ffff:ffff:ffff,SE
+2001:2002:d9d2::,2001:2002:d9d3:ffff:ffff:ffff:ffff:ffff,SE
2001:2002:d9d4:8000::,2001:2002:d9d4:ffff:ffff:ffff:ffff:ffff,SE
2001:2002:d9d7::,2001:2002:d9d7:ffff:ffff:ffff:ffff:ffff,SE
2001:2003:50dc::,2001:2003:50df:7fff:ffff:ffff:ffff:ffff,FI
-2001:2003:54f8::,2001:2003:54fb:ffff:ffff:ffff:ffff:ffff,FI
+2001:2003:54f8:4000::,2001:2003:54fb:ffff:ffff:ffff:ffff:ffff,FI
2001:2003:58c0::,2001:2003:58c1:ffff:ffff:ffff:ffff:ffff,FI
2001:2003:58c3::,2001:2003:58c3:ffff:ffff:ffff:ffff:ffff,FI
2001:2003:f042:8000::,2001:2003:f042:ffff:ffff:ffff:ffff:ffff,FI
@@ -4738,6 +4805,7 @@
2001:2003:f0ab::,2001:2003:f0ab:7fff:ffff:ffff:ffff:ffff,FI
2001:2003:f0b6::,2001:2003:f0b6:7fff:ffff:ffff:ffff:ffff,FI
2001:2003:f0e5:8000::,2001:2003:f0e5:ffff:ffff:ffff:ffff:ffff,FI
+2001:2003:f13d:8000::,2001:2003:f13d:ffff:ffff:ffff:ffff:ffff,FI
2001:2003:f19b::,2001:2003:f19b:7fff:ffff:ffff:ffff:ffff,FI
2001:2003:f19c:8000::,2001:2003:f19c:ffff:ffff:ffff:ffff:ffff,FI
2001:2003:f21a::,2001:2003:f21a:7fff:ffff:ffff:ffff:ffff,FI
@@ -4754,14 +4822,19 @@
2001:2003:f44a:8000::,2001:2003:f44a:ffff:ffff:ffff:ffff:ffff,FI
2001:2003:f45a::,2001:2003:f45a:7fff:ffff:ffff:ffff:ffff,FI
2001:2003:f468:8000::,2001:2003:f468:ffff:ffff:ffff:ffff:ffff,FI
+2001:2003:f46d:8000::,2001:2003:f46d:ffff:ffff:ffff:ffff:ffff,FI
2001:2003:f476::,2001:2003:f476:7fff:ffff:ffff:ffff:ffff,FI
2001:2003:f48c:8000::,2001:2003:f48c:ffff:ffff:ffff:ffff:ffff,FI
2001:2003:f4a6:8000::,2001:2003:f4a6:ffff:ffff:ffff:ffff:ffff,FI
2001:2003:f543::,2001:2003:f543:7fff:ffff:ffff:ffff:ffff,FI
2001:2003:f5dc::,2001:2003:f5dc:7fff:ffff:ffff:ffff:ffff,FI
+2001:2003:f617::,2001:2003:f617:7fff:ffff:ffff:ffff:ffff,FI
+2001:2003:f620::,2001:2003:f620:7fff:ffff:ffff:ffff:ffff,FI
2001:2003:f639::,2001:2003:f639:7fff:ffff:ffff:ffff:ffff,FI
+2001:2003:f662::,2001:2003:f662:7fff:ffff:ffff:ffff:ffff,FI
2001:2003:f67c:8000::,2001:2003:f67c:ffff:ffff:ffff:ffff:ffff,FI
2001:2003:f6a9:8000::,2001:2003:f6a9:ffff:ffff:ffff:ffff:ffff,FI
+2001:2003:f6ba::,2001:2003:f6ba:7fff:ffff:ffff:ffff:ffff,FI
2001:2003:f6da::,2001:2003:f6da:7fff:ffff:ffff:ffff:ffff,FI
2001:2003:f72a::,2001:2003:f72a:7fff:ffff:ffff:ffff:ffff,FI
2001:2003:f764::,2001:2003:f764:7fff:ffff:ffff:ffff:ffff,FI
@@ -4775,6 +4848,7 @@
2001:2003:f882:8000::,2001:2003:f882:ffff:ffff:ffff:ffff:ffff,FI
2001:2003:f8d4::,2001:2003:f8d4:7fff:ffff:ffff:ffff:ffff,FI
2001:2003:f8f6:8000::,2001:2003:f8f6:ffff:ffff:ffff:ffff:ffff,FI
+2001:2003:f8f9:8000::,2001:2003:f8f9:ffff:ffff:ffff:ffff:ffff,FI
2001:2003:f969:8000::,2001:2003:f969:ffff:ffff:ffff:ffff:ffff,FI
2001:2003:f9e7:8000::,2001:2003:f9e7:ffff:ffff:ffff:ffff:ffff,FI
2001:2003:f9f1::,2001:2003:f9f1:7fff:ffff:ffff:ffff:ffff,FI
@@ -4788,8 +4862,7 @@
2001:2010:d00e::,2001:2010:d00e:7fff:ffff:ffff:ffff:ffff,DK
2001:2010:d00f:8000::,2001:2010:d00f:ffff:ffff:ffff:ffff:ffff,DK
2001:2010:d012:8000::,2001:2010:d014:ffff:ffff:ffff:ffff:ffff,DK
-2001:2010:d01a:8000::,2001:2010:d01a:ffff:ffff:ffff:ffff:ffff,DK
-2001:2010:d01b:8000::,2001:2010:d01c:ffff:ffff:ffff:ffff:ffff,DK
+2001:2010:d01a:8000::,2001:2010:d01c:ffff:ffff:ffff:ffff:ffff,DK
2001:2010:d01f:8000::,2001:2010:d01f:ffff:ffff:ffff:ffff:ffff,DK
2001:2010:d023:8000::,2001:2010:d023:ffff:ffff:ffff:ffff:ffff,DK
2001:2010:d029::,2001:2010:d029:7fff:ffff:ffff:ffff:ffff,DK
@@ -5032,7 +5105,6 @@
2001:43f8:af0::,2001:43f8:af1:ffff:ffff:ffff:ffff:ffff,BJ
2001:43f8:b00::,2001:43f8:b00:ffff:ffff:ffff:ffff:ffff,KE
2001:43f8:b10::,2001:43f8:b10:ffff:ffff:ffff:ffff:ffff,NG
-2001:43f8:a700::,2001:43f8:a700:ffff:ffff:ffff:ffff:ffff,MU
2001:4400::,2001:4403:ffff:ffff:ffff:ffff:ffff:ffff,NZ
2001:4408::,2001:4408:ffff:ffff:ffff:ffff:ffff:ffff,IN
2001:4410::,2001:4410:ffff:ffff:ffff:ffff:ffff:ffff,NZ
@@ -5065,7 +5137,9 @@
2001:4538::,2001:4538:ffff:ffff:ffff:ffff:ffff:ffff,PK
2001:4540::,2001:455f:ffff:ffff:ffff:ffff:ffff:ffff,TW
2001:4580::,2001:45bf:ffff:ffff:ffff:ffff:ffff:ffff,TW
-2001:4600::,2001:46ff:ffff:ffff:ffff:ffff:ffff:ffff,NO
+2001:4600::,2001:4641:eac9:ffff:ffff:ffff:ffff:ffff,NO
+2001:4641:eaca::,2001:4641:eaca:7fff:ffff:ffff:ffff:ffff,DE
+2001:4641:eaca:8000::,2001:46ff:ffff:ffff:ffff:ffff:ffff:ffff,NO
2001:4800::,2001:4808:ffff:ffff:ffff:ffff:ffff:ffff,US
2001:4810::,2001:4810:ffff:ffff:ffff:ffff:ffff:ffff,US
2001:4818::,2001:4818:ffff:ffff:ffff:ffff:ffff:ffff,CA
@@ -5078,7 +5152,9 @@
2001:4830:1208::,2001:4830:1208:7fff:ffff:ffff:ffff:ffff,AU
2001:4830:1208:8000::,2001:4830:1212:ffff:ffff:ffff:ffff:ffff,US
2001:4830:1213::,2001:4830:1213:7fff:ffff:ffff:ffff:ffff,AU
-2001:4830:1213:8000::,2001:4830:121d:ffff:ffff:ffff:ffff:ffff,US
+2001:4830:1213:8000::,2001:4830:1216:ffff:ffff:ffff:ffff:ffff,US
+2001:4830:1217::,2001:4830:1217:7fff:ffff:ffff:ffff:ffff,AU
+2001:4830:1217:8000::,2001:4830:121d:ffff:ffff:ffff:ffff:ffff,US
2001:4830:121e::,2001:4830:121e:ffff:ffff:ffff:ffff:ffff,AU
2001:4830:121f::,2001:4830:1301:ffff:ffff:ffff:ffff:ffff,US
2001:4830:1302::,2001:4830:1302:7fff:ffff:ffff:ffff:ffff,AU
@@ -5292,7 +5368,9 @@
2003:7a:8943:8000::,2003:7a:8943:ffff:ffff:ffff:ffff:ffff,US
2003:7a:8944::,2003:84:ab78:ffff:ffff:ffff:ffff:ffff,DE
2003:84:ab79::,2003:84:ab79:7fff:ffff:ffff:ffff:ffff,RO
-2003:84:ab79:8000::,2003:1fff:ffff:ffff:ffff:ffff:ffff:ffff,DE
+2003:84:ab79:8000::,2003:87:292f:ffff:ffff:ffff:ffff:ffff,DE
+2003:87:2930::,2003:87:2930:7fff:ffff:ffff:ffff:ffff,NZ
+2003:87:2930:8000::,2003:1fff:ffff:ffff:ffff:ffff:ffff:ffff,DE
2067:8e00::,2067:8e00:ffff:ffff:ffff:ffff:ffff:ffff,US
2160:150::,2160:150:7fff:ffff:ffff:ffff:ffff:ffff,US
2400::,2400:fff:ffff:ffff:ffff:ffff:ffff:ffff,KR
@@ -5617,11 +5695,7 @@
2400:c900::,2400:c900:ffff:ffff:ffff:ffff:ffff:ffff,ID
2400:c980::,2400:c980:ffff:ffff:ffff:ffff:ffff:ffff,SG
2400:ca00::,2400:ca00:ffff:ffff:ffff:ffff:ffff:ffff,BD
-2400:cb00::,2400:cb00:20:ffff:ffff:ffff:ffff:ffff,HK
-2400:cb00:21::,2400:cb00:21:7fff:ffff:ffff:ffff:ffff,IT
-2400:cb00:21:8000::,2400:cb00:38:ffff:ffff:ffff:ffff:ffff,HK
-2400:cb00:39::,2400:cb00:39:7fff:ffff:ffff:ffff:ffff,IT
-2400:cb00:39:8000::,2400:cb00:f00c:ffff:ffff:ffff:ffff:ffff,HK
+2400:cb00::,2400:cb00:f00c:ffff:ffff:ffff:ffff:ffff,HK
2400:cb00:f00d::,2400:cb00:f00d:7fff:ffff:ffff:ffff:ffff,US
2400:cb00:f00d:8000::,2400:cb00:ffff:ffff:ffff:ffff:ffff:ffff,HK
2400:cb80::,2400:cb80:ffff:ffff:ffff:ffff:ffff:ffff,CN
@@ -5987,7 +6061,6 @@
2401:9880::,2401:9880:ffff:ffff:ffff:ffff:ffff:ffff,HK
2401:9980::,2401:9980:ffff:ffff:ffff:ffff:ffff:ffff,MY
2401:9a00::,2401:9a00:ffff:ffff:ffff:ffff:ffff:ffff,CN
-2401:9a80::,2401:9a80:ffff:ffff:ffff:ffff:ffff:ffff,CN
2401:9b00::,2401:9b00:ffff:ffff:ffff:ffff:ffff:ffff,ID
2401:9b80::,2401:9b80:ffff:ffff:ffff:ffff:ffff:ffff,CN
2401:9c00::,2401:9c00:ffff:ffff:ffff:ffff:ffff:ffff,BD
@@ -6082,7 +6155,9 @@
2401:c900:1001:100::,2401:c900:11ff:ffff:ffff:ffff:ffff:ffff,SG
2401:c900:1200::,2401:c900:1201:175:ffff:ffff:ffff:ffff,US
2401:c900:1201:176::,2401:c900:1201:176:ffff:ffff:ffff:ffff,HK
-2401:c900:1201:177::,2401:c900:12ff:ffff:ffff:ffff:ffff:ffff,US
+2401:c900:1201:177::,2401:c900:1201:1cb:ffff:ffff:ffff:ffff,US
+2401:c900:1201:1cc::,2401:c900:1201:1cc:ffff:ffff:ffff:ffff,HK
+2401:c900:1201:1cd::,2401:c900:12ff:ffff:ffff:ffff:ffff:ffff,US
2401:c900:1300::,2401:c900:1300:ffff:ffff:ffff:ffff:ffff,SG
2401:c900:1301::,2401:c900:1301:7fff:ffff:ffff:ffff:ffff,AU
2401:c900:1301:8000::,2401:c900:1400:ffff:ffff:ffff:ffff:ffff,SG
@@ -6095,7 +6170,10 @@
2401:cb80::,2401:cb80:ffff:ffff:ffff:ffff:ffff:ffff,CN
2401:cc00::,2401:cc00:ffff:ffff:ffff:ffff:ffff:ffff,CN
2401:cc80::,2401:cc80:ffff:ffff:ffff:ffff:ffff:ffff,AU
-2401:cd80::,2401:cd81:ffff:ffff:ffff:ffff:ffff:ffff,AU
+2401:cd00::,2401:cd00:ffff:ffff:ffff:ffff:ffff:ffff,BD
+2401:cd80::,2401:cd80:1:ffff:ffff:ffff:ffff:ffff,AU
+2401:cd80:2::,2401:cd80:2:ffff:ffff:ffff:ffff:ffff,NZ
+2401:cd80:3::,2401:cd81:ffff:ffff:ffff:ffff:ffff:ffff,AU
2401:ce00::,2401:ce00:ffff:ffff:ffff:ffff:ffff:ffff,CN
2401:ce80::,2401:ce80:ffff:ffff:ffff:ffff:ffff:ffff,JP
2401:cf00::,2401:cf00:ffff:ffff:ffff:ffff:ffff:ffff,AU
@@ -6188,10 +6266,10 @@
2401:fa00:2::,2401:fa00:2:ffff:ffff:ffff:ffff:ffff,IN
2401:fa00:3::,2401:fa00:3:ffff:ffff:ffff:ffff:ffff,SG
2401:fa00:4::,2401:fa00:4:ffff:ffff:ffff:ffff:ffff,JP
-2401:fa00:5::,2401:fa00:5:7fff:ffff:ffff:ffff:ffff,US
-2401:fa00:5:8000::,2401:fa00:6:ffff:ffff:ffff:ffff:ffff,IN
+2401:fa00:5::,2401:fa00:6:ffff:ffff:ffff:ffff:ffff,IN
2401:fa00:7::,2401:fa00:7:ffff:ffff:ffff:ffff:ffff,US
-2401:fa00:8::,2401:fa00:8:ffff:ffff:ffff:ffff:ffff,IN
+2401:fa00:8::,2401:fa00:8:7fff:ffff:ffff:ffff:ffff,IN
+2401:fa00:8:8000::,2401:fa00:8:ffff:ffff:ffff:ffff:ffff,MY
2401:fa00:9::,2401:fa00:9:ffff:ffff:ffff:ffff:ffff,AU
2401:fa00:a::,2401:fa00:c:ffff:ffff:ffff:ffff:ffff,IN
2401:fa00:d::,2401:fa00:d:7fff:ffff:ffff:ffff:ffff,KR
@@ -6201,9 +6279,9 @@
2401:fa00:11::,2401:fa00:11:ffff:ffff:ffff:ffff:ffff,AU
2401:fa00:12::,2401:fa00:12:ffff:ffff:ffff:ffff:ffff,NZ
2401:fa00:13::,2401:fa00:13:ffff:ffff:ffff:ffff:ffff,HK
-2401:fa00:14::,2401:fa00:14:ffff:ffff:ffff:ffff:ffff,IN
-2401:fa00:15::,2401:fa00:15:7fff:ffff:ffff:ffff:ffff,PH
-2401:fa00:15:8000::,2401:fa00:17:ffff:ffff:ffff:ffff:ffff,IN
+2401:fa00:14::,2401:fa00:15:7fff:ffff:ffff:ffff:ffff,IN
+2401:fa00:15:8000::,2401:fa00:15:ffff:ffff:ffff:ffff:ffff,US
+2401:fa00:16::,2401:fa00:17:ffff:ffff:ffff:ffff:ffff,IN
2401:fa00:18::,2401:fa00:18:7fff:ffff:ffff:ffff:ffff,PH
2401:fa00:18:8000::,2401:fa00:18:ffff:ffff:ffff:ffff:ffff,US
2401:fa00:19::,2401:fa00:1e:ffff:ffff:ffff:ffff:ffff,IN
@@ -6211,8 +6289,8 @@
2401:fa00:1f:8000::,2401:fa00:23:ffff:ffff:ffff:ffff:ffff,IN
2401:fa00:24::,2401:fa00:24:7fff:ffff:ffff:ffff:ffff,US
2401:fa00:24:8000::,2401:fa00:24:ffff:ffff:ffff:ffff:ffff,MY
-2401:fa00:25::,2401:fa00:26:7fff:ffff:ffff:ffff:ffff,IN
-2401:fa00:26:8000::,2401:fa00:26:ffff:ffff:ffff:ffff:ffff,US
+2401:fa00:25::,2401:fa00:25:ffff:ffff:ffff:ffff:ffff,IN
+2401:fa00:26::,2401:fa00:26:ffff:ffff:ffff:ffff:ffff,US
2401:fa00:27::,2401:fa00:3f:ffff:ffff:ffff:ffff:ffff,IN
2401:fa00:40::,2401:fa00:40:7fff:ffff:ffff:ffff:ffff,CN
2401:fa00:40:8000::,2401:fa00:40:ffff:ffff:ffff:ffff:ffff,IN
@@ -7115,70 +7193,134 @@
2403:bf00::,2403:bf00:ffff:ffff:ffff:ffff:ffff:ffff,TH
2403:bf80::,2403:bf80:ffff:ffff:ffff:ffff:ffff:ffff,BD
2403:c000::,2403:c000:ffff:ffff:ffff:ffff:ffff:ffff,TH
+2403:c080::,2403:c080:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:c100::,2403:c100:ffff:ffff:ffff:ffff:ffff:ffff,CN
+2403:c180::,2403:c180:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:c200::,2403:c200:ffff:ffff:ffff:ffff:ffff:ffff,NZ
+2403:c280::,2403:c280:ffff:ffff:ffff:ffff:ffff:ffff,MM
2403:c300::,2403:c300:ffff:ffff:ffff:ffff:ffff:ffff,TW
+2403:c380::,2403:c380:ffff:ffff:ffff:ffff:ffff:ffff,IN
2403:c400::,2403:c400:ffff:ffff:ffff:ffff:ffff:ffff,AU
+2403:c480::,2403:c480:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:c500::,2403:c500:ffff:ffff:ffff:ffff:ffff:ffff,SG
+2403:c580::,2403:c580:ffff:ffff:ffff:ffff:ffff:ffff,MY
2403:c600::,2403:c600:ffff:ffff:ffff:ffff:ffff:ffff,ID
+2403:c680::,2403:c680:ffff:ffff:ffff:ffff:ffff:ffff,IN
+2403:c780::,2403:c780:ffff:ffff:ffff:ffff:ffff:ffff,JP
2403:c800::,2403:c800:ffff:ffff:ffff:ffff:ffff:ffff,AU
+2403:c880::,2403:c881:ffff:ffff:ffff:ffff:ffff:ffff,HK
2403:c900::,2403:c900:ffff:ffff:ffff:ffff:ffff:ffff,NZ
+2403:c980::,2403:c980:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:ca00::,2403:ca00:ffff:ffff:ffff:ffff:ffff:ffff,AU
+2403:ca80::,2403:ca80:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:cb00::,2403:cb00:ffff:ffff:ffff:ffff:ffff:ffff,SG
+2403:cb80::,2403:cb80:ffff:ffff:ffff:ffff:ffff:ffff,ID
2403:cc00::,2403:cc00:3fff:ffff:ffff:ffff:ffff:ffff,SG
2403:cc00:4000::,2403:cc00:4000:7fff:ffff:ffff:ffff:ffff,AU
2403:cc00:4000:8000::,2403:cc00:9fff:ffff:ffff:ffff:ffff:ffff,SG
2403:cc00:a000::,2403:cc00:a000:7fff:ffff:ffff:ffff:ffff,ES
2403:cc00:a000:8000::,2403:cc00:ffff:ffff:ffff:ffff:ffff:ffff,SG
+2403:cc80::,2403:cc80:ffff:ffff:ffff:ffff:ffff:ffff,BD
2403:cd00::,2403:cd00:ffff:ffff:ffff:ffff:ffff:ffff,PH
+2403:cd80::,2403:cd80:ffff:ffff:ffff:ffff:ffff:ffff,PH
2403:ce00::,2403:ce00:ffff:ffff:ffff:ffff:ffff:ffff,AU
+2403:ce80::,2403:ce80:ffff:ffff:ffff:ffff:ffff:ffff,JP
2403:cf00::,2403:cf00:ffff:ffff:ffff:ffff:ffff:ffff,AU
+2403:cf80::,2403:cf80:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:d000::,2403:d000:ffff:ffff:ffff:ffff:ffff:ffff,JP
+2403:d080::,2403:d080:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:d100::,2403:d100:ffff:ffff:ffff:ffff:ffff:ffff,AU
+2403:d180::,2403:d180:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:d200::,2403:d200:ffff:ffff:ffff:ffff:ffff:ffff,NZ
+2403:d280::,2403:d280:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:d300::,2403:d300:ffff:ffff:ffff:ffff:ffff:ffff,HK
+2403:d380::,2403:d380:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:d400::,2403:d400:ffff:ffff:ffff:ffff:ffff:ffff,CN
+2403:d480::,2403:d480:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:d500::,2403:d500:ffff:ffff:ffff:ffff:ffff:ffff,AU
+2403:d580::,2403:d580:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:d600::,2403:d600:ffff:ffff:ffff:ffff:ffff:ffff,AU
+2403:d680::,2403:d680:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:d700::,2403:d700:ffff:ffff:ffff:ffff:ffff:ffff,MN
+2403:d780::,2403:d780:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:d800::,2403:d800:ffff:ffff:ffff:ffff:ffff:ffff,NZ
+2403:d880::,2403:d880:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:d900::,2403:d900:ffff:ffff:ffff:ffff:ffff:ffff,AU
+2403:d980::,2403:d980:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:da00::,2403:da00:ffff:ffff:ffff:ffff:ffff:ffff,ID
+2403:da80::,2403:da80:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:db00::,2403:db00:ffff:ffff:ffff:ffff:ffff:ffff,CN
+2403:db80::,2403:db80:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:dc00::,2403:dc00:ffff:ffff:ffff:ffff:ffff:ffff,AU
+2403:dc80::,2403:dc80:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:dd00::,2403:dd00:ffff:ffff:ffff:ffff:ffff:ffff,BD
+2403:dd80::,2403:dd80:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:de00::,2403:de00:ffff:ffff:ffff:ffff:ffff:ffff,NZ
+2403:de80::,2403:de80:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:df00::,2403:df00:ffff:ffff:ffff:ffff:ffff:ffff,SG
+2403:df80::,2403:df80:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:e000::,2403:e000:ffff:ffff:ffff:ffff:ffff:ffff,AU
+2403:e080::,2403:e080:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:e100::,2403:e100:ffff:ffff:ffff:ffff:ffff:ffff,BD
+2403:e180::,2403:e180:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:e200::,2403:e200:ffff:ffff:ffff:ffff:ffff:ffff,VN
+2403:e280::,2403:e280:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:e300::,2403:e300:ffff:ffff:ffff:ffff:ffff:ffff,CN
+2403:e380::,2403:e380:ffff:ffff:ffff:ffff:ffff:ffff,ID
2403:e400::,2403:e400:ffff:ffff:ffff:ffff:ffff:ffff,HK
+2403:e480::,2403:e480:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:e500::,2403:e500:ffff:ffff:ffff:ffff:ffff:ffff,CN
+2403:e580::,2403:e580:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:e600::,2403:e600:ffff:ffff:ffff:ffff:ffff:ffff,ID
+2403:e680::,2403:e680:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:e700::,2403:e700:ffff:ffff:ffff:ffff:ffff:ffff,CN
+2403:e780::,2403:e780:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:e800::,2403:e800:ffff:ffff:ffff:ffff:ffff:ffff,HK
+2403:e880::,2403:e880:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:e900::,2403:e900:ffff:ffff:ffff:ffff:ffff:ffff,SG
+2403:e980::,2403:e980:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:ea00::,2403:ea00:ffff:ffff:ffff:ffff:ffff:ffff,HK
+2403:ea80::,2403:ea80:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:eb00::,2403:eb00:ffff:ffff:ffff:ffff:ffff:ffff,BD
+2403:eb80::,2403:eb80:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:ec00::,2403:ec00:ffff:ffff:ffff:ffff:ffff:ffff,BD
+2403:ec80::,2403:ec80:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:ed00::,2403:ed00:ffff:ffff:ffff:ffff:ffff:ffff,CN
+2403:ed80::,2403:ed80:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:ee00::,2403:ee00:ffff:ffff:ffff:ffff:ffff:ffff,TW
+2403:ee80::,2403:ee80:ffff:ffff:ffff:ffff:ffff:ffff,CN
+2403:ef80::,2403:ef80:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:f000::,2403:f000:ffff:ffff:ffff:ffff:ffff:ffff,AU
+2403:f080::,2403:f080:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:f100::,2403:f100:ffff:ffff:ffff:ffff:ffff:ffff,CN
+2403:f180::,2403:f180:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:f200::,2403:f200:ffff:ffff:ffff:ffff:ffff:ffff,JP
+2403:f280::,2403:f280:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:f300::,2403:f300:ffff:ffff:ffff:ffff:ffff:ffff,CN
+2403:f380::,2403:f380:ffff:ffff:ffff:ffff:ffff:ffff,CN
+2403:f480::,2403:f480:ffff:ffff:ffff:ffff:ffff:ffff,AU
2403:f500::,2403:f500:ffff:ffff:ffff:ffff:ffff:ffff,HK
+2403:f580::,2403:f580:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:f600::,2403:f600:ffff:ffff:ffff:ffff:ffff:ffff,NR
+2403:f680::,2403:f680:ffff:ffff:ffff:ffff:ffff:ffff,IN
2403:f700::,2403:f700:ffff:ffff:ffff:ffff:ffff:ffff,NZ
+2403:f780::,2403:f780:ffff:ffff:ffff:ffff:ffff:ffff,BD
2403:f800::,2403:f800:ffff:ffff:ffff:ffff:ffff:ffff,CN
+2403:f880::,2403:f880:ffff:ffff:ffff:ffff:ffff:ffff,JP
2403:f900::,2403:f900:ffff:ffff:ffff:ffff:ffff:ffff,CN
+2403:f980::,2403:f980:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:fa00::,2403:fa00:ffff:ffff:ffff:ffff:ffff:ffff,HK
+2403:fa80::,2403:fa80:ffff:ffff:ffff:ffff:ffff:ffff,SG
2403:fb00::,2403:fb00:ffff:ffff:ffff:ffff:ffff:ffff,CN
+2403:fb80::,2403:fb80:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:fc00::,2403:fc00:ffff:ffff:ffff:ffff:ffff:ffff,AU
+2403:fc80::,2403:fc80:ffff:ffff:ffff:ffff:ffff:ffff,ID
2403:fd00::,2403:fd00:ffff:ffff:ffff:ffff:ffff:ffff,AU
+2403:fd80::,2403:fd80:ffff:ffff:ffff:ffff:ffff:ffff,ID
2403:fe00::,2403:fe00:ffff:ffff:ffff:ffff:ffff:ffff,IN
+2403:fe80::,2403:fe80:ffff:ffff:ffff:ffff:ffff:ffff,CN
2403:ff00::,2403:ff00:ffff:ffff:ffff:ffff:ffff:ffff,ID
+2403:ff80::,2403:ff80:ffff:ffff:ffff:ffff:ffff:ffff,CN
2404::,2404:3f:ffff:ffff:ffff:ffff:ffff:ffff,TW
2404:80::,2404:8f:ffff:ffff:ffff:ffff:ffff:ffff,TW
2404:a0::,2404:a0:ffff:ffff:ffff:ffff:ffff:ffff,NZ
@@ -7206,24 +7348,44 @@
2404:1b0::,2404:1b0:ffff:ffff:ffff:ffff:ffff:ffff,ID
2404:1b8::,2404:1b8:ffff:ffff:ffff:ffff:ffff:ffff,ID
2404:200::,2404:200:ffff:ffff:ffff:ffff:ffff:ffff,JP
+2404:280::,2404:280:ffff:ffff:ffff:ffff:ffff:ffff,CN
2404:300::,2404:300:ffff:ffff:ffff:ffff:ffff:ffff,KH
+2404:380::,2404:380:ffff:ffff:ffff:ffff:ffff:ffff,GU
2404:400::,2404:400:ffff:ffff:ffff:ffff:ffff:ffff,ID
+2404:480::,2404:480:ffff:ffff:ffff:ffff:ffff:ffff,CN
2404:500::,2404:500:ffff:ffff:ffff:ffff:ffff:ffff,ID
+2404:580::,2404:580:ffff:ffff:ffff:ffff:ffff:ffff,IN
2404:600::,2404:600:ffff:ffff:ffff:ffff:ffff:ffff,ID
+2404:680::,2404:680:ffff:ffff:ffff:ffff:ffff:ffff,CN
2404:700::,2404:700:ffff:ffff:ffff:ffff:ffff:ffff,KH
+2404:780::,2404:780:ffff:ffff:ffff:ffff:ffff:ffff,AU
2404:800::,2404:800:ffff:ffff:ffff:ffff:ffff:ffff,KR
+2404:880::,2404:880:ffff:ffff:ffff:ffff:ffff:ffff,ID
+2404:980::,2404:980:ffff:ffff:ffff:ffff:ffff:ffff,BD
2404:a00::,2404:a00:ffff:ffff:ffff:ffff:ffff:ffff,JP
+2404:a80::,2404:a80:ffff:ffff:ffff:ffff:ffff:ffff,CN
2404:b00::,2404:b00:ffff:ffff:ffff:ffff:ffff:ffff,BD
+2404:b80::,2404:b80:ffff:ffff:ffff:ffff:ffff:ffff,CN
2404:c00::,2404:c00:ffff:ffff:ffff:ffff:ffff:ffff,IN
+2404:c80::,2404:c80:ffff:ffff:ffff:ffff:ffff:ffff,AU
2404:d00::,2404:d00:ffff:ffff:ffff:ffff:ffff:ffff,BD
+2404:d80::,2404:d80:ffff:ffff:ffff:ffff:ffff:ffff,CN
2404:e00::,2404:e00:ffff:ffff:ffff:ffff:ffff:ffff,SG
+2404:e80::,2404:e80:ffff:ffff:ffff:ffff:ffff:ffff,AU
2404:f00::,2404:f00:ffff:ffff:ffff:ffff:ffff:ffff,CN
+2404:f80::,2404:f80:ffff:ffff:ffff:ffff:ffff:ffff,CN
2404:1000::,2404:1000:ffff:ffff:ffff:ffff:ffff:ffff,JP
+2404:1080::,2404:1080:ffff:ffff:ffff:ffff:ffff:ffff,CN
2404:1100::,2404:1100:ffff:ffff:ffff:ffff:ffff:ffff,SG
+2404:1180::,2404:1180:ffff:ffff:ffff:ffff:ffff:ffff,CN
2404:1200::,2404:1200:ffff:ffff:ffff:ffff:ffff:ffff,SG
+2404:1280::,2404:1280:ffff:ffff:ffff:ffff:ffff:ffff,HK
2404:1300::,2404:1300:ffff:ffff:ffff:ffff:ffff:ffff,JP
+2404:1380::,2404:1380:ffff:ffff:ffff:ffff:ffff:ffff,BD
2404:1400::,2404:1400:ffff:ffff:ffff:ffff:ffff:ffff,ID
+2404:1480::,2404:1480:ffff:ffff:ffff:ffff:ffff:ffff,IN
2404:1500::,2404:1500:ffff:ffff:ffff:ffff:ffff:ffff,IN
+2404:1580::,2404:1580:ffff:ffff:ffff:ffff:ffff:ffff,IN
2404:1600::,2404:1601:ffff:ffff:ffff:ffff:ffff:ffff,AU
2404:1700::,2404:1700:ffff:ffff:ffff:ffff:ffff:ffff,JP
2404:1800::,2404:1800:ffff:ffff:ffff:ffff:ffff:ffff,NZ
@@ -7340,7 +7502,7 @@
2404:8a00::,2404:8a00:ffff:ffff:ffff:ffff:ffff:ffff,LK
2404:8b00::,2404:8b00:ffff:ffff:ffff:ffff:ffff:ffff,CN
2404:8c00::,2404:8c00:ffff:ffff:ffff:ffff:ffff:ffff,GU
-2404:8d00::,2404:8d00:ffff:ffff:ffff:ffff:ffff:ffff,TH
+2404:8d00::,2404:8d07:ffff:ffff:ffff:ffff:ffff:ffff,TH
2404:8e00::,2404:8e01:ffff:ffff:ffff:ffff:ffff:ffff,JP
2404:8f00::,2404:8f00:ffff:ffff:ffff:ffff:ffff:ffff,AU
2404:9000::,2404:9000:ffff:ffff:ffff:ffff:ffff:ffff,JP
@@ -7376,7 +7538,6 @@
2404:b100::,2404:b100:ffff:ffff:ffff:ffff:ffff:ffff,CN
2404:b200::,2404:b200:ffff:ffff:ffff:ffff:ffff:ffff,IN
2404:b300::,2404:b300:ffff:ffff:ffff:ffff:ffff:ffff,KH
-2404:b400::,2404:b400:ffff:ffff:ffff:ffff:ffff:ffff,AU
2404:b500::,2404:b500:ffff:ffff:ffff:ffff:ffff:ffff,AU
2404:b600::,2404:b600:ffff:ffff:ffff:ffff:ffff:ffff,JP
2404:b700::,2404:b700:ffff:ffff:ffff:ffff:ffff:ffff,NZ
@@ -7511,7 +7672,9 @@
2405:2000:e00::,2405:2000:e00:ff:ffff:ffff:ffff:ffff,AU
2405:2000:e00:100::,2405:2000:eff:ffff:ffff:ffff:ffff:ffff,IN
2405:2000:f00::,2405:2000:f00:1ff:ffff:ffff:ffff:ffff,JP
-2405:2000:f00:200::,2405:2000:ffc7:ffff:ffff:ffff:ffff:ffff,IN
+2405:2000:f00:200::,2405:2000:1fff:ffff:ffff:ffff:ffff:ffff,IN
+2405:2000:2000::,2405:2000:2000:ff:ffff:ffff:ffff:ffff,AU
+2405:2000:2000:100::,2405:2000:ffc7:ffff:ffff:ffff:ffff:ffff,IN
2405:2000:ffc8::,2405:2000:ffc8:ffff:ffff:ffff:ffff:ffff,SG
2405:2000:ffc9::,2405:2001:2ff:ffff:ffff:ffff:ffff:ffff,IN
2405:2001:300::,2405:2001:300:ff:ffff:ffff:ffff:ffff,MY
@@ -7583,7 +7746,6 @@
2405:6400::,2405:6400:ffff:ffff:ffff:ffff:ffff:ffff,MY
2405:6500::,2405:6500:ffff:ffff:ffff:ffff:ffff:ffff,AU
2405:6600::,2405:6600:ffff:ffff:ffff:ffff:ffff:ffff,NP
-2405:6700::,2405:6700:ffff:ffff:ffff:ffff:ffff:ffff,AU
2405:6800::,2405:6800:ffff:ffff:ffff:ffff:ffff:ffff,IN
2405:6900::,2405:6900:ffff:ffff:ffff:ffff:ffff:ffff,BD
2405:6a00::,2405:6a00:ffff:ffff:ffff:ffff:ffff:ffff,AU
@@ -7644,7 +7806,6 @@
2405:a300::,2405:a300:ffff:ffff:ffff:ffff:ffff:ffff,IN
2405:a400::,2405:a400:ffff:ffff:ffff:ffff:ffff:ffff,NZ
2405:a500::,2405:a500:ffff:ffff:ffff:ffff:ffff:ffff,CN
-2405:a600::,2405:a600:ffff:ffff:ffff:ffff:ffff:ffff,AU
2405:a700::,2405:a700:ffff:ffff:ffff:ffff:ffff:ffff,IN
2405:a900::,2405:a900:ffff:ffff:ffff:ffff:ffff:ffff,CN
2405:aa00::,2405:aa00:ffff:ffff:ffff:ffff:ffff:ffff,KH
@@ -8209,7 +8370,6 @@
2407:f200::,2407:f200:ffff:ffff:ffff:ffff:ffff:ffff,ID
2407:f300::,2407:f300:ffff:ffff:ffff:ffff:ffff:ffff,MM
2407:f400::,2407:f400:ffff:ffff:ffff:ffff:ffff:ffff,AU
-2407:f500::,2407:f500:ffff:ffff:ffff:ffff:ffff:ffff,HK
2407:f600::,2407:f600:ffff:ffff:ffff:ffff:ffff:ffff,JP
2407:f700::,2407:f700:ffff:ffff:ffff:ffff:ffff:ffff,IN
2407:f800::,2407:f800:ffff:ffff:ffff:ffff:ffff:ffff,MY
@@ -8219,6 +8379,7 @@
2407:fe00::,2407:fe00:ffff:ffff:ffff:ffff:ffff:ffff,AU
2407:ff00::,2407:ff00:ffff:ffff:ffff:ffff:ffff:ffff,IN
2408::,2408:3ff:ffff:ffff:ffff:ffff:ffff:ffff,JP
+2408:4000::,2408:43ff:ffff:ffff:ffff:ffff:ffff:ffff,CN
2408:8000::,2408:8fff:ffff:ffff:ffff:ffff:ffff:ffff,CN
2409:10::,2409:1f:ffff:ffff:ffff:ffff:ffff:ffff,JP
2409:250::,2409:25f:ffff:ffff:ffff:ffff:ffff:ffff,JP
@@ -8237,7 +8398,9 @@
240f:74:c23a::,240f:74:c23a:7fff:ffff:ffff:ffff:ffff,US
240f:74:c23a:8000::,240f:78:8491:ffff:ffff:ffff:ffff:ffff,JP
240f:78:8492::,240f:78:8492:7fff:ffff:ffff:ffff:ffff,GB
-240f:78:8492:8000::,240f:ff:ffff:ffff:ffff:ffff:ffff:ffff,JP
+240f:78:8492:8000::,240f:93:b6d:ffff:ffff:ffff:ffff:ffff,JP
+240f:93:b6e::,240f:93:b6e:7fff:ffff:ffff:ffff:ffff,US
+240f:93:b6e:8000::,240f:ff:ffff:ffff:ffff:ffff:ffff:ffff,JP
240f:8000::,240f:80ff:ffff:ffff:ffff:ffff:ffff:ffff,CN
2600::,2600:7:ffff:ffff:ffff:ffff:ffff:ffff,US
2600:100::,2600:10f:ffff:ffff:ffff:ffff:ffff:ffff,US
@@ -8268,6 +8431,7 @@
2600:2400::,2600:2407:ffff:ffff:ffff:ffff:ffff:ffff,US
2600:2500::,2600:250f:ffff:ffff:ffff:ffff:ffff:ffff,US
2600:2600::,2600:260f:ffff:ffff:ffff:ffff:ffff:ffff,US
+2600:2700::,2600:270f:ffff:ffff:ffff:ffff:ffff:ffff,US
2600:2800::,2600:2803:ffff:ffff:ffff:ffff:ffff:ffff,US
2600:2c00::,2600:2c03:ffff:ffff:ffff:ffff:ffff:ffff,US
2600:3000::,2600:3007:ffff:ffff:ffff:ffff:ffff:ffff,US
@@ -8312,6 +8476,9 @@
2602:230::,2602:231:ffff:ffff:ffff:ffff:ffff:ffff,US
2602:240::,2602:25f:ffff:ffff:ffff:ffff:ffff:ffff,US
2602:300::,2602:3ff:ffff:ffff:ffff:ffff:ffff:ffff,US
+2602:ff60::,2602:ff60:fff:ffff:ffff:ffff:ffff:ffff,US
+2602:ff61::,2602:ff61:fff:ffff:ffff:ffff:ffff:ffff,US
+2602:ff62::,2602:ff62:fff:ffff:ffff:ffff:ffff:ffff,US
2602:ff63::,2602:ff63:fff:ffff:ffff:ffff:ffff:ffff,US
2602:ff64::,2602:ff64:fff:ffff:ffff:ffff:ffff:ffff,US
2602:ff65::,2602:ff65:fff:ffff:ffff:ffff:ffff:ffff,US
@@ -8335,8 +8502,7 @@
2602:ff77::,2602:ff77:fff:ffff:ffff:ffff:ffff:ffff,US
2602:ff78::,2602:ff78:fff:ffff:ffff:ffff:ffff:ffff,US
2602:ff79::,2602:ff79:fff:ffff:ffff:ffff:ffff:ffff,US
-2602:ff7a::,2602:ff7a:fff:ffff:ffff:ffff:ffff:ffff,US
-2602:ff7b::,2602:ff7b:fff:ffff:ffff:ffff:ffff:ffff,US
+2602:ff7a::,2602:ff7b:fff:ffff:ffff:ffff:ffff:ffff,US
2602:ff7c::,2602:ff7c:fff:ffff:ffff:ffff:ffff:ffff,US
2602:ff7d::,2602:ff7d:fff:ffff:ffff:ffff:ffff:ffff,US
2602:ff7e::,2602:ff7e:fff:ffff:ffff:ffff:ffff:ffff,US
@@ -8470,7 +8636,7 @@
2602:fff9::,2602:fff9:fff:ffff:ffff:ffff:ffff:ffff,US
2602:fffa::,2602:fffa:fff:ffff:ffff:ffff:ffff:ffff,US
2602:fffb::,2602:fffb:fff:ffff:ffff:ffff:ffff:ffff,US
-2602:fffc::,2602:fffc:fff:ffff:ffff:ffff:ffff:ffff,US
+2602:fffc::,2602:fffc:ffff:ffff:ffff:ffff:ffff:ffff,US
2602:fffd::,2602:fffd:fff:ffff:ffff:ffff:ffff:ffff,CA
2602:ffff::,2602:ffff:fff:ffff:ffff:ffff:ffff:ffff,US
2603::,2603:10ff:ffff:ffff:ffff:ffff:ffff:ffff,US
@@ -9558,7 +9724,9 @@
2606:2d80::,2606:2d80:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:2e00::,2606:2e00:8001:ffff:ffff:ffff:ffff:ffff,US
2606:2e00:8002::,2606:2e00:8002:7fff:ffff:ffff:ffff:ffff,JP
-2606:2e00:8002:8000::,2606:2e00:ffff:ffff:ffff:ffff:ffff:ffff,US
+2606:2e00:8002:8000::,2606:2e00:800a:2:ffff:ffff:ffff:ffff,US
+2606:2e00:800a:3::,2606:2e00:800a:3:ffff:ffff:ffff:ffff,HK
+2606:2e00:800a:4::,2606:2e00:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:2e80::,2606:2e80:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:2f00::,2606:2f00:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:2f80::,2606:2f80:ffff:ffff:ffff:ffff:ffff:ffff,CA
@@ -9849,37 +10017,71 @@
2606:be00::,2606:be00:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:be80::,2606:be80:ffff:ffff:ffff:ffff:ffff:ffff,CA
2606:bf00::,2606:bf00:ffff:ffff:ffff:ffff:ffff:ffff,US
+2606:bf80::,2606:bf80:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:c000::,2606:c000:ffff:ffff:ffff:ffff:ffff:ffff,US
+2606:c080::,2606:c080:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:c100::,2606:c100:ffff:ffff:ffff:ffff:ffff:ffff,US
+2606:c180::,2606:c180:ffff:ffff:ffff:ffff:ffff:ffff,US
+2606:c280::,2606:c280:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:c300::,2606:c300:ffff:ffff:ffff:ffff:ffff:ffff,US
+2606:c380::,2606:c380:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:c400::,2606:c400:ffff:ffff:ffff:ffff:ffff:ffff,US
+2606:c480::,2606:c480:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:c500::,2606:c500:ffff:ffff:ffff:ffff:ffff:ffff,JM
+2606:c580::,2606:c580:ffff:ffff:ffff:ffff:ffff:ffff,US
+2606:c680::,2606:c680:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:c700::,2606:c700:ffff:ffff:ffff:ffff:ffff:ffff,US
+2606:c780::,2606:c780:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:c800::,2606:c800:ffff:ffff:ffff:ffff:ffff:ffff,US
+2606:c880::,2606:c880:ffff:ffff:ffff:ffff:ffff:ffff,CA
2606:c900::,2606:c900:ffff:ffff:ffff:ffff:ffff:ffff,US
+2606:c980::,2606:c980:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:ca00::,2606:ca00:ffff:ffff:ffff:ffff:ffff:ffff,CA
+2606:ca80::,2606:ca80:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:cb00::,2606:cb00:ffff:ffff:ffff:ffff:ffff:ffff,US
+2606:cb80::,2606:cb80:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:cc00::,2606:cc00:ffff:ffff:ffff:ffff:ffff:ffff,US
+2606:cc80::,2606:cc80:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:cd00::,2606:cd00:ffff:ffff:ffff:ffff:ffff:ffff,US
+2606:cd80::,2606:cd80:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:ce00::,2606:ce00:ffff:ffff:ffff:ffff:ffff:ffff,US
+2606:ce80::,2606:ce80:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:cf00::,2606:cf00:ffff:ffff:ffff:ffff:ffff:ffff,US
+2606:cf80::,2606:cf80:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:d000::,2606:d000:ffff:ffff:ffff:ffff:ffff:ffff,US
+2606:d080::,2606:d080:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:d100::,2606:d100:ffff:ffff:ffff:ffff:ffff:ffff,US
+2606:d180::,2606:d180:ffff:ffff:ffff:ffff:ffff:ffff,CA
2606:d200::,2606:d200:ffff:ffff:ffff:ffff:ffff:ffff,US
+2606:d280::,2606:d280:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:d300::,2606:d300:fff:ffff:ffff:ffff:ffff:ffff,US
+2606:d380::,2606:d380:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:d400::,2606:d400:ffff:ffff:ffff:ffff:ffff:ffff,US
+2606:d480::,2606:d480:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:d500::,2606:d500:ffff:ffff:ffff:ffff:ffff:ffff,US
+2606:d580::,2606:d580:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:d600::,2606:d600:ffff:ffff:ffff:ffff:ffff:ffff,US
+2606:d680::,2606:d680:ffff:ffff:ffff:ffff:ffff:ffff,CA
2606:d700::,2606:d700:ffff:ffff:ffff:ffff:ffff:ffff,US
+2606:d780::,2606:d780:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:d800::,2606:d800:ffff:ffff:ffff:ffff:ffff:ffff,US
+2606:d880::,2606:d880:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:d900::,2606:d900:ffff:ffff:ffff:ffff:ffff:ffff,US
+2606:d980::,2606:d980:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:da00::,2606:da00:ffff:ffff:ffff:ffff:ffff:ffff,US
+2606:da80::,2606:da80:fff:ffff:ffff:ffff:ffff:ffff,US
2606:db00::,2606:db00:ffff:ffff:ffff:ffff:ffff:ffff,US
+2606:db80::,2606:db80:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:dc00::,2606:dc00:ffff:ffff:ffff:ffff:ffff:ffff,US
+2606:dc80::,2606:dc80:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:dd00::,2606:dd00:fff:ffff:ffff:ffff:ffff:ffff,US
+2606:dd80::,2606:dd80:ffff:ffff:ffff:ffff:ffff:ffff,CA
2606:de00::,2606:de00:ffff:ffff:ffff:ffff:ffff:ffff,CA
+2606:de80::,2606:de80:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:df00::,2606:df00:ffff:ffff:ffff:ffff:ffff:ffff,US
+2606:df80::,2606:df80:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:e000::,2606:e000:ffff:ffff:ffff:ffff:ffff:ffff,CA
+2606:e080::,2606:e080:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:e100::,2606:e100:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:e200::,2606:e200:ffff:ffff:ffff:ffff:ffff:ffff,US
2606:e300::,2606:e300:ffff:ffff:ffff:ffff:ffff:ffff,US
@@ -9995,7 +10197,7 @@
2607:5200::,2607:5201:ffff:ffff:ffff:ffff:ffff:ffff,US
2607:5300::,2607:5300:ffff:ffff:ffff:ffff:ffff:ffff,CA
2607:5400::,2607:5400:ffff:ffff:ffff:ffff:ffff:ffff,US
-2607:5500::,2607:5500:ffff:ffff:ffff:ffff:ffff:ffff,US
+2607:5500::,2607:5501:ffff:ffff:ffff:ffff:ffff:ffff,US
2607:5600::,2607:5600:ffff:ffff:ffff:ffff:ffff:ffff,US
2607:5700::,2607:5700:ffff:ffff:ffff:ffff:ffff:ffff,US
2607:5800::,2607:5800:ffff:ffff:ffff:ffff:ffff:ffff,US
@@ -10180,7 +10382,9 @@
2607:f0d0:1c01:8000::,2607:f0d0:3700:ffff:ffff:ffff:ffff:ffff,US
2607:f0d0:3701::,2607:f0d0:3701:7fff:ffff:ffff:ffff:ffff,CA
2607:f0d0:3701:8000::,2607:f0d1:ffff:ffff:ffff:ffff:ffff:ffff,US
-2607:f0d8::,2607:f0e0:ffff:ffff:ffff:ffff:ffff:ffff,US
+2607:f0d8::,2607:f0dc:5001:7fff:ffff:ffff:ffff:ffff,US
+2607:f0dc:5001:8000::,2607:f0dc:5001:ffff:ffff:ffff:ffff:ffff,TW
+2607:f0dc:5002::,2607:f0e0:ffff:ffff:ffff:ffff:ffff:ffff,US
2607:f0e8::,2607:f0e8:ffff:ffff:ffff:ffff:ffff:ffff,US
2607:f0f8::,2607:f0f8:ffff:ffff:ffff:ffff:ffff:ffff,US
2607:f100::,2607:f100:ffff:ffff:ffff:ffff:ffff:ffff,US
@@ -10369,9 +10573,7 @@
2607:f720::,2607:f720:ffff:ffff:ffff:ffff:ffff:ffff,US
2607:f728::,2607:f728:ffff:ffff:ffff:ffff:ffff:ffff,US
2607:f738::,2607:f738:ffff:ffff:ffff:ffff:ffff:ffff,US
-2607:f740::,2607:f740:6f:ffff:ffff:ffff:ffff:ffff,US
-2607:f740:70::,2607:f740:70:7fff:ffff:ffff:ffff:ffff,CA
-2607:f740:70:8000::,2607:f740:8f:ffff:ffff:ffff:ffff:ffff,US
+2607:f740::,2607:f740:8f:ffff:ffff:ffff:ffff:ffff,US
2607:f740:90::,2607:f740:90:7fff:ffff:ffff:ffff:ffff,HK
2607:f740:90:8000::,2607:f740:ffff:ffff:ffff:ffff:ffff:ffff,US
2607:f748::,2607:f748:ffff:ffff:ffff:ffff:ffff:ffff,CA
@@ -10908,8 +11110,8 @@
2620:0:1056::,2620::1056:7fff:ffff:ffff:ffff:ffff,FR
2620:0:1056:8000::,2620::1056:ffff:ffff:ffff:ffff:ffff,US
2620:0:1057::,2620::1057:7fff:ffff:ffff:ffff:ffff,DE
-2620:0:1057:8000::,2620::105a:7fff:ffff:ffff:ffff:ffff,US
-2620:0:105a:8000::,2620::105a:ffff:ffff:ffff:ffff:ffff,UG
+2620:0:1057:8000::,2620::1059:ffff:ffff:ffff:ffff:ffff,US
+2620:0:105a::,2620::105a:ffff:ffff:ffff:ffff:ffff,UG
2620:0:105b::,2620::105e:ffff:ffff:ffff:ffff:ffff,US
2620:0:105f::,2620::105f:ffff:ffff:ffff:ffff:ffff,CH
2620:0:1060::,2620::1060:ffff:ffff:ffff:ffff:ffff,US
@@ -10982,8 +11184,7 @@
2620:0:2860::,2620::2860:ffff:ffff:ffff:ffff:ffff,US
2620:0:2870::,2620::2870:ffff:ffff:ffff:ffff:ffff,US
2620:0:2880::,2620::2880:ffff:ffff:ffff:ffff:ffff,US
-2620:0:28a0::,2620::28a0:ffff:ffff:ffff:ffff:ffff,US
-2620:0:28b0::,2620::28b0:ffff:ffff:ffff:ffff:ffff,US
+2620:0:28a0::,2620::28b0:ffff:ffff:ffff:ffff:ffff,US
2620:0:28d0::,2620::28d0:ffff:ffff:ffff:ffff:ffff,US
2620:0:28f0::,2620::28f0:ffff:ffff:ffff:ffff:ffff,US
2620:0:2900::,2620::290f:ffff:ffff:ffff:ffff:ffff,US
@@ -11398,7 +11599,6 @@
2620:63:c000::,2620:63:c000:ffff:ffff:ffff:ffff:ffff,US
2620:64::,2620:64::ffff:ffff:ffff:ffff:ffff,US
2620:64:4000::,2620:64:4000:ffff:ffff:ffff:ffff:ffff,US
-2620:64:8000::,2620:64:8000:ffff:ffff:ffff:ffff:ffff,TW
2620:64:c000::,2620:64:c00f:ffff:ffff:ffff:ffff:ffff,US
2620:65::,2620:65:ff:ffff:ffff:ffff:ffff:ffff,US
2620:65:8000::,2620:65:800f:ffff:ffff:ffff:ffff:ffff,US
@@ -11493,7 +11693,6 @@
2620:7e::,2620:7e:f:ffff:ffff:ffff:ffff:ffff,US
2620:7e:60c0::,2620:7e:60c0:ffff:ffff:ffff:ffff:ffff,US
2620:7e:c080::,2620:7e:c080:ffff:ffff:ffff:ffff:ffff,US
-2620:7f:2040::,2620:7f:2040:ffff:ffff:ffff:ffff:ffff,US
2620:7f:8000::,2620:7f:8000:ffff:ffff:ffff:ffff:ffff,CA
2620:7f:c000::,2620:7f:c000:ffff:ffff:ffff:ffff:ffff,US
2620:80:4000::,2620:80:4000:ffff:ffff:ffff:ffff:ffff,US
@@ -11826,7 +12025,7 @@
2620:d4::,2620:d4::ffff:ffff:ffff:ffff:ffff,US
2620:d4:4000::,2620:d4:4000:ffff:ffff:ffff:ffff:ffff,US
2620:d4:8000::,2620:d4:8000:ffff:ffff:ffff:ffff:ffff,US
-2620:d4:c000::,2620:d4:c000:ffff:ffff:ffff:ffff:ffff,US
+2620:d4:c000::,2620:d4:c00f:ffff:ffff:ffff:ffff:ffff,US
2620:d5::,2620:d5::ffff:ffff:ffff:ffff:ffff,US
2620:d5:4000::,2620:d5:4000:ffff:ffff:ffff:ffff:ffff,US
2620:d5:8000::,2620:d5:8000:ffff:ffff:ffff:ffff:ffff,US
@@ -11906,21 +12105,37 @@
2620:e8::,2620:e8::ffff:ffff:ffff:ffff:ffff,US
2620:e8:4000::,2620:e8:4000:ffff:ffff:ffff:ffff:ffff,US
2620:e8:8000::,2620:e8:8000:ffff:ffff:ffff:ffff:ffff,US
+2620:e8:c000::,2620:e8:c000:ffff:ffff:ffff:ffff:ffff,US
2620:e9::,2620:e9::ffff:ffff:ffff:ffff:ffff,US
+2620:e9:4000::,2620:e9:4000:ffff:ffff:ffff:ffff:ffff,US
2620:e9:8000::,2620:e9:8000:ffff:ffff:ffff:ffff:ffff,US
+2620:e9:c000::,2620:e9:c000:ffff:ffff:ffff:ffff:ffff,US
2620:ea::,2620:ea:f:ffff:ffff:ffff:ffff:ffff,US
+2620:ea:4000::,2620:ea:4000:ffff:ffff:ffff:ffff:ffff,US
2620:ea:8000::,2620:ea:8000:ffff:ffff:ffff:ffff:ffff,US
+2620:ea:c000::,2620:ea:c000:ffff:ffff:ffff:ffff:ffff,US
2620:eb::,2620:eb::ffff:ffff:ffff:ffff:ffff,US
+2620:eb:4000::,2620:eb:4000:ffff:ffff:ffff:ffff:ffff,US
2620:eb:8000::,2620:eb:8000:ffff:ffff:ffff:ffff:ffff,US
+2620:eb:c000::,2620:eb:c000:ffff:ffff:ffff:ffff:ffff,US
2620:ec::,2620:ec::ffff:ffff:ffff:ffff:ffff,US
+2620:ec:4000::,2620:ec:4000:ffff:ffff:ffff:ffff:ffff,US
2620:ec:8000::,2620:ec:8000:ffff:ffff:ffff:ffff:ffff,US
+2620:ec:c000::,2620:ec:c000:ffff:ffff:ffff:ffff:ffff,US
2620:ed::,2620:ed::ffff:ffff:ffff:ffff:ffff,US
+2620:ed:4000::,2620:ed:4000:ffff:ffff:ffff:ffff:ffff,CA
2620:ed:8000::,2620:ed:8000:ffff:ffff:ffff:ffff:ffff,US
+2620:ed:c000::,2620:ed:c000:ffff:ffff:ffff:ffff:ffff,US
2620:ee::,2620:ee::ffff:ffff:ffff:ffff:ffff,US
+2620:ee:4000::,2620:ee:4000:ffff:ffff:ffff:ffff:ffff,US
2620:ee:8000::,2620:ee:8000:ffff:ffff:ffff:ffff:ffff,US
+2620:ee:c000::,2620:ee:c000:ffff:ffff:ffff:ffff:ffff,US
2620:ef::,2620:ef::ffff:ffff:ffff:ffff:ffff,US
+2620:ef:4000::,2620:ef:4000:ffff:ffff:ffff:ffff:ffff,US
2620:ef:8000::,2620:ef:8000:ffff:ffff:ffff:ffff:ffff,US
+2620:ef:c000::,2620:ef:c000:ffff:ffff:ffff:ffff:ffff,US
2620:f0::,2620:f0::ffff:ffff:ffff:ffff:ffff,US
+2620:f0:4000::,2620:f0:4000:ffff:ffff:ffff:ffff:ffff,US
2620:f0:8000::,2620:f0:8000:ffff:ffff:ffff:ffff:ffff,US
2620:f1::,2620:f1::ffff:ffff:ffff:ffff:ffff,US
2620:f1:8000::,2620:f1:8000:ffff:ffff:ffff:ffff:ffff,US
@@ -12165,9 +12380,7 @@
2620:10d:9000::,2620:10d:900f:ffff:ffff:ffff:ffff:ffff,US
2620:10d:a000::,2620:10d:a0ff:ffff:ffff:ffff:ffff:ffff,US
2620:10d:b000::,2620:10d:b00f:ffff:ffff:ffff:ffff:ffff,US
-2620:10d:c000::,2620:10d:c091:ffff:ffff:ffff:ffff:ffff,US
-2620:10d:c092::,2620:10d:c092:7fff:ffff:ffff:ffff:ffff,GB
-2620:10d:c092:8000::,2620:10d:c0f0:ffff:ffff:ffff:ffff:ffff,US
+2620:10d:c000::,2620:10d:c0f0:ffff:ffff:ffff:ffff:ffff,US
2620:10d:c0f1::,2620:10d:c0f1:7fff:ffff:ffff:ffff:ffff,KR
2620:10d:c0f1:8000::,2620:10d:c0ff:ffff:ffff:ffff:ffff:ffff,US
2620:10d:d000::,2620:10d:d00f:ffff:ffff:ffff:ffff:ffff,CA
@@ -12216,7 +12429,6 @@
2620:110:8000::,2620:110:80ff:ffff:ffff:ffff:ffff:ffff,US
2620:110:9000::,2620:110:900f:ffff:ffff:ffff:ffff:ffff,US
2620:110:a000::,2620:110:a00f:ffff:ffff:ffff:ffff:ffff,US
-2620:110:b000::,2620:110:b00f:ffff:ffff:ffff:ffff:ffff,US
2620:110:d000::,2620:110:d00f:ffff:ffff:ffff:ffff:ffff,US
2620:110:e000::,2620:110:e00f:ffff:ffff:ffff:ffff:ffff,US
2620:110:f000::,2620:110:f00f:ffff:ffff:ffff:ffff:ffff,US
@@ -12523,6 +12735,21 @@
2620:123:b000::,2620:123:b00f:ffff:ffff:ffff:ffff:ffff,US
2620:123:c000::,2620:123:c0ff:ffff:ffff:ffff:ffff:ffff,US
2620:123:d000::,2620:123:d0ff:ffff:ffff:ffff:ffff:ffff,US
+2620:123:e000::,2620:123:e0ff:ffff:ffff:ffff:ffff:ffff,US
+2620:123:f000::,2620:123:f00f:ffff:ffff:ffff:ffff:ffff,US
+2620:124::,2620:124:f:ffff:ffff:ffff:ffff:ffff,US
+2620:124:1000::,2620:124:100f:ffff:ffff:ffff:ffff:ffff,US
+2620:124:2000::,2620:124:200f:ffff:ffff:ffff:ffff:ffff,US
+2620:124:3000::,2620:124:30ff:ffff:ffff:ffff:ffff:ffff,US
+2620:124:4000::,2620:124:400f:ffff:ffff:ffff:ffff:ffff,US
+2620:124:5000::,2620:124:50ff:ffff:ffff:ffff:ffff:ffff,CA
+2620:124:6000::,2620:124:60ff:ffff:ffff:ffff:ffff:ffff,US
+2620:124:7000::,2620:124:700f:ffff:ffff:ffff:ffff:ffff,US
+2620:124:8000::,2620:124:800f:ffff:ffff:ffff:ffff:ffff,US
+2620:124:9000::,2620:124:900f:ffff:ffff:ffff:ffff:ffff,US
+2620:124:a000::,2620:124:a00f:ffff:ffff:ffff:ffff:ffff,US
+2620:124:b000::,2620:124:b0ff:ffff:ffff:ffff:ffff:ffff,CA
+2620:124:c000::,2620:124:c00f:ffff:ffff:ffff:ffff:ffff,US
2620:140::,2620:140:3ff:ffff:ffff:ffff:ffff:ffff,US
2620:141::,2620:141:fff:ffff:ffff:ffff:ffff:ffff,US
2620:143::,2620:143:7ff:ffff:ffff:ffff:ffff:ffff,US
@@ -12549,9 +12776,12 @@
2620:159::,2620:159:fff:ffff:ffff:ffff:ffff:ffff,US
2620:15a::,2620:15a:fff:ffff:ffff:ffff:ffff:ffff,US
2620:15b::,2620:15b:fff:ffff:ffff:ffff:ffff:ffff,US
-2620:15c::,2620:15c:4:ffff:ffff:ffff:ffff:ffff,US
+2620:15c::,2620:15c::7fff:ffff:ffff:ffff:ffff,CA
+2620:15c:0:8000::,2620:15c:4:ffff:ffff:ffff:ffff:ffff,US
2620:15c:5::,2620:15c:5:ffff:ffff:ffff:ffff:ffff,BR
-2620:15c:6::,2620:15c:fff:ffff:ffff:ffff:ffff:ffff,US
+2620:15c:6::,2620:15c:d:ffff:ffff:ffff:ffff:ffff,US
+2620:15c:e::,2620:15c:e:7fff:ffff:ffff:ffff:ffff,MX
+2620:15c:e:8000::,2620:15c:fff:ffff:ffff:ffff:ffff:ffff,US
2620:15d::,2620:15e:fff:ffff:ffff:ffff:ffff:ffff,US
2620:15f::,2620:15f:fff:ffff:ffff:ffff:ffff:ffff,US
2620:160::,2620:160:ffff:ffff:ffff:ffff:ffff:ffff,US
@@ -12914,6 +13144,7 @@
2801:12:c000::,2801:12:c000:ffff:ffff:ffff:ffff:ffff,AR
2801:12:e000::,2801:12:e000:ffff:ffff:ffff:ffff:ffff,PA
2801:13::,2801:13::ffff:ffff:ffff:ffff:ffff,VE
+2801:13:1000::,2801:13:1000:ffff:ffff:ffff:ffff:ffff,AR
2801:13:2000::,2801:13:2000:ffff:ffff:ffff:ffff:ffff,AR
2801:13:4000::,2801:13:4000:ffff:ffff:ffff:ffff:ffff,CL
2801:13:6000::,2801:13:6000:ffff:ffff:ffff:ffff:ffff,GT
@@ -12931,6 +13162,7 @@
2801:14:c000::,2801:14:c000:ffff:ffff:ffff:ffff:ffff,BO
2801:14:e000::,2801:14:e000:ffff:ffff:ffff:ffff:ffff,PY
2801:15::,2801:15::ffff:ffff:ffff:ffff:ffff,EC
+2801:15:1000::,2801:15:1000:ffff:ffff:ffff:ffff:ffff,SV
2801:15:2000::,2801:15:2000:ffff:ffff:ffff:ffff:ffff,CR
2801:15:4000::,2801:15:4000:ffff:ffff:ffff:ffff:ffff,CO
2801:15:6000::,2801:15:6000:ffff:ffff:ffff:ffff:ffff,SV
@@ -12948,6 +13180,7 @@
2801:16:a000::,2801:16:a000:ffff:ffff:ffff:ffff:ffff,CR
2801:16:c000::,2801:16:c000:ffff:ffff:ffff:ffff:ffff,AR
2801:17::,2801:17::ffff:ffff:ffff:ffff:ffff,CL
+2801:17:1000::,2801:17:1000:ffff:ffff:ffff:ffff:ffff,HN
2801:17:2000::,2801:17:2000:ffff:ffff:ffff:ffff:ffff,PY
2801:17:4000::,2801:17:4000:ffff:ffff:ffff:ffff:ffff,CO
2801:17:6000::,2801:17:6000:ffff:ffff:ffff:ffff:ffff,AR
@@ -12983,6 +13216,7 @@
2801:1a:c000::,2801:1a:c000:ffff:ffff:ffff:ffff:ffff,CO
2801:1a:e000::,2801:1a:e000:ffff:ffff:ffff:ffff:ffff,DO
2801:1b::,2801:1b::ffff:ffff:ffff:ffff:ffff,CR
+2801:1b:1000::,2801:1b:1000:ffff:ffff:ffff:ffff:ffff,CL
2801:1b:2000::,2801:1b:2000:ffff:ffff:ffff:ffff:ffff,UY
2801:1b:4000::,2801:1b:4000:ffff:ffff:ffff:ffff:ffff,CL
2801:1b:6000::,2801:1b:6000:ffff:ffff:ffff:ffff:ffff,CL
@@ -13000,6 +13234,7 @@
2801:1c:c000::,2801:1c:c000:ffff:ffff:ffff:ffff:ffff,HN
2801:1c:e000::,2801:1c:e000:ffff:ffff:ffff:ffff:ffff,CO
2801:1d::,2801:1d::ffff:ffff:ffff:ffff:ffff,PY
+2801:1d:1000::,2801:1d:1000:ffff:ffff:ffff:ffff:ffff,AR
2801:1d:2000::,2801:1d:2000:ffff:ffff:ffff:ffff:ffff,GT
2801:1d:4000::,2801:1d:4000:ffff:ffff:ffff:ffff:ffff,TT
2801:1d:6000::,2801:1d:6000:ffff:ffff:ffff:ffff:ffff,NI
@@ -13295,7 +13530,16 @@
2801:80:13c0::,2801:80:13c0:ffff:ffff:ffff:ffff:ffff,BR
2801:80:13d0::,2801:80:13d0:ffff:ffff:ffff:ffff:ffff,BR
2801:80:13e0::,2801:80:13e0:ffff:ffff:ffff:ffff:ffff,BR
+2801:80:13f0::,2801:80:13f0:ffff:ffff:ffff:ffff:ffff,BR
2801:80:1400::,2801:80:14ff:ffff:ffff:ffff:ffff:ffff,BR
+2801:80:1600::,2801:80:1600:ffff:ffff:ffff:ffff:ffff,BR
+2801:80:1610::,2801:80:1610:ffff:ffff:ffff:ffff:ffff,BR
+2801:80:1620::,2801:80:162f:ffff:ffff:ffff:ffff:ffff,BR
+2801:80:1640::,2801:80:1640:ffff:ffff:ffff:ffff:ffff,BR
+2801:80:1650::,2801:80:1650:ffff:ffff:ffff:ffff:ffff,BR
+2801:80:1660::,2801:80:1660:ffff:ffff:ffff:ffff:ffff,BR
+2801:80:1670::,2801:80:1670:ffff:ffff:ffff:ffff:ffff,BR
+2801:80:1680::,2801:80:1680:ffff:ffff:ffff:ffff:ffff,BR
2801:82::,2801:82:ffff:ffff:ffff:ffff:ffff:ffff,BR
2801:84::,2801:84:ffff:ffff:ffff:ffff:ffff:ffff,BR
2801:86::,2801:86:ffff:ffff:ffff:ffff:ffff:ffff,BR
@@ -13330,6 +13574,7 @@
2801:c0::,2801:c0:ffff:ffff:ffff:ffff:ffff:ffff,MX
2801:c4::,2801:c4::ffff:ffff:ffff:ffff:ffff,MX
2801:c4:10::,2801:c4:10:ffff:ffff:ffff:ffff:ffff,MX
+2801:c4:12::,2801:c4:12:ffff:ffff:ffff:ffff:ffff,MX
2801:c4:20::,2801:c4:20:ffff:ffff:ffff:ffff:ffff,MX
2801:c4:30::,2801:c4:30:ffff:ffff:ffff:ffff:ffff,MX
2801:c4:40::,2801:c4:40:ffff:ffff:ffff:ffff:ffff,MX
@@ -13355,6 +13600,7 @@
2801:140::,2801:140:ffff:ffff:ffff:ffff:ffff:ffff,AR
2801:148::,2801:148:ff:ffff:ffff:ffff:ffff:ffff,AR
2801:150::,2801:150:ffff:ffff:ffff:ffff:ffff:ffff,PE
+2801:158::,2801:158:fff:ffff:ffff:ffff:ffff:ffff,PA
2801:160::,2801:160:ff:ffff:ffff:ffff:ffff:ffff,CO
2801:168::,2801:168:ff:ffff:ffff:ffff:ffff:ffff,AR
2801:170::,2801:170:fff:ffff:ffff:ffff:ffff:ffff,CO
@@ -13387,6 +13633,7 @@
2803:440::,2803:440:ffff:ffff:ffff:ffff:ffff:ffff,AR
2803:480::,2803:480:ffff:ffff:ffff:ffff:ffff:ffff,EC
2803:500::,2803:500:ffff:ffff:ffff:ffff:ffff:ffff,PE
+2803:540::,2803:540:ffff:ffff:ffff:ffff:ffff:ffff,CR
2803:580::,2803:580:ffff:ffff:ffff:ffff:ffff:ffff,AR
2803:600::,2803:600:ffff:ffff:ffff:ffff:ffff:ffff,PA
2803:640::,2803:640:ffff:ffff:ffff:ffff:ffff:ffff,AR
@@ -13446,6 +13693,7 @@
2803:1840::,2803:1840:ffff:ffff:ffff:ffff:ffff:ffff,CO
2803:1880::,2803:1880:ffff:ffff:ffff:ffff:ffff:ffff,PE
2803:1900::,2803:1900:ffff:ffff:ffff:ffff:ffff:ffff,AR
+2803:1940::,2803:1940:ffff:ffff:ffff:ffff:ffff:ffff,AR
2803:1980::,2803:1980:ffff:ffff:ffff:ffff:ffff:ffff,CO
2803:1a00::,2803:1a00:ffff:ffff:ffff:ffff:ffff:ffff,CO
2803:1a40::,2803:1a40:ffff:ffff:ffff:ffff:ffff:ffff,AR
@@ -13527,6 +13775,7 @@
2803:3840::,2803:3840:ffff:ffff:ffff:ffff:ffff:ffff,AR
2803:3880::,2803:3880:ffff:ffff:ffff:ffff:ffff:ffff,AR
2803:3900::,2803:3900:ffff:ffff:ffff:ffff:ffff:ffff,VE
+2803:3940::,2803:3940:ffff:ffff:ffff:ffff:ffff:ffff,AR
2803:3980::,2803:3980:ffff:ffff:ffff:ffff:ffff:ffff,VE
2803:3a00::,2803:3a00:ffff:ffff:ffff:ffff:ffff:ffff,GT
2803:3a40::,2803:3a40:ffff:ffff:ffff:ffff:ffff:ffff,CL
@@ -13558,6 +13807,7 @@
2803:4440::,2803:4440:ffff:ffff:ffff:ffff:ffff:ffff,AR
2803:4480::,2803:4480:ffff:ffff:ffff:ffff:ffff:ffff,PE
2803:4500::,2803:4500:ffff:ffff:ffff:ffff:ffff:ffff,CW
+2803:4540::,2803:4540:ffff:ffff:ffff:ffff:ffff:ffff,HN
2803:4580::,2803:4580:ffff:ffff:ffff:ffff:ffff:ffff,CR
2803:4600::,2803:4600:ffff:ffff:ffff:ffff:ffff:ffff,HN
2803:4640::,2803:4640:ffff:ffff:ffff:ffff:ffff:ffff,CL
@@ -13608,6 +13858,7 @@
2803:5840::,2803:5840:ffff:ffff:ffff:ffff:ffff:ffff,CR
2803:5880::,2803:5880:ffff:ffff:ffff:ffff:ffff:ffff,AR
2803:5900::,2803:5900:ffff:ffff:ffff:ffff:ffff:ffff,GF
+2803:5940::,2803:5940:ffff:ffff:ffff:ffff:ffff:ffff,PE
2803:5980::,2803:5980:ffff:ffff:ffff:ffff:ffff:ffff,AR
2803:5a00::,2803:5a00:ffff:ffff:ffff:ffff:ffff:ffff,AR
2803:5a40::,2803:5a40:ffff:ffff:ffff:ffff:ffff:ffff,PY
@@ -13648,6 +13899,7 @@
2803:6840::,2803:6840:ffff:ffff:ffff:ffff:ffff:ffff,AR
2803:6880::,2803:6880:ffff:ffff:ffff:ffff:ffff:ffff,AR
2803:6900::,2803:6900:ffff:ffff:ffff:ffff:ffff:ffff,CR
+2803:6940::,2803:6940:ffff:ffff:ffff:ffff:ffff:ffff,PY
2803:6980::,2803:6980:ffff:ffff:ffff:ffff:ffff:ffff,AR
2803:6a00::,2803:6a00:ffff:ffff:ffff:ffff:ffff:ffff,EC
2803:6a40::,2803:6a40:ffff:ffff:ffff:ffff:ffff:ffff,AR
@@ -13689,6 +13941,7 @@
2803:7840::,2803:7840:ffff:ffff:ffff:ffff:ffff:ffff,AR
2803:7880::,2803:7880:ffff:ffff:ffff:ffff:ffff:ffff,AR
2803:7900::,2803:7900:ffff:ffff:ffff:ffff:ffff:ffff,BZ
+2803:7940::,2803:7940:ffff:ffff:ffff:ffff:ffff:ffff,AR
2803:7980::,2803:7980:ffff:ffff:ffff:ffff:ffff:ffff,VE
2803:7a00::,2803:7a00:ffff:ffff:ffff:ffff:ffff:ffff,CR
2803:7a40::,2803:7a40:ffff:ffff:ffff:ffff:ffff:ffff,AR
@@ -13720,6 +13973,7 @@
2803:8440::,2803:8440:ffff:ffff:ffff:ffff:ffff:ffff,AR
2803:8480::,2803:8480:ffff:ffff:ffff:ffff:ffff:ffff,AR
2803:8500::,2803:8500:ffff:ffff:ffff:ffff:ffff:ffff,AR
+2803:8540::,2803:8540:ffff:ffff:ffff:ffff:ffff:ffff,CL
2803:8580::,2803:8580:ffff:ffff:ffff:ffff:ffff:ffff,CO
2803:8600::,2803:8600:ffff:ffff:ffff:ffff:ffff:ffff,HT
2803:8640::,2803:8640:ffff:ffff:ffff:ffff:ffff:ffff,AR
@@ -13771,6 +14025,7 @@
2803:9840::,2803:9840:ffff:ffff:ffff:ffff:ffff:ffff,NI
2803:9880::,2803:9880:ffff:ffff:ffff:ffff:ffff:ffff,BZ
2803:9900::,2803:9900:ffff:ffff:ffff:ffff:ffff:ffff,CL
+2803:9940::,2803:9940:ffff:ffff:ffff:ffff:ffff:ffff,AR
2803:9980::,2803:9980:ffff:ffff:ffff:ffff:ffff:ffff,CO
2803:9a00::,2803:9a00:ffff:ffff:ffff:ffff:ffff:ffff,BZ
2803:9a40::,2803:9a40:ffff:ffff:ffff:ffff:ffff:ffff,BZ
@@ -13852,6 +14107,7 @@
2803:b840::,2803:b840:ffff:ffff:ffff:ffff:ffff:ffff,PA
2803:b880::,2803:b880:ffff:ffff:ffff:ffff:ffff:ffff,AR
2803:b900::,2803:b900:ffff:ffff:ffff:ffff:ffff:ffff,AR
+2803:b940::,2803:b940:ffff:ffff:ffff:ffff:ffff:ffff,PE
2803:ba00::,2803:ba00:ffff:ffff:ffff:ffff:ffff:ffff,GT
2803:ba40::,2803:ba40:ffff:ffff:ffff:ffff:ffff:ffff,AR
2803:ba80::,2803:ba80:ffff:ffff:ffff:ffff:ffff:ffff,AR
@@ -13920,7 +14176,6 @@
2803:d200::,2803:d200:ffff:ffff:ffff:ffff:ffff:ffff,CR
2803:d240::,2803:d240:ffff:ffff:ffff:ffff:ffff:ffff,AR
2803:d280::,2803:d280:ffff:ffff:ffff:ffff:ffff:ffff,PY
-2803:d300::,2803:d300:ffff:ffff:ffff:ffff:ffff:ffff,PA
2803:d380::,2803:d380:ffff:ffff:ffff:ffff:ffff:ffff,CL
2803:d400::,2803:d400:ffff:ffff:ffff:ffff:ffff:ffff,AR
2803:d440::,2803:d440:ffff:ffff:ffff:ffff:ffff:ffff,VE
@@ -13936,6 +14191,7 @@
2803:d840::,2803:d840:ffff:ffff:ffff:ffff:ffff:ffff,PA
2803:d880::,2803:d880:ffff:ffff:ffff:ffff:ffff:ffff,CR
2803:d900::,2803:d900:ffff:ffff:ffff:ffff:ffff:ffff,CR
+2803:d940::,2803:d940:ffff:ffff:ffff:ffff:ffff:ffff,VE
2803:d980::,2803:d980:ffff:ffff:ffff:ffff:ffff:ffff,PA
2803:da00::,2803:da00:ffff:ffff:ffff:ffff:ffff:ffff,GY
2803:da40::,2803:da40:ffff:ffff:ffff:ffff:ffff:ffff,AR
@@ -13977,6 +14233,7 @@
2803:e840::,2803:e840:ffff:ffff:ffff:ffff:ffff:ffff,CO
2803:e880::,2803:e880:ffff:ffff:ffff:ffff:ffff:ffff,GT
2803:e900::,2803:e900:ffff:ffff:ffff:ffff:ffff:ffff,AR
+2803:e940::,2803:e940:ffff:ffff:ffff:ffff:ffff:ffff,AR
2803:e980::,2803:e980:ffff:ffff:ffff:ffff:ffff:ffff,AR
2803:ea00::,2803:ea00:ffff:ffff:ffff:ffff:ffff:ffff,AR
2803:ea40::,2803:ea40:ffff:ffff:ffff:ffff:ffff:ffff,AR
@@ -14017,6 +14274,7 @@
2803:f800::,2803:f800:ffff:ffff:ffff:ffff:ffff:ffff,CR
2803:f840::,2803:f840:ffff:ffff:ffff:ffff:ffff:ffff,CO
2803:f900::,2803:f900:ffff:ffff:ffff:ffff:ffff:ffff,BZ
+2803:f940::,2803:f940:ffff:ffff:ffff:ffff:ffff:ffff,SX
2803:f980::,2803:f980:ffff:ffff:ffff:ffff:ffff:ffff,CL
2803:fa00::,2803:fa00:ffff:ffff:ffff:ffff:ffff:ffff,BO
2803:fa40::,2803:fa40:ffff:ffff:ffff:ffff:ffff:ffff,SV
@@ -15975,6 +16233,10 @@
2804:1f10::,2804:1f10:ffff:ffff:ffff:ffff:ffff:ffff,BR
2804:1f12::,2804:1f12:ffff:ffff:ffff:ffff:ffff:ffff,BR
2804:1f14::,2804:1f14:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:1f16::,2804:1f16:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:1f18::,2804:1f18:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:1f1a::,2804:1f1a:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:1f1c::,2804:1f1c:ffff:ffff:ffff:ffff:ffff:ffff,BR
2804:2000::,2804:2000:ffff:ffff:ffff:ffff:ffff:ffff,BR
2804:2004::,2804:2004:ffff:ffff:ffff:ffff:ffff:ffff,BR
2804:2008::,2804:2008:ffff:ffff:ffff:ffff:ffff:ffff,BR
@@ -16719,9 +16981,85 @@
2804:2b98::,2804:2b98:ffff:ffff:ffff:ffff:ffff:ffff,BR
2804:2b9c::,2804:2b9c:ffff:ffff:ffff:ffff:ffff:ffff,BR
2804:2ba0::,2804:2ba0:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2ba4::,2804:2ba4:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2ba8::,2804:2ba8:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2bac::,2804:2bac:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2bb0::,2804:2bb0:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2bb4::,2804:2bb4:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2bb8::,2804:2bb8:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2bbc::,2804:2bbc:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2bc0::,2804:2bc0:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2bc4::,2804:2bc4:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2bc8::,2804:2bc8:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2bcc::,2804:2bcc:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2bd0::,2804:2bd0:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2bd4::,2804:2bd4:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2bd8::,2804:2bd8:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2bdc::,2804:2bdc:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2be0::,2804:2be0:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2be4::,2804:2be4:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2be8::,2804:2be8:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2bec::,2804:2bec:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2bf0::,2804:2bf0:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2bf4::,2804:2bf4:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2bf8::,2804:2bf8:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2bfc::,2804:2bfc:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c00::,2804:2c00:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c04::,2804:2c04:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c08::,2804:2c08:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c0c::,2804:2c0c:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c10::,2804:2c10:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c14::,2804:2c14:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c18::,2804:2c18:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c1c::,2804:2c1c:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c20::,2804:2c20:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c24::,2804:2c24:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c28::,2804:2c28:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c2c::,2804:2c2c:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c30::,2804:2c30:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c34::,2804:2c34:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c38::,2804:2c38:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c3c::,2804:2c3c:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c40::,2804:2c40:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c44::,2804:2c44:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c48::,2804:2c48:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c4c::,2804:2c4c:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c50::,2804:2c50:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c54::,2804:2c54:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c58::,2804:2c58:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c5c::,2804:2c5c:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c60::,2804:2c60:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c64::,2804:2c64:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c68::,2804:2c68:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c6c::,2804:2c6c:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c70::,2804:2c70:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c74::,2804:2c74:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c78::,2804:2c78:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c7c::,2804:2c7c:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c80::,2804:2c80:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c84::,2804:2c84:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c88::,2804:2c88:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c8c::,2804:2c8c:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c90::,2804:2c90:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c94::,2804:2c94:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c98::,2804:2c98:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2c9c::,2804:2c9c:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2ca0::,2804:2ca0:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2ca4::,2804:2ca4:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2ca8::,2804:2ca8:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2cac::,2804:2cac:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2cb0::,2804:2cb0:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2cb4::,2804:2cb4:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2cb8::,2804:2cb8:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2cbc::,2804:2cbc:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2cc0::,2804:2cc0:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2cc4::,2804:2cc4:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2cc8::,2804:2cc8:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2ccc::,2804:2ccc:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2cd0::,2804:2cd0:ffff:ffff:ffff:ffff:ffff:ffff,BR
+2804:2cd4::,2804:2cd4:ffff:ffff:ffff:ffff:ffff:ffff,BR
2806::,2806:f:ffff:ffff:ffff:ffff:ffff:ffff,MX
-2806:200::,2806:20b:ffff:ffff:ffff:ffff:ffff:ffff,MX
-2806:210::,2806:216::ffff:ffff:ffff:ffff:ffff,MX
+2806:200::,2806:216::ffff:ffff:ffff:ffff:ffff,MX
2806:217::,2806:21d:ffff:ffff:ffff:ffff:ffff:ffff,MX
2806:220::,2806:220:ffff:ffff:ffff:ffff:ffff:ffff,MX
2806:230::,2806:230:ffff:ffff:ffff:ffff:ffff:ffff,MX
@@ -16838,9 +17176,10 @@
2a00:ee8::,2a00:ee8:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a00:ef0::,2a00:ef0:ffff:ffff:ffff:ffff:ffff:ffff,DK
2a00:ef8::,2a00:ef8:ffff:ffff:ffff:ffff:ffff:ffff,NO
-2a00:f00::,2a00:f00:ffff:ffff:ffff:ffff:ffff:ffff,RU
-2a00:f08::,2a00:f08:ffff:ffff:ffff:ffff:ffff:ffff,RU
-2a00:f10::,2a00:f17:ffff:ffff:ffff:ffff:ffff:ffff,NL
+2a00:f00::,2a00:f08:ffff:ffff:ffff:ffff:ffff:ffff,RU
+2a00:f10::,2a00:f10:120:ffff:ffff:ffff:ffff:ffff,NL
+2a00:f10:121::,2a00:f10:121:7fff:ffff:ffff:ffff:ffff,FR
+2a00:f10:121:8000::,2a00:f17:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a00:f18::,2a00:f18:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a00:f20::,2a00:f20:ffff:ffff:ffff:ffff:ffff:ffff,IT
2a00:f28::,2a00:f2f:ffff:ffff:ffff:ffff:ffff:ffff,AE
@@ -16929,7 +17268,9 @@
2a00:11c0:5::,2a00:11c0:5:7fff:ffff:ffff:ffff:ffff,CH
2a00:11c0:5:8000::,2a00:11c0:7:ffff:ffff:ffff:ffff:ffff,AT
2a00:11c0:8::,2a00:11c0:8:ffff:ffff:ffff:ffff:ffff,GB
-2a00:11c0:9::,2a00:11c0:62:ffff:ffff:ffff:ffff:ffff,AT
+2a00:11c0:9::,2a00:11c0:a:ffff:ffff:ffff:ffff:ffff,AT
+2a00:11c0:b::,2a00:11c0:b:ffff:ffff:ffff:ffff:ffff,IT
+2a00:11c0:c::,2a00:11c0:62:ffff:ffff:ffff:ffff:ffff,AT
2a00:11c0:63::,2a00:11c0:63:ffff:ffff:ffff:ffff:ffff,NL
2a00:11c0:64::,2a00:11c0:ffff:ffff:ffff:ffff:ffff:ffff,AT
2a00:11c8::,2a00:11c8:ffff:ffff:ffff:ffff:ffff:ffff,GB
@@ -16996,7 +17337,7 @@
2a00:13e0::,2a00:13e0:ffff:ffff:ffff:ffff:ffff:ffff,NO
2a00:13e8::,2a00:13e8:ffff:ffff:ffff:ffff:ffff:ffff,SE
2a00:13f0::,2a00:13f0:ffff:ffff:ffff:ffff:ffff:ffff,FI
-2a00:13f8::,2a00:13f8:ffff:ffff:ffff:ffff:ffff:ffff,RU
+2a00:13f8::,2a00:13ff:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a00:1400::,2a00:1400:ffff:ffff:ffff:ffff:ffff:ffff,NO
2a00:1408::,2a00:1408:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a00:1410::,2a00:1410:ffff:ffff:ffff:ffff:ffff:ffff,RU
@@ -17029,7 +17370,7 @@
2a00:14c0::,2a00:14c0:ffff:ffff:ffff:ffff:ffff:ffff,FI
2a00:14c8::,2a00:14c8:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a00:14d0::,2a00:14d0:ffff:ffff:ffff:ffff:ffff:ffff,RU
-2a00:14d8::,2a00:14d8:ffff:ffff:ffff:ffff:ffff:ffff,NO
+2a00:14d8::,2a00:14df:ffff:ffff:ffff:ffff:ffff:ffff,NO
2a00:14e0::,2a00:14e0:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a00:14e8::,2a00:14ef:ffff:ffff:ffff:ffff:ffff:ffff,FR
2a00:14f0::,2a00:14f0:ffff:ffff:ffff:ffff:ffff:ffff,GB
@@ -17040,7 +17381,6 @@
2a00:1518::,2a00:1518:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a00:1520::,2a00:1520:ffff:ffff:ffff:ffff:ffff:ffff,SE
2a00:1528::,2a00:1528:ffff:ffff:ffff:ffff:ffff:ffff,BE
-2a00:1530::,2a00:1531:ffff:ffff:ffff:ffff:ffff:ffff,HU
2a00:1538::,2a00:1538:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a00:1540::,2a00:1540:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a00:1548::,2a00:1548:ffff:ffff:ffff:ffff:ffff:ffff,NO
@@ -17136,7 +17476,7 @@
2a00:1880::,2a00:1880:ffff:ffff:ffff:ffff:ffff:ffff,TR
2a00:1888::,2a00:1888:ffff:ffff:ffff:ffff:ffff:ffff,FR
2a00:1890::,2a00:1897:ffff:ffff:ffff:ffff:ffff:ffff,DE
-2a00:1898::,2a00:1898:ffff:ffff:ffff:ffff:ffff:ffff,RU
+2a00:1898::,2a00:189f:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a00:18a0::,2a00:18a0:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a00:18a8::,2a00:18a8:ffff:ffff:ffff:ffff:ffff:ffff,FR
2a00:18b0::,2a00:18b0:ffff:ffff:ffff:ffff:ffff:ffff,NL
@@ -17342,7 +17682,6 @@
2a00:1ed8::,2a00:1edf:ffff:ffff:ffff:ffff:ffff:ffff,IE
2a00:1ee0::,2a00:1ee0:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a00:1ee8::,2a00:1ee8:ffff:ffff:ffff:ffff:ffff:ffff,SY
-2a00:1ef0::,2a00:1ef0:ffff:ffff:ffff:ffff:ffff:ffff,BG
2a00:1ef8::,2a00:1eff:ffff:ffff:ffff:ffff:ffff:ffff,SA
2a00:1f00::,2a00:1f00:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a00:1f08::,2a00:1f08:ffff:ffff:ffff:ffff:ffff:ffff,DE
@@ -17364,11 +17703,11 @@
2a00:1f88::,2a00:1f88:ffff:ffff:ffff:ffff:ffff:ffff,AT
2a00:1f90::,2a00:1f90:ffff:ffff:ffff:ffff:ffff:ffff,TR
2a00:1f98::,2a00:1f98:ffff:ffff:ffff:ffff:ffff:ffff,DK
-2a00:1fa0::,2a00:1fa0:ffff:ffff:ffff:ffff:ffff:ffff,RU
+2a00:1fa0::,2a00:1fa7:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a00:1fa8::,2a00:1fa8:ffff:ffff:ffff:ffff:ffff:ffff,GL
2a00:1fb0::,2a00:1fb0:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a00:1fb8::,2a00:1fb8:ffff:ffff:ffff:ffff:ffff:ffff,NL
-2a00:1fc0::,2a00:1fc0:ffff:ffff:ffff:ffff:ffff:ffff,RU
+2a00:1fc0::,2a00:1fc7:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a00:1fd0::,2a00:1fd0:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a00:1fd8::,2a00:1fd8:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a00:1fe0::,2a00:1fe0:ffff:ffff:ffff:ffff:ffff:ffff,IR
@@ -17541,9 +17880,9 @@
2a00:54c0::,2a00:54c0:ffff:ffff:ffff:ffff:ffff:ffff,PL
2a00:54e0::,2a00:54e0:ffff:ffff:ffff:ffff:ffff:ffff,IT
2a00:5500::,2a00:5500::7fff:ffff:ffff:ffff:ffff,AX
-2a00:5500:0:8000::,2a00:5500:1fff:ffff:ffff:ffff:ffff:ffff,FI
-2a00:5500:2000::,2a00:5500:2000:7fff:ffff:ffff:ffff:ffff,SE
-2a00:5500:2000:8000::,2a00:5500:ffff:ffff:ffff:ffff:ffff:ffff,FI
+2a00:5500:0:8000::,2a00:5500:1:ffff:ffff:ffff:ffff:ffff,FI
+2a00:5500:2::,2a00:5500:2:7fff:ffff:ffff:ffff:ffff,AX
+2a00:5500:2:8000::,2a00:5500:ffff:ffff:ffff:ffff:ffff:ffff,FI
2a00:5520::,2a00:5520:ffff:ffff:ffff:ffff:ffff:ffff,FR
2a00:5540::,2a00:5540:385:ffff:ffff:ffff:ffff:ffff,GB
2a00:5540:386::,2a00:5540:387:ffff:ffff:ffff:ffff:ffff,SI
@@ -17685,6 +18024,7 @@
2a00:66a0::,2a00:66a0:ffff:ffff:ffff:ffff:ffff:ffff,IL
2a00:66c0::,2a00:66c0:ffff:ffff:ffff:ffff:ffff:ffff,SE
2a00:66e0::,2a00:66e0:ffff:ffff:ffff:ffff:ffff:ffff,TR
+2a00:6700::,2a00:6700:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a00:6720::,2a00:6720:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a00:6740::,2a00:6740:ffff:ffff:ffff:ffff:ffff:ffff,UA
2a00:6760::,2a00:6760:ffff:ffff:ffff:ffff:ffff:ffff,FR
@@ -17699,6 +18039,7 @@
2a00:6880::,2a00:6880:ffff:ffff:ffff:ffff:ffff:ffff,LT
2a00:68a0::,2a00:68a0:ffff:ffff:ffff:ffff:ffff:ffff,AE
2a00:68c0::,2a00:68c0:ffff:ffff:ffff:ffff:ffff:ffff,FR
+2a00:68e0::,2a00:68e0:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a00:6900::,2a00:6900:ffff:ffff:ffff:ffff:ffff:ffff,FR
2a00:6920::,2a00:6920:ffff:ffff:ffff:ffff:ffff:ffff,LB
2a00:6940::,2a00:6940:ffff:ffff:ffff:ffff:ffff:ffff,ES
@@ -17850,7 +18191,9 @@
2a00:79e0:d::,2a00:79e0:13:ffff:ffff:ffff:ffff:ffff,CH
2a00:79e0:14::,2a00:79e0:14:ffff:ffff:ffff:ffff:ffff,ZA
2a00:79e0:15::,2a00:79e0:15:ffff:ffff:ffff:ffff:ffff,DE
-2a00:79e0:16::,2a00:79e0:22:ffff:ffff:ffff:ffff:ffff,CH
+2a00:79e0:16::,2a00:79e0:1b:ffff:ffff:ffff:ffff:ffff,CH
+2a00:79e0:1c::,2a00:79e0:1c:ffff:ffff:ffff:ffff:ffff,GH
+2a00:79e0:1d::,2a00:79e0:22:ffff:ffff:ffff:ffff:ffff,CH
2a00:79e0:23::,2a00:79e0:23:ffff:ffff:ffff:ffff:ffff,GB
2a00:79e0:24::,2a00:79e1:ffff:ffff:ffff:ffff:ffff:ffff,CH
2a00:7a00::,2a00:7a00:ffff:ffff:ffff:ffff:ffff:ffff,NO
@@ -17996,7 +18339,6 @@
2a00:8be0::,2a00:8be7:ffff:ffff:ffff:ffff:ffff:ffff,NO
2a00:8c00::,2a00:8c00:ffff:ffff:ffff:ffff:ffff:ffff,LT
2a00:8c20::,2a00:8c20:ffff:ffff:ffff:ffff:ffff:ffff,DE
-2a00:8c40::,2a00:8c40:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a00:8c60::,2a00:8c60:ffff:ffff:ffff:ffff:ffff:ffff,IT
2a00:8c80::,2a00:8c80:ffff:ffff:ffff:ffff:ffff:ffff,IE
2a00:8ca0::,2a00:8ca0:ffff:ffff:ffff:ffff:ffff:ffff,BA
@@ -18359,7 +18701,7 @@
2a00:b920::,2a00:b920:ffff:ffff:ffff:ffff:ffff:ffff,DK
2a00:b940::,2a00:b940:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a00:b960::,2a00:b960:ffff:ffff:ffff:ffff:ffff:ffff,PL
-2a00:b980::,2a00:b981:ffff:ffff:ffff:ffff:ffff:ffff,GB
+2a00:b980::,2a00:b987:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a00:b9a0::,2a00:b9a0:ffff:ffff:ffff:ffff:ffff:ffff,FI
2a00:b9c0::,2a00:b9c0:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a00:b9e0::,2a00:b9e0:ffff:ffff:ffff:ffff:ffff:ffff,EE
@@ -18385,7 +18727,6 @@
2a00:bc60::,2a00:bc60:ffff:ffff:ffff:ffff:ffff:ffff,IR
2a00:bc80::,2a00:bc80:ffff:ffff:ffff:ffff:ffff:ffff,FR
2a00:bca0::,2a00:bca0:ffff:ffff:ffff:ffff:ffff:ffff,NL
-2a00:bcc0::,2a00:bcc0:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a00:bce0::,2a00:bce0:ffff:ffff:ffff:ffff:ffff:ffff,SE
2a00:bd00::,2a00:bd00:ffff:ffff:ffff:ffff:ffff:ffff,CH
2a00:bd20::,2a00:bd20:ffff:ffff:ffff:ffff:ffff:ffff,NL
@@ -18434,7 +18775,7 @@
2a00:c2a0::,2a00:c2a0:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a00:c2c0::,2a00:c2c0:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a00:c2e0::,2a00:c2e0:ffff:ffff:ffff:ffff:ffff:ffff,FR
-2a00:c300::,2a00:c300:ffff:ffff:ffff:ffff:ffff:ffff,RU
+2a00:c300::,2a00:c307:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a00:c320::,2a00:c320:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a00:c340::,2a00:c340:ffff:ffff:ffff:ffff:ffff:ffff,FR
2a00:c360::,2a00:c360:ffff:ffff:ffff:ffff:ffff:ffff,RU
@@ -18742,7 +19083,7 @@
2a00:e9c0::,2a00:e9c0:ffff:ffff:ffff:ffff:ffff:ffff,ES
2a00:e9e0::,2a00:e9e0:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a00:ea00::,2a00:ea00:ffff:ffff:ffff:ffff:ffff:ffff,PL
-2a00:ea20::,2a00:ea20:ffff:ffff:ffff:ffff:ffff:ffff,RU
+2a00:ea20::,2a00:ea27:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a00:ea40::,2a00:ea40:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a00:ea60::,2a00:ea60:ff:ffff:ffff:ffff:ffff:ffff,LT
2a00:ea60:100::,2a00:ea60:1ff:ffff:ffff:ffff:ffff:ffff,GB
@@ -18762,7 +19103,8 @@
2a00:ec20::,2a00:ec23:ffff:ffff:ffff:ffff:ffff:ffff,FR
2a00:ec40::,2a00:ec47:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a00:ec80::,2a00:ec80:ffff:ffff:ffff:ffff:ffff:ffff,FR
-2a00:eca0::,2a00:eca0:ffff:ffff:ffff:ffff:ffff:ffff,FI
+2a00:eca0::,2a00:eca0::7fff:ffff:ffff:ffff:ffff,AX
+2a00:eca0:0:8000::,2a00:eca0:ffff:ffff:ffff:ffff:ffff:ffff,FI
2a00:ecc0::,2a00:ecc0:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a00:ece0::,2a00:ece7:ffff:ffff:ffff:ffff:ffff:ffff,RO
2a00:ed00::,2a00:ed00:ffff:ffff:ffff:ffff:ffff:ffff,GB
@@ -19045,9 +19387,7 @@
2a01:380::,2a01:380:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a01:388::,2a01:388:24e:ffff:ffff:ffff:ffff:ffff,GB
2a01:388:24f::,2a01:388:24f:7fff:ffff:ffff:ffff:ffff,NL
-2a01:388:24f:8000::,2a01:388:250:ffff:ffff:ffff:ffff:ffff,GB
-2a01:388:251::,2a01:388:251:7fff:ffff:ffff:ffff:ffff,NL
-2a01:388:251:8000::,2a01:38f:ffff:ffff:ffff:ffff:ffff:ffff,GB
+2a01:388:24f:8000::,2a01:38f:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a01:390::,2a01:390:ffff:ffff:ffff:ffff:ffff:ffff,SK
2a01:398::,2a01:398:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a01:3a0::,2a01:3a7:ffff:ffff:ffff:ffff:ffff:ffff,DK
@@ -19070,7 +19410,7 @@
2a01:3e0:1b00::,2a01:3e0:1b00:ffff:ffff:ffff:ffff:ffff,FI
2a01:3e0:ff24::,2a01:3e0:ff24:ffff:ffff:ffff:ffff:ffff,DE
2a01:3e8::,2a01:3e8:ffff:ffff:ffff:ffff:ffff:ffff,IT
-2a01:3f0::,2a01:3f0:ffff:ffff:ffff:ffff:ffff:ffff,SE
+2a01:3f0::,2a01:3f7:ffff:ffff:ffff:ffff:ffff:ffff,SE
2a01:3f8::,2a01:3f8:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a01:400::,2a01:400:ffff:ffff:ffff:ffff:ffff:ffff,IE
2a01:408::,2a01:408:ffff:ffff:ffff:ffff:ffff:ffff,DE
@@ -19171,7 +19511,6 @@
2a01:730::,2a01:730:ffff:ffff:ffff:ffff:ffff:ffff,TR
2a01:738::,2a01:738:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a01:740::,2a01:740:ffff:ffff:ffff:ffff:ffff:ffff,DE
-2a01:748::,2a01:748:ffff:ffff:ffff:ffff:ffff:ffff,TR
2a01:750::,2a01:750:ffff:ffff:ffff:ffff:ffff:ffff,UA
2a01:758::,2a01:758:ffff:ffff:ffff:ffff:ffff:ffff,UA
2a01:760::,2a01:760:ffff:ffff:ffff:ffff:ffff:ffff,CH
@@ -19290,7 +19629,7 @@
2a01:4b40::,2a01:4b40:ffff:ffff:ffff:ffff:ffff:ffff,KZ
2a01:4b60::,2a01:4b60:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a01:4b80::,2a01:4b80:ffff:ffff:ffff:ffff:ffff:ffff,ES
-2a01:4ba0::,2a01:4ba0:ffff:ffff:ffff:ffff:ffff:ffff,AZ
+2a01:4ba0::,2a01:4ba7:ffff:ffff:ffff:ffff:ffff:ffff,AZ
2a01:4bc0::,2a01:4bc0:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a01:4be0::,2a01:4be0:ffff:ffff:ffff:ffff:ffff:ffff,HU
2a01:4c00::,2a01:4c00:ffff:ffff:ffff:ffff:ffff:ffff,NL
@@ -19560,7 +19899,6 @@
2a01:6ce0::,2a01:6ce0:ffff:ffff:ffff:ffff:ffff:ffff,IE
2a01:6d00::,2a01:6d00:ffff:ffff:ffff:ffff:ffff:ffff,SE
2a01:6d20::,2a01:6d20:ffff:ffff:ffff:ffff:ffff:ffff,FI
-2a01:6d40::,2a01:6d40:ffff:ffff:ffff:ffff:ffff:ffff,ES
2a01:6d60::,2a01:6d60:ffff:ffff:ffff:ffff:ffff:ffff,IT
2a01:6d80::,2a01:6d80:ffff:ffff:ffff:ffff:ffff:ffff,UA
2a01:6da0::,2a01:6da0:ffff:ffff:ffff:ffff:ffff:ffff,EE
@@ -19625,7 +19963,6 @@
2a01:7500::,2a01:7500:ffff:ffff:ffff:ffff:ffff:ffff,BE
2a01:7520::,2a01:7520:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a01:7540::,2a01:7540:ffff:ffff:ffff:ffff:ffff:ffff,IT
-2a01:7560::,2a01:7560:ffff:ffff:ffff:ffff:ffff:ffff,BG
2a01:7580::,2a01:7580:ffff:ffff:ffff:ffff:ffff:ffff,ES
2a01:75a0::,2a01:75a0:ffff:ffff:ffff:ffff:ffff:ffff,AE
2a01:75c0::,2a01:75c7:ffff:ffff:ffff:ffff:ffff:ffff,DE
@@ -19710,7 +20047,7 @@
2a01:7fe0::,2a01:7fe0:ffff:ffff:ffff:ffff:ffff:ffff,CZ
2a01:8000::,2a01:8000:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a01:8020::,2a01:8020:ffff:ffff:ffff:ffff:ffff:ffff,EE
-2a01:8040::,2a01:8040:ffff:ffff:ffff:ffff:ffff:ffff,RU
+2a01:8040::,2a01:8047:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a01:8060::,2a01:8060:ffff:ffff:ffff:ffff:ffff:ffff,AE
2a01:8080::,2a01:8080:ffff:ffff:ffff:ffff:ffff:ffff,RO
2a01:80a0::,2a01:80a0:ffff:ffff:ffff:ffff:ffff:ffff,AT
@@ -20216,7 +20553,7 @@
2a02:10::,2a02:17:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a02:18::,2a02:18:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a02:20::,2a02:20:ffff:ffff:ffff:ffff:ffff:ffff,IT
-2a02:28::,2a02:28:ffff:ffff:ffff:ffff:ffff:ffff,RU
+2a02:28::,2a02:2f:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a02:30::,2a02:30:ffff:ffff:ffff:ffff:ffff:ffff,SE
2a02:38::,2a02:38:ffff:ffff:ffff:ffff:ffff:ffff,CZ
2a02:40::,2a02:40:ffff:ffff:ffff:ffff:ffff:ffff,GB
@@ -20522,7 +20859,7 @@
2a02:968::,2a02:968:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a02:970::,2a02:970:ffff:ffff:ffff:ffff:ffff:ffff,CZ
2a02:978::,2a02:978:ffff:ffff:ffff:ffff:ffff:ffff,RU
-2a02:980::,2a02:980:ffff:ffff:ffff:ffff:ffff:ffff,DK
+2a02:980::,2a02:987:ffff:ffff:ffff:ffff:ffff:ffff,DK
2a02:988::,2a02:988:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a02:990::,2a02:990:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a02:998::,2a02:998:ffff:ffff:ffff:ffff:ffff:ffff,DE
@@ -20632,7 +20969,7 @@
2a02:cf0::,2a02:cf0:ffff:ffff:ffff:ffff:ffff:ffff,UA
2a02:d00::,2a02:d00:ffff:ffff:ffff:ffff:ffff:ffff,CZ
2a02:d08::,2a02:d0f:ffff:ffff:ffff:ffff:ffff:ffff,BE
-2a02:d10::,2a02:d10:ffff:ffff:ffff:ffff:ffff:ffff,RO
+2a02:d10::,2a02:d17:ffff:ffff:ffff:ffff:ffff:ffff,RO
2a02:d18::,2a02:d18:ffff:ffff:ffff:ffff:ffff:ffff,AM
2a02:d20::,2a02:d20:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a02:d28::,2a02:d28:ffff:ffff:ffff:ffff:ffff:ffff,NL
@@ -21201,8 +21538,8 @@
2a02:2dc0::,2a02:2dc0:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a02:2de0::,2a02:2de0:ffff:ffff:ffff:ffff:ffff:ffff,PL
2a02:2e00::,2a02:2e1f:ffff:ffff:ffff:ffff:ffff:ffff,ES
-2a02:2f00::,2a02:2f0b:804d:3fff:ffff:ffff:ffff:ffff,RO
-2a02:2f0b:804d:4000::,2a02:2f0b:804d:7fff:ffff:ffff:ffff:ffff,FR
+2a02:2f00::,2a02:2f0b:804c:ffff:ffff:ffff:ffff:ffff,RO
+2a02:2f0b:804d::,2a02:2f0b:804d:7fff:ffff:ffff:ffff:ffff,FR
2a02:2f0b:804d:8000::,2a02:2f0f:ffff:ffff:ffff:ffff:ffff:ffff,RO
2a02:2f80::,2a02:2f80:ffff:ffff:ffff:ffff:ffff:ffff,ES
2a02:2fc0::,2a02:2fc7:ffff:ffff:ffff:ffff:ffff:ffff,DE
@@ -21370,7 +21707,7 @@
2a02:54a0::,2a02:54a0:ffff:ffff:ffff:ffff:ffff:ffff,IT
2a02:54c0::,2a02:54c0:ffff:ffff:ffff:ffff:ffff:ffff,AT
2a02:54e0::,2a02:54e0:ffff:ffff:ffff:ffff:ffff:ffff,PL
-2a02:5500::,2a02:5500:ffff:ffff:ffff:ffff:ffff:ffff,RU
+2a02:5500::,2a02:5507:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a02:5520::,2a02:5520:ffff:ffff:ffff:ffff:ffff:ffff,FR
2a02:5540::,2a02:5540:ffff:ffff:ffff:ffff:ffff:ffff,ES
2a02:5560::,2a02:5560:ffff:ffff:ffff:ffff:ffff:ffff,NO
@@ -21389,7 +21726,7 @@
2a02:5700::,2a02:5700:ffff:ffff:ffff:ffff:ffff:ffff,LB
2a02:5720::,2a02:5720:ffff:ffff:ffff:ffff:ffff:ffff,MK
2a02:5740::,2a02:5740:ffff:ffff:ffff:ffff:ffff:ffff,EE
-2a02:5760::,2a02:5760:ffff:ffff:ffff:ffff:ffff:ffff,NL
+2a02:5760::,2a02:5767:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a02:5780::,2a02:5780:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a02:57a0::,2a02:57a0:ffff:ffff:ffff:ffff:ffff:ffff,FR
2a02:57c0::,2a02:57c0:ffff:ffff:ffff:ffff:ffff:ffff,TR
@@ -21454,7 +21791,7 @@
2a02:5f20::,2a02:5f20:ffff:ffff:ffff:ffff:ffff:ffff,TR
2a02:5f40::,2a02:5f40:ffff:ffff:ffff:ffff:ffff:ffff,HR
2a02:5f60::,2a02:5f60:ffff:ffff:ffff:ffff:ffff:ffff,DE
-2a02:5f80::,2a02:5f80:ffff:ffff:ffff:ffff:ffff:ffff,RU
+2a02:5f80::,2a02:5f87:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a02:5fa0::,2a02:5fa0:ffff:ffff:ffff:ffff:ffff:ffff,FR
2a02:5fc0::,2a02:5fc0:ffff:ffff:ffff:ffff:ffff:ffff,ES
2a02:5fe0::,2a02:5fe0:ffff:ffff:ffff:ffff:ffff:ffff,RU
@@ -21714,9 +22051,7 @@
2a02:8020::,2a02:8023:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a02:8040::,2a02:8043:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a02:8060::,2a02:8061:ffff:ffff:ffff:ffff:ffff:ffff,AD
-2a02:8070::,2a02:8070:e289:ffff:ffff:ffff:ffff:ffff,DE
-2a02:8070:e28a::,2a02:8070:e28a:7fff:ffff:ffff:ffff:ffff,AT
-2a02:8070:e28a:8000::,2a02:8071:ffff:ffff:ffff:ffff:ffff:ffff,DE
+2a02:8070::,2a02:8071:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a02:8080::,2a02:8087:ffff:ffff:ffff:ffff:ffff:ffff,IE
2a02:80c0::,2a02:80c3:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a02:80e0::,2a02:80e3:ffff:ffff:ffff:ffff:ffff:ffff,BG
@@ -22051,7 +22386,6 @@
2a03:2a0::,2a03:2a0:ffff:ffff:ffff:ffff:ffff:ffff,CH
2a03:2c0::,2a03:2c0:ffff:ffff:ffff:ffff:ffff:ffff,BG
2a03:2e0::,2a03:2e0:ffff:ffff:ffff:ffff:ffff:ffff,CZ
-2a03:300::,2a03:300:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a03:320::,2a03:320:ffff:ffff:ffff:ffff:ffff:ffff,IL
2a03:340::,2a03:340:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a03:360::,2a03:360:ffff:ffff:ffff:ffff:ffff:ffff,FR
@@ -22646,7 +22980,8 @@
2a03:4a80:0:8::,2a03:4a80::8:ffff:ffff:ffff:ffff,TR
2a03:4a80:0:9::,2a03:4a80::9:ffff:ffff:ffff:ffff,UA
2a03:4a80:0:a::,2a03:4a80::a:ffff:ffff:ffff:ffff,MX
-2a03:4a80:0:b::,2a03:4a80::ffff:ffff:ffff:ffff:ffff,NL
+2a03:4a80:0:b::,2a03:4a80::b:ffff:ffff:ffff:ffff,AE
+2a03:4a80:0:c::,2a03:4a80::ffff:ffff:ffff:ffff:ffff,NL
2a03:4a80:1::,2a03:4a80:1:ffff:ffff:ffff:ffff:ffff,GB
2a03:4a80:2::,2a03:4a80:2:ffff:ffff:ffff:ffff:ffff,CA
2a03:4a80:3::,2a03:4a80:3:ffff:ffff:ffff:ffff:ffff,CZ
@@ -22786,7 +23121,6 @@
2a03:5aa0::,2a03:5aa0:ffff:ffff:ffff:ffff:ffff:ffff,ES
2a03:5ac0::,2a03:5ac0:ffff:ffff:ffff:ffff:ffff:ffff,CH
2a03:5ae0::,2a03:5ae0:ffff:ffff:ffff:ffff:ffff:ffff,HU
-2a03:5b00::,2a03:5b00:ffff:ffff:ffff:ffff:ffff:ffff,TR
2a03:5b20::,2a03:5b20:ffff:ffff:ffff:ffff:ffff:ffff,RE
2a03:5b40::,2a03:5b40:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a03:5b60::,2a03:5b60:ffff:ffff:ffff:ffff:ffff:ffff,NL
@@ -22836,7 +23170,6 @@
2a03:6140::,2a03:6140:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a03:6160::,2a03:6160:ffff:ffff:ffff:ffff:ffff:ffff,AZ
2a03:6180::,2a03:6180:ffff:ffff:ffff:ffff:ffff:ffff,NO
-2a03:61a0::,2a03:61a0:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a03:61c0::,2a03:61c0:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a03:61e0::,2a03:61e0:ffff:ffff:ffff:ffff:ffff:ffff,ES
2a03:6200::,2a03:6200:ffff:ffff:ffff:ffff:ffff:ffff,RU
@@ -22865,7 +23198,7 @@
2a03:64a0::,2a03:64a0:ffff:ffff:ffff:ffff:ffff:ffff,ES
2a03:64c0::,2a03:64c0:ffff:ffff:ffff:ffff:ffff:ffff,UA
2a03:64e0::,2a03:64e0:ffff:ffff:ffff:ffff:ffff:ffff,LB
-2a03:6500::,2a03:6500:ffff:ffff:ffff:ffff:ffff:ffff,RU
+2a03:6500::,2a03:6507:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a03:6520::,2a03:6520:ffff:ffff:ffff:ffff:ffff:ffff,ES
2a03:6540::,2a03:6540:ffff:ffff:ffff:ffff:ffff:ffff,UA
2a03:6560::,2a03:6560:ffff:ffff:ffff:ffff:ffff:ffff,FR
@@ -22966,7 +23299,7 @@
2a03:71a0::,2a03:71a0:ffff:ffff:ffff:ffff:ffff:ffff,UA
2a03:71c0::,2a03:71c0:ffff:ffff:ffff:ffff:ffff:ffff,CZ
2a03:71e0::,2a03:71e0:ffff:ffff:ffff:ffff:ffff:ffff,NL
-2a03:7200::,2a03:7200:ffff:ffff:ffff:ffff:ffff:ffff,RU
+2a03:7200::,2a03:7207:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a03:7220::,2a03:7220:ffff:ffff:ffff:ffff:ffff:ffff,FR
2a03:7240::,2a03:7240:ffff:ffff:ffff:ffff:ffff:ffff,CZ
2a03:7260::,2a03:7260:ffff:ffff:ffff:ffff:ffff:ffff,ES
@@ -23301,36 +23634,66 @@
2a03:9b80::,2a03:9b80:ffff:ffff:ffff:ffff:ffff:ffff,FI
2a03:9ba0::,2a03:9ba0:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a03:9bc0::,2a03:9bc0:ffff:ffff:ffff:ffff:ffff:ffff,ES
+2a03:9be0::,2a03:9be0:ffff:ffff:ffff:ffff:ffff:ffff,PL
2a03:9c00::,2a03:9c00:ffff:ffff:ffff:ffff:ffff:ffff,RO
+2a03:9c20::,2a03:9c20:ffff:ffff:ffff:ffff:ffff:ffff,RO
2a03:9c40::,2a03:9c40:ffff:ffff:ffff:ffff:ffff:ffff,LU
+2a03:9c60::,2a03:9c60:ffff:ffff:ffff:ffff:ffff:ffff,PL
2a03:9c80::,2a03:9c80:ffff:ffff:ffff:ffff:ffff:ffff,PT
+2a03:9ca0::,2a03:9ca0:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a03:9cc0::,2a03:9cc7:ffff:ffff:ffff:ffff:ffff:ffff,BE
2a03:9d00::,2a03:9d00:ffff:ffff:ffff:ffff:ffff:ffff,DE
+2a03:9d20::,2a03:9d20:ffff:ffff:ffff:ffff:ffff:ffff,ES
2a03:9d40::,2a03:9d40:ffff:ffff:ffff:ffff:ffff:ffff,NL
+2a03:9d60::,2a03:9d60:ffff:ffff:ffff:ffff:ffff:ffff,FR
2a03:9d80::,2a03:9d80:ffff:ffff:ffff:ffff:ffff:ffff,RS
+2a03:9da0::,2a03:9da0:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a03:9dc0::,2a03:9dc0:ffff:ffff:ffff:ffff:ffff:ffff,GB
+2a03:9de0::,2a03:9de0:ffff:ffff:ffff:ffff:ffff:ffff,LB
2a03:9e00::,2a03:9e00:ffff:ffff:ffff:ffff:ffff:ffff,IM
+2a03:9e20::,2a03:9e20:ffff:ffff:ffff:ffff:ffff:ffff,IT
2a03:9e40::,2a03:9e47:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a03:9e80::,2a03:9e80:ffff:ffff:ffff:ffff:ffff:ffff,GB
+2a03:9ea0::,2a03:9ea0:ffff:ffff:ffff:ffff:ffff:ffff,SE
2a03:9ec0::,2a03:9ec0:ffff:ffff:ffff:ffff:ffff:ffff,GB
+2a03:9ee0::,2a03:9ee0:ffff:ffff:ffff:ffff:ffff:ffff,HU
2a03:9f00::,2a03:9f00:ffff:ffff:ffff:ffff:ffff:ffff,GB
+2a03:9f20::,2a03:9f20:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a03:9f40::,2a03:9f40:ffff:ffff:ffff:ffff:ffff:ffff,FR
+2a03:9f60::,2a03:9f60:ffff:ffff:ffff:ffff:ffff:ffff,IQ
2a03:9f80::,2a03:9f80:ffff:ffff:ffff:ffff:ffff:ffff,FI
+2a03:9fa0::,2a03:9fa0:ffff:ffff:ffff:ffff:ffff:ffff,US
2a03:9fc0::,2a03:9fc0:ffff:ffff:ffff:ffff:ffff:ffff,SE
+2a03:9fe0::,2a03:9fe0:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a03:a000::,2a03:a000:ffff:ffff:ffff:ffff:ffff:ffff,GB
+2a03:a020::,2a03:a020:ffff:ffff:ffff:ffff:ffff:ffff,SE
2a03:a040::,2a03:a040:ffff:ffff:ffff:ffff:ffff:ffff,RU
+2a03:a060::,2a03:a060:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a03:a080::,2a03:a080:ffff:ffff:ffff:ffff:ffff:ffff,DE
+2a03:a0a0::,2a03:a0a0:ffff:ffff:ffff:ffff:ffff:ffff,FR
2a03:a0c0::,2a03:a0c0:ffff:ffff:ffff:ffff:ffff:ffff,GB
+2a03:a0e0::,2a03:a0e0:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a03:a100::,2a03:a100:ffff:ffff:ffff:ffff:ffff:ffff,SI
+2a03:a120::,2a03:a120:ffff:ffff:ffff:ffff:ffff:ffff,AE
2a03:a140::,2a03:a140:ffff:ffff:ffff:ffff:ffff:ffff,FR
+2a03:a160::,2a03:a160:ffff:ffff:ffff:ffff:ffff:ffff,AT
2a03:a180::,2a03:a180:ffff:ffff:ffff:ffff:ffff:ffff,RU
+2a03:a1a0::,2a03:a1a0:ffff:ffff:ffff:ffff:ffff:ffff,BE
2a03:a1c0::,2a03:a1c0:ffff:ffff:ffff:ffff:ffff:ffff,RU
+2a03:a1e0::,2a03:a1e0:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a03:a200::,2a03:a200:ffff:ffff:ffff:ffff:ffff:ffff,SK
+2a03:a220::,2a03:a220:ffff:ffff:ffff:ffff:ffff:ffff,PL
2a03:a240::,2a03:a240:ffff:ffff:ffff:ffff:ffff:ffff,FR
+2a03:a260::,2a03:a260:ffff:ffff:ffff:ffff:ffff:ffff,IT
2a03:a280::,2a03:a280:ffff:ffff:ffff:ffff:ffff:ffff,IT
+2a03:a2a0::,2a03:a2a0:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a03:a2c0::,2a03:a2c7:ffff:ffff:ffff:ffff:ffff:ffff,FR
+2a03:a2e0::,2a03:a2e0:ffff:ffff:ffff:ffff:ffff:ffff,PL
2a03:a300::,2a03:a300:ffff:ffff:ffff:ffff:ffff:ffff,KZ
+2a03:a320::,2a03:a320:ffff:ffff:ffff:ffff:ffff:ffff,ES
+2a03:a360::,2a03:a360:ffff:ffff:ffff:ffff:ffff:ffff,CH
2a03:a380::,2a03:a380:ffff:ffff:ffff:ffff:ffff:ffff,IT
+2a03:a3a0::,2a03:a3a0:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a03:a3c0::,2a03:a3c0:ffff:ffff:ffff:ffff:ffff:ffff,IT
2a03:a400::,2a03:a400:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a03:a440::,2a03:a440:ffff:ffff:ffff:ffff:ffff:ffff,ES
@@ -23391,7 +23754,7 @@
2a03:b180::,2a03:b180:ffff:ffff:ffff:ffff:ffff:ffff,AE
2a03:b1c0::,2a03:b1c0:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a03:b200::,2a03:b207:ffff:ffff:ffff:ffff:ffff:ffff,GB
-2a03:b240::,2a03:b240:ffff:ffff:ffff:ffff:ffff:ffff,CH
+2a03:b240::,2a03:b247:ffff:ffff:ffff:ffff:ffff:ffff,CH
2a03:b280::,2a03:b280:ffff:ffff:ffff:ffff:ffff:ffff,CZ
2a03:b2c0::,2a03:b2c0:ffff:ffff:ffff:ffff:ffff:ffff,CH
2a03:b300::,2a03:b300:ffff:ffff:ffff:ffff:ffff:ffff,GB
@@ -23756,7 +24119,6 @@
2a04:d40::,2a04:d47:ffff:ffff:ffff:ffff:ffff:ffff,IT
2a04:d80::,2a04:d87:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a04:dc0::,2a04:dc7:ffff:ffff:ffff:ffff:ffff:ffff,RU
-2a04:e00::,2a04:e07:ffff:ffff:ffff:ffff:ffff:ffff,IT
2a04:e40::,2a04:e47:ffff:ffff:ffff:ffff:ffff:ffff,FR
2a04:e80::,2a04:e87:ffff:ffff:ffff:ffff:ffff:ffff,ES
2a04:ec0::,2a04:ec7:ffff:ffff:ffff:ffff:ffff:ffff,GB
@@ -24043,6 +24405,7 @@
2a04:5380::,2a04:5387:ffff:ffff:ffff:ffff:ffff:ffff,FR
2a04:53c0::,2a04:53c7:ffff:ffff:ffff:ffff:ffff:ffff,PT
2a04:5400::,2a04:5407:ffff:ffff:ffff:ffff:ffff:ffff,IE
+2a04:5440::,2a04:5447:ffff:ffff:ffff:ffff:ffff:ffff,FR
2a04:5480::,2a04:5487:ffff:ffff:ffff:ffff:ffff:ffff,TR
2a04:54c0::,2a04:54c7:ffff:ffff:ffff:ffff:ffff:ffff,NO
2a04:5500::,2a04:5507:ffff:ffff:ffff:ffff:ffff:ffff,RU
@@ -24057,7 +24420,6 @@
2a04:5740::,2a04:5747:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a04:5780::,2a04:5787:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a04:57c0::,2a04:57c7:ffff:ffff:ffff:ffff:ffff:ffff,SE
-2a04:5800::,2a04:5807:ffff:ffff:ffff:ffff:ffff:ffff,IT
2a04:5880::,2a04:5887:ffff:ffff:ffff:ffff:ffff:ffff,IT
2a04:58c0::,2a04:58c7:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a04:5900::,2a04:5907:ffff:ffff:ffff:ffff:ffff:ffff,AL
@@ -24169,12 +24531,12 @@
2a04:7300::,2a04:7307:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a04:7340::,2a04:7347:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a04:7380::,2a04:7387:ffff:ffff:ffff:ffff:ffff:ffff,GB
+2a04:73c0::,2a04:73c7:ffff:ffff:ffff:ffff:ffff:ffff,RS
2a04:7400::,2a04:7407:ffff:ffff:ffff:ffff:ffff:ffff,ME
2a04:7440::,2a04:7447:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a04:7480::,2a04:7487:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a04:74c0::,2a04:74c7:ffff:ffff:ffff:ffff:ffff:ffff,FR
2a04:7500::,2a04:7507:ffff:ffff:ffff:ffff:ffff:ffff,AT
-2a04:7540::,2a04:7547:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a04:7580::,2a04:7587:ffff:ffff:ffff:ffff:ffff:ffff,MD
2a04:75c0::,2a04:75c7:ffff:ffff:ffff:ffff:ffff:ffff,UA
2a04:7600::,2a04:7607:ffff:ffff:ffff:ffff:ffff:ffff,NO
@@ -24200,6 +24562,7 @@
2a04:7ac0::,2a04:7ac7:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a04:7b00::,2a04:7b07:ffff:ffff:ffff:ffff:ffff:ffff,IT
2a04:7b40::,2a04:7b47:ffff:ffff:ffff:ffff:ffff:ffff,DE
+2a04:7b80::,2a04:7b87:ffff:ffff:ffff:ffff:ffff:ffff,TR
2a04:7bc0::,2a04:7bc7:ffff:ffff:ffff:ffff:ffff:ffff,SA
2a04:7c00::,2a04:7c07:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a04:7c40::,2a04:7c47:ffff:ffff:ffff:ffff:ffff:ffff,ES
@@ -24274,6 +24637,7 @@
2a04:8d40::,2a04:8d47:ffff:ffff:ffff:ffff:ffff:ffff,SE
2a04:8d80::,2a04:8d87:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a04:8dc0::,2a04:8dc7:ffff:ffff:ffff:ffff:ffff:ffff,LU
+2a04:8e00::,2a04:8e07:ffff:ffff:ffff:ffff:ffff:ffff,MK
2a04:8e40::,2a04:8e47:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a04:8e80::,2a04:8e81:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a04:8e90::,2a04:8e91:ffff:ffff:ffff:ffff:ffff:ffff,CH
@@ -24408,7 +24772,6 @@
2a04:b000::,2a04:b007:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a04:b040::,2a04:b047:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a04:b080::,2a04:b087:ffff:ffff:ffff:ffff:ffff:ffff,FI
-2a04:b0c0::,2a04:b0c7:ffff:ffff:ffff:ffff:ffff:ffff,PL
2a04:b100::,2a04:b107:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a04:b140::,2a04:b147:ffff:ffff:ffff:ffff:ffff:ffff,TR
2a04:b180::,2a04:b187:ffff:ffff:ffff:ffff:ffff:ffff,FR
@@ -24435,7 +24798,6 @@
2a04:b700::,2a04:b707:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a04:b740::,2a04:b747:ffff:ffff:ffff:ffff:ffff:ffff,PL
2a04:b780::,2a04:b787:ffff:ffff:ffff:ffff:ffff:ffff,GB
-2a04:b7c0::,2a04:b7c7:ffff:ffff:ffff:ffff:ffff:ffff,BG
2a04:b800::,2a04:b807:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a04:b840::,2a04:b847:ffff:ffff:ffff:ffff:ffff:ffff,PL
2a04:b880::,2a04:b887:ffff:ffff:ffff:ffff:ffff:ffff,ES
@@ -24610,6 +24972,7 @@
2a04:e340::,2a04:e347:ffff:ffff:ffff:ffff:ffff:ffff,AE
2a04:e380::,2a04:e387:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a04:e3c0::,2a04:e3c7:ffff:ffff:ffff:ffff:ffff:ffff,DK
+2a04:e440::,2a04:e447:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a04:e480::,2a04:e487:ffff:ffff:ffff:ffff:ffff:ffff,IT
2a04:e4c0:10::,2a04:e4c0:10:ffff:ffff:ffff:ffff:ffff,GB
2a04:e4c0:11::,2a04:e4c0:11:ffff:ffff:ffff:ffff:ffff,DE
@@ -24777,6 +25140,7 @@
2a05:c00::,2a05:c07:ffff:ffff:ffff:ffff:ffff:ffff,NO
2a05:c80::,2a05:c87:ffff:ffff:ffff:ffff:ffff:ffff,ES
2a05:cc0::,2a05:cc7:ffff:ffff:ffff:ffff:ffff:ffff,GB
+2a05:d00::,2a05:d07:ffff:ffff:ffff:ffff:ffff:ffff,CH
2a05:d40::,2a05:d47:ffff:ffff:ffff:ffff:ffff:ffff,FR
2a05:dc0::,2a05:dc7:ffff:ffff:ffff:ffff:ffff:ffff,ES
2a05:e00::,2a05:e07:ffff:ffff:ffff:ffff:ffff:ffff,FR
@@ -24786,6 +25150,7 @@
2a05:f00::,2a05:f07:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a05:f40::,2a05:f47:ffff:ffff:ffff:ffff:ffff:ffff,FR
2a05:f80::,2a05:f87:ffff:ffff:ffff:ffff:ffff:ffff,GB
+2a05:fc0::,2a05:fc7:ffff:ffff:ffff:ffff:ffff:ffff,CH
2a05:1000::,2a05:1007:ffff:ffff:ffff:ffff:ffff:ffff,FR
2a05:1040::,2a05:1047:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a05:1080::,2a05:1087:ffff:ffff:ffff:ffff:ffff:ffff,DE
@@ -24804,7 +25169,6 @@
2a05:1380::,2a05:1387:ffff:ffff:ffff:ffff:ffff:ffff,IT
2a05:13c0::,2a05:13c7:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a05:1400::,2a05:1407:ffff:ffff:ffff:ffff:ffff:ffff,AT
-2a05:1440::,2a05:1447:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a05:1480::,2a05:1487:ffff:ffff:ffff:ffff:ffff:ffff,PL
2a05:14c0::,2a05:14c7:ffff:ffff:ffff:ffff:ffff:ffff,CH
2a05:1500::,2a05:1507:ffff:ffff:ffff:ffff:ffff:ffff,DE
@@ -24862,6 +25226,7 @@
2a05:2380::,2a05:2387:ffff:ffff:ffff:ffff:ffff:ffff,BE
2a05:23c0::,2a05:23c7:ffff:ffff:ffff:ffff:ffff:ffff,IT
2a05:2400::,2a05:2407:ffff:ffff:ffff:ffff:ffff:ffff,PL
+2a05:2440::,2a05:2447:ffff:ffff:ffff:ffff:ffff:ffff,SE
2a05:2480::,2a05:2487:ffff:ffff:ffff:ffff:ffff:ffff,AE
2a05:24c0::,2a05:24c7:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a05:2500::,2a05:2507:ffff:ffff:ffff:ffff:ffff:ffff,NL
@@ -24918,7 +25283,6 @@
2a05:3240::,2a05:3247:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a05:3280::,2a05:3287:ffff:ffff:ffff:ffff:ffff:ffff,SA
2a05:3300::,2a05:3307:ffff:ffff:ffff:ffff:ffff:ffff,FR
-2a05:3340::,2a05:3347:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a05:3380::,2a05:3387:ffff:ffff:ffff:ffff:ffff:ffff,YE
2a05:33c0::,2a05:33c7:ffff:ffff:ffff:ffff:ffff:ffff,SI
2a05:3400::,2a05:3407:ffff:ffff:ffff:ffff:ffff:ffff,SE
@@ -24932,7 +25296,6 @@
2a05:3600::,2a05:3607:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a05:3640::,2a05:3647:ffff:ffff:ffff:ffff:ffff:ffff,PL
2a05:3680::,2a05:3687:ffff:ffff:ffff:ffff:ffff:ffff,IT
-2a05:36c0::,2a05:36c7:ffff:ffff:ffff:ffff:ffff:ffff,CH
2a05:3700::,2a05:3707:ffff:ffff:ffff:ffff:ffff:ffff,FR
2a05:3740::,2a05:3747:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a05:3780::,2a05:3787:ffff:ffff:ffff:ffff:ffff:ffff,CH
@@ -24961,7 +25324,6 @@
2a05:3d00::,2a05:3d07:ffff:ffff:ffff:ffff:ffff:ffff,BE
2a05:3d40::,2a05:3d47:ffff:ffff:ffff:ffff:ffff:ffff,CZ
2a05:3d80::,2a05:3d87:ffff:ffff:ffff:ffff:ffff:ffff,CH
-2a05:3dc0::,2a05:3dc7:ffff:ffff:ffff:ffff:ffff:ffff,TR
2a05:3e00::,2a05:3e07:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a05:3e40::,2a05:3e47:ffff:ffff:ffff:ffff:ffff:ffff,IR
2a05:3e80::,2a05:3e87:ffff:ffff:ffff:ffff:ffff:ffff,RU
@@ -24992,6 +25354,7 @@
2a05:44c0::,2a05:44c7:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a05:4500::,2a05:4507:ffff:ffff:ffff:ffff:ffff:ffff,CZ
2a05:4540::,2a05:4547:ffff:ffff:ffff:ffff:ffff:ffff,SE
+2a05:4580::,2a05:4587:ffff:ffff:ffff:ffff:ffff:ffff,IR
2a05:45c0::,2a05:45c7:ffff:ffff:ffff:ffff:ffff:ffff,UZ
2a05:4600::,2a05:4607:ffff:ffff:ffff:ffff:ffff:ffff,DK
2a05:4640::,2a05:4647:ffff:ffff:ffff:ffff:ffff:ffff,TR
@@ -25064,6 +25427,7 @@
2a05:5700::,2a05:5707:ffff:ffff:ffff:ffff:ffff:ffff,RO
2a05:5740::,2a05:5747:ffff:ffff:ffff:ffff:ffff:ffff,UA
2a05:5780::,2a05:5787:ffff:ffff:ffff:ffff:ffff:ffff,TR
+2a05:57c0::,2a05:57c7:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a05:5800::,2a05:5807:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a05:5840::,2a05:5847:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a05:5880::,2a05:5887:ffff:ffff:ffff:ffff:ffff:ffff,NO
@@ -25282,6 +25646,7 @@
2a05:8dc0::,2a05:8dc7:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a05:8e00::,2a05:8e07:ffff:ffff:ffff:ffff:ffff:ffff,ES
2a05:8e40::,2a05:8e47:ffff:ffff:ffff:ffff:ffff:ffff,DE
+2a05:8e80::,2a05:8e87:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a05:8ec0::,2a05:8ec7:ffff:ffff:ffff:ffff:ffff:ffff,LB
2a05:8f00::,2a05:8f07:ffff:ffff:ffff:ffff:ffff:ffff,CH
2a05:8f40::,2a05:8f47:ffff:ffff:ffff:ffff:ffff:ffff,NL
@@ -25293,6 +25658,7 @@
2a05:90c0::,2a05:90c7:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a05:9100::,2a05:9107:ffff:ffff:ffff:ffff:ffff:ffff,FI
2a05:9140::,2a05:9147:ffff:ffff:ffff:ffff:ffff:ffff,DE
+2a05:9180::,2a05:9187:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a05:91c0::,2a05:91c7:ffff:ffff:ffff:ffff:ffff:ffff,RO
2a05:9200::,2a05:9207:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a05:9240::,2a05:9247:ffff:ffff:ffff:ffff:ffff:ffff,IR
@@ -25303,7 +25669,6 @@
2a05:9380::,2a05:9387:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a05:93c0::,2a05:93c7:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a05:9400::,2a05:9407:ffff:ffff:ffff:ffff:ffff:ffff,BG
-2a05:9440::,2a05:9447:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a05:9480::,2a05:9487:ffff:ffff:ffff:ffff:ffff:ffff,IQ
2a05:94c0::,2a05:94c7:ffff:ffff:ffff:ffff:ffff:ffff,IR
2a05:9500::,2a05:9507:ffff:ffff:ffff:ffff:ffff:ffff,TR
@@ -25416,10 +25781,11 @@
2a05:b000::,2a05:b007:ffff:ffff:ffff:ffff:ffff:ffff,BE
2a05:b040::,2a05:b047:ffff:ffff:ffff:ffff:ffff:ffff,CH
2a05:b080::,2a05:b087:ffff:ffff:ffff:ffff:ffff:ffff,FI
-2a05:b0c0::,2a05:b0c7:ffff:ffff:ffff:ffff:ffff:ffff,GB
+2a05:b0c0::,2a05:b0c6:6ff:ffff:ffff:ffff:ffff:ffff,GB
+2a05:b0c6:700::,2a05:b0c6:7ff:ffff:ffff:ffff:ffff:ffff,AT
+2a05:b0c6:800::,2a05:b0c7:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a05:b100::,2a05:b107:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a05:b140::,2a05:b147:ffff:ffff:ffff:ffff:ffff:ffff,TR
-2a05:b180::,2a05:b187:ffff:ffff:ffff:ffff:ffff:ffff,UA
2a05:b1c0::,2a05:b1c7:ffff:ffff:ffff:ffff:ffff:ffff,IR
2a05:b200::,2a05:b207:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a05:b240::,2a05:b247:ffff:ffff:ffff:ffff:ffff:ffff,IT
@@ -25448,7 +25814,6 @@
2a05:b800::,2a05:b807:ffff:ffff:ffff:ffff:ffff:ffff,CZ
2a05:b840::,2a05:b847:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a05:b880::,2a05:b887:ffff:ffff:ffff:ffff:ffff:ffff,SE
-2a05:b8c0::,2a05:b8c7:ffff:ffff:ffff:ffff:ffff:ffff,SE
2a05:b900::,2a05:b907:ffff:ffff:ffff:ffff:ffff:ffff,TR
2a05:b940::,2a05:b947:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a05:b980::,2a05:b987:ffff:ffff:ffff:ffff:ffff:ffff,LB
@@ -25537,6 +25902,7 @@
2a05:ce80::,2a05:ce87:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a05:cec0::,2a05:cec7:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a05:cf00::,2a05:cf07:ffff:ffff:ffff:ffff:ffff:ffff,DE
+2a05:cf40::,2a05:cf47:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a05:cf80::,2a05:cf87:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a05:cfc0::,2a05:cfc7:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a05:d000::,2a05:d07f:ffff:ffff:ffff:ffff:ffff:ffff,IE
@@ -25545,7 +25911,6 @@
2a05:d480::,2a05:d487:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a05:d4c0::,2a05:d4c7:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a05:d500::,2a05:d507:ffff:ffff:ffff:ffff:ffff:ffff,DE
-2a05:d540::,2a05:d547:ffff:ffff:ffff:ffff:ffff:ffff,ES
2a05:d580::,2a05:d587:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a05:d5c0::,2a05:d5c7:ffff:ffff:ffff:ffff:ffff:ffff,GE
2a05:d600::,2a05:d607:ffff:ffff:ffff:ffff:ffff:ffff,LB
@@ -25685,8 +26050,7 @@
2a05:f400::,2a05:f407:ffff:ffff:ffff:ffff:ffff:ffff,CH
2a05:f440::,2a05:f447:ffff:ffff:ffff:ffff:ffff:ffff,FR
2a05:f480::,2a05:f487:ffff:ffff:ffff:ffff:ffff:ffff,FR
-2a05:f4c0::,2a05:f4c7:ffff:ffff:ffff:ffff:ffff:ffff,ES
-2a05:f500::,2a05:f507:ffff:ffff:ffff:ffff:ffff:ffff,ES
+2a05:f4c0::,2a05:f4c7:ffff:ffff:ffff:ffff:ffff:ffff,RO
2a05:f540::,2a05:f547:ffff:ffff:ffff:ffff:ffff:ffff,FR
2a05:f580::,2a05:f587:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a05:f5c0::,2a05:f5c7:ffff:ffff:ffff:ffff:ffff:ffff,HU
@@ -25711,7 +26075,6 @@
2a05:fa80::,2a05:fa87:ffff:ffff:ffff:ffff:ffff:ffff,ES
2a05:fac0::,2a05:fac7:ffff:ffff:ffff:ffff:ffff:ffff,FR
2a05:fb00::,2a05:fb07:ffff:ffff:ffff:ffff:ffff:ffff,SE
-2a05:fb40::,2a05:fb47:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a05:fb80::,2a05:fb87:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a05:fbc0::,2a05:fbc3:ffff:ffff:ffff:ffff:ffff:ffff,TR
2a05:fc00::,2a05:fc07:ffff:ffff:ffff:ffff:ffff:ffff,AT
@@ -25724,6 +26087,7 @@
2a05:fdc0::,2a05:fdc7:ffff:ffff:ffff:ffff:ffff:ffff,AL
2a05:fe00::,2a05:fe07:ffff:ffff:ffff:ffff:ffff:ffff,IT
2a05:fe40::,2a05:fe47:ffff:ffff:ffff:ffff:ffff:ffff,TR
+2a05:fe80::,2a05:fe87:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a05:fec0::,2a05:fec7:ffff:ffff:ffff:ffff:ffff:ffff,TR
2a05:ff00::,2a05:ff07:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a05:ff40::,2a05:ff47:ffff:ffff:ffff:ffff:ffff:ffff,SE
@@ -25749,7 +26113,6 @@
2a06:440::,2a06:447:ffff:ffff:ffff:ffff:ffff:ffff,SE
2a06:480::,2a06:487:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a06:4c0::,2a06:4c7:ffff:ffff:ffff:ffff:ffff:ffff,BG
-2a06:500::,2a06:507:ffff:ffff:ffff:ffff:ffff:ffff,FR
2a06:540::,2a06:547:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a06:580::,2a06:587:ffff:ffff:ffff:ffff:ffff:ffff,KZ
2a06:5c0::,2a06:5c7:ffff:ffff:ffff:ffff:ffff:ffff,IT
@@ -25779,7 +26142,6 @@
2a06:bc0::,2a06:bc7:ffff:ffff:ffff:ffff:ffff:ffff,IR
2a06:c00::,2a06:c07:ffff:ffff:ffff:ffff:ffff:ffff,CH
2a06:c40::,2a06:c47:ffff:ffff:ffff:ffff:ffff:ffff,GB
-2a06:c80::,2a06:c87:ffff:ffff:ffff:ffff:ffff:ffff,SE
2a06:cc0::,2a06:cc7:ffff:ffff:ffff:ffff:ffff:ffff,SK
2a06:d00::,2a06:d07:ffff:ffff:ffff:ffff:ffff:ffff,IT
2a06:d40::,2a06:d47:ffff:ffff:ffff:ffff:ffff:ffff,US
@@ -25866,9 +26228,9 @@
2a06:2040::,2a06:2047:ffff:ffff:ffff:ffff:ffff:ffff,FR
2a06:2080::,2a06:2087:ffff:ffff:ffff:ffff:ffff:ffff,IT
2a06:20c0::,2a06:20c7:ffff:ffff:ffff:ffff:ffff:ffff,FI
-2a06:2100::,2a06:2107:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a06:2140::,2a06:2147:ffff:ffff:ffff:ffff:ffff:ffff,CZ
2a06:2180::,2a06:2187:ffff:ffff:ffff:ffff:ffff:ffff,SK
+2a06:21c0::,2a06:21c7:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a06:2200::,2a06:2207:ffff:ffff:ffff:ffff:ffff:ffff,IR
2a06:2240::,2a06:2247:ffff:ffff:ffff:ffff:ffff:ffff,NO
2a06:2280::,2a06:2287:ffff:ffff:ffff:ffff:ffff:ffff,UA
@@ -25889,7 +26251,7 @@
2a06:2640::,2a06:2647:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a06:2680::,2a06:2687:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a06:26c0::,2a06:26c7:ffff:ffff:ffff:ffff:ffff:ffff,PL
-2a06:2700::,2a06:2707:ffff:ffff:ffff:ffff:ffff:ffff,ES
+2a06:2700::,2a06:2707:ffff:ffff:ffff:ffff:ffff:ffff,RO
2a06:2740::,2a06:2747:ffff:ffff:ffff:ffff:ffff:ffff,FR
2a06:2780::,2a06:2787:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a06:27c0::,2a06:27c7:ffff:ffff:ffff:ffff:ffff:ffff,GB
@@ -25912,6 +26274,7 @@
2a06:2c00::,2a06:2c07:ffff:ffff:ffff:ffff:ffff:ffff,IR
2a06:2c40::,2a06:2c47:ffff:ffff:ffff:ffff:ffff:ffff,SK
2a06:2c80::,2a06:2c87:ffff:ffff:ffff:ffff:ffff:ffff,RO
+2a06:2cc0::,2a06:2cc7:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a06:2d00::,2a06:2d07:ffff:ffff:ffff:ffff:ffff:ffff,TR
2a06:2d40::,2a06:2d47:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a06:2d80::,2a06:2d87:ffff:ffff:ffff:ffff:ffff:ffff,RU
@@ -25923,6 +26286,7 @@
2a06:2e80::,2a06:2e87:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a06:2ec0::,2a06:2ec7:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a06:2f00::,2a06:2f07:ffff:ffff:ffff:ffff:ffff:ffff,QA
+2a06:2f40::,2a06:2f47:ffff:ffff:ffff:ffff:ffff:ffff,SE
2a06:2f80::,2a06:2f87:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a06:2fc0::,2a06:2fc7:ffff:ffff:ffff:ffff:ffff:ffff,FR
2a06:3000::,2a06:3007:ffff:ffff:ffff:ffff:ffff:ffff,GB
@@ -25930,8 +26294,11 @@
2a06:3080::,2a06:3087:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a06:30c0::,2a06:30c7:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a06:3100::,2a06:3107:ffff:ffff:ffff:ffff:ffff:ffff,NL
+2a06:3180::,2a06:3187:ffff:ffff:ffff:ffff:ffff:ffff,SA
2a06:3200::,2a06:3207:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a06:3240::,2a06:3247:ffff:ffff:ffff:ffff:ffff:ffff,NL
+2a06:3280::,2a06:3287:ffff:ffff:ffff:ffff:ffff:ffff,IT
+2a06:32c0::,2a06:32c7:ffff:ffff:ffff:ffff:ffff:ffff,IR
2a06:3300::,2a06:3307:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a06:3340::,2a06:3347:ffff:ffff:ffff:ffff:ffff:ffff,NO
2a06:3380::,2a06:3387:ffff:ffff:ffff:ffff:ffff:ffff,DE
@@ -25951,6 +26318,7 @@
2a06:3700::,2a06:3707:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a06:3740::,2a06:3747:ffff:ffff:ffff:ffff:ffff:ffff,UA
2a06:3780::,2a06:3787:ffff:ffff:ffff:ffff:ffff:ffff,GB
+2a06:37c0::,2a06:37c7:ffff:ffff:ffff:ffff:ffff:ffff,ES
2a06:3800::,2a06:3807:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a06:3840::,2a06:3847:ffff:ffff:ffff:ffff:ffff:ffff,BE
2a06:3880::,2a06:3887:ffff:ffff:ffff:ffff:ffff:ffff,NL
@@ -25974,7 +26342,6 @@
2a06:3d00::,2a06:3d07:ffff:ffff:ffff:ffff:ffff:ffff,GR
2a06:3d40::,2a06:3d47:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a06:3d80::,2a06:3d87:ffff:ffff:ffff:ffff:ffff:ffff,NL
-2a06:3dc0::,2a06:3dc7:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a06:3e00::,2a06:3e07:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a06:3e40::,2a06:3e47:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a06:3e80::,2a06:3e87:ffff:ffff:ffff:ffff:ffff:ffff,NL
@@ -26009,9 +26376,9 @@
2a06:4600::,2a06:4607:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a06:4640::,2a06:4647:ffff:ffff:ffff:ffff:ffff:ffff,KW
2a06:4680::,2a06:4687:ffff:ffff:ffff:ffff:ffff:ffff,RU
-2a06:46c0::,2a06:46c7:ffff:ffff:ffff:ffff:ffff:ffff,ES
-2a06:4700::,2a06:4707:ffff:ffff:ffff:ffff:ffff:ffff,ES
-2a06:4740::,2a06:4747:ffff:ffff:ffff:ffff:ffff:ffff,ES
+2a06:46c0::,2a06:46c7:ffff:ffff:ffff:ffff:ffff:ffff,RO
+2a06:4700::,2a06:4707:ffff:ffff:ffff:ffff:ffff:ffff,RO
+2a06:4740::,2a06:4747:ffff:ffff:ffff:ffff:ffff:ffff,RO
2a06:4780::,2a06:4787:ffff:ffff:ffff:ffff:ffff:ffff,ES
2a06:47c0::,2a06:47c7:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a06:4800::,2a06:4807:ffff:ffff:ffff:ffff:ffff:ffff,ES
@@ -26029,7 +26396,6 @@
2a06:4b40::,2a06:4b47:ffff:ffff:ffff:ffff:ffff:ffff,TR
2a06:4b80::,2a06:4b87:ffff:ffff:ffff:ffff:ffff:ffff,IR
2a06:4bc0::,2a06:4bc7:ffff:ffff:ffff:ffff:ffff:ffff,GB
-2a06:4c00::,2a06:4c07:ffff:ffff:ffff:ffff:ffff:ffff,DE
2a06:4c40::,2a06:4c47:ffff:ffff:ffff:ffff:ffff:ffff,RU
2a06:4c80::,2a06:4c87:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a06:4cc0::,2a06:4cc7:ffff:ffff:ffff:ffff:ffff:ffff,GB
@@ -26173,7 +26539,6 @@
2a06:7000::,2a06:7007:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a06:7040::,2a06:7047:ffff:ffff:ffff:ffff:ffff:ffff,AT
2a06:7080::,2a06:7087:ffff:ffff:ffff:ffff:ffff:ffff,IE
-2a06:70c0::,2a06:70c7:ffff:ffff:ffff:ffff:ffff:ffff,IR
2a06:7100::,2a06:7107:ffff:ffff:ffff:ffff:ffff:ffff,NL
2a06:7140::,2a06:7147:ffff:ffff:ffff:ffff:ffff:ffff,IR
2a06:7180::,2a06:7187:ffff:ffff:ffff:ffff:ffff:ffff,DE
@@ -26244,9 +26609,13 @@
2a06:8181:a0::,2a06:8181:af:ffff:ffff:ffff:ffff:ffff,NL
2a06:8181:b0::,2a06:8181:fef:ffff:ffff:ffff:ffff:ffff,GB
2a06:8181:ff0::,2a06:8181:fff:ffff:ffff:ffff:ffff:ffff,AT
-2a06:8181:1000::,2a06:8184:ffff:ffff:ffff:ffff:ffff:ffff,GB
+2a06:8181:1000::,2a06:8181:1fcf:ffff:ffff:ffff:ffff:ffff,GB
+2a06:8181:1fd0::,2a06:8181:1fdf:ffff:ffff:ffff:ffff:ffff,AT
+2a06:8181:1fe0::,2a06:8184:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a06:8185::,2a06:8185:ffff:ffff:ffff:ffff:ffff:ffff,CH
-2a06:8186::,2a06:8187:ffff:ffff:ffff:ffff:ffff:ffff,GB
+2a06:8186::,2a06:8187:fcff:ffff:ffff:ffff:ffff:ffff,GB
+2a06:8187:fd00::,2a06:8187:fdff:ffff:ffff:ffff:ffff:ffff,FR
+2a06:8187:fe00::,2a06:8187:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a06:81c0::,2a06:81c7:ffff:ffff:ffff:ffff:ffff:ffff,NO
2a06:8200::,2a06:8207:ffff:ffff:ffff:ffff:ffff:ffff,IR
2a06:8240::,2a06:8247:ffff:ffff:ffff:ffff:ffff:ffff,MY
@@ -26304,7 +26673,9 @@
2a06:8ec0:2::,2a06:8ec0:2:ffff:ffff:ffff:ffff:ffff,CH
2a06:8ec0:3::,2a06:8ec0:3:ffff:ffff:ffff:ffff:ffff,GB
2a06:8ec0:4::,2a06:8ec0:4:ffff:ffff:ffff:ffff:ffff,NL
-2a06:8ec0:5::,2a06:8ec7:ffff:ffff:ffff:ffff:ffff:ffff,GB
+2a06:8ec0:5::,2a06:8ec0:5:ffff:ffff:ffff:ffff:ffff,GB
+2a06:8ec0:6::,2a06:8ec0:6:ffff:ffff:ffff:ffff:ffff,SE
+2a06:8ec0:7::,2a06:8ec7:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a06:8f00::,2a06:8f07:ffff:ffff:ffff:ffff:ffff:ffff,AL
2a06:8f40::,2a06:8f47:ffff:ffff:ffff:ffff:ffff:ffff,ES
2a06:8f80::,2a06:8f87:ffff:ffff:ffff:ffff:ffff:ffff,FI
@@ -26343,9 +26714,7 @@
2a06:97c0::,2a06:97c7:ffff:ffff:ffff:ffff:ffff:ffff,RS
2a06:9800::,2a06:9807:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a06:9840::,2a06:9847:ffff:ffff:ffff:ffff:ffff:ffff,FR
-2a06:98c0::,2a06:98c0:fff:ffff:ffff:ffff:ffff:ffff,GB
-2a06:98c0:1000::,2a06:98c0:1000:7fff:ffff:ffff:ffff:ffff,US
-2a06:98c0:1000:8000::,2a06:98c7:ffff:ffff:ffff:ffff:ffff:ffff,GB
+2a06:98c0::,2a06:98c7:ffff:ffff:ffff:ffff:ffff:ffff,GB
2a06:9900::,2a06:9907:ffff:ffff:ffff:ffff:ffff:ffff,NO
2a06:9940::,2a06:9947:ffff:ffff:ffff:ffff:ffff:ffff,ES
2a06:9980::,2a06:9987:ffff:ffff:ffff:ffff:ffff:ffff,RU
@@ -26577,6 +26946,85 @@
2a06:d200::,2a06:d207:ffff:ffff:ffff:ffff:ffff:ffff,IR
2a06:d240::,2a06:d247:ffff:ffff:ffff:ffff:ffff:ffff,HU
2a06:d280::,2a06:d287:ffff:ffff:ffff:ffff:ffff:ffff,UA
+2a06:d2c0::,2a06:d2c7:ffff:ffff:ffff:ffff:ffff:ffff,NO
+2a06:d300::,2a06:d307:ffff:ffff:ffff:ffff:ffff:ffff,SY
+2a06:d340::,2a06:d347:ffff:ffff:ffff:ffff:ffff:ffff,DE
+2a06:d380::,2a06:d387:ffff:ffff:ffff:ffff:ffff:ffff,DK
+2a06:d3c0::,2a06:d3c7:ffff:ffff:ffff:ffff:ffff:ffff,NO
+2a06:d400::,2a06:d407:ffff:ffff:ffff:ffff:ffff:ffff,IR
+2a06:d440::,2a06:d447:ffff:ffff:ffff:ffff:ffff:ffff,IT
+2a06:d480::,2a06:d487:ffff:ffff:ffff:ffff:ffff:ffff,DK
+2a06:d4c0::,2a06:d4c7:ffff:ffff:ffff:ffff:ffff:ffff,GB
+2a06:d500::,2a06:d507:ffff:ffff:ffff:ffff:ffff:ffff,AT
+2a06:d540::,2a06:d547:ffff:ffff:ffff:ffff:ffff:ffff,CZ
+2a06:d580::,2a06:d587:ffff:ffff:ffff:ffff:ffff:ffff,CH
+2a06:d5c0::,2a06:d5c7:ffff:ffff:ffff:ffff:ffff:ffff,GB
+2a06:d600::,2a06:d607:ffff:ffff:ffff:ffff:ffff:ffff,ES
+2a06:d640::,2a06:d647:ffff:ffff:ffff:ffff:ffff:ffff,RU
+2a06:d680::,2a06:d687:ffff:ffff:ffff:ffff:ffff:ffff,DE
+2a06:d6c0::,2a06:d6c7:ffff:ffff:ffff:ffff:ffff:ffff,LT
+2a06:d700::,2a06:d707:ffff:ffff:ffff:ffff:ffff:ffff,IS
+2a06:d740::,2a06:d747:ffff:ffff:ffff:ffff:ffff:ffff,FR
+2a06:d780::,2a06:d787:ffff:ffff:ffff:ffff:ffff:ffff,PL
+2a06:d7c0::,2a06:d7c7:ffff:ffff:ffff:ffff:ffff:ffff,IQ
+2a06:d800::,2a06:d807:ffff:ffff:ffff:ffff:ffff:ffff,UA
+2a06:d840::,2a06:d847:ffff:ffff:ffff:ffff:ffff:ffff,IQ
+2a06:d880::,2a06:d887:ffff:ffff:ffff:ffff:ffff:ffff,FI
+2a06:d8c0::,2a06:d8c7:ffff:ffff:ffff:ffff:ffff:ffff,NO
+2a06:d900::,2a06:d907:ffff:ffff:ffff:ffff:ffff:ffff,RU
+2a06:d940::,2a06:d947:ffff:ffff:ffff:ffff:ffff:ffff,IR
+2a06:d980::,2a06:d987:ffff:ffff:ffff:ffff:ffff:ffff,IQ
+2a06:d9c0::,2a06:d9c7:ffff:ffff:ffff:ffff:ffff:ffff,CH
+2a06:da00::,2a06:da07:ffff:ffff:ffff:ffff:ffff:ffff,ES
+2a06:da40::,2a06:da47:ffff:ffff:ffff:ffff:ffff:ffff,ES
+2a06:da80::,2a06:da87:ffff:ffff:ffff:ffff:ffff:ffff,LT
+2a06:dac0::,2a06:dac7:ffff:ffff:ffff:ffff:ffff:ffff,GB
+2a06:db00::,2a06:db07:ffff:ffff:ffff:ffff:ffff:ffff,DK
+2a06:db40::,2a06:db47:ffff:ffff:ffff:ffff:ffff:ffff,GB
+2a06:db80::,2a06:db87:ffff:ffff:ffff:ffff:ffff:ffff,IR
+2a06:dbc0::,2a06:dbc7:ffff:ffff:ffff:ffff:ffff:ffff,SK
+2a06:dc00::,2a06:dc07:ffff:ffff:ffff:ffff:ffff:ffff,NL
+2a06:dc40::,2a06:dc47:ffff:ffff:ffff:ffff:ffff:ffff,RU
+2a06:dc80::,2a06:dc87:ffff:ffff:ffff:ffff:ffff:ffff,FR
+2a06:dcc0::,2a06:dcc7:ffff:ffff:ffff:ffff:ffff:ffff,NO
+2a06:dd00::,2a06:dd07:ffff:ffff:ffff:ffff:ffff:ffff,RU
+2a06:dd40::,2a06:dd47:ffff:ffff:ffff:ffff:ffff:ffff,GB
+2a06:dd80::,2a06:dd87:ffff:ffff:ffff:ffff:ffff:ffff,FR
+2a06:ddc0::,2a06:ddc7:ffff:ffff:ffff:ffff:ffff:ffff,RU
+2a06:de00::,2a06:de07:ffff:ffff:ffff:ffff:ffff:ffff,GB
+2a06:de40::,2a06:de47:ffff:ffff:ffff:ffff:ffff:ffff,IT
+2a06:de80::,2a06:de87:ffff:ffff:ffff:ffff:ffff:ffff,FR
+2a06:dec0::,2a06:dec7:ffff:ffff:ffff:ffff:ffff:ffff,PL
+2a06:df00::,2a06:df07:ffff:ffff:ffff:ffff:ffff:ffff,IT
+2a06:df40::,2a06:df47:ffff:ffff:ffff:ffff:ffff:ffff,TR
+2a06:df80::,2a06:df87:ffff:ffff:ffff:ffff:ffff:ffff,BG
+2a06:dfc0::,2a06:dfc7:ffff:ffff:ffff:ffff:ffff:ffff,LT
+2a06:e000::,2a06:e007:ffff:ffff:ffff:ffff:ffff:ffff,RO
+2a06:e040::,2a06:e047:ffff:ffff:ffff:ffff:ffff:ffff,FR
+2a06:e080::,2a06:e087:ffff:ffff:ffff:ffff:ffff:ffff,IR
+2a06:e0c0::,2a06:e0c7:ffff:ffff:ffff:ffff:ffff:ffff,RU
+2a06:e100::,2a06:e107:ffff:ffff:ffff:ffff:ffff:ffff,GB
+2a06:e140::,2a06:e147:ffff:ffff:ffff:ffff:ffff:ffff,ES
+2a06:e180::,2a06:e187:ffff:ffff:ffff:ffff:ffff:ffff,CZ
+2a06:e1c0::,2a06:e1c7:ffff:ffff:ffff:ffff:ffff:ffff,FR
+2a06:e200::,2a06:e207:ffff:ffff:ffff:ffff:ffff:ffff,RU
+2a06:e240::,2a06:e247:ffff:ffff:ffff:ffff:ffff:ffff,ES
+2a06:e280::,2a06:e287:ffff:ffff:ffff:ffff:ffff:ffff,GB
+2a06:e2c0::,2a06:e2c7:ffff:ffff:ffff:ffff:ffff:ffff,ES
+2a06:e300::,2a06:e307:ffff:ffff:ffff:ffff:ffff:ffff,IL
+2a06:e340::,2a06:e347:ffff:ffff:ffff:ffff:ffff:ffff,ME
+2a06:e380::,2a06:e387:ffff:ffff:ffff:ffff:ffff:ffff,DE
+2a06:e3c0::,2a06:e3c7:ffff:ffff:ffff:ffff:ffff:ffff,CZ
+2a06:e400::,2a06:e407:ffff:ffff:ffff:ffff:ffff:ffff,DE
+2a06:e440::,2a06:e447:ffff:ffff:ffff:ffff:ffff:ffff,KW
+2a06:e480::,2a06:e487:ffff:ffff:ffff:ffff:ffff:ffff,RS
+2a06:e4c0::,2a06:e4c7:ffff:ffff:ffff:ffff:ffff:ffff,UA
+2a06:e500::,2a06:e507:ffff:ffff:ffff:ffff:ffff:ffff,SK
+2a06:e540::,2a06:e547:ffff:ffff:ffff:ffff:ffff:ffff,ES
+2a06:e580::,2a06:e587:ffff:ffff:ffff:ffff:ffff:ffff,IT
+2a06:e5c0::,2a06:e5c7:ffff:ffff:ffff:ffff:ffff:ffff,RS
+2a06:e600::,2a06:e607:ffff:ffff:ffff:ffff:ffff:ffff,RU
+2a06:e640::,2a06:e647:ffff:ffff:ffff:ffff:ffff:ffff,PT
2c0e::,2c0e:fff:ffff:ffff:ffff:ffff:ffff:ffff,EG
2c0e:2000::,2c0e:2fff:ffff:ffff:ffff:ffff:ffff:ffff,ZA
2c0e:4000::,2c0e:40ff:ffff:ffff:ffff:ffff:ffff:ffff,ZA
@@ -26624,6 +27072,9 @@
2c0f:f548::,2c0f:f548:ffff:ffff:ffff:ffff:ffff:ffff,KE
2c0f:f550::,2c0f:f550:ffff:ffff:ffff:ffff:ffff:ffff,MU
2c0f:f558::,2c0f:f558:ffff:ffff:ffff:ffff:ffff:ffff,CD
+2c0f:f560::,2c0f:f560:ffff:ffff:ffff:ffff:ffff:ffff,KM
+2c0f:f568::,2c0f:f568:ffff:ffff:ffff:ffff:ffff:ffff,CG
+2c0f:f570::,2c0f:f570:ffff:ffff:ffff:ffff:ffff:ffff,ZA
2c0f:f600::,2c0f:f600:ffff:ffff:ffff:ffff:ffff:ffff,GN
2c0f:f608::,2c0f:f608:ffff:ffff:ffff:ffff:ffff:ffff,RE
2c0f:f610::,2c0f:f610:ffff:ffff:ffff:ffff:ffff:ffff,ZA
diff --git a/src/ext/README b/src/ext/README
index 5501aba758..7ce1bc3b74 100644
--- a/src/ext/README
+++ b/src/ext/README
@@ -65,6 +65,10 @@ ed25519/donna/*
Andrew Moon's semi-portable ed25519-donna implementation of
ed25519. Public domain.
+keccak-tiny/
+
+ David Leon Gil's portable Keccak implementation. CC0.
+
readpassphrase.[ch]
Portable readpassphrase implementation from OpenSSH portable, version
diff --git a/src/ext/include.am b/src/ext/include.am
index 47d4c03d0b..bf678f2c9d 100644
--- a/src/ext/include.am
+++ b/src/ext/include.am
@@ -135,3 +135,16 @@ noinst_HEADERS += $(ED25519_DONNA_HDRS)
LIBED25519_DONNA=src/ext/ed25519/donna/libed25519_donna.a
noinst_LIBRARIES += $(LIBED25519_DONNA)
+src_ext_keccak_tiny_libkeccak_tiny_a_CFLAGS=
+
+src_ext_keccak_tiny_libkeccak_tiny_a_SOURCES= \
+ src/ext/keccak-tiny/keccak-tiny-unrolled.c
+
+LIBKECCAK_TINY_HDRS = \
+ src/ext/keccak-tiny/keccak-tiny.h
+
+noinst_HEADERS += $(LIBKECCAK_TINY_HDRS)
+
+LIBKECCAK_TINY=src/ext/keccak-tiny/libkeccak-tiny.a
+noinst_LIBRARIES += $(LIBKECCAK_TINY)
+
diff --git a/src/ext/keccak-tiny/README.markdown b/src/ext/keccak-tiny/README.markdown
new file mode 100644
index 0000000000..784d6f6bdb
--- /dev/null
+++ b/src/ext/keccak-tiny/README.markdown
@@ -0,0 +1,82 @@
+# libkeccak-tiny
+
+An implementation of the FIPS-202-defined SHA-3 and SHAKE functions
+in 120 cloc (156 lines). One C file, one header.
+
+The `Keccak-f[1600]` permutation is fully unrolled; it's nearly as fast
+as the Keccak team's optimized permutation.
+
+## Building
+
+ > clang -O3 -march=native -std=c11 -Wextra -dynamic -shared keccak-tiny.c -o libkeccak-tiny.dylib
+
+If you don't have a modern libc that includes the `memset_s` function,
+you can just add `-D"memset_s(W,WL,V,OL)=memset(W,V,OL)` to the command
+line.
+
+## Using
+
+Build the library, include the header, and do, e.g.,
+
+ shake256(out, 256, in, inlen);
+
+That's it.
+
+(Note: You can request less output from the fixed-output-length
+functions, but not more.)
+
+## TweetShake
+
+The relevant tweets:
+
+```C
+// @hashbreaker Inspired by TweetNaCl!
+// Keccak and SHA-3 are supposedly hard to implement. So, how many tweets does it take to get to the center of a sponge...?
+#define decshake(bits) int shake##bits(unsigned char* o, unsigned long, unsigned char*, unsigned long); /*begin keccak.h*/
+#define decsha3(bits) int sha3_##bits(unsigned char*,unsigned long,unsigned char*,unsigned long);
+decshake(128) decshake(256) decsha3(224) decsha3(256) decsha3(384) decsha3(512) /*end keccak.h*/
+#define K static const /* Keccak constants: rho rotations, pi lanes, and iota RCs */ /*begin keccak.c*/
+typedef unsigned char byte;typedef byte*bytes;typedef unsigned long z;typedef unsigned long long u8;K u8 V=1ULL<<63;K u8 W=1ULL<<31;/*!gcc*/
+#define V (1ULL<<63)
+#define W (1ULL<31)
+K byte rho[24]={1,3,6,10,15,21,28,36,45,55,2,14,27,41,56,8,25,43,62,18,39,61,20,44};K u8 RC[24]={1,0x8082,V|0x808a,V|W|0x8000,0x808b,W|1,V|W
+|0x8081,V|0x8009,138,136,W|0x8009,W|10,W|0x808b,V|0x8b,V|0x8089,V|0x8003,V|0x8002,V|0x80,0x800a,V|W|0xa,V|W|0x8081,V|0x8080,W|1,V|W|0x8008};
+K byte pi[25]={10,7,11,17,18,3,5,16,8,21,24,4,15,23,19,13,12,2,20,14,22,9,6,1}; /**helpers:*/static inline z min(z a,z b){return (a<b)?a:b;}
+#define ROL(x, s) /* rotary shift */ (((x) << s) | ((x) >> (64-s))) /**macros to fully unroll the Keccak-f[1600] permutation:*/
+#define R24(e) /* repeat 24 times */ e e e e e e e e e e e e e e e e e e e e e e e e
+#define L5(v,s,e) /* 5-unroll a loop */ v=0; e; v+=s; e; v+=s; e; v+=s; e; v+=s; e; v+=s; /**the permutation:*/
+static inline void keccakf(u8* a){u8 b[5]={0};u8 t=0;byte x,y,i=0; /*24 rounds:*/R24( L5(x,1,b[x]=0;L5(y,5, /*parity*/ b[x] ^= a[x+y]))
+L5(x,1,L5(y,5,/*theta*/a[y+x] ^= b[(x+4)%5] ^ ROL(b[(x+1)%5],1))) t=a[1];x=0;R24(b[0]=a[pi[x]];/*rho*/a[pi[x]]=ROL(t, rho[x]);t=b[0];x++;)
+L5(y,5,L5(x,1, /*chi*/ b[x] = a[y+x]) L5(x,1, a[y+x] = b[x] ^ ~b[(x+1)%5] & b[(x+2)%5])) /*iota*/ a[0] ^= RC[i]; i++; )} /**keccak-f!**/
+#define FOR(i, ST, L, S) /*obvious*/ do { for (z i = 0; i < L; i += ST) { S; } } while (0) /**now, the sponge construction in hash mode**/
+#define appl(NAME, S) /*macro to define array comprehensions*/ static inline void NAME(bytes dst, bytes src, z len) { FOR(i, 1, len, S); }
+/*helpers:*/ static inline void clear(bytes a) { FOR(i,1,200,a[i]=0); } appl(xorin, dst[i] ^= src[i]) appl(set, src[i] = dst[i])
+#define foldP(I, L, F) /* macro to fold app P F */ while (L >= r) { /*apply F*/ F(a, I, r); /*permute*/ keccakf(A); I += r; L -= r; }
+static inline int hash(bytes o,z olen,bytes in,z ilen,z r,byte D){ if((o == (void*)0)||((in == (void*)0)&&ilen != 0)||(r >= 200))return -1;
+/*absorb*/u8 A[25]={0};bytes a=(bytes)A;/*full blocks*/foldP(in,ilen,xorin);/*last block*/xorin(a,in,ilen);/**ds+padstart*/a[ilen]^=D;
+/*padend:*/a[r-1]^=0x80; /**permute**/keccakf(A); /**squeeze:**/foldP(o,olen,set);/*last bytes*/set(a,o,olen);/*done!*/clear(a);return 0;}
+#define defshake(bits) int shake##bits(bytes o, z olen, bytes in, z ilen) {return hash(o,olen,in,ilen,200-(bits/4),0x1f);}
+#define defsha3(bits) int sha3_##bits(bytes o,z olen,bytes in,z ilen) {return hash(o,min(olen,200-(bits/4)),in,ilen,200-(bits/4),0x06);}
+/*define the SHA3 and SHAKE instances:*/defshake(128) defshake(256) defsha3(224) defsha3(256) defsha3(384) defsha3(512)/*end keccak.c*/
+// ...chomp. 24 kinda legible tweets (3232 bytes). And a simple interface: shake256(digest, digestlen, in, inlen)
+// Clang recommended. GCC users will need to insert "#define V (1ULL<<63)" and "#define W (1ULL<31)" at the point marked "/*!gcc*/"
+// If you're using as a prefix MAC, you MUST replace the body of "clear" with "memset_s(a, 200, 0, 200)" to avoid misoptimization.
+// @everyone_who_is_still_using_sha1 Please stop using SHA-1.
+// Oh, one more thing: a C11-threaded, memmapped shake256sum in 10 tweets. (Your libc may need a shim for C11 thread support.)
+// echo -n string stdio stdint fcntl sys/mman sys/stat sys/types unistd threads|tr ' ' \\n|xargs -n1 -I_ echo '#include <_.h>'
+#include "kcksum_tweet.h"
+#define E(LABEL, MSG) if (err != 0) { strerror_r(err, serr, 1024); fprintf(stderr, "%s: '%s' %s\n", serr, fn, MSG); goto LABEL;}
+static mtx_t iomtx;void h(void* v);void h(void* v){char* fn=(char*)v;int err=0;char serr[1024]={0};/*open file*/int fd=open(fn, O_RDONLY);
+err=!fd;E(ret,"couldn't be opened.");/*stat it*/struct stat stat;err=fstat(fd,&stat);E(close,"doesn't exist.");err=!!(stat.st_mode&S_IFDIR);
+E(close,"not a regular file.");z length=(size_t)stat.st_size;/*mmap the file*/bytes in=length?mmap(0,length,PROT_READ,MAP_SHARED,fd,0):NULL;
+if(length&&(in==MAP_FAILED)){E(close,"mmap-ing failed.");}byte out[64]={0};/*hash it*/shake256(out,64,in,length);length&&munmap(in,length);
+/*lock io*/mtx_lock(&iomtx);printf("SHAKE256('%s') = ", fn);FOR(i,1,64,printf("%02x",out[i]));printf("\n");mtx_unlock(&iomtx);/*unlock io*/
+close:close(fd);ret:thrd_exit(err);}int main(int argc,char** argv){int err=0; mtx_init(&iomtx, mtx_plain); thrd_t t[4]; int res[4],i,j,k;
+for(i=1;i<argc;i+=4){for(j=0;j<4;j++){if((j+i)==argc){/*out of files*/goto join;} /*spawn*/ thrd_create(t + j,h,argv[i + j]);}
+join: for (k = 0; k < j; k++) { /*wait*/ err |= thrd_join(t[k], res + k); err |= res[k];} } mtx_destroy(&iomtx); return err; } /* done! */
+```
+
+
+## License
+
+[CC0](http://creativecommons.org/publicdomain/zero/1.0/)
diff --git a/src/ext/keccak-tiny/do.sh b/src/ext/keccak-tiny/do.sh
new file mode 100644
index 0000000000..cf99f249e7
--- /dev/null
+++ b/src/ext/keccak-tiny/do.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/env sh
+cc=$(which clang-3.6||which gcc-4.9||which clang||||which gcc)
+so=$(test -f /etc/asl.conf && printf dylib|| printf so)
+$cc "-Dinline=__attribute__((__always_inline__))" -O3 -march=native -std=c11 -Wextra -Wpedantic -Wall -dynamic -shared keccak-tiny.c -o libkeccak-tiny.$so
+$cc -Os -march=native -std=c11 -Wextra -Wpedantic -Wall -dynamic -shared keccak-tiny.c -o libkeccak-tiny-small.$so
diff --git a/src/ext/keccak-tiny/keccak-tiny-unrolled.c b/src/ext/keccak-tiny/keccak-tiny-unrolled.c
new file mode 100644
index 0000000000..4b4f51c7cf
--- /dev/null
+++ b/src/ext/keccak-tiny/keccak-tiny-unrolled.c
@@ -0,0 +1,368 @@
+/** libkeccak-tiny
+ *
+ * A single-file implementation of SHA-3 and SHAKE.
+ *
+ * Implementor: David Leon Gil
+ * License: CC0, attribution kindly requested. Blame taken too,
+ * but not liability.
+ */
+#include "keccak-tiny.h"
+
+#include <string.h>
+#include "crypto.h"
+
+/******** The Keccak-f[1600] permutation ********/
+
+/*** Constants. ***/
+static const uint8_t rho[24] = \
+ { 1, 3, 6, 10, 15, 21,
+ 28, 36, 45, 55, 2, 14,
+ 27, 41, 56, 8, 25, 43,
+ 62, 18, 39, 61, 20, 44};
+static const uint8_t pi[24] = \
+ {10, 7, 11, 17, 18, 3,
+ 5, 16, 8, 21, 24, 4,
+ 15, 23, 19, 13, 12, 2,
+ 20, 14, 22, 9, 6, 1};
+static const uint64_t RC[24] = \
+ {1ULL, 0x8082ULL, 0x800000000000808aULL, 0x8000000080008000ULL,
+ 0x808bULL, 0x80000001ULL, 0x8000000080008081ULL, 0x8000000000008009ULL,
+ 0x8aULL, 0x88ULL, 0x80008009ULL, 0x8000000aULL,
+ 0x8000808bULL, 0x800000000000008bULL, 0x8000000000008089ULL, 0x8000000000008003ULL,
+ 0x8000000000008002ULL, 0x8000000000000080ULL, 0x800aULL, 0x800000008000000aULL,
+ 0x8000000080008081ULL, 0x8000000000008080ULL, 0x80000001ULL, 0x8000000080008008ULL};
+
+/*** Helper macros to unroll the permutation. ***/
+#define rol(x, s) (((x) << s) | ((x) >> (64 - s)))
+#define REPEAT6(e) e e e e e e
+#define REPEAT24(e) REPEAT6(e e e e)
+#define REPEAT5(e) e e e e e
+#define FOR5(v, s, e) \
+ v = 0; \
+ REPEAT5(e; v += s;)
+
+/*** Keccak-f[1600] ***/
+static inline void keccakf(void* state) {
+ uint64_t* a = (uint64_t*)state;
+ uint64_t b[5] = {0};
+ uint64_t t = 0;
+ uint8_t x, y, i = 0;
+
+ REPEAT24(
+ // Theta
+ FOR5(x, 1,
+ b[x] = 0;
+ FOR5(y, 5,
+ b[x] ^= a[x + y]; ))
+ FOR5(x, 1,
+ FOR5(y, 5,
+ a[y + x] ^= b[(x + 4) % 5] ^ rol(b[(x + 1) % 5], 1); ))
+ // Rho and pi
+ t = a[1];
+ x = 0;
+ REPEAT24(b[0] = a[pi[x]];
+ a[pi[x]] = rol(t, rho[x]);
+ t = b[0];
+ x++; )
+ // Chi
+ FOR5(y,
+ 5,
+ FOR5(x, 1,
+ b[x] = a[y + x];)
+ FOR5(x, 1,
+ a[y + x] = b[x] ^ ((~b[(x + 1) % 5]) & b[(x + 2) % 5]); ))
+ // Iota
+ a[0] ^= RC[i];
+ i++; )
+}
+
+/******** The FIPS202-defined functions. ********/
+
+/*** Some helper macros. ***/
+
+#define _(S) do { S } while (0)
+#define FOR(i, ST, L, S) \
+ _(for (size_t i = 0; i < L; i += ST) { S; })
+#define mkapply_ds(NAME, S) \
+ static inline void NAME(uint8_t* dst, \
+ const uint8_t* src, \
+ size_t len) { \
+ FOR(i, 1, len, S); \
+ }
+#define mkapply_sd(NAME, S) \
+ static inline void NAME(const uint8_t* src, \
+ uint8_t* dst, \
+ size_t len) { \
+ FOR(i, 1, len, S); \
+ }
+
+mkapply_ds(xorin, dst[i] ^= src[i]) // xorin
+mkapply_sd(setout, dst[i] = src[i]) // setout
+
+#define P keccakf
+#define Plen KECCAK_MAX_RATE
+
+#define KECCAK_DELIM_DIGEST 0x06
+#define KECCAK_DELIM_XOF 0x1f
+
+// Fold P*F over the full blocks of an input.
+#define foldP(I, L, F) \
+ while (L >= s->rate) { \
+ F(s->a, I, s->rate); \
+ P(s->a); \
+ I += s->rate; \
+ L -= s->rate; \
+ }
+
+static inline void
+keccak_absorb_blocks(keccak_state *s, const uint8_t *buf, size_t nr_blocks)
+{
+ size_t blen = nr_blocks * s->rate;
+ foldP(buf, blen, xorin);
+}
+
+static int
+keccak_update(keccak_state *s, const uint8_t *buf, size_t len)
+{
+ if (s->finalized)
+ return -1;
+ if ((buf == NULL) && len != 0)
+ return -1;
+
+ size_t remaining = len;
+ while (remaining > 0) {
+ if (s->offset == 0) {
+ const size_t blocks = remaining / s->rate;
+ size_t direct_bytes = blocks * s->rate;
+ if (direct_bytes > 0) {
+ keccak_absorb_blocks(s, buf, blocks);
+ remaining -= direct_bytes;
+ buf += direct_bytes;
+ }
+ }
+
+ const size_t buf_avail = s->rate - s->offset;
+ const size_t buf_bytes = (buf_avail > remaining) ? remaining : buf_avail;
+ if (buf_bytes > 0) {
+ memcpy(&s->block[s->offset], buf, buf_bytes);
+ s->offset += buf_bytes;
+ remaining -= buf_bytes;
+ buf += buf_bytes;
+ }
+ if (s->offset == s->rate) {
+ keccak_absorb_blocks(s, s->block, 1);
+ s->offset = 0;
+ }
+ }
+ return 0;
+}
+
+static void
+keccak_finalize(keccak_state *s)
+{
+ // Xor in the DS and pad frame.
+ s->a[s->offset] ^= s->delim;
+ s->a[s->rate - 1] ^= 0x80;
+ // Xor in the last block.
+ xorin(s->a, s->block, s->offset);
+
+ memwipe(s->block, 0, sizeof(s->block));
+ s->finalized = 1;
+ s->offset = s->rate;
+}
+
+static inline void
+keccak_squeeze_blocks(keccak_state *s, uint8_t *out, size_t nr_blocks)
+{
+ for (size_t n = 0; n < nr_blocks; n++) {
+ keccakf(s->a);
+ setout(s->a, out, s->rate);
+ out += s->rate;
+ }
+}
+
+static int
+keccak_squeeze(keccak_state *s, uint8_t *out, size_t outlen)
+{
+ if (!s->finalized)
+ return -1;
+
+ size_t remaining = outlen;
+ while (remaining > 0) {
+ if (s->offset == s->rate) {
+ const size_t blocks = remaining / s->rate;
+ const size_t direct_bytes = blocks * s->rate;
+ if (blocks > 0) {
+ keccak_squeeze_blocks(s, out, blocks);
+ out += direct_bytes;
+ remaining -= direct_bytes;
+ }
+
+ if (remaining > 0) {
+ keccak_squeeze_blocks(s, s->block, 1);
+ s->offset = 0;
+ }
+ }
+
+ const size_t buf_bytes = s->rate - s->offset;
+ const size_t indirect_bytes = (buf_bytes > remaining) ? remaining : buf_bytes;
+ if (indirect_bytes > 0) {
+ memcpy(out, &s->block[s->offset], indirect_bytes);
+ out += indirect_bytes;
+ s->offset += indirect_bytes;
+ remaining -= indirect_bytes;
+ }
+ }
+ return 0;
+}
+
+int
+keccak_digest_init(keccak_state *s, size_t bits)
+{
+ if (s == NULL)
+ return -1;
+ if (bits != 224 && bits != 256 && bits != 384 && bits != 512)
+ return -1;
+
+ keccak_cleanse(s);
+ s->rate = KECCAK_RATE(bits);
+ s->delim = KECCAK_DELIM_DIGEST;
+ return 0;
+}
+
+int
+keccak_digest_update(keccak_state *s, const uint8_t *buf, size_t len)
+{
+ if (s == NULL)
+ return -1;
+ if (s->delim != KECCAK_DELIM_DIGEST)
+ return -1;
+
+ return keccak_update(s, buf, len);
+}
+
+int
+keccak_digest_sum(const keccak_state *s, uint8_t *out, size_t outlen)
+{
+ if (s == NULL)
+ return -1;
+ if (s->delim != KECCAK_DELIM_DIGEST)
+ return -1;
+ if (out == NULL || outlen > 4 * (KECCAK_MAX_RATE - s->rate) / 8)
+ return -1;
+
+ // Work in a copy so that incremental/rolling hashes are easy.
+ keccak_state s_tmp;
+ keccak_clone(&s_tmp, s);
+ keccak_finalize(&s_tmp);
+ int ret = keccak_squeeze(&s_tmp, out, outlen);
+ keccak_cleanse(&s_tmp);
+ return ret;
+}
+
+int
+keccak_xof_init(keccak_state *s, size_t bits)
+{
+ if (s == NULL)
+ return -1;
+ if (bits != 128 && bits != 256)
+ return -1;
+
+ keccak_cleanse(s);
+ s->rate = KECCAK_RATE(bits);
+ s->delim = KECCAK_DELIM_XOF;
+ return 0;
+}
+
+int
+keccak_xof_absorb(keccak_state *s, const uint8_t *buf, size_t len)
+{
+ if (s == NULL)
+ return -1;
+ if (s->delim != KECCAK_DELIM_XOF)
+ return -1;
+
+ return keccak_update(s, buf, len);
+}
+
+int
+keccak_xof_squeeze(keccak_state *s, uint8_t *out, size_t outlen)
+{
+ if (s == NULL)
+ return -1;
+ if (s->delim != KECCAK_DELIM_XOF)
+ return -1;
+
+ if (!s->finalized)
+ keccak_finalize(s);
+
+ return keccak_squeeze(s, out, outlen);
+}
+
+void
+keccak_clone(keccak_state *out, const keccak_state *in)
+{
+ memcpy(out, in, sizeof(keccak_state));
+}
+
+void
+keccak_cleanse(keccak_state *s)
+{
+ memwipe(s, 0, sizeof(keccak_state));
+}
+
+/** The sponge-based hash construction. **/
+static inline int hash(uint8_t* out, size_t outlen,
+ const uint8_t* in, size_t inlen,
+ size_t bits, uint8_t delim) {
+ if ((out == NULL) || ((in == NULL) && inlen != 0)) {
+ return -1;
+ }
+
+ int ret = 0;
+ keccak_state s;
+
+ switch (delim) {
+ case KECCAK_DELIM_DIGEST:
+ ret |= keccak_digest_init(&s, bits);
+ ret |= keccak_digest_update(&s, in, inlen);
+ // Use the internal API instead of sum to avoid the memcpy.
+ keccak_finalize(&s);
+ ret |= keccak_squeeze(&s, out, outlen);
+ break;
+ case KECCAK_DELIM_XOF:
+ ret |= keccak_xof_init(&s, bits);
+ ret |= keccak_xof_absorb(&s, in, inlen);
+ ret |= keccak_xof_squeeze(&s, out, outlen);
+ break;
+ default:
+ return -1;
+ }
+ keccak_cleanse(&s);
+ return ret;
+}
+
+/*** Helper macros to define SHA3 and SHAKE instances. ***/
+#define defshake(bits) \
+ int shake##bits(uint8_t* out, size_t outlen, \
+ const uint8_t* in, size_t inlen) { \
+ return hash(out, outlen, in, inlen, bits, KECCAK_DELIM_XOF); \
+ }
+#define defsha3(bits) \
+ int sha3_##bits(uint8_t* out, size_t outlen, \
+ const uint8_t* in, size_t inlen) { \
+ if (outlen > (bits/8)) { \
+ return -1; \
+ } \
+ return hash(out, outlen, in, inlen, bits, KECCAK_DELIM_DIGEST); \
+ }
+
+/*** FIPS202 SHAKE VOFs ***/
+defshake(128)
+defshake(256)
+
+/*** FIPS202 SHA3 FOFs ***/
+defsha3(224)
+defsha3(256)
+defsha3(384)
+defsha3(512)
diff --git a/src/ext/keccak-tiny/keccak-tiny.c b/src/ext/keccak-tiny/keccak-tiny.c
new file mode 100644
index 0000000000..76d89fa78c
--- /dev/null
+++ b/src/ext/keccak-tiny/keccak-tiny.c
@@ -0,0 +1,163 @@
+/** libkeccak-tiny
+ *
+ * A single-file implementation of SHA-3 and SHAKE.
+ *
+ * Implementor: David Leon Gil
+ * License: CC0, attribution kindly requested. Blame taken too,
+ * but not liability.
+ */
+#include "keccak-tiny.h"
+
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/******** The Keccak-f[1600] permutation ********/
+
+/*** Constants. ***/
+static const uint8_t rho[24] = \
+ { 1, 3, 6, 10, 15, 21,
+ 28, 36, 45, 55, 2, 14,
+ 27, 41, 56, 8, 25, 43,
+ 62, 18, 39, 61, 20, 44};
+static const uint8_t pi[24] = \
+ {10, 7, 11, 17, 18, 3,
+ 5, 16, 8, 21, 24, 4,
+ 15, 23, 19, 13, 12, 2,
+ 20, 14, 22, 9, 6, 1};
+static const uint64_t RC[24] = \
+ {1ULL, 0x8082ULL, 0x800000000000808aULL, 0x8000000080008000ULL,
+ 0x808bULL, 0x80000001ULL, 0x8000000080008081ULL, 0x8000000000008009ULL,
+ 0x8aULL, 0x88ULL, 0x80008009ULL, 0x8000000aULL,
+ 0x8000808bULL, 0x800000000000008bULL, 0x8000000000008089ULL, 0x8000000000008003ULL,
+ 0x8000000000008002ULL, 0x8000000000000080ULL, 0x800aULL, 0x800000008000000aULL,
+ 0x8000000080008081ULL, 0x8000000000008080ULL, 0x80000001ULL, 0x8000000080008008ULL};
+
+/*** Helper macros to unroll the permutation. ***/
+#define rol(x, s) (((x) << s) | ((x) >> (64 - s)))
+#define REPEAT6(e) e e e e e e
+#define REPEAT24(e) REPEAT6(e e e e)
+#define REPEAT5(e) e e e e e
+#define FOR5(v, s, e) \
+ v = 0; \
+ REPEAT5(e; v += s;)
+
+/*** Keccak-f[1600] ***/
+static inline void keccakf(void* state) {
+ uint64_t* a = (uint64_t*)state;
+ uint64_t b[5] = {0};
+ uint64_t t = 0;
+ uint8_t x, y;
+
+ for (int i = 0; i < 24; i++) {
+ // Theta
+ FOR5(x, 1,
+ b[x] = 0;
+ FOR5(y, 5,
+ b[x] ^= a[x + y]; ))
+ FOR5(x, 1,
+ FOR5(y, 5,
+ a[y + x] ^= b[(x + 4) % 5] ^ rol(b[(x + 1) % 5], 1); ))
+ // Rho and pi
+ t = a[1];
+ x = 0;
+ REPEAT24(b[0] = a[pi[x]];
+ a[pi[x]] = rol(t, rho[x]);
+ t = b[0];
+ x++; )
+ // Chi
+ FOR5(y,
+ 5,
+ FOR5(x, 1,
+ b[x] = a[y + x];)
+ FOR5(x, 1,
+ a[y + x] = b[x] ^ ((~b[(x + 1) % 5]) & b[(x + 2) % 5]); ))
+ // Iota
+ a[0] ^= RC[i];
+ }
+}
+
+/******** The FIPS202-defined functions. ********/
+
+/*** Some helper macros. ***/
+
+#define _(S) do { S } while (0)
+#define FOR(i, ST, L, S) \
+ _(for (size_t i = 0; i < L; i += ST) { S; })
+#define mkapply_ds(NAME, S) \
+ static inline void NAME(uint8_t* dst, \
+ const uint8_t* src, \
+ size_t len) { \
+ FOR(i, 1, len, S); \
+ }
+#define mkapply_sd(NAME, S) \
+ static inline void NAME(const uint8_t* src, \
+ uint8_t* dst, \
+ size_t len) { \
+ FOR(i, 1, len, S); \
+ }
+
+mkapply_ds(xorin, dst[i] ^= src[i]) // xorin
+mkapply_sd(setout, dst[i] = src[i]) // setout
+
+#define P keccakf
+#define Plen 200
+
+// Fold P*F over the full blocks of an input.
+#define foldP(I, L, F) \
+ while (L >= rate) { \
+ F(a, I, rate); \
+ P(a); \
+ I += rate; \
+ L -= rate; \
+ }
+
+/** The sponge-based hash construction. **/
+static inline int hash(uint8_t* out, size_t outlen,
+ const uint8_t* in, size_t inlen,
+ size_t rate, uint8_t delim) {
+ if ((out == NULL) || ((in == NULL) && inlen != 0) || (rate >= Plen)) {
+ return -1;
+ }
+ uint8_t a[Plen] = {0};
+ // Absorb input.
+ foldP(in, inlen, xorin);
+ // Xor in the DS and pad frame.
+ a[inlen] ^= delim;
+ a[rate - 1] ^= 0x80;
+ // Xor in the last block.
+ xorin(a, in, inlen);
+ // Apply P
+ P(a);
+ // Squeeze output.
+ foldP(out, outlen, setout);
+ setout(a, out, outlen);
+ memset_s(a, 200, 0, 200);
+ return 0;
+}
+
+/*** Helper macros to define SHA3 and SHAKE instances. ***/
+#define defshake(bits) \
+ int shake##bits(uint8_t* out, size_t outlen, \
+ const uint8_t* in, size_t inlen) { \
+ return hash(out, outlen, in, inlen, 200 - (bits / 4), 0x1f); \
+ }
+#define defsha3(bits) \
+ int sha3_##bits(uint8_t* out, size_t outlen, \
+ const uint8_t* in, size_t inlen) { \
+ if (outlen > (bits/8)) { \
+ return -1; \
+ } \
+ return hash(out, outlen, in, inlen, 200 - (bits / 4), 0x06); \
+ }
+
+/*** FIPS202 SHAKE VOFs ***/
+defshake(128)
+defshake(256)
+
+/*** FIPS202 SHA3 FOFs ***/
+defsha3(224)
+defsha3(256)
+defsha3(384)
+defsha3(512)
diff --git a/src/ext/keccak-tiny/keccak-tiny.h b/src/ext/keccak-tiny/keccak-tiny.h
new file mode 100644
index 0000000000..7efea2319e
--- /dev/null
+++ b/src/ext/keccak-tiny/keccak-tiny.h
@@ -0,0 +1,66 @@
+#ifndef KECCAK_FIPS202_H
+#define KECCAK_FIPS202_H
+
+#include <stddef.h>
+#include "torint.h"
+
+#define KECCAK_MAX_RATE 200
+
+/* Calculate the rate (block size) from the security target. */
+#define KECCAK_RATE(bits) (KECCAK_MAX_RATE - (bits / 4))
+
+/* The internal structure of a FIPS202 hash/xof instance. Most callers
+ * should treat this as an opaque structure.
+ */
+typedef struct keccak_state {
+ uint8_t a[KECCAK_MAX_RATE];
+ size_t rate;
+ uint8_t delim;
+
+ uint8_t block[KECCAK_MAX_RATE];
+ size_t offset;
+
+ uint8_t finalized : 1;
+} keccak_state;
+
+/* Initialize a Keccak instance suitable for SHA-3 hash functions. */
+int keccak_digest_init(keccak_state *s, size_t bits);
+
+/* Feed more data into the SHA-3 hash instance. */
+int keccak_digest_update(keccak_state *s, const uint8_t *buf, size_t len);
+
+/* Calculate the SHA-3 hash digest. The state is unmodified to support
+ * calculating multiple/rolling digests.
+ */
+int keccak_digest_sum(const keccak_state *s, uint8_t *out, size_t outlen);
+
+/* Initialize a Keccak instance suitable for XOFs (SHAKE-128/256). */
+int keccak_xof_init(keccak_state *s, size_t bits);
+
+/* Absorb more data into the XOF. Must not be called after a squeeze call. */
+int keccak_xof_absorb(keccak_state *s, const uint8_t *buf, size_t len);
+
+/* Squeeze data out of the XOF. Must not attempt to absorb additional data,
+ * after a squeeze has been called.
+ */
+int keccak_xof_squeeze(keccak_state *s, uint8_t *out, size_t outlen);
+
+/* Clone an existing hash/XOF instance. */
+void keccak_clone(keccak_state *out, const keccak_state *in);
+
+/* Cleanse sensitive data from a given hash instance. */
+void keccak_cleanse(keccak_state *s);
+
+#define decshake(bits) \
+ int shake##bits(uint8_t*, size_t, const uint8_t*, size_t);
+
+#define decsha3(bits) \
+ int sha3_##bits(uint8_t*, size_t, const uint8_t*, size_t);
+
+decshake(128)
+decshake(256)
+decsha3(224)
+decsha3(256)
+decsha3(384)
+decsha3(512)
+#endif
diff --git a/src/or/buffers.c b/src/or/buffers.c
index 4696bec8f4..cdb499b8da 100644
--- a/src/or/buffers.c
+++ b/src/or/buffers.c
@@ -1945,7 +1945,7 @@ parse_socks(const char *data, size_t datalen, socks_request_t *req,
log_warn(LD_PROTOCOL,
"Your application (using socks4 to port %d) gave Tor "
"a malformed hostname: %s. Rejecting the connection.",
- req->port, escaped(req->address));
+ req->port, escaped_safe_str_client(req->address));
return -1;
}
if (authend != authstart) {
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 4831f2be76..5ffd1f68c7 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -92,7 +92,7 @@ circuit_is_acceptable(const origin_circuit_t *origin_circ,
/* decide if this circ is suitable for this conn */
/* for rend circs, circ->cpath->prev is not the last router in the
- * circuit, it's the magical extra bob hop. so just check the nickname
+ * circuit, it's the magical extra service hop. so just check the nickname
* of the one we meant to finish at.
*/
build_state = origin_circ->build_state;
@@ -1493,11 +1493,11 @@ circuit_has_opened(origin_circuit_t *circ)
circuit_try_attaching_streams(circ);
break;
case CIRCUIT_PURPOSE_S_ESTABLISH_INTRO:
- /* at Bob, waiting for introductions */
+ /* at the service, waiting for introductions */
rend_service_intro_has_opened(circ);
break;
case CIRCUIT_PURPOSE_S_CONNECT_REND:
- /* at Bob, connecting to rend point */
+ /* at the service, connecting to rend point */
rend_service_rendezvous_has_opened(circ);
break;
case CIRCUIT_PURPOSE_TESTING:
@@ -1617,32 +1617,32 @@ circuit_build_failed(origin_circuit_t *circ)
circuit_testing_failed(circ, failed_at_last_hop);
break;
case CIRCUIT_PURPOSE_S_ESTABLISH_INTRO:
- /* at Bob, waiting for introductions */
+ /* at the service, waiting for introductions */
if (circ->base_.state != CIRCUIT_STATE_OPEN) {
circuit_increment_failure_count();
}
- /* no need to care here, because bob will rebuild intro
+ /* no need to care here, because the service will rebuild intro
* points periodically. */
break;
case CIRCUIT_PURPOSE_C_INTRODUCING:
- /* at Alice, connecting to intro point */
- /* Don't increment failure count, since Bob may have picked
+ /* at the client, connecting to intro point */
+ /* Don't increment failure count, since the service may have picked
* the introduction point maliciously */
- /* Alice will pick a new intro point when this one dies, if
+ /* The client will pick a new intro point when this one dies, if
* the stream in question still cares. No need to act here. */
break;
case CIRCUIT_PURPOSE_C_ESTABLISH_REND:
- /* at Alice, waiting for Bob */
+ /* at the client, waiting for the service */
circuit_increment_failure_count();
- /* Alice will pick a new rend point when this one dies, if
+ /* the client will pick a new rend point when this one dies, if
* the stream in question still cares. No need to act here. */
break;
case CIRCUIT_PURPOSE_S_CONNECT_REND:
- /* at Bob, connecting to rend point */
- /* Don't increment failure count, since Alice may have picked
+ /* at the service, connecting to rend point */
+ /* Don't increment failure count, since the client may have picked
* the rendezvous point maliciously */
log_info(LD_REND,
- "Couldn't connect to Alice's chosen rend point %s "
+ "Couldn't connect to the client's chosen rend point %s "
"(%s hop failed).",
escaped(build_state_get_exit_nickname(circ->build_state)),
failed_at_last_hop?"last":"non-last");
@@ -2246,7 +2246,7 @@ consider_recording_trackhost(const entry_connection_t *conn,
char fp[HEX_DIGEST_LEN+1];
/* Search the addressmap for this conn's destination. */
- /* If he's not in the address map.. */
+ /* If they're not in the address map.. */
if (!options->TrackHostExits ||
addressmap_have_mapping(conn->socks_request->address,
options->TrackHostExitsExpire))
diff --git a/src/or/config.c b/src/or/config.c
index b9d9fb2d9a..d71cf6dec7 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -224,6 +224,7 @@ static config_var_t option_vars_[] = {
V(DirPortFrontPage, FILENAME, NULL),
VAR("DirReqStatistics", BOOL, DirReqStatistics_option, "1"),
VAR("DirAuthority", LINELIST, DirAuthorities, NULL),
+ V(DirCache, BOOL, "1"),
V(DirAuthorityFallbackRate, DOUBLE, "1.0"),
V(DisableAllSwap, BOOL, "0"),
V(DisableDebuggerAttachment, BOOL, "1"),
@@ -591,7 +592,6 @@ static const config_var_t testing_tor_network_defaults[] = {
static char *get_windows_conf_root(void);
#endif
static int options_act_reversible(const or_options_t *old_options, char **msg);
-static int options_act(const or_options_t *old_options);
static int options_transition_allowed(const or_options_t *old,
const or_options_t *new,
char **msg);
@@ -672,9 +672,9 @@ get_dirportfrontpage, (void))
return global_dirfrontpagecontents;
}
-/** Return the currently configured options. */
-or_options_t *
-get_options_mutable(void)
+/** Returns the currently configured options. */
+MOCK_IMPL(or_options_t *,
+get_options_mutable, (void))
{
tor_assert(global_options);
return global_options;
@@ -834,7 +834,6 @@ config_free_all(void)
tor_free(torrc_fname);
tor_free(torrc_defaults_fname);
- tor_free(the_tor_version);
tor_free(global_dirfrontpagecontents);
tor_free(the_short_tor_version);
@@ -918,7 +917,7 @@ static const char *default_authorities[] = {
"ipv6=[2001:638:a000:4140::ffff:189]:443 "
"131.188.40.189:80 F204 4413 DAC2 E02E 3D6B CF47 35A1 9BCA 1DE9 7281",
"dannenberg orport=443 "
- "v3ident=585769C78764D58426B8B52B6651A5A71137189A "
+ "v3ident=0232AF901C31A04EE9848595AF9BB7620D4C5B2E "
"193.23.244.244:80 7BE6 83E6 5D48 1413 21C5 ED92 F075 C553 64AC 7123",
"urras orport=80 "
"v3ident=80550987E1D626E3EBA5E5E75A458DE0626D088C "
@@ -939,6 +938,14 @@ static const char *default_authorities[] = {
NULL
};
+/** List of fallback directory authorities. The list is generated by opt-in of
+ * relays that meet certain stability criteria.
+ */
+static const char *default_fallbacks[] = {
+#include "fallback_dirs.inc"
+ NULL
+};
+
/** Add the default directory authorities directly into the trusted dir list,
* but only add them insofar as they share bits with <b>type</b>.
* Each authority's bits are restricted to the bits shared with <b>type</b>.
@@ -961,14 +968,10 @@ MOCK_IMPL(void,
add_default_fallback_dir_servers,(void))
{
int i;
- const char *fallback[] = {
-#include "fallback_dirs.inc"
- NULL
- };
- for (i=0; fallback[i]; i++) {
- if (parse_dir_fallback_line(fallback[i], 0)<0) {
+ for (i=0; default_fallbacks[i]; i++) {
+ if (parse_dir_fallback_line(default_fallbacks[i], 0)<0) {
log_err(LD_BUG, "Couldn't parse internal FallbackDir line %s",
- fallback[i]);
+ default_fallbacks[i]);
}
}
}
@@ -1443,7 +1446,7 @@ options_transition_requires_fresh_tls_context(const or_options_t *old_options,
* Note: We haven't moved all the "act on new configuration" logic
* here yet. Some is still in do_hup() and other places.
*/
-static int
+STATIC int
options_act(const or_options_t *old_options)
{
config_line_t *cl;
@@ -1465,10 +1468,12 @@ options_act(const or_options_t *old_options)
if (options->DisableDebuggerAttachment && !disabled_debugger_attach &&
running_tor) {
int ok = tor_disable_debugger_attach();
+ /* LCOV_EXCL_START the warned_debugger_attach is 0 can't reach inside. */
if (warned_debugger_attach && ok == 1) {
log_notice(LD_CONFIG, "Disabled attaching debuggers for unprivileged "
"users.");
}
+ /* LCOV_EXCL_STOP */
disabled_debugger_attach = (ok == 1);
} else if (!options->DisableDebuggerAttachment &&
!warned_debugger_attach) {
@@ -1495,12 +1500,14 @@ options_act(const or_options_t *old_options)
#endif
#ifdef ENABLE_TOR2WEB_MODE
+/* LCOV_EXCL_START */
if (!options->Tor2webMode) {
log_err(LD_CONFIG, "This copy of Tor was compiled to run in "
"'tor2web mode'. It can only be run with the Tor2webMode torrc "
"option enabled.");
return -1;
}
+/* LCOV_EXCL_STOP */
#else
if (options->Tor2webMode) {
log_err(LD_CONFIG, "This copy of Tor was not compiled to run in "
@@ -1512,7 +1519,7 @@ options_act(const or_options_t *old_options)
#endif
/* If we are a bridge with a pluggable transport proxy but no
- Extended ORPort, inform the user that she is missing out. */
+ Extended ORPort, inform the user that they are missing out. */
if (server_mode(options) && options->ServerTransportPlugin &&
!options->ExtORPort_lines) {
log_notice(LD_CONFIG, "We use pluggable transports but the Extended "
@@ -1764,8 +1771,8 @@ options_act(const or_options_t *old_options)
if (revise_trackexithosts)
addressmap_clear_excluded_trackexithosts(options);
- if (!options->AutomapHostsOnResolve) {
- if (old_options->AutomapHostsOnResolve)
+ if (!options->AutomapHostsOnResolve &&
+ old_options->AutomapHostsOnResolve) {
revise_automap_entries = 1;
} else {
if (!smartlist_strings_eq(old_options->AutomapHostsSuffixes,
@@ -1904,8 +1911,8 @@ options_act(const or_options_t *old_options)
print_notice = 1;
}
if (print_notice)
- log_notice(LD_CONFIG, "Configured to measure statistics. Look for "
- "the *-stats files that will first be written to the "
+ log_notice(LD_CONFIG, "Configured to measure statistics. Look for "
+ "the *-stats files that will first be written to the "
"data directory in 24 hours from now.");
}
@@ -3473,8 +3480,30 @@ options_validate(or_options_t *old_options, or_options_t *options,
options->AccountingRule = ACCT_SUM;
else if (!strcmp(options->AccountingRule_option, "max"))
options->AccountingRule = ACCT_MAX;
+ else if (!strcmp(options->AccountingRule_option, "in"))
+ options->AccountingRule = ACCT_IN;
+ else if (!strcmp(options->AccountingRule_option, "out"))
+ options->AccountingRule = ACCT_OUT;
else
- REJECT("AccountingRule must be 'sum' or 'max'");
+ REJECT("AccountingRule must be 'sum', 'max', 'in', or 'out'");
+ }
+
+ if (options->DirPort_set && !options->DirCache) {
+ REJECT("DirPort configured but DirCache disabled. DirPort requires "
+ "DirCache.");
+ }
+
+ if (options->BridgeRelay && !options->DirCache) {
+ REJECT("We're a bridge but DirCache is disabled. BridgeRelay requires "
+ "DirCache.");
+ }
+
+ if (server_mode(options)) {
+ char *msg = NULL;
+ if (have_enough_mem_for_dircache(options, 0, &msg)) {
+ log_warn(LD_CONFIG, "%s", msg);
+ tor_free(msg);
+ }
}
if (options->HTTPProxy) { /* parse it now */
@@ -4085,6 +4114,52 @@ compute_real_max_mem_in_queues(const uint64_t val, int log_guess)
}
}
+/* If we have less than 300 MB suggest disabling dircache */
+#define DIRCACHE_MIN_MB_BANDWIDTH 300
+#define DIRCACHE_MIN_BANDWIDTH (DIRCACHE_MIN_MB_BANDWIDTH*ONE_MEGABYTE)
+#define STRINGIFY(val) #val
+
+/** Create a warning message for emitting if we are a dircache but may not have
+ * enough system memory, or if we are not a dircache but probably should be.
+ * Return -1 when a message is returned in *msg*, else return 0. */
+STATIC int
+have_enough_mem_for_dircache(const or_options_t *options, size_t total_mem,
+ char **msg)
+{
+ *msg = NULL;
+ /* XXX We should possibly be looking at MaxMemInQueues here
+ * unconditionally. Or we should believe total_mem unconditionally. */
+ if (total_mem == 0) {
+ if (get_total_system_memory(&total_mem) < 0) {
+ total_mem = options->MaxMemInQueues >= SIZE_MAX ?
+ SIZE_MAX : (size_t)options->MaxMemInQueues;
+ }
+ }
+ if (options->DirCache) {
+ if (total_mem < DIRCACHE_MIN_BANDWIDTH) {
+ if (options->BridgeRelay) {
+ *msg = strdup("Running a Bridge with less than "
+ STRINGIFY(DIRCACHE_MIN_MB_BANDWIDTH) " MB of memory is "
+ "not recommended.");
+ } else {
+ *msg = strdup("Being a directory cache (default) with less than "
+ STRINGIFY(DIRCACHE_MIN_MB_BANDWIDTH) " MB of memory is "
+ "not recommended and may consume most of the available "
+ "resources, consider disabling this functionality by "
+ "setting the DirCache option to 0.");
+ }
+ }
+ } else {
+ if (total_mem >= DIRCACHE_MIN_BANDWIDTH) {
+ *msg = strdup("DirCache is disabled and we are configured as a "
+ "relay. This may disqualify us from becoming a guard in the "
+ "future.");
+ }
+ }
+ return *msg == NULL ? 0 : -1;
+}
+#undef STRINGIFY
+
/** Helper: return true iff s1 and s2 are both NULL, or both non-NULL
* equal strings. */
static int
@@ -4273,7 +4348,8 @@ options_transition_affects_descriptor(const or_options_t *old_options,
!opt_streq(old_options->MyFamily, new_options->MyFamily) ||
!opt_streq(old_options->AccountingStart, new_options->AccountingStart) ||
old_options->AccountingMax != new_options->AccountingMax ||
- public_server_mode(old_options) != public_server_mode(new_options))
+ public_server_mode(old_options) != public_server_mode(new_options) ||
+ old_options->DirCache != new_options->DirCache)
return 1;
return 0;
@@ -6018,15 +6094,6 @@ warn_nonlocal_controller_ports(smartlist_t *ports, unsigned forbid_nonlocal)
} SMARTLIST_FOREACH_END(port);
}
-#define CL_PORT_NO_STREAM_OPTIONS (1u<<0)
-#define CL_PORT_WARN_NONLOCAL (1u<<1)
-#define CL_PORT_ALLOW_EXTRA_LISTENADDR (1u<<2)
-#define CL_PORT_SERVER_OPTIONS (1u<<3)
-#define CL_PORT_FORBID_NONLOCAL (1u<<4)
-#define CL_PORT_TAKES_HOSTNAMES (1u<<5)
-#define CL_PORT_IS_UNIXSOCKET (1u<<6)
-#define CL_PORT_DFLT_GROUP_WRITABLE (1u<<7)
-
#ifdef HAVE_SYS_UN_H
/** Parse the given <b>addrport</b> and set <b>path_out</b> if a Unix socket
@@ -6114,7 +6181,7 @@ config_parse_unix_port(const char *addrport, char **path_out)
* <b>out</b> for every port that the client should listen on. Return 0
* on success, -1 on failure.
*/
-static int
+STATIC int
parse_port_config(smartlist_t *out,
const config_line_t *ports,
const config_line_t *listenaddrs,
@@ -6320,7 +6387,7 @@ parse_port_config(smartlist_t *out,
}
port = ptmp;
} else {
- log_warn(LD_CONFIG, "Couldn't parse address '%s' for %sPort",
+ log_warn(LD_CONFIG, "Couldn't parse address %s for %sPort",
escaped(addrport), portname);
goto err;
}
@@ -7344,7 +7411,7 @@ getinfo_helper_config(control_connection_t *conn,
smartlist_free(sl);
} else if (!strcmp(question, "config/defaults")) {
smartlist_t *sl = smartlist_new();
- int i, dirauth_lines_seen = 0;
+ int i, dirauth_lines_seen = 0, fallback_lines_seen = 0;
for (i = 0; option_vars_[i].name; ++i) {
const config_var_t *var = &option_vars_[i];
if (var->initvalue != NULL) {
@@ -7355,6 +7422,13 @@ getinfo_helper_config(control_connection_t *conn,
*/
++dirauth_lines_seen;
}
+ if (strcmp(option_vars_[i].name, "FallbackDir") == 0) {
+ /*
+ * Similarly count fallback lines, so that we can decided later
+ * to add the defaults manually.
+ */
+ ++fallback_lines_seen;
+ }
char *val = esc_for_log(var->initvalue);
smartlist_add_asprintf(sl, "%s %s\n",var->name,val);
tor_free(val);
@@ -7380,6 +7454,24 @@ getinfo_helper_config(control_connection_t *conn,
}
}
+ if (fallback_lines_seen == 0 &&
+ get_options()->UseDefaultFallbackDirs == 1) {
+ /*
+ * We didn't see any explicitly configured fallback mirrors,
+ * so add the defaults to the list manually.
+ *
+ * default_fallbacks is included earlier in this file and
+ * is a const char ** NULL-terminated array of fallback config lines.
+ */
+ const char **i;
+
+ for (i = default_fallbacks; *i != NULL; ++i) {
+ char *val = esc_for_log(*i);
+ smartlist_add_asprintf(sl, "FallbackDir %s\n", val);
+ tor_free(val);
+ }
+ }
+
*answer = smartlist_join_strings(sl, "", 0, NULL);
SMARTLIST_FOREACH(sl, char *, c, tor_free(c));
smartlist_free(sl);
diff --git a/src/or/config.h b/src/or/config.h
index bfdd1694eb..c7ce57d2aa 100644
--- a/src/or/config.h
+++ b/src/or/config.h
@@ -16,7 +16,7 @@
MOCK_DECL(const char*, get_dirportfrontpage, (void));
MOCK_DECL(const or_options_t *, get_options, (void));
-or_options_t *get_options_mutable(void);
+MOCK_DECL(or_options_t *, get_options_mutable, (void));
int set_options(or_options_t *new_val, char **msg);
void config_free_all(void);
const char *safe_str_client(const char *address);
@@ -136,6 +136,17 @@ smartlist_t *get_options_from_transport_options_line(const char *line,
smartlist_t *get_options_for_server_transport(const char *transport);
#ifdef CONFIG_PRIVATE
+
+#define CL_PORT_NO_STREAM_OPTIONS (1u<<0)
+#define CL_PORT_WARN_NONLOCAL (1u<<1)
+#define CL_PORT_ALLOW_EXTRA_LISTENADDR (1u<<2)
+#define CL_PORT_SERVER_OPTIONS (1u<<3)
+#define CL_PORT_FORBID_NONLOCAL (1u<<4)
+#define CL_PORT_TAKES_HOSTNAMES (1u<<5)
+#define CL_PORT_IS_UNIXSOCKET (1u<<6)
+#define CL_PORT_DFLT_GROUP_WRITABLE (1u<<7)
+
+STATIC int options_act(const or_options_t *old_options);
#ifdef TOR_UNIT_TESTS
extern struct config_format_t options_format;
#endif
@@ -158,6 +169,16 @@ STATIC int parse_dir_authority_line(const char *line,
dirinfo_type_t required_type,
int validate_only);
STATIC int parse_dir_fallback_line(const char *line, int validate_only);
+STATIC int have_enough_mem_for_dircache(const or_options_t *options,
+ size_t total_mem, char **msg);
+STATIC int parse_port_config(smartlist_t *out,
+ const config_line_t *ports,
+ const config_line_t *listenaddrs,
+ const char *portname,
+ int listener_type,
+ const char *defaultaddr,
+ int defaultport,
+ const unsigned flags);
#endif
#endif
diff --git a/src/or/connection.c b/src/or/connection.c
index 63bfb2e01e..a8ce220c60 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -1138,11 +1138,12 @@ connection_listener_new(const struct sockaddr *listensockaddr,
tor_socket_strerror(errno));
}
-#if defined USE_TRANSPARENT && defined(IP_TRANSPARENT)
+#if defined(USE_TRANSPARENT) && defined(IP_TRANSPARENT)
if (options->TransProxyType_parsed == TPT_TPROXY &&
type == CONN_TYPE_AP_TRANS_LISTENER) {
int one = 1;
- if (setsockopt(s, SOL_IP, IP_TRANSPARENT, &one, sizeof(one)) < 0) {
+ if (setsockopt(s, SOL_IP, IP_TRANSPARENT, (void*)&one,
+ (socklen_t)sizeof(one)) < 0) {
const char *extra = "";
int e = tor_socket_errno(s);
if (e == EPERM)
@@ -1156,16 +1157,11 @@ connection_listener_new(const struct sockaddr *listensockaddr,
#ifdef IPV6_V6ONLY
if (listensockaddr->sa_family == AF_INET6) {
-#ifdef _WIN32
- /* In Redmond, this kind of thing passes for standards-conformance. */
- DWORD one = 1;
-#else
int one = 1;
-#endif
/* We need to set IPV6_V6ONLY so that this socket can't get used for
* IPv4 connections. */
if (setsockopt(s,IPPROTO_IPV6, IPV6_V6ONLY,
- (void*)&one, sizeof(one)) < 0) {
+ (void*)&one, (socklen_t)sizeof(one)) < 0) {
int e = tor_socket_errno(s);
log_warn(LD_NET, "Error setting IPV6_V6ONLY flag: %s",
tor_socket_strerror(e));
@@ -1447,7 +1443,7 @@ connection_handle_listener_read(connection_t *conn, int new_type)
if (!SOCKET_OK(news)) { /* accept() error */
int e = tor_socket_errno(conn->s);
if (ERRNO_IS_ACCEPT_EAGAIN(e)) {
- return 0; /* he hung up before we could accept(). that's fine. */
+ return 0; /* they hung up before we could accept(). that's fine. */
} else if (ERRNO_IS_RESOURCE_LIMIT(e)) {
warn_too_many_conns();
return 0;
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 8a3beb3ce9..758d583c39 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -800,20 +800,23 @@ connection_ap_attach_pending(int retry)
if (untried_pending_connections == 0 && !retry)
return;
- SMARTLIST_FOREACH_BEGIN(pending_entry_connections,
+ /* Don't allow modifications to pending_entry_connections while we are
+ * iterating over it. */
+ smartlist_t *pending = pending_entry_connections;
+ pending_entry_connections = smartlist_new();
+
+ SMARTLIST_FOREACH_BEGIN(pending,
entry_connection_t *, entry_conn) {
connection_t *conn = ENTRY_TO_CONN(entry_conn);
tor_assert(conn && entry_conn);
if (conn->marked_for_close) {
UNMARK();
- SMARTLIST_DEL_CURRENT(pending_entry_connections, entry_conn);
continue;
}
if (conn->magic != ENTRY_CONNECTION_MAGIC) {
log_warn(LD_BUG, "%p has impossible magic value %u.",
entry_conn, (unsigned)conn->magic);
UNMARK();
- SMARTLIST_DEL_CURRENT(pending_entry_connections, entry_conn);
continue;
}
if (conn->state != AP_CONN_STATE_CIRCUIT_WAIT) {
@@ -822,7 +825,6 @@ connection_ap_attach_pending(int retry)
entry_conn,
conn_state_to_string(conn->type, conn->state));
UNMARK();
- SMARTLIST_DEL_CURRENT(pending_entry_connections, entry_conn);
continue;
}
@@ -832,18 +834,19 @@ connection_ap_attach_pending(int retry)
END_STREAM_REASON_CANT_ATTACH);
}
- if (conn->marked_for_close ||
- conn->type != CONN_TYPE_AP ||
- conn->state != AP_CONN_STATE_CIRCUIT_WAIT) {
- UNMARK();
- SMARTLIST_DEL_CURRENT(pending_entry_connections, entry_conn);
- continue;
+ if (! conn->marked_for_close &&
+ conn->type == CONN_TYPE_AP &&
+ conn->state == AP_CONN_STATE_CIRCUIT_WAIT) {
+ if (!smartlist_contains(pending_entry_connections, entry_conn)) {
+ smartlist_add(pending_entry_connections, entry_conn);
+ continue;
+ }
}
- tor_assert(conn->magic == ENTRY_CONNECTION_MAGIC);
-
+ UNMARK();
} SMARTLIST_FOREACH_END(entry_conn);
+ smartlist_free(pending);
untried_pending_connections = 0;
}
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index 73e4d19369..d778eb3b4f 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -1581,7 +1581,7 @@ connection_or_nonopen_was_started_here(or_connection_t *conn)
}
/** <b>Conn</b> just completed its handshake. Return 0 if all is well, and
- * return -1 if he is lying, broken, or otherwise something is wrong.
+ * return -1 if they are lying, broken, or otherwise something is wrong.
*
* If we initiated this connection (<b>started_here</b> is true), make sure
* the other side sent a correctly formed certificate. If I initiated the
@@ -1754,7 +1754,7 @@ connection_or_client_used(or_connection_t *conn)
*
* Make sure we are happy with the person we just handshaked with.
*
- * If he initiated the connection, make sure he's not already connected,
+ * If they initiated the connection, make sure they're not already connected,
* then initialize conn from the information in router.
*
* If all is successful, call circuit_n_conn_done() to handle events
diff --git a/src/or/directory.c b/src/or/directory.c
index b3a2f36f20..9419f2a590 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -144,7 +144,7 @@ purpose_needs_anonymity(uint8_t dir_purpose, uint8_t router_purpose)
/** Return a newly allocated string describing <b>auth</b>. Only describes
* authority features. */
-static char *
+STATIC char *
authdir_type_to_string(dirinfo_type_t auth)
{
char *result;
@@ -163,7 +163,7 @@ authdir_type_to_string(dirinfo_type_t auth)
}
/** Return a string describing a given directory connection purpose. */
-static const char *
+STATIC const char *
dir_conn_purpose_to_string(int purpose)
{
switch (purpose)
@@ -371,7 +371,7 @@ directory_post_to_dirservers(uint8_t dir_purpose, uint8_t router_purpose,
/** Return true iff, according to the values in <b>options</b>, we should be
* using directory guards for direct downloads of directory information. */
-static int
+STATIC int
should_use_directory_guards(const or_options_t *options)
{
/* Public (non-bridge) servers never use directory guards. */
@@ -766,15 +766,15 @@ directory_initiate_command_routerstatus_rend(const routerstatus_t *status,
* When fetching a rendezvous descriptor, <b>resource</b> is the service ID we
* want to fetch.
*/
-void
-directory_initiate_command_routerstatus(const routerstatus_t *status,
- uint8_t dir_purpose,
- uint8_t router_purpose,
- dir_indirection_t indirection,
- const char *resource,
- const char *payload,
- size_t payload_len,
- time_t if_modified_since)
+MOCK_IMPL(void, directory_initiate_command_routerstatus,
+ (const routerstatus_t *status,
+ uint8_t dir_purpose,
+ uint8_t router_purpose,
+ dir_indirection_t indirection,
+ const char *resource,
+ const char *payload,
+ size_t payload_len,
+ time_t if_modified_since))
{
directory_initiate_command_routerstatus_rend(status, dir_purpose,
router_purpose,
@@ -812,7 +812,7 @@ connection_dir_request_failed(dir_connection_t *conn)
return; /* this was a test fetch. don't retry. */
}
if (!entry_list_is_constrained(get_options()))
- router_set_status(conn->identity_digest, 0); /* don't try him again */
+ router_set_status(conn->identity_digest, 0); /* don't try this one again */
if (conn->base_.purpose == DIR_PURPOSE_FETCH_SERVERDESC ||
conn->base_.purpose == DIR_PURPOSE_FETCH_EXTRAINFO) {
log_info(LD_DIR, "Giving up on serverdesc/extrainfo fetch from "
@@ -2742,7 +2742,7 @@ client_likes_consensus(networkstatus_t *v, const char *want_url)
/** Return the compression level we should use for sending a compressed
* response of size <b>n_bytes</b>. */
-static zlib_compression_level_t
+STATIC zlib_compression_level_t
choose_compression_level(ssize_t n_bytes)
{
if (! have_been_under_memory_pressure()) {
@@ -3811,11 +3811,10 @@ connection_dir_finished_connecting(dir_connection_t *conn)
* Then return a list of int pointers defining download delays in seconds.
* Helper function for download_status_increment_failure(),
* download_status_reset(), and download_status_increment_attempt(). */
-static const smartlist_t *
+STATIC const smartlist_t *
find_dl_schedule(download_status_t *dls, const or_options_t *options)
{
- /* XX/teor Replace with dir_server_mode from #12538 */
- const int dir_server = options->DirPort_set;
+ const int dir_server = dir_server_mode(options);
const int multi_d = networkstatus_consensus_can_use_multiple_directories(
options);
const int we_are_bootstrapping = networkstatus_consensus_is_boostrapping(
diff --git a/src/or/directory.h b/src/or/directory.h
index 61c29baf06..2630705fdb 100644
--- a/src/or/directory.h
+++ b/src/or/directory.h
@@ -39,14 +39,16 @@ typedef enum {
DIRIND_ANON_DIRPORT,
} dir_indirection_t;
-void directory_initiate_command_routerstatus(const routerstatus_t *status,
- uint8_t dir_purpose,
- uint8_t router_purpose,
- dir_indirection_t indirection,
- const char *resource,
- const char *payload,
- size_t payload_len,
- time_t if_modified_since);
+MOCK_DECL(void, directory_initiate_command_routerstatus,
+ (const routerstatus_t *status,
+ uint8_t dir_purpose,
+ uint8_t router_purpose,
+ dir_indirection_t indirection,
+ const char *resource,
+ const char *payload,
+ size_t payload_len,
+ time_t if_modified_since));
+
void directory_initiate_command_routerstatus_rend(const routerstatus_t *status,
uint8_t dir_purpose,
uint8_t router_purpose,
@@ -101,7 +103,8 @@ time_t download_status_increment_attempt(download_status_t *dls,
* the optional status code <b>sc</b>. */
#define download_status_failed(dls, sc) \
download_status_increment_failure((dls), (sc), NULL, \
- get_options()->DirPort_set, time(NULL))
+ dir_server_mode(get_options()), \
+ time(NULL))
void download_status_reset(download_status_t *dls);
static int download_status_is_ready(download_status_t *dls, time_t now,
@@ -146,6 +149,13 @@ STATIC int connection_dir_would_close_consensus_conn_helper(void);
STATIC int download_status_schedule_get_delay(download_status_t *dls,
const smartlist_t *schedule,
time_t now);
+
+STATIC char* authdir_type_to_string(dirinfo_type_t auth);
+STATIC const char * dir_conn_purpose_to_string(int purpose);
+STATIC int should_use_directory_guards(const or_options_t *options);
+STATIC zlib_compression_level_t choose_compression_level(ssize_t n_bytes);
+STATIC const smartlist_t *find_dl_schedule(download_status_t *dls,
+ const or_options_t *options);
#endif
#endif
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 39563c3932..620d324704 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -1091,13 +1091,13 @@ directory_fetches_from_authorities(const or_options_t *options)
return 1; /* we don't know our IP address; ask an authority. */
refuseunknown = ! router_my_exit_policy_is_reject_star() &&
should_refuse_unknown_exits(options);
- if (!options->DirPort_set && !refuseunknown)
+ if (!dir_server_mode(options) && !refuseunknown)
return 0;
if (!server_mode(options) || !advertised_server_mode())
return 0;
me = router_get_my_routerinfo();
- if (!me || (!me->dir_port && !refuseunknown))
- return 0; /* if dirport not advertised, return 0 too */
+ if (!me || (!me->supports_tunnelled_dir_requests && !refuseunknown))
+ return 0; /* if we don't service directory requests, return 0 too */
return 1;
}
@@ -1128,7 +1128,7 @@ directory_fetches_dir_info_later(const or_options_t *options)
int
directory_caches_unknown_auth_certs(const or_options_t *options)
{
- return options->DirPort_set || options->BridgeRelay;
+ return dir_server_mode(options) || options->BridgeRelay;
}
/** Return 1 if we want to keep descriptors, networkstatuses, etc around
@@ -1137,7 +1137,7 @@ directory_caches_unknown_auth_certs(const or_options_t *options)
int
directory_caches_dir_info(const or_options_t *options)
{
- if (options->BridgeRelay || options->DirPort_set)
+ if (options->BridgeRelay || dir_server_mode(options))
return 1;
if (!server_mode(options) || !advertised_server_mode())
return 0;
@@ -1153,7 +1153,7 @@ directory_caches_dir_info(const or_options_t *options)
int
directory_permits_begindir_requests(const or_options_t *options)
{
- return options->BridgeRelay != 0 || options->DirPort_set;
+ return options->BridgeRelay != 0 || dir_server_mode(options);
}
/** Return 1 if we have no need to fetch new descriptors. This generally
@@ -1350,8 +1350,9 @@ dirserv_thinks_router_is_unreliable(time_t now,
}
/** Return true iff <b>router</b> should be assigned the "HSDir" flag.
+ *
* Right now this means it advertises support for it, it has a high uptime,
- * it has a DirPort open, it has the Stable and Fast flag and it's currently
+ * it's a directory cache, it has the Stable and Fast flags, and it's currently
* considered Running.
*
* This function needs to be called after router-\>is_running has
@@ -1378,7 +1379,8 @@ dirserv_thinks_router_is_hs_dir(const routerinfo_t *router,
else
uptime = real_uptime(router, now);
- return (router->wants_to_be_hs_dir && router->dir_port &&
+ return (router->wants_to_be_hs_dir &&
+ router->supports_tunnelled_dir_requests &&
node->is_stable && node->is_fast &&
uptime >= get_options()->MinUptimeHidServDirectoryV2 &&
router_is_active(router, node, now));
@@ -1921,7 +1923,7 @@ routerstatus_format_entry(const routerstatus_t *rs, const char *version,
rs->is_hs_dir?" HSDir":"",
rs->is_flagged_running?" Running":"",
rs->is_stable?" Stable":"",
- (rs->dir_port!=0)?" V2Dir":"",
+ rs->is_v2_dir?" V2Dir":"",
rs->is_valid?" Valid":"");
/* length of "opt v \n" */
@@ -2185,6 +2187,7 @@ set_routerstatus_from_routerinfo(routerstatus_t *rs,
strlcpy(rs->nickname, ri->nickname, sizeof(rs->nickname));
rs->or_port = ri->or_port;
rs->dir_port = ri->dir_port;
+ rs->is_v2_dir = ri->supports_tunnelled_dir_requests;
if (options->AuthDirHasIPv6Connectivity == 1 &&
!tor_addr_is_null(&ri->ipv6_addr) &&
node->last_reachable6 >= now - REACHABLE_TIMEOUT) {
diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index 0449e9d8d9..b61b33af79 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -54,7 +54,6 @@ static int dirvote_perform_vote(void);
static void dirvote_clear_votes(int all_votes);
static int dirvote_compute_consensuses(void);
static int dirvote_publish_consensus(void);
-static char *make_consensus_method_list(int low, int high, const char *sep);
/* =====
* Voting
@@ -564,7 +563,7 @@ consensus_method_is_supported(int method)
/** Return a newly allocated string holding the numbers between low and high
* (inclusive) that are supported consensus methods. */
-static char *
+STATIC char *
make_consensus_method_list(int low, int high, const char *separator)
{
char *list;
diff --git a/src/or/dirvote.h b/src/or/dirvote.h
index 966d163088..cc526ea34e 100644
--- a/src/or/dirvote.h
+++ b/src/or/dirvote.h
@@ -177,6 +177,7 @@ STATIC char *format_networkstatus_vote(crypto_pk_t *private_key,
STATIC char *dirvote_compute_params(smartlist_t *votes, int method,
int total_authorities);
STATIC char *compute_consensus_package_lines(smartlist_t *votes);
+STATIC char *make_consensus_method_list(int low, int high, const char *sep);
#endif
#endif
diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c
index 1ce44d1026..d6bef658ff 100644
--- a/src/or/entrynodes.c
+++ b/src/or/entrynodes.c
@@ -1156,7 +1156,7 @@ choose_random_entry_impl(cpath_build_state_t *state, int for_directory,
} else {
/* Try to have at least 2 choices available. This way we don't
* get stuck with a single live-but-crummy entry and just keep
- * using him.
+ * using it.
* (We might get 2 live-but-crummy entry guards, but so be it.) */
preferred_min = 2;
}
diff --git a/src/or/ext_orport.c b/src/or/ext_orport.c
index f159f7d0a6..810fa0d9aa 100644
--- a/src/or/ext_orport.c
+++ b/src/or/ext_orport.c
@@ -151,7 +151,7 @@ init_ext_or_cookie_authentication(int is_enabled)
}
/** Read data from <b>conn</b> and see if the client sent us the
- * authentication type that she prefers to use in this session.
+ * authentication type that they prefer to use in this session.
*
* Return -1 if we received corrupted data or if we don't support the
* authentication type. Return 0 if we need more data in
diff --git a/src/or/fallback_dirs.inc b/src/or/fallback_dirs.inc
index d9214cb884..d05f16f4ea 100644
--- a/src/or/fallback_dirs.inc
+++ b/src/or/fallback_dirs.inc
@@ -1 +1,206 @@
-/* This list will be empty until opt-ins are finalised. */
+/* Trial fallbacks for 0.2.8.1-alpha with ADDRESS_AND_PORT_STABLE_DAYS = 30
+ * This works around an issue where relays post a descriptor without a DirPort
+ * when restarted. If these relays stay up, they will have been up for 120 days
+ * by the 0.2.8 stable release -- teor */
+/* Whitelist & blacklist excluded 1070 of 1091 candidates. */
+/*
+Fallback Directory Summary
+Final Count: 21 (Eligible 21, Usable 21, Target 290 (1454 * 0.200000), Clamped to 500)
+*/
+/* Ignore low fallback numbers in alpha builds -- teor
+#error Fallback Count 21 is too low. Must be at least 100 for diversity. Try adding entries to the whitelist, or setting INCLUDE_UNLISTED_ENTRIES = True.
+*/
+/*
+Final Weight: 491920 (Eligible 546000)
+Max Weight: 43680 (8.879%) (Clamped to 10.000%)
+Min Weight: 8080 (1.643%) (Clamped to 0.100%)
+Clamped: 54080 (10.994%) Excess Weight, 4 High Weight Fallbacks (19.0%)
+*/
+/*
+Onionoo Source: details Date: 2016-01-18 00:00:00 Version: 3.0
+URL: https://onionoo.torproject.org/details?fields=fingerprint%2Cnickname%2Ccontact%2Clast_changed_address_or_port%2Cconsensus_weight%2Cor_addresses%2Cdir_address%2Crecommended_version%2Cflags&flag=V2Dir&type=relay&last_seen_days=-7&first_seen_days=30-
+*/
+/*
+Onionoo Source: uptime Date: 2016-01-18 00:00:00 Version: 3.0
+URL: https://onionoo.torproject.org/uptime?first_seen_days=30-&flag=V2Dir&type=relay&last_seen_days=-7
+*/
+/*
+wagner
+Flags: Fast Guard Running Stable V2Dir Valid
+Fallback Weight: 43680 / 491920 (8.879%)
+Consensus Weight: 62600 / 546000 (11.465%)
+Rarely used email <trff914 AT gmail DOT com>
+*/
+"5.175.233.86:80 orport=443 id=5525D0429BFE5DC4F1B0E9DE47A4CFA169661E33"
+" weight=43680",
+/*
+kitten2
+Flags: Fast Guard HSDir Running Stable V2Dir Valid
+Fallback Weight: 43680 / 491920 (8.879%)
+Consensus Weight: 59100 / 546000 (10.824%)
+0xEFB74277ECE4E222 Aeris <aeris+tor AT imirhil DOT fr> - 1aerisnnLWPchhDSXpxWGYWwLiSFUVFnd
+*/
+"62.210.124.124:9130 orport=9101 id=2EBD117806EE43C3CC885A8F1E4DC60F207E7D3E"
+" ipv6=[2001:bc8:3f23:100::1]:9101"
+" weight=43680",
+/*
+kitten1
+Flags: Fast Guard HSDir Running Stable V2Dir Valid
+Fallback Weight: 43680 / 491920 (8.879%)
+Consensus Weight: 57600 / 546000 (10.549%)
+0xEFB74277ECE4E222 Aeris <aeris+tor AT imirhil DOT fr> - 1aerisnnLWPchhDSXpxWGYWwLiSFUVFnd
+*/
+"62.210.124.124:9030 orport=9001 id=86E78DD3720C78DA8673182EF96C54B162CD660C"
+" ipv6=[2001:bc8:3f23:100::1]:9001"
+" weight=43680",
+/*
+fluxe4
+Flags: Fast Guard HSDir Running Stable V2Dir Valid
+Fallback Weight: 43680 / 491920 (8.879%)
+Consensus Weight: 49500 / 546000 (9.066%)
+Sebastian <tor@sebastianhahn.net> - 12NbRAjAG5U3LLWETSF7fSTcdaz32Mu5CN
+*/
+"131.188.40.188:443 orport=80 id=EBE718E1A49EE229071702964F8DB1F318075FF8"
+" weight=43680",
+/*
+BabylonNetwork03
+Flags: Exit Fast Guard HSDir Running Stable V2Dir Valid
+Fallback Weight: 38700 / 491920 (7.867%)
+Babylon Network | noc <AT> babylon <DOT> network | PGP 0x2A540FA5 | 1HiSG8pia5DdDLUMyYNkF9sicGozojZLnH
+*/
+"193.111.136.162:80 orport=443 id=C79552275DFCD486B942510EF663ED36ACA1A84B"
+" ipv6=[2001:4ba0:cafe:10d0::1]:443"
+" weight=38700",
+/*
+tornoderdednl
+Flags: Fast Guard Running Stable V2Dir Valid
+Fallback Weight: 33000 / 491920 (6.708%)
+0x4871E82F Thom Wiggers <thom @AT@ RDED POINT NL> BTC 1DLyDFV13zhCWJYHMh5bk5C58yYvpxqxfQ
+*/
+"178.62.199.226:80 orport=443 id=CBEFF7BA4A4062045133C053F2D70524D8BBE5BE"
+" ipv6=[2a03:b0c0:2:d0::b7:5001]:443"
+" weight=33000",
+/*
+fluxe3
+Flags: Fast Guard HSDir Running Stable V2Dir Valid
+Fallback Weight: 31500 / 491920 (6.403%)
+Sebastian <tor@sebastianhahn.net> - 12NbRAjAG5U3LLWETSF7fSTcdaz32Mu5CN
+*/
+"78.47.18.110:443 orport=80 id=F8D27B163B9247B232A2EEE68DD8B698695C28DE"
+" weight=31500",
+/*
+BabylonNetwork02
+Flags: Exit Fast Guard HSDir Running Stable V2Dir Valid
+Fallback Weight: 27300 / 491920 (5.550%)
+Babylon Network | noc <AT> babylon <DOT> network | PGP 0x2A540FA5 | 1HiSG8pia5DdDLUMyYNkF9sicGozojZLnH
+*/
+"149.202.98.161:80 orport=443 id=54660C671B47E6986B465B80444414BD19E5A34B"
+" ipv6=[2001:41d0:8:4528::161]:443"
+" weight=27300",
+/*
+coby
+Flags: Fast Guard HSDir Running Stable V2Dir Valid
+Fallback Weight: 20400 / 491920 (4.147%)
+c0by <coby AT 127001 dot ovh>
+*/
+"51.255.33.237:9091 orport=9001 id=A360C21FA87FFA2046D92C17086A6B47E5C68109"
+" weight=20400",
+/*
+kili
+Flags: Fast Guard HSDir Running Stable V2Dir Valid
+Fallback Weight: 19300 / 491920 (3.923%)
+0x49CBC553 Joost Rijneveld <joost AT joostrijneveld dot nl>
+*/
+"178.62.173.203:9030 orport=9001 id=DD85503F2D1F52EF9EAD621E942298F46CD2FC10"
+" ipv6=[2a03:b0c0:0:1010::a4:b001]:9001"
+" weight=19300",
+/*
+Logforme
+Flags: Fast Guard HSDir Running Stable V2Dir Valid
+Fallback Weight: 18600 / 491920 (3.781%)
+Logforme <m7527 AT abc dot se>
+*/
+"84.219.173.60:9030 orport=443 id=855BC2DABE24C861CD887DB9B2E950424B49FC34"
+" weight=18600",
+/*
+eriador
+Flags: Fast Guard HSDir Running Stable V2Dir Valid
+Fallback Weight: 17400 / 491920 (3.537%)
+hwertiout695@safe-mail.net
+*/
+"85.25.138.93:9030 orport=4029 id=6DE61A6F72C1E5418A66BFED80DFB63E4C77668F"
+" weight=17400",
+/*
+Doedel24
+Flags: Fast Guard HSDir Running Stable V2Dir Valid
+Fallback Weight: 17000 / 491920 (3.456%)
+Felix <zwiebel ta quantentunnel tod de>
+*/
+"178.254.20.134:9030 orport=9001 id=2CE96A8A1DA032664C90F574AFFBECE18A6E8DFC"
+" weight=17000",
+/*
+GrmmlLitavis
+Flags: Fast Guard HSDir Running Stable V2Dir Valid
+Fallback Weight: 15500 / 491920 (3.151%)
+<tor AT grmml DOT eu>
+*/
+"5.39.88.19:9030 orport=9001 id=7CB8C31432A796731EA7B6BF4025548DFEB25E0C"
+" ipv6=[2001:41d0:8:9a13::1]:9050"
+" weight=15500",
+/*
+Doedel21
+Flags: Fast Guard HSDir Running Stable V2Dir Valid
+Fallback Weight: 13800 / 491920 (2.805%)
+Felix <zwiebel ta quantentunnel tod de>
+*/
+"178.254.44.135:80 orport=443 id=AE6A8C18E7499B586CD36246AC4BCAFFBBF93AB2"
+" weight=13800",
+/*
+Unnamed
+Flags: Fast Guard HSDir Running Stable V2Dir Valid
+Fallback Weight: 13400 / 491920 (2.724%)
+monitor0penmailbox0rg
+*/
+"217.12.199.208:80 orport=443 id=DF3AED4322B1824BF5539AE54B2D1B38E080FF05"
+" weight=13400",
+/*
+Doedel26
+Flags: Fast Guard HSDir Running Stable V2Dir Valid
+Fallback Weight: 12800 / 491920 (2.602%)
+Felix <zwiebel ta quantentunnel tod de>
+*/
+"178.254.20.134:80 orport=443 id=9F5068310818ED7C70B0BC4087AB55CB12CB4377"
+" weight=12800",
+/*
+Doedel22
+Flags: Fast Guard HSDir Running Stable V2Dir Valid
+Fallback Weight: 12000 / 491920 (2.439%)
+Felix <zwiebel ta quantentunnel tod de>
+*/
+"178.254.44.135:9030 orport=9001 id=8FA37B93397015B2BC5A525C908485260BE9F422"
+" weight=12000",
+/*
+kitten4
+Flags: Fast Guard HSDir Running Stable V2Dir Valid
+Fallback Weight: 10100 / 491920 (2.053%)
+0xEFB74277ECE4E222 Aeris <aeris+tor AT imirhil DOT fr> - 1aerisnnLWPchhDSXpxWGYWwLiSFUVFnd
+*/
+"212.47.237.95:9130 orport=9101 id=6FB38EB22E57EF7ED5EF00238F6A48E553735D88"
+" weight=10100",
+/*
+Binnacle
+Flags: Fast Guard HSDir Running Stable V2Dir Valid
+Fallback Weight: 8320 / 491920 (1.691%)
+starlight dot YYYYqQ at binnacle dot cx
+*/
+"108.53.208.157:80 orport=443 id=4F0DB7E687FC7C0AE55C8F243DA8B0EB27FBF1F2"
+" weight=8320",
+/*
+PedicaboMundi
+Flags: Fast Guard HSDir Running Stable V2Dir Valid
+Fallback Weight: 8080 / 491920 (1.643%)
+0x43DE8191 - 12LiRiasTEL346ZFjgCh5e3nBexQuvDBTg
+*/
+"144.76.14.145:110 orport=143 id=14419131033443AE6E21DA82B0D307F7CAE42BDB"
+" ipv6=[2a01:4f8:190:9490::dead]:443"
+" weight=8080",
diff --git a/src/or/geoip.c b/src/or/geoip.c
index 3ef1672f52..26030ae52a 100644
--- a/src/or/geoip.c
+++ b/src/or/geoip.c
@@ -1279,6 +1279,8 @@ geoip_dirreq_stats_write(time_t now)
/* Generate history string .*/
str = geoip_format_dirreq_stats(now);
+ if (! str)
+ goto done;
/* Write dirreq-stats string to disk. */
if (!check_or_create_data_subdir("stats")) {
diff --git a/src/or/hibernate.c b/src/or/hibernate.c
index 5f727e27d4..7f8530b221 100644
--- a/src/or/hibernate.c
+++ b/src/or/hibernate.c
@@ -412,11 +412,15 @@ configure_accounting(time_t now)
/** Return the relevant number of bytes sent/received this interval
* based on the set AccountingRule */
-static uint64_t
+uint64_t
get_accounting_bytes(void)
{
if (get_options()->AccountingRule == ACCT_SUM)
return n_bytes_read_in_interval+n_bytes_written_in_interval;
+ else if (get_options()->AccountingRule == ACCT_IN)
+ return n_bytes_read_in_interval;
+ else if (get_options()->AccountingRule == ACCT_OUT)
+ return n_bytes_written_in_interval;
else
return MAX(n_bytes_read_in_interval, n_bytes_written_in_interval);
}
@@ -1010,7 +1014,7 @@ getinfo_helper_accounting(control_connection_t *conn,
else
*answer = tor_strdup("awake");
} else if (!strcmp(question, "accounting/bytes")) {
- tor_asprintf(answer, U64_FORMAT" "U64_FORMAT,
+ tor_asprintf(answer, U64_FORMAT" "U64_FORMAT,
U64_PRINTF_ARG(n_bytes_read_in_interval),
U64_PRINTF_ARG(n_bytes_written_in_interval));
} else if (!strcmp(question, "accounting/bytes-left")) {
@@ -1022,6 +1026,18 @@ getinfo_helper_accounting(control_connection_t *conn,
total_left = limit - total_bytes;
tor_asprintf(answer, U64_FORMAT" "U64_FORMAT,
U64_PRINTF_ARG(total_left), U64_PRINTF_ARG(total_left));
+ } else if (get_options()->AccountingRule == ACCT_IN) {
+ uint64_t read_left = 0;
+ if (n_bytes_read_in_interval < limit)
+ read_left = limit - n_bytes_read_in_interval;
+ tor_asprintf(answer, U64_FORMAT" "U64_FORMAT,
+ U64_PRINTF_ARG(read_left), U64_PRINTF_ARG(limit));
+ } else if (get_options()->AccountingRule == ACCT_OUT) {
+ uint64_t write_left = 0;
+ if (n_bytes_written_in_interval < limit)
+ write_left = limit - n_bytes_written_in_interval;
+ tor_asprintf(answer, U64_FORMAT" "U64_FORMAT,
+ U64_PRINTF_ARG(limit), U64_PRINTF_ARG(write_left));
} else {
uint64_t read_left = 0, write_left = 0;
if (n_bytes_read_in_interval < limit)
diff --git a/src/or/hibernate.h b/src/or/hibernate.h
index b9e619c5ad..e0d0c29bdb 100644
--- a/src/or/hibernate.h
+++ b/src/or/hibernate.h
@@ -19,6 +19,7 @@ MOCK_DECL(int, accounting_is_enabled, (const or_options_t *options));
int accounting_get_interval_length(void);
MOCK_DECL(time_t, accounting_get_end_time, (void));
void configure_accounting(time_t now);
+uint64_t get_accounting_bytes(void);
void accounting_run_housekeeping(time_t now);
void accounting_add_bytes(size_t n_read, size_t n_written, int seconds);
int accounting_record_bandwidth_usage(time_t now, or_state_t *state);
diff --git a/src/or/include.am b/src/or/include.am
index 5ec96e5a93..712ae18406 100644
--- a/src/or/include.am
+++ b/src/or/include.am
@@ -93,7 +93,8 @@ src_or_libtor_testing_a_SOURCES = $(LIBTOR_A_SOURCES)
src_or_tor_SOURCES = src/or/tor_main.c
AM_CPPFLAGS += -I$(srcdir)/src/or -Isrc/or
-src/or/tor_main.o: micro-revision.i
+src/or/tor_main.$(OBJEXT) \
+ src/or/src_or_tor_cov-tor_main.$(OBJEXT): micro-revision.i
AM_CPPFLAGS += -DSHARE_DATADIR="\"$(datadir)\"" \
-DLOCALSTATEDIR="\"$(localstatedir)\"" \
@@ -109,7 +110,7 @@ src_or_libtor_testing_a_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
src_or_tor_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ @TOR_LDFLAGS_libevent@
src_or_tor_LDADD = src/or/libtor.a src/common/libor.a \
- src/common/libor-crypto.a $(LIBDONNA) \
+ src/common/libor-crypto.a $(LIBKECCAK_TINY) $(LIBDONNA) \
src/common/libor-event.a src/trunnel/libor-trunnel.a \
@TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ @TOR_OPENSSL_LIBS@ \
@TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ @TOR_SYSTEMD_LIBS@
@@ -120,7 +121,7 @@ src_or_tor_cov_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CPPFLAGS)
src_or_tor_cov_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
src_or_tor_cov_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ @TOR_LDFLAGS_libevent@
src_or_tor_cov_LDADD = src/or/libtor-testing.a src/common/libor-testing.a \
- src/common/libor-crypto-testing.a $(LIBDONNA) \
+ src/common/libor-crypto-testing.a $(LIBKECCAK_TINY) $(LIBDONNA) \
src/common/libor-event-testing.a src/trunnel/libor-trunnel-testing.a \
@TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ @TOR_OPENSSL_LIBS@ \
@TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ @TOR_SYSTEMD_LIBS@
diff --git a/src/or/main.c b/src/or/main.c
index 455cba4513..bd4f7eaa71 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -225,11 +225,13 @@ set_buffer_lengths_to_zero(tor_socket_t s)
{
int zero = 0;
int r = 0;
- if (setsockopt(s, SOL_SOCKET, SO_SNDBUF, (void*)&zero, sizeof(zero))) {
+ if (setsockopt(s, SOL_SOCKET, SO_SNDBUF, (void*)&zero,
+ (socklen_t)sizeof(zero))) {
log_warn(LD_NET, "Unable to clear SO_SNDBUF");
r = -1;
}
- if (setsockopt(s, SOL_SOCKET, SO_RCVBUF, (void*)&zero, sizeof(zero))) {
+ if (setsockopt(s, SOL_SOCKET, SO_RCVBUF, (void*)&zero,
+ (socklen_t)sizeof(zero))) {
log_warn(LD_NET, "Unable to clear SO_RCVBUF");
r = -1;
}
@@ -1299,7 +1301,7 @@ static periodic_event_item_t periodic_events[] = {
/* These are pointers to members of periodic_events[] that are used to
* implement particular callbacks. We keep them separate here so that we
* can access them by name. We also keep them inside periodic_events[]
- * so that we can implement "reset all timers" in a reasaonable way. */
+ * so that we can implement "reset all timers" in a reasonable way. */
static periodic_event_item_t *check_descriptor_event=NULL;
static periodic_event_item_t *fetch_networkstatus_event=NULL;
static periodic_event_item_t *launch_descriptor_fetches_event=NULL;
@@ -2067,8 +2069,9 @@ second_elapsed_callback(periodic_timer_t *timer, void *arg)
if (me && !check_whether_orport_reachable()) {
char *address = tor_dup_ip(me->addr);
log_warn(LD_CONFIG,"Your server (%s:%d) has not managed to confirm that "
- "its ORPort is reachable. Please check your firewalls, ports, "
- "address, /etc/hosts file, etc.",
+ "its ORPort is reachable. Relays do not publish descriptors "
+ "until their ORPort and DirPort are reachable. Please check "
+ "your firewalls, ports, address, /etc/hosts file, etc.",
address, me->or_port);
control_event_server_status(LOG_WARN,
"REACHABILITY_FAILED ORADDRESS=%s:%d",
@@ -2080,8 +2083,9 @@ second_elapsed_callback(periodic_timer_t *timer, void *arg)
char *address = tor_dup_ip(me->addr);
log_warn(LD_CONFIG,
"Your server (%s:%d) has not managed to confirm that its "
- "DirPort is reachable. Please check your firewalls, ports, "
- "address, /etc/hosts file, etc.",
+ "DirPort is reachable. Relays do not publish descriptors "
+ "until their ORPort and DirPort are reachable. Please check "
+ "your firewalls, ports, address, /etc/hosts file, etc.",
address, me->dir_port);
control_event_server_status(LOG_WARN,
"REACHABILITY_FAILED DIRADDRESS=%s:%d",
@@ -3460,6 +3464,9 @@ sandbox_init_filter(void)
".tmp");
OPEN_DATADIR2_SUFFIX("keys", "ed25519_master_id_public_key", ".tmp");
OPEN_DATADIR2_SUFFIX("keys", "ed25519_signing_secret_key", ".tmp");
+ OPEN_DATADIR2_SUFFIX("keys", "ed25519_signing_secret_key_encrypted",
+ ".tmp");
+ OPEN_DATADIR2_SUFFIX("keys", "ed25519_signing_public_key", ".tmp");
OPEN_DATADIR2_SUFFIX("keys", "ed25519_signing_cert", ".tmp");
OPEN_DATADIR2_SUFFIX("stats", "bridge-stats", ".tmp");
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index 0cf8873f03..f3a8276689 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -1461,6 +1461,38 @@ networkstatus_copy_old_consensus_info(networkstatus_t *new_c,
} SMARTLIST_FOREACH_JOIN_END(rs_old, rs_new);
}
+#ifdef TOR_UNIT_TESTS
+/**Accept a <b>flavor</b> consensus <b>c</b> without any additional
+ * validation. This is exclusively for unit tests.
+ * We copy any ancillary information from a pre-existing consensus
+ * and then free the current one and replace it with the newly
+ * provided instance. Returns -1 on unrecognized flavor, 0 otherwise.
+ */
+int
+networkstatus_set_current_consensus_from_ns(networkstatus_t *c,
+ const char *flavor)
+{
+ int flav = networkstatus_parse_flavor_name(flavor);
+ switch (flav) {
+ case FLAV_NS:
+ if (current_ns_consensus) {
+ networkstatus_copy_old_consensus_info(c, current_ns_consensus);
+ networkstatus_vote_free(current_ns_consensus);
+ }
+ current_ns_consensus = c;
+ break;
+ case FLAV_MICRODESC:
+ if (current_md_consensus) {
+ networkstatus_copy_old_consensus_info(c, current_md_consensus);
+ networkstatus_vote_free(current_md_consensus);
+ }
+ current_md_consensus = c;
+ break;
+ }
+ return current_md_consensus ? 0 : -1;
+}
+#endif //TOR_UNIT_TESTS
+
/** Try to replace the current cached v3 networkstatus with the one in
* <b>consensus</b>. If we don't have enough certificates to validate it,
* store it in consensus_waiting_for_certs and launch a certificate fetch.
diff --git a/src/or/networkstatus.h b/src/or/networkstatus.h
index 4cb33c3fc0..4eab4d83f8 100644
--- a/src/or/networkstatus.h
+++ b/src/or/networkstatus.h
@@ -114,6 +114,10 @@ int networkstatus_get_weight_scale_param(networkstatus_t *ns);
#ifdef NETWORKSTATUS_PRIVATE
STATIC void vote_routerstatus_free(vote_routerstatus_t *rs);
+#ifdef TOR_UNIT_TESTS
+STATIC int networkstatus_set_current_consensus_from_ns(networkstatus_t *c,
+ const char *flavor);
+#endif // TOR_UNIT_TESTS
#endif
#endif
diff --git a/src/or/nodelist.c b/src/or/nodelist.c
index 28d874133c..d7cada94d3 100644
--- a/src/or/nodelist.c
+++ b/src/or/nodelist.c
@@ -643,12 +643,19 @@ node_is_named(const node_t *node)
int
node_is_dir(const node_t *node)
{
- if (node->rs)
- return node->rs->dir_port != 0;
- else if (node->ri)
- return node->ri->dir_port != 0;
- else
+ if (node->rs) {
+ routerstatus_t * rs = node->rs;
+ /* This is true if supports_tunnelled_dir_requests is true which
+ * indicates that we support directory request tunnelled or through the
+ * DirPort. */
+ return rs->is_v2_dir;
+ } else if (node->ri) {
+ routerinfo_t * ri = node->ri;
+ /* Both tunnelled request is supported or DirPort is set. */
+ return ri->supports_tunnelled_dir_requests;
+ } else {
return 0;
+ }
}
/** Return true iff <b>node</b> has either kind of usable descriptor -- that
diff --git a/src/or/or.h b/src/or/or.h
index 79b1c95ff0..697c576873 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -458,9 +458,11 @@ typedef enum {
#define CIRCUIT_PURPOSE_OR_MIN_ 1
/** OR-side circuit purpose: normal circuit, at OR. */
#define CIRCUIT_PURPOSE_OR 1
-/** OR-side circuit purpose: At OR, from Bob, waiting for intro from Alices. */
+/** OR-side circuit purpose: At OR, from the service, waiting for intro from
+ * clients. */
#define CIRCUIT_PURPOSE_INTRO_POINT 2
-/** OR-side circuit purpose: At OR, from Alice, waiting for Bob. */
+/** OR-side circuit purpose: At OR, from the client, waiting for the service.
+ */
#define CIRCUIT_PURPOSE_REND_POINT_WAITING 3
/** OR-side circuit purpose: At OR, both circuits have this purpose. */
#define CIRCUIT_PURPOSE_REND_ESTABLISHED 4
@@ -479,43 +481,47 @@ typedef enum {
* to becoming open, or they are open and have sent the
* establish_rendezvous cell but haven't received an ack.
* circuits that are c_rend_ready are open and have received a
- * rend ack, but haven't heard from bob yet. if they have a
+ * rend ack, but haven't heard from the service yet. if they have a
* buildstate->pending_final_cpath then they're expecting a
- * cell from bob, else they're not.
+ * cell from the service, else they're not.
* circuits that are c_rend_ready_intro_acked are open, and
* some intro circ has sent its intro and received an ack.
* circuits that are c_rend_joined are open, have heard from
- * bob, and are talking to him.
+ * the service, and are talking to it.
*/
/** Client-side circuit purpose: Normal circuit, with cpath. */
#define CIRCUIT_PURPOSE_C_GENERAL 5
-/** Client-side circuit purpose: at Alice, connecting to intro point. */
+/** Client-side circuit purpose: at the client, connecting to intro point. */
#define CIRCUIT_PURPOSE_C_INTRODUCING 6
-/** Client-side circuit purpose: at Alice, sent INTRODUCE1 to intro point,
+/** Client-side circuit purpose: at the client, sent INTRODUCE1 to intro point,
* waiting for ACK/NAK. */
#define CIRCUIT_PURPOSE_C_INTRODUCE_ACK_WAIT 7
-/** Client-side circuit purpose: at Alice, introduced and acked, closing. */
+/** Client-side circuit purpose: at the client, introduced and acked, closing.
+ */
#define CIRCUIT_PURPOSE_C_INTRODUCE_ACKED 8
-/** Client-side circuit purpose: at Alice, waiting for ack. */
+/** Client-side circuit purpose: at the client, waiting for ack. */
#define CIRCUIT_PURPOSE_C_ESTABLISH_REND 9
-/** Client-side circuit purpose: at Alice, waiting for Bob. */
+/** Client-side circuit purpose: at the client, waiting for the service. */
#define CIRCUIT_PURPOSE_C_REND_READY 10
-/** Client-side circuit purpose: at Alice, waiting for Bob, INTRODUCE
- * has been acknowledged. */
+/** Client-side circuit purpose: at the client, waiting for the service,
+ * INTRODUCE has been acknowledged. */
#define CIRCUIT_PURPOSE_C_REND_READY_INTRO_ACKED 11
-/** Client-side circuit purpose: at Alice, rendezvous established. */
+/** Client-side circuit purpose: at the client, rendezvous established. */
#define CIRCUIT_PURPOSE_C_REND_JOINED 12
/** This circuit is used for build time measurement only */
#define CIRCUIT_PURPOSE_C_MEASURE_TIMEOUT 13
#define CIRCUIT_PURPOSE_C_MAX_ 13
-/** Hidden-service-side circuit purpose: at Bob, waiting for introductions. */
+/** Hidden-service-side circuit purpose: at the service, waiting for
+ * introductions. */
#define CIRCUIT_PURPOSE_S_ESTABLISH_INTRO 14
-/** Hidden-service-side circuit purpose: at Bob, successfully established
- * intro. */
+/** Hidden-service-side circuit purpose: at the service, successfully
+ * established intro. */
#define CIRCUIT_PURPOSE_S_INTRO 15
-/** Hidden-service-side circuit purpose: at Bob, connecting to rend point. */
+/** Hidden-service-side circuit purpose: at the service, connecting to rend
+ * point. */
#define CIRCUIT_PURPOSE_S_CONNECT_REND 16
-/** Hidden-service-side circuit purpose: at Bob, rendezvous established. */
+/** Hidden-service-side circuit purpose: at the service, rendezvous
+ * established. */
#define CIRCUIT_PURPOSE_S_REND_JOINED 17
/** A testing circuit; not meant to be used for actual traffic. */
#define CIRCUIT_PURPOSE_TESTING 18
@@ -2147,6 +2153,11 @@ typedef struct {
* tests for it. */
unsigned int needs_retest_if_added:1;
+ /** True iff this router included "tunnelled-dir-server" in its descriptor,
+ * implying it accepts tunnelled directory requests, or it advertised
+ * dir_port > 0. */
+ unsigned int supports_tunnelled_dir_requests:1;
+
/** Tor can use this router for general positions in circuits; we got it
* from a directory server as usual, or we're an authority and a server
* uploaded it. */
@@ -2224,6 +2235,9 @@ typedef struct routerstatus_t {
* an exit node. */
unsigned int is_hs_dir:1; /**< True iff this router is a v2-or-later hidden
* service directory. */
+ unsigned int is_v2_dir:1; /** True iff this router publishes an open DirPort
+ * or it claims to accept tunnelled dir requests.
+ */
/** True iff we know version info for this router. (i.e., a "v" entry was
* included.) We'll replace all these with a big tor_version_t or a char[]
* if the number of traits we care about ever becomes incredibly big. */
@@ -2325,7 +2339,7 @@ typedef struct microdesc_t {
curve25519_public_key_t *onion_curve25519_pkey;
/** Ed25519 identity key, if included. */
ed25519_public_key_t *ed25519_identity_pkey;
- /** As routerinfo_t.ipv6_add */
+ /** As routerinfo_t.ipv6_addr */
tor_addr_t ipv6_addr;
/** As routerinfo_t.ipv6_orport */
uint16_t ipv6_orport;
@@ -2343,7 +2357,7 @@ typedef struct microdesc_t {
* Specifically, a node_t is a Tor router as we are using it: a router that
* we are considering for circuits, connections, and so on. A node_t is a
* thin wrapper around the routerstatus, routerinfo, and microdesc for a
- * single wrapper, and provides a consistent interface for all of them.
+ * single router, and provides a consistent interface for all of them.
*
* Also, a node_t has mutable state. While a routerinfo, a routerstatus,
* and a microdesc have[*] only the information read from a router
@@ -3886,9 +3900,11 @@ typedef struct {
* hibernate." */
/** How do we determine when our AccountingMax has been reached?
* "max" for when in or out reaches AccountingMax
- * "sum" for when in plus out reaches AccountingMax */
+ * "sum" for when in plus out reaches AccountingMax
+ * "in" for when in reaches AccountingMax
+ * "out" for when out reaches AccountingMax */
char *AccountingRule_option;
- enum { ACCT_MAX, ACCT_SUM } AccountingRule;
+ enum { ACCT_MAX, ACCT_SUM, ACCT_IN, ACCT_OUT } AccountingRule;
/** Base64-encoded hash of accepted passwords for the control system. */
config_line_t *HashedControlPassword;
@@ -3962,6 +3978,10 @@ typedef struct {
/** Should we fetch our dir info at the start of the consensus period? */
int FetchDirInfoExtraEarly;
+ int DirCache; /**< Cache all directory documents and accept requests via
+ * tunnelled dir conns from clients. If 1, enabled (default);
+ * If 0, disabled. */
+
char *VirtualAddrNetworkIPv4; /**< Address and mask to hand out for virtual
* MAPADDRESS requests for IPv4 addresses */
char *VirtualAddrNetworkIPv6; /**< Address and mask to hand out for virtual
diff --git a/src/or/relay.c b/src/or/relay.c
index ee2f041dbd..aea51a165b 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -833,7 +833,7 @@ connection_ap_process_end_not_open(
}
}
}
- /* check if he *ought* to have allowed it */
+ /* check if the exit *ought* to have allowed it */
adjust_exit_policy_from_exitpolicy_failure(circ,
conn,
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index dc05d6f2ed..b822295832 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -182,7 +182,7 @@ rend_client_send_introduction(origin_circuit_t *introcirc,
goto cleanup;
}
- /* first 20 bytes of payload are the hash of Bob's pk */
+ /* first 20 bytes of payload are the hash of the service's pk */
intro_key = NULL;
SMARTLIST_FOREACH(entry->parsed->intro_nodes, rend_intro_point_t *,
intro, {
@@ -1096,9 +1096,9 @@ rend_client_rendezvous_acked(origin_circuit_t *circ, const uint8_t *request,
circ->base_.timestamp_dirty = time(NULL);
/* From a path bias point of view, this circuit is now successfully used.
- * Waiting any longer opens us up to attacks from Bob. He could induce
- * Alice to attempt to connect to his hidden service and never reply
- * to her rend requests */
+ * Waiting any longer opens us up to attacks from malicious hidden services.
+ * They could induce the client to attempt to connect to their hidden
+ * service and never reply to the client's rend requests */
pathbias_mark_use_success(circ);
/* XXXX This is a pretty brute-force approach. It'd be better to
@@ -1110,7 +1110,7 @@ rend_client_rendezvous_acked(origin_circuit_t *circ, const uint8_t *request,
return 0;
}
-/** Bob sent us a rendezvous cell; join the circuits. */
+/** The service sent us a rendezvous cell; join the circuits. */
int
rend_client_receive_rendezvous(origin_circuit_t *circ, const uint8_t *request,
size_t request_len)
@@ -1135,7 +1135,8 @@ rend_client_receive_rendezvous(origin_circuit_t *circ, const uint8_t *request,
log_info(LD_REND,"Got RENDEZVOUS2 cell from hidden service.");
- /* first DH_KEY_LEN bytes are g^y from bob. Finish the dh handshake...*/
+ /* first DH_KEY_LEN bytes are g^y from the service. Finish the dh
+ * handshake...*/
tor_assert(circ->build_state);
tor_assert(circ->build_state->pending_final_cpath);
hop = circ->build_state->pending_final_cpath;
@@ -1164,7 +1165,7 @@ rend_client_receive_rendezvous(origin_circuit_t *circ, const uint8_t *request,
circuit_change_purpose(TO_CIRCUIT(circ), CIRCUIT_PURPOSE_C_REND_JOINED);
hop->state = CPATH_STATE_OPEN;
/* set the windows to default. these are the windows
- * that alice thinks bob has.
+ * that the client thinks the service has.
*/
hop->package_window = circuit_initial_package_window();
hop->deliver_window = CIRCWINDOW_START;
diff --git a/src/or/rendmid.c b/src/or/rendmid.c
index 2451acb514..cbfbcbe051 100644
--- a/src/or/rendmid.c
+++ b/src/or/rendmid.c
@@ -80,7 +80,7 @@ rend_mid_establish_intro(or_circuit_t *circ, const uint8_t *request,
goto err;
}
- /* The request is valid. First, compute the hash of Bob's PK.*/
+ /* The request is valid. First, compute the hash of the service's PK.*/
if (crypto_pk_get_digest(pk, pk_digest)<0) {
log_warn(LD_BUG, "Internal error: couldn't hash public key.");
goto err;
@@ -178,7 +178,8 @@ rend_mid_introduce(or_circuit_t *circ, const uint8_t *request,
base32_encode(serviceid, REND_SERVICE_ID_LEN_BASE32+1,
(char*)request, REND_SERVICE_ID_LEN);
- /* The first 20 bytes are all we look at: they have a hash of Bob's PK. */
+ /* The first 20 bytes are all we look at: they have a hash of the service's
+ * PK. */
intro_circ = circuit_get_intro_point((const uint8_t*)request);
if (!intro_circ) {
log_info(LD_REND,
@@ -202,7 +203,7 @@ rend_mid_introduce(or_circuit_t *circ, const uint8_t *request,
"Unable to send INTRODUCE2 cell to Tor client.");
goto err;
}
- /* And send an ack down Alice's circuit. Empty body means succeeded. */
+ /* And send an ack down the client's circuit. Empty body means succeeded. */
if (relay_send_command_from_edge(0,TO_CIRCUIT(circ),
RELAY_COMMAND_INTRODUCE_ACK,
NULL,0,NULL)) {
@@ -337,7 +338,7 @@ rend_mid_rendezvous(or_circuit_t *circ, const uint8_t *request,
circ->circuit_carries_hs_traffic_stats = 1;
}
- /* Send the RENDEZVOUS2 cell to Alice. */
+ /* Send the RENDEZVOUS2 cell to the client. */
if (relay_send_command_from_edge(0, TO_CIRCUIT(rend_circ),
RELAY_COMMAND_RENDEZVOUS2,
(char*)(request+REND_COOKIE_LEN),
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 15d98bfde5..7471c6252f 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -1676,7 +1676,7 @@ rend_service_receive_introduction(origin_circuit_t *circuit,
/* help predict this next time */
rep_hist_note_used_internal(now, circ_needs_uptime, 1);
- /* Launch a circuit to alice's chosen rendezvous point.
+ /* Launch a circuit to the client's chosen rendezvous point.
*/
for (i=0;i<MAX_REND_FAILURES;i++) {
int flags = CIRCLAUNCH_NEED_CAPACITY | CIRCLAUNCH_IS_INTERNAL;
@@ -2970,7 +2970,7 @@ rend_service_rendezvous_has_opened(origin_circuit_t *circuit)
/* Append the cpath entry. */
hop->state = CPATH_STATE_OPEN;
/* set the windows to default. these are the windows
- * that bob thinks alice has.
+ * that the service thinks the client has.
*/
hop->package_window = circuit_initial_package_window();
hop->deliver_window = CIRCWINDOW_START;
diff --git a/src/or/router.c b/src/or/router.c
index d4131992aa..c4a805ff39 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -1099,43 +1099,47 @@ check_whether_dirport_reachable(void)
can_reach_dir_port;
}
-/** Look at a variety of factors, and return 0 if we don't want to
- * advertise the fact that we have a DirPort open. Else return the
- * DirPort we want to advertise.
- *
- * Log a helpful message if we change our mind about whether to publish
- * a DirPort.
+/** The lower threshold of remaining bandwidth required to advertise (or
+ * automatically provide) directory services */
+/* XXX Should this be increased? */
+#define MIN_BW_TO_ADVERTISE_DIRSERVER 51200
+
+/** Return true iff we have enough configured bandwidth to cache directory
+ * information. */
+static int
+router_has_bandwidth_to_be_dirserver(const or_options_t *options)
+{
+ if (options->BandwidthRate < MIN_BW_TO_ADVERTISE_DIRSERVER) {
+ return 0;
+ }
+ if (options->RelayBandwidthRate > 0 &&
+ options->RelayBandwidthRate < MIN_BW_TO_ADVERTISE_DIRSERVER) {
+ return 0;
+ }
+ return 1;
+}
+
+/** Helper: Return 1 if we have sufficient resources for serving directory
+ * requests, return 0 otherwise.
+ * dir_port is either 0 or the configured DirPort number.
+ * If AccountingMax is set less than our advertised bandwidth, then don't
+ * serve requests. Likewise, if our advertised bandwidth is less than
+ * MIN_BW_TO_ADVERTISE_DIRSERVER, don't bother trying to serve requests.
*/
static int
-decide_to_advertise_dirport(const or_options_t *options, uint16_t dir_port)
+router_should_be_directory_server(const or_options_t *options, int dir_port)
{
static int advertising=1; /* start out assuming we will advertise */
int new_choice=1;
const char *reason = NULL;
- /* Section one: reasons to publish or not publish that aren't
- * worth mentioning to the user, either because they're obvious
- * or because they're normal behavior. */
-
- if (!dir_port) /* short circuit the rest of the function */
- return 0;
- if (authdir_mode(options)) /* always publish */
- return dir_port;
- if (net_is_disabled())
- return 0;
- if (!check_whether_dirport_reachable())
- return 0;
- if (!router_get_advertised_dir_port(options, dir_port))
- return 0;
-
- /* Section two: reasons to publish or not publish that the user
- * might find surprising. These are generally config options that
- * make us choose not to publish. */
-
- if (accounting_is_enabled(options)) {
+ if (accounting_is_enabled(options) &&
+ get_options()->AccountingRule != ACCT_IN) {
/* Don't spend bytes for directory traffic if we could end up hibernating,
* but allow DirPort otherwise. Some people set AccountingMax because
- * they're confused or to get statistics. */
+ * they're confused or to get statistics. Directory traffic has a much
+ * larger effect on output than input so there is no reason to turn it
+ * off if using AccountingRule in. */
int interval_length = accounting_get_interval_length();
uint32_t effective_bw = get_effective_bwrate(options);
uint64_t acc_bytes;
@@ -1158,10 +1162,7 @@ decide_to_advertise_dirport(const or_options_t *options, uint16_t dir_port)
new_choice = 0;
reason = "AccountingMax enabled";
}
-#define MIN_BW_TO_ADVERTISE_DIRPORT 51200
- } else if (options->BandwidthRate < MIN_BW_TO_ADVERTISE_DIRPORT ||
- (options->RelayBandwidthRate > 0 &&
- options->RelayBandwidthRate < MIN_BW_TO_ADVERTISE_DIRPORT)) {
+ } else if (! router_has_bandwidth_to_be_dirserver(options)) {
/* if we're advertising a small amount */
new_choice = 0;
reason = "BandwidthRate under 50KB";
@@ -1169,15 +1170,63 @@ decide_to_advertise_dirport(const or_options_t *options, uint16_t dir_port)
if (advertising != new_choice) {
if (new_choice == 1) {
- log_notice(LD_DIR, "Advertising DirPort as %d", dir_port);
+ if (dir_port > 0)
+ log_notice(LD_DIR, "Advertising DirPort as %d", dir_port);
+ else
+ log_notice(LD_DIR, "Advertising directory service support");
} else {
tor_assert(reason);
- log_notice(LD_DIR, "Not advertising DirPort (Reason: %s)", reason);
+ log_notice(LD_DIR, "Not advertising Dir%s (Reason: %s)",
+ dir_port ? "Port" : "ectory Service support", reason);
}
advertising = new_choice;
}
- return advertising ? dir_port : 0;
+ return advertising;
+}
+
+/** Return 1 if we are configured to accept either relay or directory requests
+ * from clients and we aren't at risk of exceeding our bandwidth limits, thus
+ * we should be a directory server. If not, return 0.
+ */
+int
+dir_server_mode(const or_options_t *options)
+{
+ if (!options->DirCache)
+ return 0;
+ return options->DirPort_set ||
+ (server_mode(options) && router_has_bandwidth_to_be_dirserver(options));
+}
+
+/** Look at a variety of factors, and return 0 if we don't want to
+ * advertise the fact that we have a DirPort open, else return the
+ * DirPort we want to advertise.
+ *
+ * Log a helpful message if we change our mind about whether to publish
+ * a DirPort.
+ */
+static int
+decide_to_advertise_dirport(const or_options_t *options, uint16_t dir_port)
+{
+ /* Part one: reasons to publish or not publish that aren't
+ * worth mentioning to the user, either because they're obvious
+ * or because they're normal behavior. */
+
+ if (!dir_port) /* short circuit the rest of the function */
+ return 0;
+ if (authdir_mode(options)) /* always publish */
+ return dir_port;
+ if (net_is_disabled())
+ return 0;
+ if (!check_whether_dirport_reachable())
+ return 0;
+ if (!router_get_advertised_dir_port(options, dir_port))
+ return 0;
+
+ /* Part two: reasons to publish or not publish that the user
+ * might find surprising. router_should_be_directory_server()
+ * considers config options that make us choose not to publish. */
+ return router_should_be_directory_server(options, dir_port) ? dir_port : 0;
}
/** Allocate and return a new extend_info_t that can be used to build
@@ -1269,7 +1318,8 @@ router_orport_found_reachable(void)
char *address = tor_dup_ip(me->addr);
log_notice(LD_OR,"Self-testing indicates your ORPort is reachable from "
"the outside. Excellent.%s",
- get_options()->PublishServerDescriptor_ != NO_DIRINFO ?
+ get_options()->PublishServerDescriptor_ != NO_DIRINFO
+ && check_whether_dirport_reachable() ?
" Publishing server descriptor." : "");
can_reach_or_port = 1;
mark_my_descriptor_dirty("ORPort found reachable");
@@ -1293,7 +1343,10 @@ router_dirport_found_reachable(void)
if (!can_reach_dir_port && me) {
char *address = tor_dup_ip(me->addr);
log_notice(LD_DIRSERV,"Self-testing indicates your DirPort is reachable "
- "from the outside. Excellent.");
+ "from the outside. Excellent.%s",
+ get_options()->PublishServerDescriptor_ != NO_DIRINFO
+ && check_whether_orport_reachable() ?
+ " Publishing server descriptor." : "");
can_reach_dir_port = 1;
if (decide_to_advertise_dirport(get_options(), me->dir_port)) {
mark_my_descriptor_dirty("DirPort found reachable");
@@ -1496,7 +1549,8 @@ proxy_mode(const or_options_t *options)
* and
* - We have ORPort set
* and
- * - We believe we are reachable from the outside; or
+ * - We believe both our ORPort and DirPort (if present) are reachable from
+ * the outside; or
* - We are an authoritative directory server.
*/
static int
@@ -1515,7 +1569,7 @@ decide_if_publishable_server(void)
if (!router_get_advertised_or_port(options))
return 0;
- return check_whether_orport_reachable();
+ return check_whether_orport_reachable() && check_whether_dirport_reachable();
}
/** Initiate server descriptor upload as reasonable (if server is publishable,
@@ -1867,6 +1921,8 @@ router_build_fresh_descriptor(routerinfo_t **r, extrainfo_t **e)
ri->addr = addr;
ri->or_port = router_get_advertised_or_port(options);
ri->dir_port = router_get_advertised_dir_port(options, 0);
+ ri->supports_tunnelled_dir_requests = dir_server_mode(options) &&
+ router_should_be_directory_server(options, ri->dir_port);
ri->cache_info.published_on = time(NULL);
ri->onion_pkey = crypto_pk_dup_key(get_onion_key()); /* must invoke from
* main thread */
@@ -2320,7 +2376,7 @@ router_new_address_suggestion(const char *suggestion,
if (tor_addr_eq(&d_conn->base_.addr, &addr)) {
/* Don't believe anybody who says our IP is their IP. */
log_debug(LD_DIR, "A directory server told us our IP address is %s, "
- "but he's just reporting his own IP address. Ignoring.",
+ "but they are just reporting their own IP address. Ignoring.",
suggestion);
return;
}
@@ -2643,6 +2699,10 @@ router_dump_router_to_string(routerinfo_t *router,
tor_free(p6);
}
+ if (router->supports_tunnelled_dir_requests) {
+ smartlist_add(chunks, tor_strdup("tunnelled-dir-server\n"));
+ }
+
/* Sign the descriptor with Ed25519 */
if (emit_ed_sigs) {
smartlist_add(chunks, tor_strdup("router-sig-ed25519 "));
diff --git a/src/or/router.h b/src/or/router.h
index a4b3e9616c..ca590e3217 100644
--- a/src/or/router.h
+++ b/src/or/router.h
@@ -41,6 +41,7 @@ int init_keys_client(void);
int check_whether_orport_reachable(void);
int check_whether_dirport_reachable(void);
+int dir_server_mode(const or_options_t *options);
void consider_testing_reachability(int test_or, int test_dir);
void router_orport_found_reachable(void);
void router_dirport_found_reachable(void);
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 9b8885e9c9..f6662705dc 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -68,8 +68,6 @@ typedef struct cert_list_t cert_list_t;
static int compute_weighted_bandwidths(const smartlist_t *sl,
bandwidth_weight_rule_t rule,
u64_dbl_t **bandwidths_out);
-static const routerstatus_t *router_pick_directory_server_impl(
- dirinfo_type_t auth, int flags, int *n_busy_out);
static const routerstatus_t *router_pick_trusteddirserver_impl(
const smartlist_t *sourcelist, dirinfo_type_t auth,
int flags, int *n_busy_out);
@@ -1654,7 +1652,7 @@ router_skip_dir_reachability(const or_options_t *options, int try_ip_pref)
* directories that we excluded for no other reason than
* PDS_NO_EXISTING_SERVERDESC_FETCH or PDS_NO_EXISTING_MICRODESC_FETCH.
*/
-static const routerstatus_t *
+STATIC const routerstatus_t *
router_pick_directory_server_impl(dirinfo_type_t type, int flags,
int *n_busy_out)
{
@@ -1697,7 +1695,7 @@ router_pick_directory_server_impl(dirinfo_type_t type, int flags,
if (!status)
continue;
- if (!node->is_running || !status->dir_port || !node->is_valid)
+ if (!node->is_running || !node_is_dir(node) || !node->is_valid)
continue;
if (requireother && router_digest_is_me(node->identity))
continue;
@@ -3424,7 +3422,11 @@ routerlist_reparse_old(routerlist_t *rl, signed_descriptor_t *sd)
return ri;
}
-/** Free all memory held by the routerlist module. */
+/** Free all memory held by the routerlist module.
+ * Note: Calling routerlist_free_all() should always be paired with
+ * a call to nodelist_free_all(). These should only be called during
+ * cleanup.
+ */
void
routerlist_free_all(void)
{
@@ -4624,13 +4626,20 @@ static int
max_dl_per_request(const or_options_t *options, int purpose)
{
/* Since squid does not like URLs >= 4096 bytes we limit it to 96.
- * 4096 - strlen(http://255.255.255.255/tor/server/d/.z) == 4058
- * 4058/41 (40 for the hash and 1 for the + that separates them) => 98
+ * 4096 - strlen(http://[ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff]:65535
+ * /tor/server/d/.z) == 4026
+ * 4026/41 (40 for the hash and 1 for the + that separates them) => 98
* So use 96 because it's a nice number.
+ *
+ * For microdescriptors, the calculation is
+ * 4096 - strlen(http://[ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff]:65535
+ * /tor/micro/d/.z) == 4027
+ * 4027/44 (43 for the hash and 1 for the - that separates them) => 91
+ * So use 90 because it's a nice number.
*/
int max = 96;
if (purpose == DIR_PURPOSE_FETCH_MICRODESC) {
- max = 92;
+ max = 90;
}
/* If we're going to tunnel our connections, we can ask for a lot more
* in a request. */
@@ -5088,7 +5097,9 @@ router_differences_are_cosmetic(const routerinfo_t *r1, const routerinfo_t *r2)
(r1->contact_info && r2->contact_info &&
strcasecmp(r1->contact_info, r2->contact_info)) ||
r1->is_hibernating != r2->is_hibernating ||
- cmp_addr_policies(r1->exit_policy, r2->exit_policy))
+ cmp_addr_policies(r1->exit_policy, r2->exit_policy) ||
+ (r1->supports_tunnelled_dir_requests !=
+ r2->supports_tunnelled_dir_requests))
return 0;
if ((r1->declared_family == NULL) != (r2->declared_family == NULL))
return 0;
diff --git a/src/or/routerlist.h b/src/or/routerlist.h
index ac286d904f..483dd06039 100644
--- a/src/or/routerlist.h
+++ b/src/or/routerlist.h
@@ -234,6 +234,9 @@ STATIC int choose_array_element_by_weight(const u64_dbl_t *entries,
int n_entries);
STATIC void scale_array_elements_to_u64(u64_dbl_t *entries, int n_entries,
uint64_t *total_out);
+STATIC const routerstatus_t *router_pick_directory_server_impl(
+ dirinfo_type_t auth, int flags,
+ int *n_busy_out);
MOCK_DECL(int, router_descriptor_is_older_than, (const routerinfo_t *router,
int seconds));
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 3f794ad902..fafba96e95 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -35,8 +35,9 @@
/****************************************************************************/
/** Enumeration of possible token types. The ones starting with K_ correspond
- * to directory 'keywords'. ERR_ is an error in the tokenizing process, EOF_
- * is an end-of-file marker, and NIL_ is used to encode not-a-token.
+ * to directory 'keywords'. A_ is for an annotation, R or C is related to
+ * hidden services, ERR_ is an error in the tokenizing process, EOF_ is an
+ * end-of-file marker, and NIL_ is used to encode not-a-token.
*/
typedef enum {
K_ACCEPT = 0,
@@ -125,6 +126,7 @@ typedef enum {
K_DIR_KEY_CERTIFICATION,
K_DIR_KEY_CROSSCERT,
K_DIR_ADDRESS,
+ K_DIR_TUNNELLED,
K_VOTE_STATUS,
K_VALID_AFTER,
@@ -318,6 +320,7 @@ static token_rule_t routerdesc_token_table[] = {
T0N("opt", K_OPT, CONCAT_ARGS, OBJ_OK ),
T1( "bandwidth", K_BANDWIDTH, GE(3), NO_OBJ ),
A01("@purpose", A_PURPOSE, GE(1), NO_OBJ ),
+ T01("tunnelled-dir-server",K_DIR_TUNNELLED, NO_ARGS, NO_OBJ ),
END_OF_TABLE
};
@@ -1609,6 +1612,12 @@ router_parse_entry_from_string(const char *s, const char *end,
router->wants_to_be_hs_dir = 1;
}
+ /* This router accepts tunnelled directory requests via begindir if it has
+ * an open dirport or it included "tunnelled-dir-server". */
+ if (find_opt_by_keyword(tokens, K_DIR_TUNNELLED) || router->dir_port > 0) {
+ router->supports_tunnelled_dir_requests = 1;
+ }
+
tok = find_by_keyword(tokens, K_ROUTER_SIGNATURE);
note_crypto_pk_op(VERIFY_RTR);
#ifdef COUNT_DISTINCT_DIGESTS
@@ -2294,6 +2303,8 @@ routerstatus_parse_entry_from_string(memarea_t *area,
rs->is_unnamed = 1;
} else if (!strcmp(tok->args[i], "HSDir")) {
rs->is_hs_dir = 1;
+ } else if (!strcmp(tok->args[i], "V2Dir")) {
+ rs->is_v2_dir = 1;
}
}
}
diff --git a/src/or/status.c b/src/or/status.c
index 8f7be0aa3c..69d10721d2 100644
--- a/src/or/status.c
+++ b/src/or/status.c
@@ -164,24 +164,38 @@ log_accounting(const time_t now, const or_options_t *options)
or_state_t *state = get_or_state();
char *acc_rcvd = bytes_to_usage(state->AccountingBytesReadInInterval);
char *acc_sent = bytes_to_usage(state->AccountingBytesWrittenInInterval);
+ char *acc_used = bytes_to_usage(get_accounting_bytes());
uint64_t acc_bytes = options->AccountingMax;
char *acc_max;
time_t interval_end = accounting_get_end_time();
char end_buf[ISO_TIME_LEN + 1];
char *remaining = NULL;
- if (options->AccountingRule == ACCT_SUM)
- acc_bytes *= 2;
acc_max = bytes_to_usage(acc_bytes);
format_local_iso_time(end_buf, interval_end);
remaining = secs_to_uptime(interval_end - now);
+ const char *acc_rule;
+ switch (options->AccountingRule) {
+ case ACCT_MAX: acc_rule = "max";
+ break;
+ case ACCT_SUM: acc_rule = "sum";
+ break;
+ case ACCT_OUT: acc_rule = "out";
+ break;
+ case ACCT_IN: acc_rule = "in";
+ break;
+ default: acc_rule = "max";
+ break;
+ }
+
log_notice(LD_HEARTBEAT, "Heartbeat: Accounting enabled. "
- "Sent: %s / %s, Received: %s / %s. The "
+ "Sent: %s, Received: %s, Used: %s / %s, Rule: %s. The "
"current accounting interval ends on %s, in %s.",
- acc_sent, acc_max, acc_rcvd, acc_max, end_buf, remaining);
+ acc_sent, acc_rcvd, acc_used, acc_max, acc_rule, end_buf, remaining);
tor_free(acc_rcvd);
tor_free(acc_sent);
+ tor_free(acc_used);
tor_free(acc_max);
tor_free(remaining);
}
diff --git a/src/or/transports.c b/src/or/transports.c
index 81b8db2508..5a3af85be8 100644
--- a/src/or/transports.c
+++ b/src/or/transports.c
@@ -1100,7 +1100,7 @@ parse_smethod_line(const char *line, managed_proxy_t *mp)
smartlist_add(mp->transports, transport);
- /* For now, notify the user so that he knows where the server
+ /* For now, notify the user so that they know where the server
transport is listening. */
log_info(LD_CONFIG, "Server transport %s at %s:%d.",
method_name, address, (int)port);
diff --git a/src/test/bench.c b/src/test/bench.c
index 70ec025b7b..1ef54042b2 100644
--- a/src/test/bench.c
+++ b/src/test/bench.c
@@ -443,6 +443,45 @@ bench_siphash(void)
}
static void
+bench_digest(void)
+{
+ char buf[8192];
+ char out[DIGEST512_LEN];
+ const int lens[] = { 1, 16, 32, 64, 128, 512, 1024, 2048, -1 };
+ const int N = 300000;
+ uint64_t start, end;
+ crypto_rand(buf, sizeof(buf));
+
+ for (int alg = 0; alg < N_DIGEST_ALGORITHMS; alg++) {
+ for (int i = 0; lens[i] > 0; ++i) {
+ reset_perftime();
+ start = perftime();
+ for (int j = 0; j < N; ++j) {
+ switch (alg) {
+ case DIGEST_SHA1:
+ crypto_digest(out, buf, lens[i]);
+ break;
+ case DIGEST_SHA256:
+ case DIGEST_SHA3_256:
+ crypto_digest256(out, buf, lens[i], alg);
+ break;
+ case DIGEST_SHA512:
+ case DIGEST_SHA3_512:
+ crypto_digest512(out, buf, lens[i], alg);
+ break;
+ default:
+ tor_assert(0);
+ }
+ }
+ end = perftime();
+ printf("%s(%d): %.2f ns per call\n",
+ crypto_digest_algorithm_get_name(alg),
+ lens[i], NANOCOUNT(start,end,N));
+ }
+ }
+}
+
+static void
bench_cell_ops(void)
{
const int iters = 1<<16;
@@ -589,6 +628,7 @@ typedef struct benchmark_t {
static struct benchmark_t benchmarks[] = {
ENT(dmap),
ENT(siphash),
+ ENT(digest),
ENT(aes),
ENT(onion_TAP),
ENT(onion_ntor),
diff --git a/src/test/bt_test.py b/src/test/bt_test.py
index e694361703..dab02d7699 100755
--- a/src/test/bt_test.py
+++ b/src/test/bt_test.py
@@ -15,6 +15,7 @@ OK
"""
+from __future__ import print_function
import sys
@@ -37,6 +38,8 @@ for I in range(len(LINES)):
if matches(LINES[I:], FUNCNAMES):
print("OK")
sys.exit(0)
-else:
- print("BAD")
- sys.exit(1)
+
+for l in LINES:
+ print("{}".format(l), end="")
+
+sys.exit(1)
diff --git a/src/test/include.am b/src/test/include.am
index d52867b94e..786fb77dd0 100644
--- a/src/test/include.am
+++ b/src/test/include.am
@@ -79,6 +79,7 @@ src_test_test_SOURCES = \
src/test/test_crypto.c \
src/test/test_data.c \
src/test/test_dir.c \
+ src/test/test_dir_common.c \
src/test/test_dir_handle_get.c \
src/test/test_entryconn.c \
src/test/test_entrynodes.c \
@@ -143,6 +144,7 @@ src_test_test_switch_id_SOURCES = \
src/test/test_switch_id.c
src_test_test_switch_id_CPPFLAGS= $(src_test_AM_CPPFLAGS)
src_test_test_switch_id_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
+src_test_test_switch_id_LDFLAGS = @TOR_LDFLAGS_zlib@
src_test_test_switch_id_LDADD = \
src/common/libor-testing.a \
@TOR_ZLIB_LIBS@ @TOR_LIB_MATH@
@@ -150,8 +152,9 @@ src_test_test_switch_id_LDADD = \
src_test_test_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ \
@TOR_LDFLAGS_libevent@
src_test_test_LDADD = src/or/libtor-testing.a src/common/libor-testing.a \
- src/common/libor-crypto-testing.a $(LIBDONNA) src/common/libor.a \
- src/common/libor-event-testing.a src/trunnel/libor-trunnel-testing.a \
+ src/common/libor-crypto-testing.a $(LIBKECCAK_TINY) $(LIBDONNA) \
+ src/common/libor.a src/common/libor-event-testing.a \
+ src/trunnel/libor-trunnel-testing.a \
@TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ \
@TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ \
@TOR_SYSTEMD_LIBS@
@@ -169,7 +172,7 @@ src_test_test_memwipe_LDFLAGS = $(src_test_test_LDFLAGS)
src_test_bench_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ \
@TOR_LDFLAGS_libevent@
src_test_bench_LDADD = src/or/libtor.a src/common/libor.a \
- src/common/libor-crypto.a $(LIBDONNA) \
+ src/common/libor-crypto.a $(LIBKECCAK_TINY) $(LIBDONNA) \
src/common/libor-event.a src/trunnel/libor-trunnel.a \
@TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ \
@TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ \
@@ -179,7 +182,7 @@ src_test_test_workqueue_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ \
@TOR_LDFLAGS_libevent@
src_test_test_workqueue_LDADD = src/or/libtor-testing.a \
src/common/libor-testing.a \
- src/common/libor-crypto-testing.a $(LIBDONNA) \
+ src/common/libor-crypto-testing.a $(LIBKECCAK_TINY) $(LIBDONNA) \
src/common/libor-event-testing.a \
@TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ \
@TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@
@@ -190,6 +193,7 @@ noinst_HEADERS+= \
src/test/rend_test_helpers.h \
src/test/test.h \
src/test/test_helpers.h \
+ src/test/test_dir_common.h \
src/test/test_descriptors.inc \
src/test/example_extrainfo.inc \
src/test/failing_routerdescs.inc \
@@ -201,7 +205,7 @@ noinst_PROGRAMS+= src/test/test-ntor-cl
src_test_test_ntor_cl_SOURCES = src/test/test_ntor_cl.c
src_test_test_ntor_cl_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@
src_test_test_ntor_cl_LDADD = src/or/libtor.a src/common/libor.a \
- src/common/libor-crypto.a $(LIBDONNA) \
+ src/common/libor-crypto.a $(LIBKECCAK_TINY) $(LIBDONNA) \
@TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ \
@TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@
src_test_test_ntor_cl_AM_CPPFLAGS = \
@@ -223,4 +227,5 @@ EXTRA_DIST += \
src/test/test_keygen.sh \
src/test/test_zero_length_keys.sh \
src/test/test_ntor.sh src/test/test_bt.sh \
- src/test/test-network.sh
+ src/test/test-network.sh \
+ src/test/test_switch_id.sh
diff --git a/src/test/test_accounting.c b/src/test/test_accounting.c
index 25908e942c..7edba988a6 100644
--- a/src/test/test_accounting.c
+++ b/src/test/test_accounting.c
@@ -61,6 +61,32 @@ test_accounting_limits(void *arg)
fake_time += 1;
consider_hibernation(fake_time);
tor_assert(we_are_hibernating() == 1);
+
+ options->AccountingRule = ACCT_OUT;
+
+ accounting_add_bytes(100, 10, 1);
+ fake_time += 1;
+ consider_hibernation(fake_time);
+ tor_assert(we_are_hibernating() == 0);
+
+ accounting_add_bytes(0, 90, 1);
+ fake_time += 1;
+ consider_hibernation(fake_time);
+ tor_assert(we_are_hibernating() == 1);
+
+ options->AccountingMax = 300;
+ options->AccountingRule = ACCT_IN;
+
+ accounting_add_bytes(10, 100, 1);
+ fake_time += 1;
+ consider_hibernation(fake_time);
+ tor_assert(we_are_hibernating() == 0);
+
+ accounting_add_bytes(90, 0, 1);
+ fake_time += 1;
+ consider_hibernation(fake_time);
+ tor_assert(we_are_hibernating() == 1);
+
goto done;
done:
NS_UNMOCK(get_or_state);
diff --git a/src/test/test_addr.c b/src/test/test_addr.c
index 2c25c1ef7d..85130db4fe 100644
--- a/src/test/test_addr.c
+++ b/src/test/test_addr.c
@@ -302,6 +302,7 @@ test_addr_ip6_helpers(void *arg)
//test_ntop6_reduces("0:0:0:0:0:0:c0a8:0101", "::192.168.1.1");
test_ntop6_reduces("0:0:0:0:0:ffff:c0a8:0101", "::ffff:192.168.1.1");
+ test_ntop6_reduces("0:0:0:0:0:0:c0a8:0101", "::192.168.1.1");
test_ntop6_reduces("002:0:0000:0:3::4", "2::3:0:0:4");
test_ntop6_reduces("0:0::1:0:3", "::1:0:3");
test_ntop6_reduces("008:0::0", "8::");
diff --git a/src/test/test_address.c b/src/test/test_address.c
index 9f3d81c92c..3ddf2476e3 100644
--- a/src/test/test_address.c
+++ b/src/test/test_address.c
@@ -220,7 +220,7 @@ test_address_ifaddrs_to_smartlist(void *arg)
ifa_ipv6->ifa_dstaddr = NULL;
ifa_ipv6->ifa_data = NULL;
- smartlist = ifaddrs_to_smartlist(ifa);
+ smartlist = ifaddrs_to_smartlist(ifa, AF_UNSPEC);
tt_assert(smartlist);
tt_assert(smartlist_len(smartlist) == 3);
@@ -281,7 +281,7 @@ test_address_get_if_addrs_ifaddrs(void *arg)
(void)arg;
- results = get_interface_addresses_ifaddrs(LOG_ERR);
+ results = get_interface_addresses_ifaddrs(LOG_ERR, AF_UNSPEC);
tt_assert(results);
/* Some FreeBSD jails don't have localhost IP address. Instead, they only
@@ -314,7 +314,7 @@ test_address_get_if_addrs_win32(void *arg)
(void)arg;
- results = get_interface_addresses_win32(LOG_ERR);
+ results = get_interface_addresses_win32(LOG_ERR, AF_UNSPEC);
tt_int_op(smartlist_len(results),>=,1);
tt_assert(smartlist_contains_localhost_tor_addr(results));
@@ -511,7 +511,7 @@ test_address_get_if_addrs_ioctl(void *arg)
(void)arg;
- result = get_interface_addresses_ioctl(LOG_ERR);
+ result = get_interface_addresses_ioctl(LOG_ERR, AF_INET);
/* On an IPv6-only system, this will fail and return NULL
tt_assert(result);
@@ -845,9 +845,10 @@ test_address_get_if_addrs6_list_no_internal(void *arg)
static int called_get_interface_addresses_raw = 0;
static smartlist_t *
-mock_get_interface_addresses_raw_fail(int severity)
+mock_get_interface_addresses_raw_fail(int severity, sa_family_t family)
{
(void)severity;
+ (void)family;
called_get_interface_addresses_raw++;
return smartlist_new();
diff --git a/src/test/test_bt_cl.c b/src/test/test_bt_cl.c
index dabaee6e0a..c43143ffe9 100644
--- a/src/test/test_bt_cl.c
+++ b/src/test/test_bt_cl.c
@@ -119,6 +119,7 @@ main(int argc, char **argv)
printf("%d\n", we_weave(2));
clean_up_backtrace_handler();
+ logs_free_all();
return 0;
}
diff --git a/src/test/test_config.c b/src/test/test_config.c
index 098b0a8cf8..58487d75be 100644
--- a/src/test/test_config.c
+++ b/src/test/test_config.c
@@ -7,20 +7,43 @@
#define CONFIG_PRIVATE
#define PT_PRIVATE
+#define ROUTERSET_PRIVATE
#include "or.h"
+#include "address.h"
#include "addressmap.h"
+#include "circuitmux_ewma.h"
+#include "circuitbuild.h"
#include "config.h"
#include "confparse.h"
+#include "connection.h"
#include "connection_edge.h"
#include "test.h"
#include "util.h"
#include "address.h"
+#include "connection_or.h"
+#include "control.h"
+#include "cpuworker.h"
+#include "dirserv.h"
+#include "dirvote.h"
+#include "dns.h"
#include "entrynodes.h"
#include "transports.h"
-#include "routerlist.h"
+#include "ext_orport.h"
+#include "geoip.h"
+#include "hibernate.h"
+#include "main.h"
#include "networkstatus.h"
+#include "nodelist.h"
+#include "policies.h"
+#include "rendclient.h"
+#include "rendservice.h"
#include "router.h"
-#include "dirserv.h"
+#include "routerlist.h"
+#include "routerset.h"
+#include "statefile.h"
+#include "test.h"
+#include "transports.h"
+#include "util.h"
static void
test_config_addressmap(void *arg)
@@ -3421,9 +3444,11 @@ test_config_default_dir_servers(void *arg)
int trusted_count = 0;
int fallback_count = 0;
+ /* new set of options should stop fallback parsing */
opts = tor_malloc_zero(sizeof(or_options_t));
opts->UseDefaultFallbackDirs = 0;
- consider_adding_dir_servers(opts, opts);
+ /* set old_options to NULL to force dir update */
+ consider_adding_dir_servers(opts, NULL);
trusted_count = smartlist_len(router_get_trusted_dir_servers());
fallback_count = smartlist_len(router_get_fallback_dir_servers());
or_options_free(opts);
@@ -3575,6 +3600,8 @@ test_config_directory_fetch(void *arg)
mock_advertised_server_mode_result = 1;
mock_router_get_my_routerinfo_result = &routerinfo;
+ routerinfo.supports_tunnelled_dir_requests = 1;
+
options->RefuseUnknownExits = 1;
tt_assert(server_mode(options) == 1);
tt_assert(public_server_mode(options) == 1);
@@ -3598,6 +3625,7 @@ test_config_directory_fetch(void *arg)
memset(options, 0, sizeof(or_options_t));
options->DirPort_set = 1;
options->ORPort_set = 1;
+ options->DirCache = 1;
mock_router_pick_published_address_result = 0;
mock_router_my_exit_policy_is_reject_star_result = 1;
@@ -3629,6 +3657,7 @@ test_config_directory_fetch(void *arg)
mock_advertised_server_mode_result = 1;
routerinfo.dir_port = 0;
+ routerinfo.supports_tunnelled_dir_requests = 0;
mock_router_get_my_routerinfo_result = &routerinfo;
tt_assert(server_mode(options) == 1);
tt_assert(public_server_mode(options) == 1);
@@ -3638,6 +3667,7 @@ test_config_directory_fetch(void *arg)
mock_advertised_server_mode_result = 1;
routerinfo.dir_port = 1;
+ routerinfo.supports_tunnelled_dir_requests = 1;
mock_router_get_my_routerinfo_result = &routerinfo;
tt_assert(server_mode(options) == 1);
tt_assert(public_server_mode(options) == 1);
@@ -3680,6 +3710,831 @@ test_config_default_fallback_dirs(void *arg)
clear_dir_servers();
}
+static config_line_t *
+mock_config_line(const char *key, const char *val)
+{
+ config_line_t *config_line = tor_malloc(sizeof(config_line_t));
+ memset(config_line, 0, sizeof(config_line_t));
+ config_line->key = tor_strdup(key);
+ config_line->value = tor_strdup(val);
+ return config_line;
+}
+
+static void
+test_config_parse_port_config__listenaddress(void *data)
+{
+ (void)data;
+ int ret;
+ config_line_t *config_listen_address = NULL, *config_listen_address2 = NULL,
+ *config_listen_address3 = NULL;
+ config_line_t *config_port1 = NULL, *config_port2 = NULL,
+ *config_port3 = NULL, *config_port4 = NULL, *config_port5 = NULL;
+ smartlist_t *slout = NULL;
+ port_cfg_t *port_cfg = NULL;
+
+ // Test basic invocation with no arguments
+ ret = parse_port_config(NULL, NULL, NULL, NULL, 0, NULL, 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+
+ // Setup some test data
+ config_listen_address = mock_config_line("DNSListenAddress", "127.0.0.1");
+ config_listen_address2 = mock_config_line("DNSListenAddress", "x$$$:::345");
+ config_listen_address3 = mock_config_line("DNSListenAddress",
+ "127.0.0.1:1442");
+ config_port1 = mock_config_line("DNSPort", "42");
+ config_port2 = mock_config_line("DNSPort", "43");
+ config_port1->next = config_port2;
+ config_port3 = mock_config_line("DNSPort", "auto");
+ config_port4 = mock_config_line("DNSPort", "55542");
+ config_port5 = mock_config_line("DNSPort", "666777");
+
+ // Test failure when we have a ListenAddress line and several
+ // Port lines for the same portname
+ ret = parse_port_config(NULL, config_port1, config_listen_address, "DNS", 0,
+ NULL, 0, 0);
+ tt_int_op(ret, OP_EQ, -1);
+
+ // Test case when we have a listen address, no default port and allow
+ // spurious listen address lines
+ ret = parse_port_config(NULL, NULL, config_listen_address, "DNS", 0, NULL,
+ 0, CL_PORT_ALLOW_EXTRA_LISTENADDR);
+ tt_int_op(ret, OP_EQ, 1);
+
+ // Test case when we have a listen address, no default port but doesn't
+ // allow spurious listen address lines
+ ret = parse_port_config(NULL, NULL, config_listen_address, "DNS", 0, NULL,
+ 0, 0);
+ tt_int_op(ret, OP_EQ, -1);
+
+ // Test case when we have a listen address, and a port that points to auto,
+ // should use the AUTO port
+ slout = smartlist_new();
+ ret = parse_port_config(slout, config_port3, config_listen_address, "DNS",
+ 0, NULL, 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->port, OP_EQ, CFG_AUTO_PORT);
+
+ // Test when we have a listen address and a custom port
+ ret = parse_port_config(slout, config_port4, config_listen_address, "DNS",
+ 0, NULL, 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 2);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 1);
+ tt_int_op(port_cfg->port, OP_EQ, 55542);
+
+ // Test when we have a listen address and an invalid custom port
+ ret = parse_port_config(slout, config_port5, config_listen_address, "DNS",
+ 0, NULL, 0, 0);
+ tt_int_op(ret, OP_EQ, -1);
+
+ // Test we get a server port configuration when asked for it
+ ret = parse_port_config(slout, NULL, config_listen_address, "DNS", 0, NULL,
+ 123, CL_PORT_SERVER_OPTIONS);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 4);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 2);
+ tt_int_op(port_cfg->port, OP_EQ, 123);
+ tt_int_op(port_cfg->server_cfg.no_listen, OP_EQ, 1);
+ tt_int_op(port_cfg->server_cfg.bind_ipv4_only, OP_EQ, 1);
+
+ // Test an invalid ListenAddress configuration
+ ret = parse_port_config(NULL, NULL, config_listen_address2, "DNS", 0, NULL,
+ 222, 0);
+ tt_int_op(ret, OP_EQ, -1);
+
+ // Test default to the port in the listen address if available
+ ret = parse_port_config(slout, config_port2, config_listen_address3, "DNS",
+ 0, NULL, 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 5);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 4);
+ tt_int_op(port_cfg->port, OP_EQ, 1442);
+
+ // Test we work correctly without an out, but with a listen address
+ // and a port
+ ret = parse_port_config(NULL, config_port2, config_listen_address, "DNS",
+ 0, NULL, 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+
+ // Test warning nonlocal control
+ ret = parse_port_config(slout, config_port2, config_listen_address, "DNS",
+ CONN_TYPE_CONTROL_LISTENER, NULL, 0,
+ CL_PORT_WARN_NONLOCAL);
+ tt_int_op(ret, OP_EQ, 0);
+
+ // Test warning nonlocal ext or listener
+ ret = parse_port_config(slout, config_port2, config_listen_address, "DNS",
+ CONN_TYPE_EXT_OR_LISTENER, NULL, 0,
+ CL_PORT_WARN_NONLOCAL);
+ tt_int_op(ret, OP_EQ, 0);
+
+ // Test warning nonlocal other
+ ret = parse_port_config(slout, config_port2, config_listen_address, "DNS",
+ 0, NULL, 0, CL_PORT_WARN_NONLOCAL);
+ tt_int_op(ret, OP_EQ, 0);
+
+ // Test warning nonlocal control without an out
+ ret = parse_port_config(NULL, config_port2, config_listen_address, "DNS",
+ CONN_TYPE_CONTROL_LISTENER, NULL, 0,
+ CL_PORT_WARN_NONLOCAL);
+ tt_int_op(ret, OP_EQ, 0);
+
+ done:
+ tor_free(config_listen_address);
+ tor_free(config_listen_address2);
+ tor_free(config_listen_address3);
+ tor_free(config_port1);
+ tor_free(config_port2);
+ tor_free(config_port3);
+ tor_free(config_port4);
+ tor_free(config_port5);
+ smartlist_free(slout);
+}
+
+static void
+test_config_parse_port_config__ports__no_ports_given(void *data)
+{
+ (void)data;
+ int ret;
+ smartlist_t *slout = NULL;
+ port_cfg_t *port_cfg = NULL;
+ config_line_t *config_port_invalid = NULL, *config_port_valid = NULL;
+
+ slout = smartlist_new();
+
+ // Test no defaultport, no defaultaddress and no out
+ ret = parse_port_config(NULL, NULL, NULL, "DNS", 0, NULL, 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+
+ // Test with defaultport, no defaultaddress and no out
+ ret = parse_port_config(NULL, NULL, NULL, "DNS", 0, NULL, 42, 0);
+ tt_int_op(ret, OP_EQ, 0);
+
+ // Test no defaultport, with defaultaddress and no out
+ ret = parse_port_config(NULL, NULL, NULL, "DNS", 0, "127.0.0.2", 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+
+ // Test with defaultport, with defaultaddress and no out
+ ret = parse_port_config(NULL, NULL, NULL, "DNS", 0, "127.0.0.2", 42, 0);
+ tt_int_op(ret, OP_EQ, 0);
+
+ // Test no defaultport, no defaultaddress and with out
+ ret = parse_port_config(slout, NULL, NULL, "DNS", 0, NULL, 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 0);
+
+ // Test with defaultport, no defaultaddress and with out
+ ret = parse_port_config(slout, NULL, NULL, "DNS", 0, NULL, 42, 0);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 0);
+
+ // Test no defaultport, with defaultaddress and with out
+ ret = parse_port_config(slout, NULL, NULL, "DNS", 0, "127.0.0.2", 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 0);
+
+ // Test with defaultport, with defaultaddress and out, adds a new port cfg
+ smartlist_clear(slout);
+ ret = parse_port_config(slout, NULL, NULL, "DNS", 0, "127.0.0.2", 42, 0);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->port, OP_EQ, 42);
+ tt_int_op(port_cfg->is_unix_addr, OP_EQ, 0);
+
+ // Test with defaultport, with defaultaddress and out, adds a new port cfg
+ // for a unix address
+ smartlist_clear(slout);
+ ret = parse_port_config(slout, NULL, NULL, "DNS", 0, "/foo/bar/unixdomain",
+ 42, CL_PORT_IS_UNIXSOCKET);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->port, OP_EQ, 0);
+ tt_int_op(port_cfg->is_unix_addr, OP_EQ, 1);
+ tt_str_op(port_cfg->unix_addr, OP_EQ, "/foo/bar/unixdomain");
+
+ done:
+ smartlist_free(slout);
+ tor_free(config_port_invalid);
+ tor_free(config_port_valid);
+}
+
+static void
+test_config_parse_port_config__ports__ports_given(void *data)
+{
+ (void)data;
+ int ret;
+ smartlist_t *slout = NULL;
+ port_cfg_t *port_cfg = NULL;
+ config_line_t *config_port_invalid = NULL, *config_port_valid = NULL;
+ tor_addr_t addr;
+
+ slout = smartlist_new();
+
+ // Test error when encounters an invalid Port specification
+ config_port_invalid = mock_config_line("DNSPort", "");
+ ret = parse_port_config(NULL, config_port_invalid, NULL, "DNS", 0, NULL,
+ 0, 0);
+ tt_int_op(ret, OP_EQ, -1);
+
+ // Test error when encounters an empty unix domain specification
+ tor_free(config_port_invalid);
+ config_port_invalid = mock_config_line("DNSPort", "unix:");
+ ret = parse_port_config(NULL, config_port_invalid, NULL, "DNS", 0, NULL,
+ 0, 0);
+ tt_int_op(ret, OP_EQ, -1);
+
+ // Test error when encounters a unix domain specification but the listener
+ // doesnt support domain sockets
+ config_port_valid = mock_config_line("DNSPort", "unix:/tmp/foo/bar");
+ ret = parse_port_config(NULL, config_port_valid, NULL, "DNS",
+ CONN_TYPE_AP_DNS_LISTENER, NULL, 0, 0);
+ tt_int_op(ret, OP_EQ, -1);
+
+ // Test valid unix domain
+ smartlist_clear(slout);
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS",
+ CONN_TYPE_AP_LISTENER, NULL, 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->port, OP_EQ, 0);
+ tt_int_op(port_cfg->is_unix_addr, OP_EQ, 1);
+ tt_str_op(port_cfg->unix_addr, OP_EQ, "/tmp/foo/bar");
+
+ // Test failure if we have no ipv4 and no ipv6 (for unix domain sockets,
+ // this makes no sense - it should be fixed)
+ tor_free(config_port_invalid);
+ config_port_invalid = mock_config_line("DNSPort",
+ "unix:/tmp/foo/bar NoIPv4Traffic");
+ ret = parse_port_config(NULL, config_port_invalid, NULL, "DNS",
+ CONN_TYPE_AP_LISTENER, NULL, 0,
+ CL_PORT_TAKES_HOSTNAMES);
+ tt_int_op(ret, OP_EQ, -1);
+
+ // Test success with no ipv4 but take ipv6 (for unix domain sockets, this
+ // makes no sense - it should be fixed)
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "unix:/tmp/foo/bar "
+ "NoIPv4Traffic IPv6Traffic");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS",
+ CONN_TYPE_AP_LISTENER, NULL, 0,
+ CL_PORT_TAKES_HOSTNAMES);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->entry_cfg.ipv4_traffic, OP_EQ, 0);
+ tt_int_op(port_cfg->entry_cfg.ipv6_traffic, OP_EQ, 1);
+
+ // Test success with both ipv4 and ipv6 (for unix domain sockets,
+ // this makes no sense - it should be fixed)
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "unix:/tmp/foo/bar "
+ "IPv4Traffic IPv6Traffic");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS",
+ CONN_TYPE_AP_LISTENER, NULL, 0,
+ CL_PORT_TAKES_HOSTNAMES);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->entry_cfg.ipv4_traffic, OP_EQ, 1);
+ tt_int_op(port_cfg->entry_cfg.ipv6_traffic, OP_EQ, 1);
+
+ // Test failure if we specify world writable for an IP Port
+ tor_free(config_port_invalid);
+ config_port_invalid = mock_config_line("DNSPort", "42 WorldWritable");
+ ret = parse_port_config(NULL, config_port_invalid, NULL, "DNS", 0,
+ "127.0.0.3", 0, 0);
+ tt_int_op(ret, OP_EQ, -1);
+
+ // Test failure if we specify group writable for an IP Port
+ tor_free(config_port_invalid);
+ config_port_invalid = mock_config_line("DNSPort", "42 GroupWritable");
+ ret = parse_port_config(NULL, config_port_invalid, NULL, "DNS", 0,
+ "127.0.0.3", 0, 0);
+ tt_int_op(ret, OP_EQ, -1);
+
+ // Test success with only a port (this will fail without a default address)
+ tor_free(config_port_valid);
+ config_port_valid = mock_config_line("DNSPort", "42");
+ ret = parse_port_config(NULL, config_port_valid, NULL, "DNS", 0,
+ "127.0.0.3", 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+
+ // Test success with only a port and isolate destination port
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "42 IsolateDestPort");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS", 0,
+ "127.0.0.3", 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->entry_cfg.isolation_flags, OP_EQ,
+ ISO_DEFAULT | ISO_DESTPORT);
+
+ // Test success with a negative isolate destination port, and plural
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "42 NoIsolateDestPorts");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS", 0,
+ "127.0.0.3", 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->entry_cfg.isolation_flags, OP_EQ,
+ ISO_DEFAULT & ~ISO_DESTPORT);
+
+ // Test success with isolate destination address
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "42 IsolateDestAddr");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS", 0,
+ "127.0.0.3", 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->entry_cfg.isolation_flags, OP_EQ,
+ ISO_DEFAULT | ISO_DESTADDR);
+
+ // Test success with isolate socks AUTH
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "42 IsolateSOCKSAuth");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS", 0,
+ "127.0.0.3", 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->entry_cfg.isolation_flags, OP_EQ,
+ ISO_DEFAULT | ISO_SOCKSAUTH);
+
+ // Test success with isolate client protocol
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "42 IsolateClientProtocol");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS", 0,
+ "127.0.0.3", 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->entry_cfg.isolation_flags, OP_EQ,
+ ISO_DEFAULT | ISO_CLIENTPROTO);
+
+ // Test success with isolate client address
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "42 IsolateClientAddr");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS", 0,
+ "127.0.0.3", 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->entry_cfg.isolation_flags, OP_EQ,
+ ISO_DEFAULT | ISO_CLIENTADDR);
+
+ // Test success with ignored unknown options
+ tor_free(config_port_valid);
+ config_port_valid = mock_config_line("DNSPort", "42 ThisOptionDoesntExist");
+ ret = parse_port_config(NULL, config_port_valid, NULL, "DNS", 0,
+ "127.0.0.3", 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+
+ // Test success with no isolate socks AUTH
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "42 NoIsolateSOCKSAuth");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS", 0,
+ "127.0.0.3", 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->entry_cfg.socks_prefer_no_auth, OP_EQ, 1);
+
+ // Test success with prefer ipv6
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "42 IPv6Traffic PreferIPv6");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS",
+ CONN_TYPE_AP_LISTENER, "127.0.0.42", 0,
+ CL_PORT_TAKES_HOSTNAMES);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->entry_cfg.prefer_ipv6, OP_EQ, 1);
+
+ // Test success with cache ipv4 DNS
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "42 CacheIPv4DNS");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS", 0,
+ "127.0.0.42", 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->entry_cfg.cache_ipv4_answers, OP_EQ, 1);
+ tt_int_op(port_cfg->entry_cfg.cache_ipv6_answers, OP_EQ, 0);
+
+ // Test success with cache ipv6 DNS
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "42 CacheIPv6DNS");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS", 0,
+ "127.0.0.42", 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->entry_cfg.cache_ipv4_answers, OP_EQ, 1);
+ tt_int_op(port_cfg->entry_cfg.cache_ipv6_answers, OP_EQ, 1);
+
+ // Test success with no cache ipv4 DNS
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "42 NoCacheIPv4DNS");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS", 0,
+ "127.0.0.42", 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->entry_cfg.cache_ipv4_answers, OP_EQ, 0);
+ tt_int_op(port_cfg->entry_cfg.cache_ipv6_answers, OP_EQ, 0);
+
+ // Test success with cache DNS
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "42 CacheDNS");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS", 0,
+ "127.0.0.42", 0, CL_PORT_TAKES_HOSTNAMES);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->entry_cfg.cache_ipv4_answers, OP_EQ, 1);
+ tt_int_op(port_cfg->entry_cfg.cache_ipv6_answers, OP_EQ, 1);
+
+ // Test success with use cached ipv4 DNS
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "42 UseIPv4Cache");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS", 0,
+ "127.0.0.42", 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->entry_cfg.use_cached_ipv4_answers, OP_EQ, 1);
+ tt_int_op(port_cfg->entry_cfg.use_cached_ipv6_answers, OP_EQ, 0);
+
+ // Test success with use cached ipv6 DNS
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "42 UseIPv6Cache");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS", 0,
+ "127.0.0.42", 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->entry_cfg.use_cached_ipv4_answers, OP_EQ, 0);
+ tt_int_op(port_cfg->entry_cfg.use_cached_ipv6_answers, OP_EQ, 1);
+
+ // Test success with use cached DNS
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "42 UseDNSCache");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS", 0,
+ "127.0.0.42", 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->entry_cfg.use_cached_ipv4_answers, OP_EQ, 1);
+ tt_int_op(port_cfg->entry_cfg.use_cached_ipv6_answers, OP_EQ, 1);
+
+ // Test success with not preferring ipv6 automap
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "42 NoPreferIPv6Automap");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS", 0,
+ "127.0.0.42", 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->entry_cfg.prefer_ipv6_virtaddr, OP_EQ, 0);
+
+ // Test success with prefer SOCKS no auth
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "42 PreferSOCKSNoAuth");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS", 0,
+ "127.0.0.42", 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->entry_cfg.socks_prefer_no_auth, OP_EQ, 1);
+
+ // Test failure with both a zero port and a non-zero port
+ tor_free(config_port_invalid);
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_invalid = mock_config_line("DNSPort", "0");
+ config_port_valid = mock_config_line("DNSPort", "42");
+ config_port_invalid->next = config_port_valid;
+ ret = parse_port_config(slout, config_port_invalid, NULL, "DNS", 0,
+ "127.0.0.42", 0, 0);
+ tt_int_op(ret, OP_EQ, -1);
+
+ // Test success with warn non-local control
+ smartlist_clear(slout);
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS",
+ CONN_TYPE_CONTROL_LISTENER, "127.0.0.42", 0,
+ CL_PORT_WARN_NONLOCAL);
+ tt_int_op(ret, OP_EQ, 0);
+
+ // Test success with warn non-local listener
+ smartlist_clear(slout);
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS",
+ CONN_TYPE_EXT_OR_LISTENER, "127.0.0.42", 0,
+ CL_PORT_WARN_NONLOCAL);
+ tt_int_op(ret, OP_EQ, 0);
+
+ // Test success with warn non-local other
+ smartlist_clear(slout);
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS", 0,
+ "127.0.0.42", 0, CL_PORT_WARN_NONLOCAL);
+ tt_int_op(ret, OP_EQ, 0);
+
+ // Test success with warn non-local other without out
+ ret = parse_port_config(NULL, config_port_valid, NULL, "DNS", 0,
+ "127.0.0.42", 0, CL_PORT_WARN_NONLOCAL);
+ tt_int_op(ret, OP_EQ, 0);
+
+ // Test success with both ipv4 and ipv6 but without stream options
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "42 IPv4Traffic "
+ "IPv6Traffic");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS", 0,
+ "127.0.0.44", 0,
+ CL_PORT_TAKES_HOSTNAMES |
+ CL_PORT_NO_STREAM_OPTIONS);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->entry_cfg.ipv4_traffic, OP_EQ, 1);
+ tt_int_op(port_cfg->entry_cfg.ipv6_traffic, OP_EQ, 0);
+
+ // Test failure for a SessionGroup argument with invalid value
+ tor_free(config_port_invalid);
+ smartlist_clear(slout);
+ config_port_invalid = mock_config_line("DNSPort", "42 SessionGroup=invalid");
+ ret = parse_port_config(slout, config_port_invalid, NULL, "DNS", 0,
+ "127.0.0.44", 0, CL_PORT_NO_STREAM_OPTIONS);
+ tt_int_op(ret, OP_EQ, -1);
+
+ // TODO: this seems wrong. Shouldn't it be the other way around?
+ // Potential bug.
+ // Test failure for a SessionGroup argument with valid value but with stream
+ // options allowed
+ tor_free(config_port_invalid);
+ smartlist_clear(slout);
+ config_port_invalid = mock_config_line("DNSPort", "42 SessionGroup=123");
+ ret = parse_port_config(slout, config_port_invalid, NULL, "DNS", 0,
+ "127.0.0.44", 0, 0);
+ tt_int_op(ret, OP_EQ, -1);
+
+ // Test failure for more than one SessionGroup argument
+ tor_free(config_port_invalid);
+ smartlist_clear(slout);
+ config_port_invalid = mock_config_line("DNSPort", "42 SessionGroup=123 "
+ "SessionGroup=321");
+ ret = parse_port_config(slout, config_port_invalid, NULL, "DNS", 0,
+ "127.0.0.44", 0, CL_PORT_NO_STREAM_OPTIONS);
+ tt_int_op(ret, OP_EQ, -1);
+
+ // Test success with a sessiongroup options
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "42 SessionGroup=1111122");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS", 0,
+ "127.0.0.44", 0, CL_PORT_NO_STREAM_OPTIONS);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->entry_cfg.session_group, OP_EQ, 1111122);
+
+ // Test success with a zero unix domain socket, and doesnt add it to out
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "0");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS", 0,
+ "127.0.0.45", 0, CL_PORT_IS_UNIXSOCKET);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 0);
+
+ // Test success with a one unix domain socket, and doesnt add it to out
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "something");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS", 0,
+ "127.0.0.45", 0, CL_PORT_IS_UNIXSOCKET);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->is_unix_addr, OP_EQ, 1);
+ tt_str_op(port_cfg->unix_addr, OP_EQ, "something");
+
+ // Test success with a port of auto - it uses the default address
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "auto");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS", 0,
+ "127.0.0.46", 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->port, OP_EQ, CFG_AUTO_PORT);
+ tor_addr_parse(&addr, "127.0.0.46");
+ tt_assert(tor_addr_eq(&port_cfg->addr, &addr))
+
+ // Test success with parsing both an address and an auto port
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "127.0.0.122:auto");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS", 0,
+ "127.0.0.46", 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->port, OP_EQ, CFG_AUTO_PORT);
+ tor_addr_parse(&addr, "127.0.0.122");
+ tt_assert(tor_addr_eq(&port_cfg->addr, &addr))
+
+ // Test failure when asked to parse an invalid address followed by auto
+ tor_free(config_port_invalid);
+ config_port_invalid = mock_config_line("DNSPort", "invalidstuff!!:auto");
+ ret = parse_port_config(NULL, config_port_invalid, NULL, "DNS", 0,
+ "127.0.0.46", 0, 0);
+ tt_int_op(ret, OP_EQ, -1);
+
+ // Test success with parsing both an address and a real port
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "127.0.0.123:656");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS", 0,
+ "127.0.0.46", 0, 0);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->port, OP_EQ, 656);
+ tor_addr_parse(&addr, "127.0.0.123");
+ tt_assert(tor_addr_eq(&port_cfg->addr, &addr))
+
+ // Test failure if we can't parse anything at all
+ tor_free(config_port_invalid);
+ smartlist_clear(slout);
+ config_port_invalid = mock_config_line("DNSPort", "something wrong");
+ ret = parse_port_config(slout, config_port_invalid, NULL, "DNS", 0,
+ "127.0.0.46", 0, 0);
+ tt_int_op(ret, OP_EQ, -1);
+
+ // Test failure if we find both an address, a port and an auto
+ tor_free(config_port_invalid);
+ smartlist_clear(slout);
+ config_port_invalid = mock_config_line("DNSPort", "127.0.1.0:123:auto");
+ ret = parse_port_config(slout, config_port_invalid, NULL, "DNS", 0,
+ "127.0.0.46", 0, 0);
+ tt_int_op(ret, OP_EQ, -1);
+
+ // Test that default to group writeable default sets group writeable for
+ // domain socket
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "unix:/tmp/somewhere");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS",
+ CONN_TYPE_AP_LISTENER, "127.0.0.46", 0,
+ CL_PORT_DFLT_GROUP_WRITABLE);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->is_group_writable, OP_EQ, 1);
+
+ done:
+ smartlist_free(slout);
+ tor_free(config_port_invalid);
+ tor_free(config_port_valid);
+}
+
+static void
+test_config_parse_port_config__ports__server_options(void *data)
+{
+ (void)data;
+ int ret;
+ smartlist_t *slout = NULL;
+ port_cfg_t *port_cfg = NULL;
+ config_line_t *config_port_invalid = NULL, *config_port_valid = NULL;
+
+ slout = smartlist_new();
+
+ // Test success with NoAdvertise option
+ tor_free(config_port_valid);
+ config_port_valid = mock_config_line("DNSPort",
+ "127.0.0.124:656 NoAdvertise");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS", 0, NULL, 0,
+ CL_PORT_SERVER_OPTIONS);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->server_cfg.no_advertise, OP_EQ, 1);
+ tt_int_op(port_cfg->server_cfg.no_listen, OP_EQ, 0);
+
+ // Test success with NoListen option
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "127.0.0.124:656 NoListen");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS", 0, NULL, 0,
+ CL_PORT_SERVER_OPTIONS);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->server_cfg.no_advertise, OP_EQ, 0);
+ tt_int_op(port_cfg->server_cfg.no_listen, OP_EQ, 1);
+
+ // Test failure with both NoAdvertise and NoListen option
+ tor_free(config_port_invalid);
+ smartlist_clear(slout);
+ config_port_invalid = mock_config_line("DNSPort", "127.0.0.124:656 NoListen "
+ "NoAdvertise");
+ ret = parse_port_config(slout, config_port_invalid, NULL, "DNS", 0, NULL,
+ 0, CL_PORT_SERVER_OPTIONS);
+ tt_int_op(ret, OP_EQ, -1);
+
+ // Test success with IPv4Only
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "127.0.0.124:656 IPv4Only");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS", 0, NULL, 0,
+ CL_PORT_SERVER_OPTIONS);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->server_cfg.bind_ipv4_only, OP_EQ, 1);
+ tt_int_op(port_cfg->server_cfg.bind_ipv6_only, OP_EQ, 0);
+
+ // Test success with IPv6Only
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "[::1]:656 IPv6Only");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS", 0, NULL, 0,
+ CL_PORT_SERVER_OPTIONS);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+ port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
+ tt_int_op(port_cfg->server_cfg.bind_ipv4_only, OP_EQ, 0);
+ tt_int_op(port_cfg->server_cfg.bind_ipv6_only, OP_EQ, 1);
+
+ // Test failure with both IPv4Only and IPv6Only
+ tor_free(config_port_invalid);
+ smartlist_clear(slout);
+ config_port_invalid = mock_config_line("DNSPort", "127.0.0.124:656 IPv6Only "
+ "IPv4Only");
+ ret = parse_port_config(slout, config_port_invalid, NULL, "DNS", 0, NULL,
+ 0, CL_PORT_SERVER_OPTIONS);
+ tt_int_op(ret, OP_EQ, -1);
+
+ // Test success with invalid parameter
+ tor_free(config_port_valid);
+ smartlist_clear(slout);
+ config_port_valid = mock_config_line("DNSPort", "127.0.0.124:656 unknown");
+ ret = parse_port_config(slout, config_port_valid, NULL, "DNS", 0, NULL, 0,
+ CL_PORT_SERVER_OPTIONS);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(smartlist_len(slout), OP_EQ, 1);
+
+ // Test failure when asked to bind only to ipv6 but gets an ipv4 address
+ tor_free(config_port_invalid);
+ smartlist_clear(slout);
+ config_port_invalid = mock_config_line("DNSPort",
+ "127.0.0.124:656 IPv6Only");
+ ret = parse_port_config(slout, config_port_invalid, NULL, "DNS", 0, NULL,
+ 0, CL_PORT_SERVER_OPTIONS);
+ tt_int_op(ret, OP_EQ, -1);
+
+ // Test failure when asked to bind only to ipv4 but gets an ipv6 address
+ tor_free(config_port_invalid);
+ smartlist_clear(slout);
+ config_port_invalid = mock_config_line("DNSPort", "[::1]:656 IPv4Only");
+ ret = parse_port_config(slout, config_port_invalid, NULL, "DNS", 0, NULL,
+ 0, CL_PORT_SERVER_OPTIONS);
+ tt_int_op(ret, OP_EQ, -1);
+
+ done:
+ smartlist_free(slout);
+ tor_free(config_port_invalid);
+ tor_free(config_port_valid);
+}
+
#define CONFIG_TEST(name, flags) \
{ #name, test_config_ ## name, flags, NULL, NULL }
@@ -3701,6 +4556,10 @@ struct testcase_t config_tests[] = {
CONFIG_TEST(write_to_data_subdir, TT_FORK),
CONFIG_TEST(fix_my_family, 0),
CONFIG_TEST(directory_fetch, 0),
+ CONFIG_TEST(parse_port_config__listenaddress, 0),
+ CONFIG_TEST(parse_port_config__ports__no_ports_given, 0),
+ CONFIG_TEST(parse_port_config__ports__server_options, 0),
+ CONFIG_TEST(parse_port_config__ports__ports_given, 0),
END_OF_TESTCASES
};
diff --git a/src/test/test_connection.c b/src/test/test_connection.c
index f6e08fdf1f..c5ef92931d 100644
--- a/src/test/test_connection.c
+++ b/src/test/test_connection.c
@@ -182,14 +182,13 @@ test_conn_get_basic_teardown(const struct testcase_t *tc, void *arg)
conn->linked_conn->write_event = NULL;
}
- connection_free(conn->linked_conn);
- conn->linked_conn = NULL;
-
- conn->linked_conn->linked_conn = NULL;
if (!conn->linked_conn->marked_for_close) {
connection_close_immediate(conn->linked_conn);
connection_mark_for_close(conn->linked_conn);
}
+ conn->linked_conn->linked_conn = NULL;
+ connection_free(conn->linked_conn);
+ conn->linked_conn = NULL;
}
/* We didn't set the events up properly, so we can't use event_del() in
@@ -231,9 +230,10 @@ test_conn_get_rend_setup(const struct testcase_t *tc)
/* TODO: use directory_initiate_command_rend() to do this - maybe? */
conn->rend_data = tor_malloc_zero(sizeof(rend_data_t));
+ tor_assert(strlen(TEST_CONN_REND_ADDR) == REND_SERVICE_ID_LEN_BASE32);
memcpy(conn->rend_data->onion_address,
TEST_CONN_REND_ADDR,
- REND_SERVICE_ADDRESS_LEN+1);
+ REND_SERVICE_ID_LEN_BASE32+1);
conn->rend_data->hsdirs_fp = smartlist_new();
conn->base_.purpose = TEST_CONN_REND_PURPOSE;
diff --git a/src/test/test_crypto.c b/src/test/test_crypto.c
index a3bef2c6cb..fb21f3ad09 100644
--- a/src/test/test_crypto.c
+++ b/src/test/test_crypto.c
@@ -5,6 +5,7 @@
#include "orconfig.h"
#define CRYPTO_CURVE25519_PRIVATE
+#define CRYPTO_PRIVATE
#include "or.h"
#include "test.h"
#include "aes.h"
@@ -15,6 +16,7 @@
#include "ed25519_vectors.inc"
#include <openssl/evp.h>
+#include <openssl/rand.h>
extern const char AUTHORITY_SIGNKEY_3[];
extern const char AUTHORITY_SIGNKEY_A_DIGEST[];
@@ -131,6 +133,32 @@ test_crypto_rng_range(void *arg)
;
}
+/* Test for rectifying openssl RAND engine. */
+static void
+test_crypto_rng_engine(void *arg)
+{
+ (void)arg;
+ RAND_METHOD dummy_method;
+ memset(&dummy_method, 0, sizeof(dummy_method));
+
+ /* We should be a no-op if we're already on RAND_OpenSSL */
+ tt_int_op(0, ==, crypto_force_rand_ssleay());
+ tt_assert(RAND_get_rand_method() == RAND_OpenSSL());
+
+ /* We should correct the method if it's a dummy. */
+ RAND_set_rand_method(&dummy_method);
+ tt_assert(RAND_get_rand_method() == &dummy_method);
+ tt_int_op(1, ==, crypto_force_rand_ssleay());
+ tt_assert(RAND_get_rand_method() == RAND_OpenSSL());
+
+ /* Make sure we aren't calling dummy_method */
+ crypto_rand((void *) &dummy_method, sizeof(dummy_method));
+ crypto_rand((void *) &dummy_method, sizeof(dummy_method));
+
+ done:
+ ;
+}
+
/** Run unit tests for our AES functionality */
static void
test_crypto_aes(void *arg)
@@ -448,6 +476,394 @@ test_crypto_sha(void *arg)
tor_free(mem_op_hex_tmp);
}
+static void
+test_crypto_sha3(void *arg)
+{
+ crypto_digest_t *d1 = NULL, *d2 = NULL;
+ int i;
+ char data[DIGEST512_LEN];
+ char d_out1[DIGEST512_LEN], d_out2[DIGEST512_LEN];
+ char *mem_op_hex_tmp=NULL;
+ char *large = NULL;
+
+ (void)arg;
+
+ /* Test SHA3-[256,512] with a test vectors from the Keccak Code Package.
+ *
+ * NB: The code package's test vectors have length expressed in bits.
+ */
+
+ /* Len = 8, Msg = CC */
+ const uint8_t keccak_kat_msg8[] = { 0xcc };
+ i = crypto_digest256(data, (const char*)keccak_kat_msg8, 1, DIGEST_SHA3_256);
+ test_memeq_hex(data, "677035391CD3701293D385F037BA3279"
+ "6252BB7CE180B00B582DD9B20AAAD7F0");
+ tt_int_op(i, OP_EQ, 0);
+ i = crypto_digest512(data, (const char*)keccak_kat_msg8, 1, DIGEST_SHA3_512);
+ test_memeq_hex(data, "3939FCC8B57B63612542DA31A834E5DC"
+ "C36E2EE0F652AC72E02624FA2E5ADEEC"
+ "C7DD6BB3580224B4D6138706FC6E8059"
+ "7B528051230B00621CC2B22999EAA205");
+ tt_int_op(i, OP_EQ, 0);
+
+ /* Len = 24, Msg = 1F877C */
+ const uint8_t keccak_kat_msg24[] = { 0x1f, 0x87, 0x7c };
+ i = crypto_digest256(data, (const char*)keccak_kat_msg24, 3,
+ DIGEST_SHA3_256);
+ test_memeq_hex(data, "BC22345E4BD3F792A341CF18AC0789F1"
+ "C9C966712A501B19D1B6632CCD408EC5");
+ tt_int_op(i, OP_EQ, 0);
+ i = crypto_digest512(data, (const char*)keccak_kat_msg24, 3,
+ DIGEST_SHA3_512);
+ test_memeq_hex(data, "CB20DCF54955F8091111688BECCEF48C"
+ "1A2F0D0608C3A575163751F002DB30F4"
+ "0F2F671834B22D208591CFAF1F5ECFE4"
+ "3C49863A53B3225BDFD7C6591BA7658B");
+ tt_int_op(i, OP_EQ, 0);
+
+ /* Len = 1080, Msg = B771D5CEF... ...C35AC81B5 (SHA3-256 rate - 1) */
+ const uint8_t keccak_kat_msg1080[] = {
+ 0xB7, 0x71, 0xD5, 0xCE, 0xF5, 0xD1, 0xA4, 0x1A, 0x93, 0xD1,
+ 0x56, 0x43, 0xD7, 0x18, 0x1D, 0x2A, 0x2E, 0xF0, 0xA8, 0xE8,
+ 0x4D, 0x91, 0x81, 0x2F, 0x20, 0xED, 0x21, 0xF1, 0x47, 0xBE,
+ 0xF7, 0x32, 0xBF, 0x3A, 0x60, 0xEF, 0x40, 0x67, 0xC3, 0x73,
+ 0x4B, 0x85, 0xBC, 0x8C, 0xD4, 0x71, 0x78, 0x0F, 0x10, 0xDC,
+ 0x9E, 0x82, 0x91, 0xB5, 0x83, 0x39, 0xA6, 0x77, 0xB9, 0x60,
+ 0x21, 0x8F, 0x71, 0xE7, 0x93, 0xF2, 0x79, 0x7A, 0xEA, 0x34,
+ 0x94, 0x06, 0x51, 0x28, 0x29, 0x06, 0x5D, 0x37, 0xBB, 0x55,
+ 0xEA, 0x79, 0x6F, 0xA4, 0xF5, 0x6F, 0xD8, 0x89, 0x6B, 0x49,
+ 0xB2, 0xCD, 0x19, 0xB4, 0x32, 0x15, 0xAD, 0x96, 0x7C, 0x71,
+ 0x2B, 0x24, 0xE5, 0x03, 0x2D, 0x06, 0x52, 0x32, 0xE0, 0x2C,
+ 0x12, 0x74, 0x09, 0xD2, 0xED, 0x41, 0x46, 0xB9, 0xD7, 0x5D,
+ 0x76, 0x3D, 0x52, 0xDB, 0x98, 0xD9, 0x49, 0xD3, 0xB0, 0xFE,
+ 0xD6, 0xA8, 0x05, 0x2F, 0xBB,
+ };
+ i = crypto_digest256(data, (const char*)keccak_kat_msg1080, 135,
+ DIGEST_SHA3_256);
+ test_memeq_hex(data, "A19EEE92BB2097B64E823D597798AA18"
+ "BE9B7C736B8059ABFD6779AC35AC81B5");
+ tt_int_op(i, OP_EQ, 0);
+ i = crypto_digest512(data, (const char*)keccak_kat_msg1080, 135,
+ DIGEST_SHA3_512);
+ test_memeq_hex(data, "7575A1FB4FC9A8F9C0466BD5FCA496D1"
+ "CB78696773A212A5F62D02D14E3259D1"
+ "92A87EBA4407DD83893527331407B6DA"
+ "DAAD920DBC46489B677493CE5F20B595");
+ tt_int_op(i, OP_EQ, 0);
+
+ /* Len = 1088, Msg = B32D95B0... ...8E380C04 (SHA3-256 rate) */
+ const uint8_t keccak_kat_msg1088[] = {
+ 0xB3, 0x2D, 0x95, 0xB0, 0xB9, 0xAA, 0xD2, 0xA8, 0x81, 0x6D,
+ 0xE6, 0xD0, 0x6D, 0x1F, 0x86, 0x00, 0x85, 0x05, 0xBD, 0x8C,
+ 0x14, 0x12, 0x4F, 0x6E, 0x9A, 0x16, 0x3B, 0x5A, 0x2A, 0xDE,
+ 0x55, 0xF8, 0x35, 0xD0, 0xEC, 0x38, 0x80, 0xEF, 0x50, 0x70,
+ 0x0D, 0x3B, 0x25, 0xE4, 0x2C, 0xC0, 0xAF, 0x05, 0x0C, 0xCD,
+ 0x1B, 0xE5, 0xE5, 0x55, 0xB2, 0x30, 0x87, 0xE0, 0x4D, 0x7B,
+ 0xF9, 0x81, 0x36, 0x22, 0x78, 0x0C, 0x73, 0x13, 0xA1, 0x95,
+ 0x4F, 0x87, 0x40, 0xB6, 0xEE, 0x2D, 0x3F, 0x71, 0xF7, 0x68,
+ 0xDD, 0x41, 0x7F, 0x52, 0x04, 0x82, 0xBD, 0x3A, 0x08, 0xD4,
+ 0xF2, 0x22, 0xB4, 0xEE, 0x9D, 0xBD, 0x01, 0x54, 0x47, 0xB3,
+ 0x35, 0x07, 0xDD, 0x50, 0xF3, 0xAB, 0x42, 0x47, 0xC5, 0xDE,
+ 0x9A, 0x8A, 0xBD, 0x62, 0xA8, 0xDE, 0xCE, 0xA0, 0x1E, 0x3B,
+ 0x87, 0xC8, 0xB9, 0x27, 0xF5, 0xB0, 0x8B, 0xEB, 0x37, 0x67,
+ 0x4C, 0x6F, 0x8E, 0x38, 0x0C, 0x04,
+ };
+ i = crypto_digest256(data, (const char*)keccak_kat_msg1088, 136,
+ DIGEST_SHA3_256);
+ test_memeq_hex(data, "DF673F4105379FF6B755EEAB20CEB0DC"
+ "77B5286364FE16C59CC8A907AFF07732");
+ tt_int_op(i, OP_EQ, 0);
+ i = crypto_digest512(data, (const char*)keccak_kat_msg1088, 136,
+ DIGEST_SHA3_512);
+ test_memeq_hex(data, "2E293765022D48996CE8EFF0BE54E87E"
+ "FB94A14C72DE5ACD10D0EB5ECE029CAD"
+ "FA3BA17A40B2FFA2163991B17786E51C"
+ "ABA79E5E0FFD34CF085E2A098BE8BACB");
+ tt_int_op(i, OP_EQ, 0);
+
+ /* Len = 1096, Msg = 04410E310... ...601016A0D (SHA3-256 rate + 1) */
+ const uint8_t keccak_kat_msg1096[] = {
+ 0x04, 0x41, 0x0E, 0x31, 0x08, 0x2A, 0x47, 0x58, 0x4B, 0x40,
+ 0x6F, 0x05, 0x13, 0x98, 0xA6, 0xAB, 0xE7, 0x4E, 0x4D, 0xA5,
+ 0x9B, 0xB6, 0xF8, 0x5E, 0x6B, 0x49, 0xE8, 0xA1, 0xF7, 0xF2,
+ 0xCA, 0x00, 0xDF, 0xBA, 0x54, 0x62, 0xC2, 0xCD, 0x2B, 0xFD,
+ 0xE8, 0xB6, 0x4F, 0xB2, 0x1D, 0x70, 0xC0, 0x83, 0xF1, 0x13,
+ 0x18, 0xB5, 0x6A, 0x52, 0xD0, 0x3B, 0x81, 0xCA, 0xC5, 0xEE,
+ 0xC2, 0x9E, 0xB3, 0x1B, 0xD0, 0x07, 0x8B, 0x61, 0x56, 0x78,
+ 0x6D, 0xA3, 0xD6, 0xD8, 0xC3, 0x30, 0x98, 0xC5, 0xC4, 0x7B,
+ 0xB6, 0x7A, 0xC6, 0x4D, 0xB1, 0x41, 0x65, 0xAF, 0x65, 0xB4,
+ 0x45, 0x44, 0xD8, 0x06, 0xDD, 0xE5, 0xF4, 0x87, 0xD5, 0x37,
+ 0x3C, 0x7F, 0x97, 0x92, 0xC2, 0x99, 0xE9, 0x68, 0x6B, 0x7E,
+ 0x58, 0x21, 0xE7, 0xC8, 0xE2, 0x45, 0x83, 0x15, 0xB9, 0x96,
+ 0xB5, 0x67, 0x7D, 0x92, 0x6D, 0xAC, 0x57, 0xB3, 0xF2, 0x2D,
+ 0xA8, 0x73, 0xC6, 0x01, 0x01, 0x6A, 0x0D,
+ };
+ i = crypto_digest256(data, (const char*)keccak_kat_msg1096, 137,
+ DIGEST_SHA3_256);
+ test_memeq_hex(data, "D52432CF3B6B4B949AA848E058DCD62D"
+ "735E0177279222E7AC0AF8504762FAA0");
+ tt_int_op(i, OP_EQ, 0);
+ i = crypto_digest512(data, (const char*)keccak_kat_msg1096, 137,
+ DIGEST_SHA3_512);
+ test_memeq_hex(data, "BE8E14B6757FFE53C9B75F6DDE9A7B6C"
+ "40474041DE83D4A60645A826D7AF1ABE"
+ "1EEFCB7B74B62CA6A514E5F2697D585B"
+ "FECECE12931BBE1D4ED7EBF7B0BE660E");
+ tt_int_op(i, OP_EQ, 0);
+
+ /* Len = 1144, Msg = EA40E83C... ...66DFAFEC (SHA3-512 rate *2 - 1) */
+ const uint8_t keccak_kat_msg1144[] = {
+ 0xEA, 0x40, 0xE8, 0x3C, 0xB1, 0x8B, 0x3A, 0x24, 0x2C, 0x1E,
+ 0xCC, 0x6C, 0xCD, 0x0B, 0x78, 0x53, 0xA4, 0x39, 0xDA, 0xB2,
+ 0xC5, 0x69, 0xCF, 0xC6, 0xDC, 0x38, 0xA1, 0x9F, 0x5C, 0x90,
+ 0xAC, 0xBF, 0x76, 0xAE, 0xF9, 0xEA, 0x37, 0x42, 0xFF, 0x3B,
+ 0x54, 0xEF, 0x7D, 0x36, 0xEB, 0x7C, 0xE4, 0xFF, 0x1C, 0x9A,
+ 0xB3, 0xBC, 0x11, 0x9C, 0xFF, 0x6B, 0xE9, 0x3C, 0x03, 0xE2,
+ 0x08, 0x78, 0x33, 0x35, 0xC0, 0xAB, 0x81, 0x37, 0xBE, 0x5B,
+ 0x10, 0xCD, 0xC6, 0x6F, 0xF3, 0xF8, 0x9A, 0x1B, 0xDD, 0xC6,
+ 0xA1, 0xEE, 0xD7, 0x4F, 0x50, 0x4C, 0xBE, 0x72, 0x90, 0x69,
+ 0x0B, 0xB2, 0x95, 0xA8, 0x72, 0xB9, 0xE3, 0xFE, 0x2C, 0xEE,
+ 0x9E, 0x6C, 0x67, 0xC4, 0x1D, 0xB8, 0xEF, 0xD7, 0xD8, 0x63,
+ 0xCF, 0x10, 0xF8, 0x40, 0xFE, 0x61, 0x8E, 0x79, 0x36, 0xDA,
+ 0x3D, 0xCA, 0x5C, 0xA6, 0xDF, 0x93, 0x3F, 0x24, 0xF6, 0x95,
+ 0x4B, 0xA0, 0x80, 0x1A, 0x12, 0x94, 0xCD, 0x8D, 0x7E, 0x66,
+ 0xDF, 0xAF, 0xEC,
+ };
+ i = crypto_digest512(data, (const char*)keccak_kat_msg1144, 143,
+ DIGEST_SHA3_512);
+ test_memeq_hex(data, "3A8E938C45F3F177991296B24565D9A6"
+ "605516615D96A062C8BE53A0D6C5A648"
+ "7BE35D2A8F3CF6620D0C2DBA2C560D68"
+ "295F284BE7F82F3B92919033C9CE5D80");
+ tt_int_op(i, OP_EQ, 0);
+ i = crypto_digest256(data, (const char*)keccak_kat_msg1144, 143,
+ DIGEST_SHA3_256);
+ test_memeq_hex(data, "E58A947E98D6DD7E932D2FE02D9992E6"
+ "118C0C2C606BDCDA06E7943D2C95E0E5");
+ tt_int_op(i, OP_EQ, 0);
+
+ /* Len = 1152, Msg = 157D5B7E... ...79EE00C63 (SHA3-512 rate * 2) */
+ const uint8_t keccak_kat_msg1152[] = {
+ 0x15, 0x7D, 0x5B, 0x7E, 0x45, 0x07, 0xF6, 0x6D, 0x9A, 0x26,
+ 0x74, 0x76, 0xD3, 0x38, 0x31, 0xE7, 0xBB, 0x76, 0x8D, 0x4D,
+ 0x04, 0xCC, 0x34, 0x38, 0xDA, 0x12, 0xF9, 0x01, 0x02, 0x63,
+ 0xEA, 0x5F, 0xCA, 0xFB, 0xDE, 0x25, 0x79, 0xDB, 0x2F, 0x6B,
+ 0x58, 0xF9, 0x11, 0xD5, 0x93, 0xD5, 0xF7, 0x9F, 0xB0, 0x5F,
+ 0xE3, 0x59, 0x6E, 0x3F, 0xA8, 0x0F, 0xF2, 0xF7, 0x61, 0xD1,
+ 0xB0, 0xE5, 0x70, 0x80, 0x05, 0x5C, 0x11, 0x8C, 0x53, 0xE5,
+ 0x3C, 0xDB, 0x63, 0x05, 0x52, 0x61, 0xD7, 0xC9, 0xB2, 0xB3,
+ 0x9B, 0xD9, 0x0A, 0xCC, 0x32, 0x52, 0x0C, 0xBB, 0xDB, 0xDA,
+ 0x2C, 0x4F, 0xD8, 0x85, 0x6D, 0xBC, 0xEE, 0x17, 0x31, 0x32,
+ 0xA2, 0x67, 0x91, 0x98, 0xDA, 0xF8, 0x30, 0x07, 0xA9, 0xB5,
+ 0xC5, 0x15, 0x11, 0xAE, 0x49, 0x76, 0x6C, 0x79, 0x2A, 0x29,
+ 0x52, 0x03, 0x88, 0x44, 0x4E, 0xBE, 0xFE, 0x28, 0x25, 0x6F,
+ 0xB3, 0x3D, 0x42, 0x60, 0x43, 0x9C, 0xBA, 0x73, 0xA9, 0x47,
+ 0x9E, 0xE0, 0x0C, 0x63,
+ };
+ i = crypto_digest512(data, (const char*)keccak_kat_msg1152, 144,
+ DIGEST_SHA3_512);
+ test_memeq_hex(data, "FE45289874879720CE2A844AE34BB735"
+ "22775DCB6019DCD22B8885994672A088"
+ "9C69E8115C641DC8B83E39F7311815A1"
+ "64DC46E0BA2FCA344D86D4BC2EF2532C");
+ tt_int_op(i, OP_EQ, 0);
+ i = crypto_digest256(data, (const char*)keccak_kat_msg1152, 144,
+ DIGEST_SHA3_256);
+ test_memeq_hex(data, "A936FB9AF87FB67857B3EAD5C76226AD"
+ "84DA47678F3C2FFE5A39FDB5F7E63FFB");
+ tt_int_op(i, OP_EQ, 0);
+
+ /* Len = 1160, Msg = 836B34B5... ...11044C53 (SHA3-512 rate * 2 + 1) */
+ const uint8_t keccak_kat_msg1160[] = {
+ 0x83, 0x6B, 0x34, 0xB5, 0x15, 0x47, 0x6F, 0x61, 0x3F, 0xE4,
+ 0x47, 0xA4, 0xE0, 0xC3, 0xF3, 0xB8, 0xF2, 0x09, 0x10, 0xAC,
+ 0x89, 0xA3, 0x97, 0x70, 0x55, 0xC9, 0x60, 0xD2, 0xD5, 0xD2,
+ 0xB7, 0x2B, 0xD8, 0xAC, 0xC7, 0x15, 0xA9, 0x03, 0x53, 0x21,
+ 0xB8, 0x67, 0x03, 0xA4, 0x11, 0xDD, 0xE0, 0x46, 0x6D, 0x58,
+ 0xA5, 0x97, 0x69, 0x67, 0x2A, 0xA6, 0x0A, 0xD5, 0x87, 0xB8,
+ 0x48, 0x1D, 0xE4, 0xBB, 0xA5, 0x52, 0xA1, 0x64, 0x57, 0x79,
+ 0x78, 0x95, 0x01, 0xEC, 0x53, 0xD5, 0x40, 0xB9, 0x04, 0x82,
+ 0x1F, 0x32, 0xB0, 0xBD, 0x18, 0x55, 0xB0, 0x4E, 0x48, 0x48,
+ 0xF9, 0xF8, 0xCF, 0xE9, 0xEB, 0xD8, 0x91, 0x1B, 0xE9, 0x57,
+ 0x81, 0xA7, 0x59, 0xD7, 0xAD, 0x97, 0x24, 0xA7, 0x10, 0x2D,
+ 0xBE, 0x57, 0x67, 0x76, 0xB7, 0xC6, 0x32, 0xBC, 0x39, 0xB9,
+ 0xB5, 0xE1, 0x90, 0x57, 0xE2, 0x26, 0x55, 0x2A, 0x59, 0x94,
+ 0xC1, 0xDB, 0xB3, 0xB5, 0xC7, 0x87, 0x1A, 0x11, 0xF5, 0x53,
+ 0x70, 0x11, 0x04, 0x4C, 0x53,
+ };
+ i = crypto_digest512(data, (const char*)keccak_kat_msg1160, 145,
+ DIGEST_SHA3_512);
+ test_memeq_hex(data, "AFF61C6E11B98E55AC213B1A0BC7DE04"
+ "05221AC5EFB1229842E4614F4A029C9B"
+ "D14A0ED7FD99AF3681429F3F309FDB53"
+ "166AA9A3CD9F1F1223D04B4A9015E94A");
+ tt_int_op(i, OP_EQ, 0);
+ i = crypto_digest256(data, (const char*)keccak_kat_msg1160, 145,
+ DIGEST_SHA3_256);
+ test_memeq_hex(data, "3A654B88F88086C2751EDAE6D3924814"
+ "3CF6235C6B0B7969342C45A35194B67E");
+ tt_int_op(i, OP_EQ, 0);
+
+ /* SHA3-[256,512] Empty case (wikipedia) */
+ i = crypto_digest256(data, "", 0, DIGEST_SHA3_256);
+ test_memeq_hex(data, "a7ffc6f8bf1ed76651c14756a061d662"
+ "f580ff4de43b49fa82d80a4b80f8434a");
+ tt_int_op(i, OP_EQ, 0);
+ i = crypto_digest512(data, "", 0, DIGEST_SHA3_512);
+ test_memeq_hex(data, "a69f73cca23a9ac5c8b567dc185a756e"
+ "97c982164fe25859e0d1dcc1475c80a6"
+ "15b2123af1f5f94c11e3e9402c3ac558"
+ "f500199d95b6d3e301758586281dcd26");
+ tt_int_op(i, OP_EQ, 0);
+
+ /* Incremental digest code with SHA3-256 */
+ d1 = crypto_digest256_new(DIGEST_SHA3_256);
+ tt_assert(d1);
+ crypto_digest_add_bytes(d1, "abcdef", 6);
+ d2 = crypto_digest_dup(d1);
+ tt_assert(d2);
+ crypto_digest_add_bytes(d2, "ghijkl", 6);
+ crypto_digest_get_digest(d2, d_out1, DIGEST256_LEN);
+ crypto_digest256(d_out2, "abcdefghijkl", 12, DIGEST_SHA3_256);
+ tt_mem_op(d_out1,OP_EQ, d_out2, DIGEST256_LEN);
+ crypto_digest_assign(d2, d1);
+ crypto_digest_add_bytes(d2, "mno", 3);
+ crypto_digest_get_digest(d2, d_out1, DIGEST256_LEN);
+ crypto_digest256(d_out2, "abcdefmno", 9, DIGEST_SHA3_256);
+ tt_mem_op(d_out1,OP_EQ, d_out2, DIGEST256_LEN);
+ crypto_digest_get_digest(d1, d_out1, DIGEST256_LEN);
+ crypto_digest256(d_out2, "abcdef", 6, DIGEST_SHA3_256);
+ tt_mem_op(d_out1,OP_EQ, d_out2, DIGEST256_LEN);
+ crypto_digest_free(d1);
+ crypto_digest_free(d2);
+
+ /* Incremental digest code with SHA3-512 */
+ d1 = crypto_digest512_new(DIGEST_SHA3_512);
+ tt_assert(d1);
+ crypto_digest_add_bytes(d1, "abcdef", 6);
+ d2 = crypto_digest_dup(d1);
+ tt_assert(d2);
+ crypto_digest_add_bytes(d2, "ghijkl", 6);
+ crypto_digest_get_digest(d2, d_out1, DIGEST512_LEN);
+ crypto_digest512(d_out2, "abcdefghijkl", 12, DIGEST_SHA3_512);
+ tt_mem_op(d_out1,OP_EQ, d_out2, DIGEST512_LEN);
+ crypto_digest_assign(d2, d1);
+ crypto_digest_add_bytes(d2, "mno", 3);
+ crypto_digest_get_digest(d2, d_out1, DIGEST512_LEN);
+ crypto_digest512(d_out2, "abcdefmno", 9, DIGEST_SHA3_512);
+ tt_mem_op(d_out1,OP_EQ, d_out2, DIGEST512_LEN);
+ crypto_digest_get_digest(d1, d_out1, DIGEST512_LEN);
+ crypto_digest512(d_out2, "abcdef", 6, DIGEST_SHA3_512);
+ tt_mem_op(d_out1,OP_EQ, d_out2, DIGEST512_LEN);
+ crypto_digest_free(d1);
+
+ /* Attempt to exercise the incremental hashing code by creating a randomized
+ * 100 KiB buffer, and hashing rand[1, 5 * Rate] bytes at a time. SHA3-512
+ * is used because it has a lowest rate of the family (the code is common,
+ * but the slower rate exercises more of it).
+ */
+ const size_t bufsz = 100 * 1024;
+ size_t j = 0;
+ large = tor_malloc(bufsz);
+ crypto_rand(large, bufsz);
+ d1 = crypto_digest512_new(DIGEST_SHA3_512); /* Running digest. */
+ while (j < bufsz) {
+ /* Pick how much data to add to the running digest. */
+ size_t incr = (size_t)crypto_rand_int_range(1, 72 * 5);
+ incr = MIN(bufsz - j, incr);
+
+ /* Add the data, and calculate the hash. */
+ crypto_digest_add_bytes(d1, large + j, incr);
+ crypto_digest_get_digest(d1, d_out1, DIGEST512_LEN);
+
+ /* One-shot hash the buffer up to the data that was just added,
+ * and ensure that the values match up.
+ *
+ * XXX/yawning: If this actually fails, it'll be rather difficult to
+ * reproduce. Improvements welcome.
+ */
+ i = crypto_digest512(d_out2, large, j + incr, DIGEST_SHA3_512);
+ tt_int_op(i, OP_EQ, 0);
+ tt_mem_op(d_out1, OP_EQ, d_out2, DIGEST512_LEN);
+
+ j += incr;
+ }
+
+ done:
+ if (d1)
+ crypto_digest_free(d1);
+ if (d2)
+ crypto_digest_free(d2);
+ tor_free(large);
+ tor_free(mem_op_hex_tmp);
+}
+
+/** Run unit tests for our XOF. */
+static void
+test_crypto_sha3_xof(void *arg)
+{
+ uint8_t msg[255];
+ uint8_t out[512];
+ crypto_xof_t *xof;
+ char *mem_op_hex_tmp=NULL;
+
+ (void)arg;
+
+ /* SHAKE256 test vector (Len = 2040) from the Keccak Code Package. */
+ base16_decode((char *)msg, 255,
+ "3A3A819C48EFDE2AD914FBF00E18AB6BC4F14513AB27D0C178A188B61431"
+ "E7F5623CB66B23346775D386B50E982C493ADBBFC54B9A3CD383382336A1"
+ "A0B2150A15358F336D03AE18F666C7573D55C4FD181C29E6CCFDE63EA35F"
+ "0ADF5885CFC0A3D84A2B2E4DD24496DB789E663170CEF74798AA1BBCD457"
+ "4EA0BBA40489D764B2F83AADC66B148B4A0CD95246C127D5871C4F114186"
+ "90A5DDF01246A0C80A43C70088B6183639DCFDA4125BD113A8F49EE23ED3"
+ "06FAAC576C3FB0C1E256671D817FC2534A52F5B439F72E424DE376F4C565"
+ "CCA82307DD9EF76DA5B7C4EB7E085172E328807C02D011FFBF33785378D7"
+ "9DC266F6A5BE6BB0E4A92ECEEBAEB1", 510);
+ const char *squeezed_hex =
+ "8A5199B4A7E133E264A86202720655894D48CFF344A928CF8347F48379CE"
+ "F347DFC5BCFFAB99B27B1F89AA2735E23D30088FFA03B9EDB02B9635470A"
+ "B9F1038985D55F9CA774572DD006470EA65145469609F9FA0831BF1FFD84"
+ "2DC24ACADE27BD9816E3B5BF2876CB112232A0EB4475F1DFF9F5C713D9FF"
+ "D4CCB89AE5607FE35731DF06317949EEF646E9591CF3BE53ADD6B7DD2B60"
+ "96E2B3FB06E662EC8B2D77422DAAD9463CD155204ACDBD38E319613F39F9"
+ "9B6DFB35CA9365160066DB19835888C2241FF9A731A4ACBB5663727AAC34"
+ "A401247FBAA7499E7D5EE5B69D31025E63D04C35C798BCA1262D5673A9CF"
+ "0930B5AD89BD485599DC184528DA4790F088EBD170B635D9581632D2FF90"
+ "DB79665CED430089AF13C9F21F6D443A818064F17AEC9E9C5457001FA8DC"
+ "6AFBADBE3138F388D89D0E6F22F66671255B210754ED63D81DCE75CE8F18"
+ "9B534E6D6B3539AA51E837C42DF9DF59C71E6171CD4902FE1BDC73FB1775"
+ "B5C754A1ED4EA7F3105FC543EE0418DAD256F3F6118EA77114A16C15355B"
+ "42877A1DB2A7DF0E155AE1D8670ABCEC3450F4E2EEC9838F895423EF63D2"
+ "61138BAAF5D9F104CB5A957AEA06C0B9B8C78B0D441796DC0350DDEABB78"
+ "A33B6F1F9E68EDE3D1805C7B7E2CFD54E0FAD62F0D8CA67A775DC4546AF9"
+ "096F2EDB221DB42843D65327861282DC946A0BA01A11863AB2D1DFD16E39"
+ "73D4";
+
+ /* Test oneshot absorb/squeeze. */
+ xof = crypto_xof_new();
+ tt_assert(xof);
+ crypto_xof_add_bytes(xof, msg, sizeof(msg));
+ crypto_xof_squeeze_bytes(xof, out, sizeof(out));
+ test_memeq_hex(out, squeezed_hex);
+ crypto_xof_free(xof);
+ memset(out, 0, sizeof(out));
+
+ /* Test incremental absorb/squeeze. */
+ xof = crypto_xof_new();
+ tt_assert(xof);
+ for (size_t i = 0; i < sizeof(msg); i++)
+ crypto_xof_add_bytes(xof, msg + i, 1);
+ for (size_t i = 0; i < sizeof(out); i++)
+ crypto_xof_squeeze_bytes(xof, out + i, 1);
+ test_memeq_hex(out, squeezed_hex);
+
+ done:
+ if (xof)
+ crypto_xof_free(xof);
+ tor_free(mem_op_hex_tmp);
+}
+
/** Run unit tests for our public key crypto functions */
static void
test_crypto_pk(void *arg)
@@ -1300,6 +1716,24 @@ test_crypto_curve25519_persist(void *arg)
tor_free(tag);
}
+static void *
+ed25519_testcase_setup(const struct testcase_t *testcase)
+{
+ crypto_ed25519_testing_force_impl(testcase->setup_data);
+ return testcase->setup_data;
+}
+static int
+ed25519_testcase_cleanup(const struct testcase_t *testcase, void *ptr)
+{
+ (void)testcase;
+ (void)ptr;
+ crypto_ed25519_testing_restore_impl();
+ return 1;
+}
+static const struct testcase_setup_t ed25519_test_setup = {
+ ed25519_testcase_setup, ed25519_testcase_cleanup
+};
+
static void
test_crypto_ed25519_simple(void *arg)
{
@@ -1939,10 +2373,19 @@ test_crypto_failure_modes(void *arg)
#define CRYPTO_LEGACY(name) \
{ #name, test_crypto_ ## name , 0, NULL, NULL }
+#define ED25519_TEST_ONE(name, fl, which) \
+ { #name "/ed25519_" which, test_crypto_ed25519_ ## name, (fl), \
+ &ed25519_test_setup, (void*)which }
+
+#define ED25519_TEST(name, fl) \
+ ED25519_TEST_ONE(name, (fl), "donna"), \
+ ED25519_TEST_ONE(name, (fl), "ref10")
+
struct testcase_t crypto_tests[] = {
CRYPTO_LEGACY(formats),
CRYPTO_LEGACY(rng),
{ "rng_range", test_crypto_rng_range, 0, NULL, NULL },
+ { "rng_engine", test_crypto_rng_engine, TT_FORK, NULL, NULL },
{ "aes_AES", test_crypto_aes, TT_FORK, &passthrough_setup, (void*)"aes" },
{ "aes_EVP", test_crypto_aes, TT_FORK, &passthrough_setup, (void*)"evp" },
CRYPTO_LEGACY(sha),
@@ -1950,6 +2393,8 @@ struct testcase_t crypto_tests[] = {
{ "pk_fingerprints", test_crypto_pk_fingerprints, TT_FORK, NULL, NULL },
{ "pk_base64", test_crypto_pk_base64, TT_FORK, NULL, NULL },
CRYPTO_LEGACY(digests),
+ { "sha3", test_crypto_sha3, TT_FORK, NULL, NULL},
+ { "sha3_xof", test_crypto_sha3_xof, TT_FORK, NULL, NULL},
CRYPTO_LEGACY(dh),
{ "aes_iv_AES", test_crypto_aes_iv, TT_FORK, &passthrough_setup,
(void*)"aes" },
@@ -1965,14 +2410,13 @@ struct testcase_t crypto_tests[] = {
{ "curve25519_wrappers", test_crypto_curve25519_wrappers, 0, NULL, NULL },
{ "curve25519_encode", test_crypto_curve25519_encode, 0, NULL, NULL },
{ "curve25519_persist", test_crypto_curve25519_persist, 0, NULL, NULL },
- { "ed25519_simple", test_crypto_ed25519_simple, 0, NULL, NULL },
- { "ed25519_test_vectors", test_crypto_ed25519_test_vectors, 0, NULL, NULL },
- { "ed25519_encode", test_crypto_ed25519_encode, 0, NULL, NULL },
- { "ed25519_convert", test_crypto_ed25519_convert, 0, NULL, NULL },
- { "ed25519_blinding", test_crypto_ed25519_blinding, 0, NULL, NULL },
- { "ed25519_testvectors", test_crypto_ed25519_testvectors, 0, NULL, NULL },
- { "ed25519_fuzz_donna", test_crypto_ed25519_fuzz_donna, TT_FORK, NULL,
- NULL },
+ ED25519_TEST(simple, 0),
+ ED25519_TEST(test_vectors, 0),
+ ED25519_TEST(encode, 0),
+ ED25519_TEST(convert, 0),
+ ED25519_TEST(blinding, 0),
+ ED25519_TEST(testvectors, 0),
+ ED25519_TEST(fuzz_donna, TT_FORK),
{ "siphash", test_crypto_siphash, 0, NULL, NULL },
{ "failure_modes", test_crypto_failure_modes, TT_FORK, NULL, NULL },
END_OF_TESTCASES
diff --git a/src/test/test_dir.c b/src/test/test_dir.c
index ce639b644f..05fbe0a4f6 100644
--- a/src/test/test_dir.c
+++ b/src/test/test_dir.c
@@ -6,19 +6,24 @@
#include "orconfig.h"
#include <math.h>
+#define CONFIG_PRIVATE
#define DIRSERV_PRIVATE
#define DIRVOTE_PRIVATE
#define ROUTER_PRIVATE
#define ROUTERLIST_PRIVATE
#define HIBERNATE_PRIVATE
#define NETWORKSTATUS_PRIVATE
+#define RELAY_PRIVATE
+
#include "or.h"
+#include "confparse.h"
#include "config.h"
#include "crypto_ed25519.h"
#include "directory.h"
#include "dirserv.h"
#include "dirvote.h"
#include "hibernate.h"
+#include "memarea.h"
#include "networkstatus.h"
#include "router.h"
#include "routerkeys.h"
@@ -26,7 +31,11 @@
#include "routerparse.h"
#include "routerset.h"
#include "test.h"
+#include "test_dir_common.h"
#include "torcert.h"
+#include "relay.h"
+
+#define NS_MODULE dir
static void
test_dir_nicknames(void *arg)
@@ -110,6 +119,7 @@ test_dir_formats(void *arg)
r1->cache_info.published_on = 0;
r1->or_port = 9000;
r1->dir_port = 9003;
+ r1->supports_tunnelled_dir_requests = 1;
tor_addr_parse(&r1->ipv6_addr, "1:2:3:4::");
r1->ipv6_orport = 9999;
r1->onion_pkey = crypto_pk_dup_key(pk1);
@@ -154,6 +164,7 @@ test_dir_formats(void *arg)
r2->cache_info.published_on = 5;
r2->or_port = 9005;
r2->dir_port = 0;
+ r2->supports_tunnelled_dir_requests = 1;
r2->onion_pkey = crypto_pk_dup_key(pk2);
curve25519_keypair_t r2_onion_keypair;
curve25519_keypair_generate(&r2_onion_keypair, 0);
@@ -174,7 +185,9 @@ test_dir_formats(void *arg)
/* XXXX025 router_dump_to_string should really take this from ri.*/
options->ContactInfo = tor_strdup("Magri White "
"<magri@elsewhere.example.com>");
+
buf = router_dump_router_to_string(r1, pk2, NULL, NULL, NULL);
+
tor_free(options->ContactInfo);
tt_assert(buf);
@@ -200,7 +213,8 @@ test_dir_formats(void *arg)
strlcat(buf2, "hidden-service-dir\n", sizeof(buf2));
strlcat(buf2, "contact Magri White <magri@elsewhere.example.com>\n",
sizeof(buf2));
- strlcat(buf2, "reject *:*\nrouter-signature\n", sizeof(buf2));
+ strlcat(buf2, "reject *:*\n", sizeof(buf2));
+ strlcat(buf2, "tunnelled-dir-server\nrouter-signature\n", sizeof(buf2));
buf[strlen(buf2)] = '\0'; /* Don't compare the sig; it's never the same
* twice */
@@ -214,12 +228,13 @@ test_dir_formats(void *arg)
tt_assert(rp1);
tt_int_op(rp1->addr,OP_EQ, r1->addr);
tt_int_op(rp1->or_port,OP_EQ, r1->or_port);
- //test_eq(rp1->dir_port, r1->dir_port);
+ tt_int_op(rp1->dir_port,OP_EQ, r1->dir_port);
tt_int_op(rp1->bandwidthrate,OP_EQ, r1->bandwidthrate);
tt_int_op(rp1->bandwidthburst,OP_EQ, r1->bandwidthburst);
tt_int_op(rp1->bandwidthcapacity,OP_EQ, r1->bandwidthcapacity);
tt_assert(crypto_pk_cmp_keys(rp1->onion_pkey, pk1) == 0);
tt_assert(crypto_pk_cmp_keys(rp1->identity_pkey, pk2) == 0);
+ tt_assert(rp1->supports_tunnelled_dir_requests);
//tt_assert(rp1->exit_policy == NULL);
tor_free(buf);
@@ -290,6 +305,7 @@ test_dir_formats(void *arg)
BASE64_ENCODE_MULTILINE);
strlcat(buf2, cert_buf, sizeof(buf2));
strlcat(buf2, "accept *:80\nreject 18.0.0.0/8:24\n", sizeof(buf2));
+ strlcat(buf2, "tunnelled-dir-server\n", sizeof(buf2));
strlcat(buf2, "router-sig-ed25519 ", sizeof(buf2));
buf = router_dump_router_to_string(r2, pk1, pk2, &r2_onion_keypair, &kp2);
@@ -301,6 +317,8 @@ test_dir_formats(void *arg)
tor_free(buf);
buf = router_dump_router_to_string(r2, pk1, NULL, NULL, NULL);
+
+ /* Reset for later */
cp = buf;
rp2 = router_parse_entry_from_string((const char*)cp,NULL,1,0,NULL,NULL);
tt_assert(rp2);
@@ -315,6 +333,7 @@ test_dir_formats(void *arg)
CURVE25519_PUBKEY_LEN);
tt_assert(crypto_pk_cmp_keys(rp2->onion_pkey, pk2) == 0);
tt_assert(crypto_pk_cmp_keys(rp2->identity_pkey, pk1) == 0);
+ tt_assert(rp2->supports_tunnelled_dir_requests);
tt_int_op(smartlist_len(rp2->exit_policy),OP_EQ, 2);
@@ -478,6 +497,7 @@ test_dir_routerinfo_parsing(void *arg)
#undef CHECK_FAIL
#undef CHECK_OK
done:
+ memarea_clear_freelist();
routerinfo_free(ri);
}
@@ -580,6 +600,8 @@ test_dir_extrainfo_parsing(void *arg)
#undef CHECK_FAIL
done:
+ escaped(NULL);
+ memarea_clear_freelist();
extrainfo_free(ei);
routerinfo_free(ri);
digestmap_free((digestmap_t*)map, routerinfo_free_wrapper_);
@@ -1477,13 +1499,6 @@ test_dir_param_voting(void *arg)
return;
}
-extern const char AUTHORITY_CERT_1[];
-extern const char AUTHORITY_SIGNKEY_1[];
-extern const char AUTHORITY_CERT_2[];
-extern const char AUTHORITY_SIGNKEY_2[];
-extern const char AUTHORITY_CERT_3[];
-extern const char AUTHORITY_SIGNKEY_3[];
-
/** Helper: Test that two networkstatus_voter_info_t do in fact represent the
* same voting authority, and that they do in fact have all the same
* information. */
@@ -1503,42 +1518,6 @@ test_same_voter(networkstatus_voter_info_t *v1,
;
}
-/** Helper: Make a new routerinfo containing the right information for a
- * given vote_routerstatus_t. */
-static routerinfo_t *
-generate_ri_from_rs(const vote_routerstatus_t *vrs)
-{
- routerinfo_t *r;
- const routerstatus_t *rs = &vrs->status;
- static time_t published = 0;
-
- r = tor_malloc_zero(sizeof(routerinfo_t));
- r->cert_expiration_time = TIME_MAX;
- memcpy(r->cache_info.identity_digest, rs->identity_digest, DIGEST_LEN);
- memcpy(r->cache_info.signed_descriptor_digest, rs->descriptor_digest,
- DIGEST_LEN);
- r->cache_info.do_not_cache = 1;
- r->cache_info.routerlist_index = -1;
- r->cache_info.signed_descriptor_body =
- tor_strdup("123456789012345678901234567890123");
- r->cache_info.signed_descriptor_len =
- strlen(r->cache_info.signed_descriptor_body);
- r->exit_policy = smartlist_new();
- r->cache_info.published_on = ++published + time(NULL);
- if (rs->has_bandwidth) {
- /*
- * Multiply by 1000 because the routerinfo_t and the routerstatus_t
- * seem to use different units (*sigh*) and because we seem stuck on
- * icky and perverse decimal kilobytes (*double sigh*) - see
- * router_get_advertised_bandwidth_capped() of routerlist.c and
- * routerstatus_format_entry() of dirserv.c.
- */
- r->bandwidthrate = rs->bandwidth_kb * 1000;
- r->bandwidthcapacity = rs->bandwidth_kb * 1000;
- }
- return r;
-}
-
/** Helper: get a detached signatures document for one or two
* consensuses. */
static char *
@@ -1556,100 +1535,6 @@ get_detached_sigs(networkstatus_t *ns, networkstatus_t *ns2)
return r;
}
-/**
- * Generate a routerstatus for v3_networkstatus test
- */
-static vote_routerstatus_t *
-gen_routerstatus_for_v3ns(int idx, time_t now)
-{
- vote_routerstatus_t *vrs=NULL;
- routerstatus_t *rs;
- tor_addr_t addr_ipv6;
-
- switch (idx) {
- case 0:
- /* Generate the first routerstatus. */
- vrs = tor_malloc_zero(sizeof(vote_routerstatus_t));
- rs = &vrs->status;
- vrs->version = tor_strdup("0.1.2.14");
- rs->published_on = now-1500;
- strlcpy(rs->nickname, "router2", sizeof(rs->nickname));
- memset(rs->identity_digest, 3, DIGEST_LEN);
- memset(rs->descriptor_digest, 78, DIGEST_LEN);
- rs->addr = 0x99008801;
- rs->or_port = 443;
- rs->dir_port = 8000;
- /* all flags but running cleared */
- rs->is_flagged_running = 1;
- break;
- case 1:
- /* Generate the second routerstatus. */
- vrs = tor_malloc_zero(sizeof(vote_routerstatus_t));
- rs = &vrs->status;
- vrs->version = tor_strdup("0.2.0.5");
- rs->published_on = now-1000;
- strlcpy(rs->nickname, "router1", sizeof(rs->nickname));
- memset(rs->identity_digest, 5, DIGEST_LEN);
- memset(rs->descriptor_digest, 77, DIGEST_LEN);
- rs->addr = 0x99009901;
- rs->or_port = 443;
- rs->dir_port = 0;
- tor_addr_parse(&addr_ipv6, "[1:2:3::4]");
- tor_addr_copy(&rs->ipv6_addr, &addr_ipv6);
- rs->ipv6_orport = 4711;
- rs->is_exit = rs->is_stable = rs->is_fast = rs->is_flagged_running =
- rs->is_valid = rs->is_possible_guard = 1;
- break;
- case 2:
- /* Generate the third routerstatus. */
- vrs = tor_malloc_zero(sizeof(vote_routerstatus_t));
- rs = &vrs->status;
- vrs->version = tor_strdup("0.1.0.3");
- rs->published_on = now-1000;
- strlcpy(rs->nickname, "router3", sizeof(rs->nickname));
- memset(rs->identity_digest, 33, DIGEST_LEN);
- memset(rs->descriptor_digest, 79, DIGEST_LEN);
- rs->addr = 0xAA009901;
- rs->or_port = 400;
- rs->dir_port = 9999;
- rs->is_authority = rs->is_exit = rs->is_stable = rs->is_fast =
- rs->is_flagged_running = rs->is_valid =
- rs->is_possible_guard = 1;
- break;
- case 3:
- /* Generate a fourth routerstatus that is not running. */
- vrs = tor_malloc_zero(sizeof(vote_routerstatus_t));
- rs = &vrs->status;
- vrs->version = tor_strdup("0.1.6.3");
- rs->published_on = now-1000;
- strlcpy(rs->nickname, "router4", sizeof(rs->nickname));
- memset(rs->identity_digest, 34, DIGEST_LEN);
- memset(rs->descriptor_digest, 47, DIGEST_LEN);
- rs->addr = 0xC0000203;
- rs->or_port = 500;
- rs->dir_port = 1999;
- /* Running flag (and others) cleared */
- break;
- case 4:
- /* No more for this test; return NULL */
- vrs = NULL;
- break;
- default:
- /* Shouldn't happen */
- tt_assert(0);
- }
- if (vrs) {
- vrs->microdesc = tor_malloc_zero(sizeof(vote_microdesc_hash_t));
- tor_asprintf(&vrs->microdesc->microdesc_hash_line,
- "m 9,10,11,12,13,14,15,16,17 "
- "sha256=xyzajkldsdsajdadlsdjaslsdksdjlsdjsdaskdaaa%d\n",
- idx);
- }
-
- done:
- return vrs;
-}
-
/** Apply tweaks to the vote list for each voter */
static int
vote_tweaks_for_v3ns(networkstatus_t *v, int voter, time_t now)
@@ -1681,7 +1566,7 @@ vote_tweaks_for_v3ns(networkstatus_t *v, int voter, time_t now)
vrs = smartlist_get(v->routerstatus_list, 0);
memset(vrs->status.descriptor_digest, (int)'Z', DIGEST_LEN);
tt_assert(router_add_to_routerlist(
- generate_ri_from_rs(vrs), &msg,0,0) >= 0);
+ dir_common_generate_ri_from_rs(vrs), &msg,0,0) >= 0);
}
}
@@ -1746,11 +1631,11 @@ test_vrs_for_v3ns(vote_routerstatus_t *vrs, int voter, time_t now)
tt_assert(tor_addr_eq(&rs->ipv6_addr, &addr_ipv6));
tt_int_op(rs->ipv6_orport,OP_EQ, 4711);
if (voter == 1) {
- /* all except "authority" (1) and "v2dir" (64) */
- tt_u64_op(vrs->flags, OP_EQ, U64_LITERAL(190));
+ /* all except "authority" (1) */
+ tt_u64_op(vrs->flags, OP_EQ, U64_LITERAL(254));
} else {
- /* 1023 - authority(1) - madeofcheese(16) - madeoftin(32) - v2dir(256) */
- tt_u64_op(vrs->flags, OP_EQ, U64_LITERAL(718));
+ /* 1023 - authority(1) - madeofcheese(16) - madeoftin(32) */
+ tt_u64_op(vrs->flags, OP_EQ, U64_LITERAL(974));
}
} else if (tor_memeq(rs->identity_digest,
"\x33\x33\x33\x33\x33\x33\x33\x33\x33\x33"
@@ -1820,6 +1705,7 @@ test_routerstatus_for_v3ns(routerstatus_t *rs, time_t now)
tt_assert(rs->is_flagged_running);
tt_assert(!rs->is_valid);
tt_assert(!rs->is_named);
+ tt_assert(rs->is_v2_dir);
/* XXXX check version */
} else if (tor_memeq(rs->identity_digest,
"\x5\x5\x5\x5\x5\x5\x5\x5\x5\x5\x5\x5\x5\x5\x5\x5"
@@ -1845,6 +1731,7 @@ test_routerstatus_for_v3ns(routerstatus_t *rs, time_t now)
tt_assert(rs->is_stable);
tt_assert(rs->is_flagged_running);
tt_assert(rs->is_valid);
+ tt_assert(rs->is_v2_dir);
tt_assert(!rs->is_named);
/* XXXX check version */
} else {
@@ -1869,7 +1756,6 @@ test_a_networkstatus(
authority_cert_t *cert1=NULL, *cert2=NULL, *cert3=NULL;
crypto_pk_t *sign_skey_1=NULL, *sign_skey_2=NULL, *sign_skey_3=NULL;
crypto_pk_t *sign_skey_leg1=NULL;
- const char *msg=NULL;
/*
* Sum the non-zero returns from vote_tweaks() we've seen; if vote_tweaks()
* returns non-zero, it changed net_params and we should skip the tests for
@@ -1885,8 +1771,7 @@ test_a_networkstatus(
vote_routerstatus_t *vrs;
routerstatus_t *rs;
int idx, n_rs, n_vrs;
- char *v1_text=NULL, *v2_text=NULL, *v3_text=NULL, *consensus_text=NULL,
- *cp=NULL;
+ char *consensus_text=NULL, *cp=NULL;
smartlist_t *votes = smartlist_new();
/* For generating the two other consensuses. */
@@ -1901,79 +1786,13 @@ test_a_networkstatus(
tt_assert(rs_test);
tt_assert(vrs_test);
- /* Parse certificates and keys. */
- cert1 = authority_cert_parse_from_string(AUTHORITY_CERT_1, NULL);
- tt_assert(cert1);
- cert2 = authority_cert_parse_from_string(AUTHORITY_CERT_2, NULL);
- tt_assert(cert2);
- cert3 = authority_cert_parse_from_string(AUTHORITY_CERT_3, NULL);
- tt_assert(cert3);
- sign_skey_1 = crypto_pk_new();
- sign_skey_2 = crypto_pk_new();
- sign_skey_3 = crypto_pk_new();
+ tt_assert(!dir_common_authority_pk_init(&cert1, &cert2, &cert3,
+ &sign_skey_1, &sign_skey_2,
+ &sign_skey_3));
sign_skey_leg1 = pk_generate(4);
- tt_assert(!crypto_pk_read_private_key_from_string(sign_skey_1,
- AUTHORITY_SIGNKEY_1, -1));
- tt_assert(!crypto_pk_read_private_key_from_string(sign_skey_2,
- AUTHORITY_SIGNKEY_2, -1));
- tt_assert(!crypto_pk_read_private_key_from_string(sign_skey_3,
- AUTHORITY_SIGNKEY_3, -1));
-
- tt_assert(!crypto_pk_cmp_keys(sign_skey_1, cert1->signing_key));
- tt_assert(!crypto_pk_cmp_keys(sign_skey_2, cert2->signing_key));
-
- /*
- * Set up a vote; generate it; try to parse it.
- */
- vote = tor_malloc_zero(sizeof(networkstatus_t));
- vote->type = NS_TYPE_VOTE;
- vote->published = now;
- vote->valid_after = now+1000;
- vote->fresh_until = now+2000;
- vote->valid_until = now+3000;
- vote->vote_seconds = 100;
- vote->dist_seconds = 200;
- vote->supported_methods = smartlist_new();
- smartlist_split_string(vote->supported_methods, "1 2 3", NULL, 0, -1);
- vote->client_versions = tor_strdup("0.1.2.14,0.1.2.15");
- vote->server_versions = tor_strdup("0.1.2.14,0.1.2.15,0.1.2.16");
- vote->known_flags = smartlist_new();
- smartlist_split_string(vote->known_flags,
- "Authority Exit Fast Guard Running Stable V2Dir Valid",
- 0, SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0);
- vote->voters = smartlist_new();
- voter = tor_malloc_zero(sizeof(networkstatus_voter_info_t));
- voter->nickname = tor_strdup("Voter1");
- voter->address = tor_strdup("1.2.3.4");
- voter->addr = 0x01020304;
- voter->dir_port = 80;
- voter->or_port = 9000;
- voter->contact = tor_strdup("voter@example.com");
- crypto_pk_get_digest(cert1->identity_key, voter->identity_digest);
- smartlist_add(vote->voters, voter);
- vote->cert = authority_cert_dup(cert1);
- vote->net_params = smartlist_new();
- smartlist_split_string(vote->net_params, "circuitwindow=101 foo=990",
- NULL, 0, 0);
- vote->routerstatus_list = smartlist_new();
- /* add routerstatuses */
- idx = 0;
- do {
- vrs = vrs_gen(idx, now);
- if (vrs) {
- smartlist_add(vote->routerstatus_list, vrs);
- tt_assert(router_add_to_routerlist(generate_ri_from_rs(vrs),
- &msg,0,0)>=0);
- ++idx;
- }
- } while (vrs);
- n_vrs = idx;
-
- /* dump the vote and try to parse it. */
- v1_text = format_networkstatus_vote(sign_skey_1, vote);
- tt_assert(v1_text);
- v1 = networkstatus_parse_vote_from_string(v1_text, NULL, NS_TYPE_VOTE);
+ tt_assert(!dir_common_construct_vote_1(&vote, cert1, sign_skey_1, vrs_gen,
+ &v1, &n_vrs, now, 1));
tt_assert(v1);
/* Make sure the parsed thing was right. */
@@ -2000,6 +1819,8 @@ test_a_networkstatus(
tt_str_op(cp,OP_EQ, "Authority:Exit:Fast:Guard:Running:Stable:V2Dir:Valid");
tor_free(cp);
tt_int_op(smartlist_len(v1->routerstatus_list),OP_EQ, n_vrs);
+ networkstatus_vote_free(vote);
+ vote = NULL;
if (vote_tweaks) params_tweaked += vote_tweaks(v1, 1, now);
@@ -2011,33 +1832,10 @@ test_a_networkstatus(
}
/* Generate second vote. It disagrees on some of the times,
- * and doesn't list versions, and knows some crazy flags */
- vote->published = now+1;
- vote->fresh_until = now+3005;
- vote->dist_seconds = 300;
- authority_cert_free(vote->cert);
- vote->cert = authority_cert_dup(cert2);
- SMARTLIST_FOREACH(vote->net_params, char *, c, tor_free(c));
- smartlist_clear(vote->net_params);
- smartlist_split_string(vote->net_params, "bar=2000000000 circuitwindow=20",
- NULL, 0, 0);
- tor_free(vote->client_versions);
- tor_free(vote->server_versions);
- voter = smartlist_get(vote->voters, 0);
- tor_free(voter->nickname);
- tor_free(voter->address);
- voter->nickname = tor_strdup("Voter2");
- voter->address = tor_strdup("2.3.4.5");
- voter->addr = 0x02030405;
- crypto_pk_get_digest(cert2->identity_key, voter->identity_digest);
- smartlist_add(vote->known_flags, tor_strdup("MadeOfCheese"));
- smartlist_add(vote->known_flags, tor_strdup("MadeOfTin"));
- smartlist_sort_strings(vote->known_flags);
-
- /* generate and parse v2. */
- v2_text = format_networkstatus_vote(sign_skey_2, vote);
- tt_assert(v2_text);
- v2 = networkstatus_parse_vote_from_string(v2_text, NULL, NS_TYPE_VOTE);
+ * and doesn't list versions, and knows some crazy flags.
+ * Generate and parse v2. */
+ tt_assert(!dir_common_construct_vote_2(&vote, cert2, sign_skey_2, vrs_gen,
+ &v2, &n_vrs, now, 1));
tt_assert(v2);
if (vote_tweaks) params_tweaked += vote_tweaks(v2, 2, now);
@@ -2055,34 +1853,12 @@ test_a_networkstatus(
tt_assert(vrs);
vrs_test(vrs, 2, now);
}
+ networkstatus_vote_free(vote);
+ vote = NULL;
- /* Generate the third vote. */
- vote->published = now;
- vote->fresh_until = now+2003;
- vote->dist_seconds = 250;
- authority_cert_free(vote->cert);
- vote->cert = authority_cert_dup(cert3);
- SMARTLIST_FOREACH(vote->net_params, char *, c, tor_free(c));
- smartlist_clear(vote->net_params);
- smartlist_split_string(vote->net_params, "circuitwindow=80 foo=660",
- NULL, 0, 0);
- smartlist_add(vote->supported_methods, tor_strdup("4"));
- vote->client_versions = tor_strdup("0.1.2.14,0.1.2.17");
- vote->server_versions = tor_strdup("0.1.2.10,0.1.2.15,0.1.2.16");
- voter = smartlist_get(vote->voters, 0);
- tor_free(voter->nickname);
- tor_free(voter->address);
- voter->nickname = tor_strdup("Voter3");
- voter->address = tor_strdup("3.4.5.6");
- voter->addr = 0x03040506;
- crypto_pk_get_digest(cert3->identity_key, voter->identity_digest);
- /* This one has a legacy id. */
- memset(voter->legacy_id_digest, (int)'A', DIGEST_LEN);
-
- v3_text = format_networkstatus_vote(sign_skey_3, vote);
- tt_assert(v3_text);
-
- v3 = networkstatus_parse_vote_from_string(v3_text, NULL, NS_TYPE_VOTE);
+ /* Generate the third vote with a legacy id. */
+ tt_assert(!dir_common_construct_vote_3(&vote, cert3, sign_skey_3, vrs_gen,
+ &v3, &n_vrs, now, 1));
tt_assert(v3);
if (vote_tweaks) params_tweaked += vote_tweaks(v3, 3, now);
@@ -2153,12 +1929,20 @@ test_a_networkstatus(
/* Check the routerstatuses. */
n_rs = smartlist_len(con->routerstatus_list);
+ tt_assert(n_rs);
for (idx = 0; idx < n_rs; ++idx) {
rs = smartlist_get(con->routerstatus_list, idx);
tt_assert(rs);
rs_test(rs, now);
}
+ n_rs = smartlist_len(con_md->routerstatus_list);
+ tt_assert(n_rs);
+ for (idx = 0; idx < n_rs; ++idx) {
+ rs = smartlist_get(con_md->routerstatus_list, idx);
+ tt_assert(rs);
+ }
+
/* Check signatures. the first voter is a pseudo-entry with a legacy key.
* The second one hasn't signed. The fourth one has signed: validate it. */
voter = smartlist_get(con->voters, 1);
@@ -2309,38 +2093,22 @@ test_a_networkstatus(
done:
tor_free(cp);
smartlist_free(votes);
- tor_free(v1_text);
- tor_free(v2_text);
- tor_free(v3_text);
tor_free(consensus_text);
tor_free(consensus_text_md);
- if (vote)
- networkstatus_vote_free(vote);
- if (v1)
- networkstatus_vote_free(v1);
- if (v2)
- networkstatus_vote_free(v2);
- if (v3)
- networkstatus_vote_free(v3);
- if (con)
- networkstatus_vote_free(con);
- if (con_md)
- networkstatus_vote_free(con_md);
- if (sign_skey_1)
- crypto_pk_free(sign_skey_1);
- if (sign_skey_2)
- crypto_pk_free(sign_skey_2);
- if (sign_skey_3)
- crypto_pk_free(sign_skey_3);
- if (sign_skey_leg1)
- crypto_pk_free(sign_skey_leg1);
- if (cert1)
- authority_cert_free(cert1);
- if (cert2)
- authority_cert_free(cert2);
- if (cert3)
- authority_cert_free(cert3);
+ networkstatus_vote_free(vote);
+ networkstatus_vote_free(v1);
+ networkstatus_vote_free(v2);
+ networkstatus_vote_free(v3);
+ networkstatus_vote_free(con);
+ networkstatus_vote_free(con_md);
+ crypto_pk_free(sign_skey_1);
+ crypto_pk_free(sign_skey_2);
+ crypto_pk_free(sign_skey_3);
+ crypto_pk_free(sign_skey_leg1);
+ authority_cert_free(cert1);
+ authority_cert_free(cert2);
+ authority_cert_free(cert3);
tor_free(consensus_text2);
tor_free(consensus_text3);
@@ -2348,18 +2116,13 @@ test_a_networkstatus(
tor_free(consensus_text_md3);
tor_free(detached_text1);
tor_free(detached_text2);
- if (con2)
- networkstatus_vote_free(con2);
- if (con3)
- networkstatus_vote_free(con3);
- if (con_md2)
- networkstatus_vote_free(con_md2);
- if (con_md3)
- networkstatus_vote_free(con_md3);
- if (dsig1)
- ns_detached_signatures_free(dsig1);
- if (dsig2)
- ns_detached_signatures_free(dsig2);
+
+ networkstatus_vote_free(con2);
+ networkstatus_vote_free(con3);
+ networkstatus_vote_free(con_md2);
+ networkstatus_vote_free(con_md3);
+ ns_detached_signatures_free(dsig1);
+ ns_detached_signatures_free(dsig2);
}
/** Run unit tests for generating and parsing V3 consensus networkstatus
@@ -2368,7 +2131,7 @@ static void
test_dir_v3_networkstatus(void *arg)
{
(void)arg;
- test_a_networkstatus(gen_routerstatus_for_v3ns,
+ test_a_networkstatus(dir_common_gen_routerstatus_for_v3ns,
vote_tweaks_for_v3ns,
test_vrs_for_v3ns,
test_consensus_for_v3ns,
@@ -2965,6 +2728,7 @@ test_dir_fmt_control_ns(void *arg)
rs.is_fast = 1;
rs.is_flagged_running = 1;
rs.has_bandwidth = 1;
+ rs.is_v2_dir = 1;
rs.bandwidth_kb = 1000;
s = networkstatus_getinfo_helper_single(&rs);
@@ -3340,12 +3104,33 @@ static void
test_dir_fetch_type(void *arg)
{
(void)arg;
- tt_assert(dir_fetch_type(DIR_PURPOSE_FETCH_MICRODESC, ROUTER_PURPOSE_GENERAL,
- NULL) == MICRODESC_DIRINFO);
- tt_assert(dir_fetch_type(DIR_PURPOSE_FETCH_SERVERDESC, ROUTER_PURPOSE_BRIDGE,
- NULL) == BRIDGE_DIRINFO);
- tt_assert(dir_fetch_type(DIR_PURPOSE_FETCH_CONSENSUS, ROUTER_PURPOSE_GENERAL,
- "microdesc") == (V3_DIRINFO | MICRODESC_DIRINFO));
+ tt_int_op(dir_fetch_type(DIR_PURPOSE_FETCH_EXTRAINFO, ROUTER_PURPOSE_BRIDGE,
+ NULL), OP_EQ, EXTRAINFO_DIRINFO | BRIDGE_DIRINFO);
+ tt_int_op(dir_fetch_type(DIR_PURPOSE_FETCH_EXTRAINFO, ROUTER_PURPOSE_GENERAL,
+ NULL), OP_EQ, EXTRAINFO_DIRINFO | V3_DIRINFO);
+
+ tt_int_op(dir_fetch_type(DIR_PURPOSE_FETCH_SERVERDESC, ROUTER_PURPOSE_BRIDGE,
+ NULL), OP_EQ, BRIDGE_DIRINFO);
+ tt_int_op(dir_fetch_type(DIR_PURPOSE_FETCH_SERVERDESC,
+ ROUTER_PURPOSE_GENERAL, NULL), OP_EQ, V3_DIRINFO);
+
+ tt_int_op(dir_fetch_type(DIR_PURPOSE_FETCH_STATUS_VOTE,
+ ROUTER_PURPOSE_GENERAL, NULL), OP_EQ, V3_DIRINFO);
+ tt_int_op(dir_fetch_type(DIR_PURPOSE_FETCH_DETACHED_SIGNATURES,
+ ROUTER_PURPOSE_GENERAL, NULL), OP_EQ, V3_DIRINFO);
+ tt_int_op(dir_fetch_type(DIR_PURPOSE_FETCH_CERTIFICATE,
+ ROUTER_PURPOSE_GENERAL, NULL), OP_EQ, V3_DIRINFO);
+
+ tt_int_op(dir_fetch_type(DIR_PURPOSE_FETCH_CONSENSUS, ROUTER_PURPOSE_GENERAL,
+ "microdesc"), OP_EQ, V3_DIRINFO|MICRODESC_DIRINFO);
+ tt_int_op(dir_fetch_type(DIR_PURPOSE_FETCH_CONSENSUS, ROUTER_PURPOSE_GENERAL,
+ NULL), OP_EQ, V3_DIRINFO);
+
+ tt_int_op(dir_fetch_type(DIR_PURPOSE_FETCH_MICRODESC, ROUTER_PURPOSE_GENERAL,
+ NULL), OP_EQ, MICRODESC_DIRINFO);
+
+ tt_int_op(dir_fetch_type(DIR_PURPOSE_FETCH_RENDDESC_V2,
+ ROUTER_PURPOSE_GENERAL, NULL), OP_EQ, NO_DIRINFO);
done: ;
}
@@ -3923,6 +3708,341 @@ test_dir_download_status_increment(void *arg)
mock_get_options_calls = 0;
}
+static void
+test_dir_authdir_type_to_string(void *data)
+{
+ (void)data;
+ char *res;
+
+ tt_str_op(res = authdir_type_to_string(NO_DIRINFO), OP_EQ,
+ "[Not an authority]");
+ tor_free(res);
+
+ tt_str_op(res = authdir_type_to_string(EXTRAINFO_DIRINFO), OP_EQ,
+ "[Not an authority]");
+ tor_free(res);
+
+ tt_str_op(res = authdir_type_to_string(MICRODESC_DIRINFO), OP_EQ,
+ "[Not an authority]");
+ tor_free(res);
+
+ tt_str_op(res = authdir_type_to_string(V3_DIRINFO), OP_EQ, "V3");
+ tor_free(res);
+
+ tt_str_op(res = authdir_type_to_string(BRIDGE_DIRINFO), OP_EQ, "Bridge");
+ tor_free(res);
+
+ tt_str_op(res = authdir_type_to_string(
+ V3_DIRINFO | BRIDGE_DIRINFO | EXTRAINFO_DIRINFO), OP_EQ,
+ "V3, Bridge");
+ done:
+ tor_free(res);
+}
+
+static void
+test_dir_conn_purpose_to_string(void *data)
+{
+ (void)data;
+
+#define EXPECT_CONN_PURPOSE(purpose, expected) \
+ tt_str_op(dir_conn_purpose_to_string(purpose), OP_EQ, expected);
+
+ EXPECT_CONN_PURPOSE(DIR_PURPOSE_UPLOAD_DIR, "server descriptor upload");
+ EXPECT_CONN_PURPOSE(DIR_PURPOSE_UPLOAD_VOTE, "server vote upload");
+ EXPECT_CONN_PURPOSE(DIR_PURPOSE_UPLOAD_SIGNATURES,
+ "consensus signature upload");
+ EXPECT_CONN_PURPOSE(DIR_PURPOSE_FETCH_SERVERDESC, "server descriptor fetch");
+ EXPECT_CONN_PURPOSE(DIR_PURPOSE_FETCH_EXTRAINFO, "extra-info fetch");
+ EXPECT_CONN_PURPOSE(DIR_PURPOSE_FETCH_CONSENSUS,
+ "consensus network-status fetch");
+ EXPECT_CONN_PURPOSE(DIR_PURPOSE_FETCH_CERTIFICATE, "authority cert fetch");
+ EXPECT_CONN_PURPOSE(DIR_PURPOSE_FETCH_STATUS_VOTE, "status vote fetch");
+ EXPECT_CONN_PURPOSE(DIR_PURPOSE_FETCH_DETACHED_SIGNATURES,
+ "consensus signature fetch");
+ EXPECT_CONN_PURPOSE(DIR_PURPOSE_FETCH_RENDDESC_V2,
+ "hidden-service v2 descriptor fetch");
+ EXPECT_CONN_PURPOSE(DIR_PURPOSE_UPLOAD_RENDDESC_V2,
+ "hidden-service v2 descriptor upload");
+ EXPECT_CONN_PURPOSE(DIR_PURPOSE_FETCH_MICRODESC, "microdescriptor fetch");
+ EXPECT_CONN_PURPOSE(1024, "(unknown)");
+
+ done: ;
+}
+
+NS_DECL(int,
+public_server_mode, (const or_options_t *options));
+
+static int
+NS(public_server_mode)(const or_options_t *options)
+{
+ (void)options;
+
+ if (CALLED(public_server_mode)++ == 0) {
+ return 1;
+ }
+
+ return 0;
+}
+
+static void
+test_dir_should_use_directory_guards(void *data)
+{
+ or_options_t *options;
+ char *errmsg = NULL;
+ (void)data;
+
+ NS_MOCK(public_server_mode);
+
+ options = options_new();
+ options_init(options);
+
+ tt_int_op(should_use_directory_guards(options), OP_EQ, 0);
+ tt_int_op(CALLED(public_server_mode), OP_EQ, 1);
+
+ options->UseEntryGuardsAsDirGuards = 1;
+ options->UseEntryGuards = 1;
+ options->DownloadExtraInfo = 0;
+ options->FetchDirInfoEarly = 0;
+ options->FetchDirInfoExtraEarly = 0;
+ options->FetchUselessDescriptors = 0;
+ tt_int_op(should_use_directory_guards(options), OP_EQ, 1);
+ tt_int_op(CALLED(public_server_mode), OP_EQ, 2);
+
+ options->UseEntryGuards = 0;
+ tt_int_op(should_use_directory_guards(options), OP_EQ, 0);
+ tt_int_op(CALLED(public_server_mode), OP_EQ, 3);
+ options->UseEntryGuards = 1;
+
+ options->UseEntryGuardsAsDirGuards = 0;
+ tt_int_op(should_use_directory_guards(options), OP_EQ, 0);
+ tt_int_op(CALLED(public_server_mode), OP_EQ, 4);
+ options->UseEntryGuardsAsDirGuards = 1;
+
+ options->DownloadExtraInfo = 1;
+ tt_int_op(should_use_directory_guards(options), OP_EQ, 0);
+ tt_int_op(CALLED(public_server_mode), OP_EQ, 5);
+ options->DownloadExtraInfo = 0;
+
+ options->FetchDirInfoEarly = 1;
+ tt_int_op(should_use_directory_guards(options), OP_EQ, 0);
+ tt_int_op(CALLED(public_server_mode), OP_EQ, 6);
+ options->FetchDirInfoEarly = 0;
+
+ options->FetchDirInfoExtraEarly = 1;
+ tt_int_op(should_use_directory_guards(options), OP_EQ, 0);
+ tt_int_op(CALLED(public_server_mode), OP_EQ, 7);
+ options->FetchDirInfoExtraEarly = 0;
+
+ options->FetchUselessDescriptors = 1;
+ tt_int_op(should_use_directory_guards(options), OP_EQ, 0);
+ tt_int_op(CALLED(public_server_mode), OP_EQ, 8);
+ options->FetchUselessDescriptors = 0;
+
+ done:
+ NS_UNMOCK(public_server_mode);
+ or_options_free(options);
+ tor_free(errmsg);
+}
+
+NS_DECL(void,
+directory_initiate_command_routerstatus, (const routerstatus_t *status,
+ uint8_t dir_purpose,
+ uint8_t router_purpose,
+ dir_indirection_t indirection,
+ const char *resource,
+ const char *payload,
+ size_t payload_len,
+ time_t if_modified_since));
+
+static void
+test_dir_should_not_init_request_to_ourselves(void *data)
+{
+ char digest[DIGEST_LEN];
+ dir_server_t *ourself = NULL;
+ crypto_pk_t *key = pk_generate(2);
+ (void) data;
+
+ NS_MOCK(directory_initiate_command_routerstatus);
+
+ clear_dir_servers();
+ routerlist_free_all();
+
+ set_server_identity_key(key);
+ crypto_pk_get_digest(key, (char*) &digest);
+ ourself = trusted_dir_server_new("ourself", "127.0.0.1", 9059, 9060,
+ NULL, digest,
+ NULL, V3_DIRINFO, 1.0);
+
+ tt_assert(ourself);
+ dir_server_add(ourself);
+
+ directory_get_from_all_authorities(DIR_PURPOSE_FETCH_STATUS_VOTE, 0, NULL);
+ tt_int_op(CALLED(directory_initiate_command_routerstatus), OP_EQ, 0);
+
+ directory_get_from_all_authorities(DIR_PURPOSE_FETCH_DETACHED_SIGNATURES, 0,
+ NULL);
+
+ tt_int_op(CALLED(directory_initiate_command_routerstatus), OP_EQ, 0);
+
+ done:
+ NS_UNMOCK(directory_initiate_command_routerstatus);
+ clear_dir_servers();
+ routerlist_free_all();
+ crypto_pk_free(key);
+}
+
+static void
+test_dir_should_not_init_request_to_dir_auths_without_v3_info(void *data)
+{
+ dir_server_t *ds = NULL;
+ dirinfo_type_t dirinfo_type = BRIDGE_DIRINFO | EXTRAINFO_DIRINFO \
+ | MICRODESC_DIRINFO;
+ (void) data;
+
+ NS_MOCK(directory_initiate_command_routerstatus);
+
+ clear_dir_servers();
+ routerlist_free_all();
+
+ ds = trusted_dir_server_new("ds", "10.0.0.1", 9059, 9060, NULL,
+ "12345678901234567890", NULL, dirinfo_type, 1.0);
+ tt_assert(ds);
+ dir_server_add(ds);
+
+ directory_get_from_all_authorities(DIR_PURPOSE_FETCH_STATUS_VOTE, 0, NULL);
+ tt_int_op(CALLED(directory_initiate_command_routerstatus), OP_EQ, 0);
+
+ directory_get_from_all_authorities(DIR_PURPOSE_FETCH_DETACHED_SIGNATURES, 0,
+ NULL);
+ tt_int_op(CALLED(directory_initiate_command_routerstatus), OP_EQ, 0);
+
+ done:
+ NS_UNMOCK(directory_initiate_command_routerstatus);
+ clear_dir_servers();
+ routerlist_free_all();
+}
+
+static void
+test_dir_should_init_request_to_dir_auths(void *data)
+{
+ dir_server_t *ds = NULL;
+ (void) data;
+
+ NS_MOCK(directory_initiate_command_routerstatus);
+
+ clear_dir_servers();
+ routerlist_free_all();
+
+ ds = trusted_dir_server_new("ds", "10.0.0.1", 9059, 9060, NULL,
+ "12345678901234567890", NULL, V3_DIRINFO, 1.0);
+ tt_assert(ds);
+ dir_server_add(ds);
+
+ directory_get_from_all_authorities(DIR_PURPOSE_FETCH_STATUS_VOTE, 0, NULL);
+ tt_int_op(CALLED(directory_initiate_command_routerstatus), OP_EQ, 1);
+
+ directory_get_from_all_authorities(DIR_PURPOSE_FETCH_DETACHED_SIGNATURES, 0,
+ NULL);
+ tt_int_op(CALLED(directory_initiate_command_routerstatus), OP_EQ, 2);
+
+ done:
+ NS_UNMOCK(directory_initiate_command_routerstatus);
+ clear_dir_servers();
+ routerlist_free_all();
+}
+
+void
+NS(directory_initiate_command_routerstatus)(const routerstatus_t *status,
+ uint8_t dir_purpose,
+ uint8_t router_purpose,
+ dir_indirection_t indirection,
+ const char *resource,
+ const char *payload,
+ size_t payload_len,
+ time_t if_modified_since)
+{
+ (void)status;
+ (void)dir_purpose;
+ (void)router_purpose;
+ (void)indirection;
+ (void)resource;
+ (void)payload;
+ (void)payload_len;
+ (void)if_modified_since;
+ CALLED(directory_initiate_command_routerstatus)++;
+}
+
+static void
+test_dir_choose_compression_level(void* data)
+{
+ (void)data;
+
+ /* It starts under_memory_pressure */
+ tt_int_op(have_been_under_memory_pressure(), OP_EQ, 1);
+
+ tt_assert(HIGH_COMPRESSION == choose_compression_level(-1));
+ tt_assert(LOW_COMPRESSION == choose_compression_level(1024-1));
+ tt_assert(MEDIUM_COMPRESSION == choose_compression_level(2048-1));
+ tt_assert(HIGH_COMPRESSION == choose_compression_level(2048));
+
+ /* Reset under_memory_pressure timer */
+ cell_queues_check_size();
+ tt_int_op(have_been_under_memory_pressure(), OP_EQ, 0);
+
+ tt_assert(HIGH_COMPRESSION == choose_compression_level(-1));
+ tt_assert(HIGH_COMPRESSION == choose_compression_level(1024-1));
+ tt_assert(HIGH_COMPRESSION == choose_compression_level(2048-1));
+ tt_assert(HIGH_COMPRESSION == choose_compression_level(2048));
+
+ done: ;
+}
+
+static void
+test_dir_find_dl_schedule(void* data)
+{
+ download_status_t dls;
+ smartlist_t server, client, server_cons, client_cons, bridge;
+ (void)data;
+
+ mock_options = malloc(sizeof(or_options_t));
+ reset_options(mock_options, &mock_get_options_calls);
+ MOCK(get_options, mock_get_options);
+
+ mock_options->TestingServerDownloadSchedule = &server;
+ mock_options->TestingClientDownloadSchedule = &client;
+ mock_options->TestingServerConsensusDownloadSchedule = &server_cons;
+ mock_options->TestingClientConsensusDownloadSchedule = &client_cons;
+ mock_options->TestingBridgeDownloadSchedule = &bridge;
+
+ dls.schedule = DL_SCHED_GENERIC;
+ mock_options->ClientOnly = 1;
+ tt_ptr_op(find_dl_schedule(&dls, mock_options), OP_EQ, &client);
+ mock_options->ClientOnly = 0;
+ mock_options->DirPort_set = 1;
+ mock_options->ORPort_set = 1;
+ mock_options->DirCache = 1;
+ tt_ptr_op(find_dl_schedule(&dls, mock_options), OP_EQ, &server);
+
+#if 0
+ dls.schedule = DL_SCHED_CONSENSUS;
+ mock_options->ClientOnly = 1;
+ mock_options->DirCache = 0;
+ tt_ptr_op(find_dl_schedule(&dls, mock_options), OP_EQ, &client_cons);
+ mock_options->ClientOnly = 0;
+ mock_options->DirCache = 1;
+ tt_ptr_op(find_dl_schedule(&dls, mock_options), OP_EQ, &server_cons);
+#endif
+
+ dls.schedule = DL_SCHED_BRIDGE;
+ mock_options->ClientOnly = 1;
+ tt_ptr_op(find_dl_schedule(&dls, mock_options), OP_EQ, &bridge);
+ mock_options->ClientOnly = 0;
+ tt_ptr_op(find_dl_schedule(&dls, mock_options), OP_EQ, &bridge);
+
+ done:
+ UNMOCK(get_options);
+}
+
#define DIR_LEGACY(name) \
{ #name, test_dir_ ## name , TT_FORK, NULL, NULL }
@@ -3956,6 +4076,14 @@ struct testcase_t dir_tests[] = {
DIR(packages, 0),
DIR(download_status_schedule, 0),
DIR(download_status_increment, 0),
+ DIR(authdir_type_to_string, 0),
+ DIR(conn_purpose_to_string, 0),
+ DIR(should_use_directory_guards, 0),
+ DIR(should_not_init_request_to_ourselves, TT_FORK),
+ DIR(should_not_init_request_to_dir_auths_without_v3_info, 0),
+ DIR(should_init_request_to_dir_auths, 0),
+ DIR(choose_compression_level, 0),
+ DIR(find_dl_schedule, 0),
END_OF_TESTCASES
};
diff --git a/src/test/test_dir_common.c b/src/test/test_dir_common.c
new file mode 100644
index 0000000000..f9e97c973c
--- /dev/null
+++ b/src/test/test_dir_common.c
@@ -0,0 +1,425 @@
+/* Copyright (c) 2001-2004, Roger Dingledine.
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
+ * Copyright (c) 2007-2014, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+#include "orconfig.h"
+#define DIRVOTE_PRIVATE
+#include "crypto.h"
+#include "test.h"
+#include "container.h"
+#include "or.h"
+#include "dirvote.h"
+#include "nodelist.h"
+#include "routerlist.h"
+#include "test_dir_common.h"
+
+void dir_common_setup_vote(networkstatus_t **vote, time_t now);
+networkstatus_t * dir_common_add_rs_and_parse(networkstatus_t *vote,
+ networkstatus_t **vote_out,
+ vote_routerstatus_t * (*vrs_gen)(int idx, time_t now),
+ crypto_pk_t *sign_skey, int *n_vrs,
+ time_t now, int clear_rl);
+
+extern const char AUTHORITY_CERT_1[];
+extern const char AUTHORITY_SIGNKEY_1[];
+extern const char AUTHORITY_CERT_2[];
+extern const char AUTHORITY_SIGNKEY_2[];
+extern const char AUTHORITY_CERT_3[];
+extern const char AUTHORITY_SIGNKEY_3[];
+
+/** Initialize and set auth certs and keys
+ * Returns 0 on success, -1 on failure. Clean up handled by caller.
+ */
+int
+dir_common_authority_pk_init(authority_cert_t **cert1,
+ authority_cert_t **cert2,
+ authority_cert_t **cert3,
+ crypto_pk_t **sign_skey_1,
+ crypto_pk_t **sign_skey_2,
+ crypto_pk_t **sign_skey_3)
+{
+ /* Parse certificates and keys. */
+ authority_cert_t *cert;
+ cert = authority_cert_parse_from_string(AUTHORITY_CERT_1, NULL);
+ tt_assert(cert);
+ tt_assert(cert->identity_key);
+ *cert1 = cert;
+ tt_assert(*cert1);
+ *cert2 = authority_cert_parse_from_string(AUTHORITY_CERT_2, NULL);
+ tt_assert(*cert2);
+ *cert3 = authority_cert_parse_from_string(AUTHORITY_CERT_3, NULL);
+ tt_assert(*cert3);
+ *sign_skey_1 = crypto_pk_new();
+ *sign_skey_2 = crypto_pk_new();
+ *sign_skey_3 = crypto_pk_new();
+
+ tt_assert(!crypto_pk_read_private_key_from_string(*sign_skey_1,
+ AUTHORITY_SIGNKEY_1, -1));
+ tt_assert(!crypto_pk_read_private_key_from_string(*sign_skey_2,
+ AUTHORITY_SIGNKEY_2, -1));
+ tt_assert(!crypto_pk_read_private_key_from_string(*sign_skey_3,
+ AUTHORITY_SIGNKEY_3, -1));
+
+ tt_assert(!crypto_pk_cmp_keys(*sign_skey_1, (*cert1)->signing_key));
+ tt_assert(!crypto_pk_cmp_keys(*sign_skey_2, (*cert2)->signing_key));
+
+ return 0;
+ done:
+ return -1;
+}
+
+/**
+ * Generate a routerstatus for v3_networkstatus test.
+ */
+vote_routerstatus_t *
+dir_common_gen_routerstatus_for_v3ns(int idx, time_t now)
+{
+ vote_routerstatus_t *vrs=NULL;
+ routerstatus_t *rs = NULL;
+ tor_addr_t addr_ipv6;
+ char *method_list = NULL;
+
+ switch (idx) {
+ case 0:
+ /* Generate the first routerstatus. */
+ vrs = tor_malloc_zero(sizeof(vote_routerstatus_t));
+ rs = &vrs->status;
+ vrs->version = tor_strdup("0.1.2.14");
+ rs->published_on = now-1500;
+ strlcpy(rs->nickname, "router2", sizeof(rs->nickname));
+ memset(rs->identity_digest, TEST_DIR_ROUTER_ID_1, DIGEST_LEN);
+ memset(rs->descriptor_digest, TEST_DIR_ROUTER_DD_1, DIGEST_LEN);
+ rs->addr = 0x99008801;
+ rs->or_port = 443;
+ rs->dir_port = 8000;
+ /* all flags but running and v2dir cleared */
+ rs->is_flagged_running = 1;
+ rs->is_v2_dir = 1;
+ break;
+ case 1:
+ /* Generate the second routerstatus. */
+ vrs = tor_malloc_zero(sizeof(vote_routerstatus_t));
+ rs = &vrs->status;
+ vrs->version = tor_strdup("0.2.0.5");
+ rs->published_on = now-1000;
+ strlcpy(rs->nickname, "router1", sizeof(rs->nickname));
+ memset(rs->identity_digest, TEST_DIR_ROUTER_ID_2, DIGEST_LEN);
+ memset(rs->descriptor_digest, TEST_DIR_ROUTER_DD_2, DIGEST_LEN);
+ rs->addr = 0x99009901;
+ rs->or_port = 443;
+ rs->dir_port = 0;
+ tor_addr_parse(&addr_ipv6, "[1:2:3::4]");
+ tor_addr_copy(&rs->ipv6_addr, &addr_ipv6);
+ rs->ipv6_orport = 4711;
+ rs->is_exit = rs->is_stable = rs->is_fast = rs->is_flagged_running =
+ rs->is_valid = rs->is_possible_guard = rs->is_v2_dir = 1;
+ break;
+ case 2:
+ /* Generate the third routerstatus. */
+ vrs = tor_malloc_zero(sizeof(vote_routerstatus_t));
+ rs = &vrs->status;
+ vrs->version = tor_strdup("0.1.0.3");
+ rs->published_on = now-1000;
+ strlcpy(rs->nickname, "router3", sizeof(rs->nickname));
+ memset(rs->identity_digest, TEST_DIR_ROUTER_ID_3, DIGEST_LEN);
+ memset(rs->descriptor_digest, TEST_DIR_ROUTER_DD_3, DIGEST_LEN);
+ rs->addr = 0xAA009901;
+ rs->or_port = 400;
+ rs->dir_port = 9999;
+ rs->is_authority = rs->is_exit = rs->is_stable = rs->is_fast =
+ rs->is_flagged_running = rs->is_valid = rs->is_v2_dir =
+ rs->is_possible_guard = 1;
+ break;
+ case 3:
+ /* Generate a fourth routerstatus that is not running. */
+ vrs = tor_malloc_zero(sizeof(vote_routerstatus_t));
+ rs = &vrs->status;
+ vrs->version = tor_strdup("0.1.6.3");
+ rs->published_on = now-1000;
+ strlcpy(rs->nickname, "router4", sizeof(rs->nickname));
+ memset(rs->identity_digest, TEST_DIR_ROUTER_ID_4, DIGEST_LEN);
+ memset(rs->descriptor_digest, TEST_DIR_ROUTER_DD_4, DIGEST_LEN);
+ rs->addr = 0xC0000203;
+ rs->or_port = 500;
+ rs->dir_port = 1999;
+ rs->is_v2_dir = 1;
+ /* Running flag (and others) cleared */
+ break;
+ case 4:
+ /* No more for this test; return NULL */
+ vrs = NULL;
+ break;
+ default:
+ /* Shouldn't happen */
+ tt_assert(0);
+ }
+ if (vrs) {
+ vrs->microdesc = tor_malloc_zero(sizeof(vote_microdesc_hash_t));
+ method_list = make_consensus_method_list(MIN_SUPPORTED_CONSENSUS_METHOD,
+ MAX_SUPPORTED_CONSENSUS_METHOD,
+ ",");
+ tor_asprintf(&vrs->microdesc->microdesc_hash_line,
+ "m %s "
+ "sha256=xyzajkldsdsajdadlsdjaslsdksdjlsdjsdaskdaaa%d\n",
+ method_list, idx);
+ }
+
+ done:
+ tor_free(method_list);
+ return vrs;
+}
+
+/** Initialize networkstatus vote object attributes. */
+void
+dir_common_setup_vote(networkstatus_t **vote, time_t now)
+{
+ *vote = tor_malloc_zero(sizeof(networkstatus_t));
+ (*vote)->type = NS_TYPE_VOTE;
+ (*vote)->published = now;
+ (*vote)->supported_methods = smartlist_new();
+ (*vote)->known_flags = smartlist_new();
+ (*vote)->net_params = smartlist_new();
+ (*vote)->routerstatus_list = smartlist_new();
+ (*vote)->voters = smartlist_new();
+}
+
+/** Helper: Make a new routerinfo containing the right information for a
+ * given vote_routerstatus_t. */
+routerinfo_t *
+dir_common_generate_ri_from_rs(const vote_routerstatus_t *vrs)
+{
+ routerinfo_t *r;
+ const routerstatus_t *rs = &vrs->status;
+ static time_t published = 0;
+
+ r = tor_malloc_zero(sizeof(routerinfo_t));
+ r->cert_expiration_time = TIME_MAX;
+ memcpy(r->cache_info.identity_digest, rs->identity_digest, DIGEST_LEN);
+ memcpy(r->cache_info.signed_descriptor_digest, rs->descriptor_digest,
+ DIGEST_LEN);
+ r->cache_info.do_not_cache = 1;
+ r->cache_info.routerlist_index = -1;
+ r->cache_info.signed_descriptor_body =
+ tor_strdup("123456789012345678901234567890123");
+ r->cache_info.signed_descriptor_len =
+ strlen(r->cache_info.signed_descriptor_body);
+ r->exit_policy = smartlist_new();
+ r->cache_info.published_on = ++published + time(NULL);
+ if (rs->has_bandwidth) {
+ /*
+ * Multiply by 1000 because the routerinfo_t and the routerstatus_t
+ * seem to use different units (*sigh*) and because we seem stuck on
+ * icky and perverse decimal kilobytes (*double sigh*) - see
+ * router_get_advertised_bandwidth_capped() of routerlist.c and
+ * routerstatus_format_entry() of dirserv.c.
+ */
+ r->bandwidthrate = rs->bandwidth_kb * 1000;
+ r->bandwidthcapacity = rs->bandwidth_kb * 1000;
+ }
+ return r;
+}
+
+/** Create routerstatuses and signed vote.
+ * Create routerstatuses using *vrs_gen* and add them to global routerlist.
+ * Next, create signed vote using *sign_skey* and *vote*, which should have
+ * predefined header fields.
+ * Setting *clear_rl* clears the global routerlist before adding the new
+ * routers.
+ * Return the signed vote, same as *vote_out*. Save the number of routers added
+ * in *n_vrs*.
+ */
+networkstatus_t *
+dir_common_add_rs_and_parse(networkstatus_t *vote, networkstatus_t **vote_out,
+ vote_routerstatus_t * (*vrs_gen)(int idx, time_t now),
+ crypto_pk_t *sign_skey, int *n_vrs, time_t now,
+ int clear_rl)
+{
+ vote_routerstatus_t *vrs;
+ char *v_text=NULL;
+ const char *msg=NULL;
+ int idx;
+ was_router_added_t router_added = -1;
+ *vote_out = NULL;
+
+ if (clear_rl) {
+ nodelist_free_all();
+ routerlist_free_all();
+ }
+
+ idx = 0;
+ do {
+ vrs = vrs_gen(idx, now);
+ if (vrs) {
+ smartlist_add(vote->routerstatus_list, vrs);
+ router_added =
+ router_add_to_routerlist(dir_common_generate_ri_from_rs(vrs),
+ &msg,0,0);
+ tt_assert(router_added >= 0);
+ ++idx;
+ }
+ } while (vrs);
+ *n_vrs = idx;
+
+ /* dump the vote and try to parse it. */
+ v_text = format_networkstatus_vote(sign_skey, vote);
+ tt_assert(v_text);
+ *vote_out = networkstatus_parse_vote_from_string(v_text, NULL, NS_TYPE_VOTE);
+
+ done:
+ if (v_text)
+ tor_free(v_text);
+
+ return *vote_out;
+}
+
+/** Create a fake *vote* where *cert* describes the signer, *sign_skey*
+ * is the signing key, and *vrs_gen* is the function we'll use to create the
+ * routers on which we're voting.
+ * We pass *vote_out*, *n_vrs*, and *clear_rl* directly to vrs_gen().
+ * Return 0 on success, return -1 on failure.
+ */
+int
+dir_common_construct_vote_1(networkstatus_t **vote, authority_cert_t *cert,
+ crypto_pk_t *sign_skey,
+ vote_routerstatus_t * (*vrs_gen)(int idx, time_t now),
+ networkstatus_t **vote_out, int *n_vrs,
+ time_t now, int clear_rl)
+{
+ networkstatus_voter_info_t *voter;
+
+ dir_common_setup_vote(vote, now);
+ (*vote)->valid_after = now+1000;
+ (*vote)->fresh_until = now+2000;
+ (*vote)->valid_until = now+3000;
+ (*vote)->vote_seconds = 100;
+ (*vote)->dist_seconds = 200;
+ smartlist_split_string((*vote)->supported_methods, "1 2 3", NULL, 0, -1);
+ (*vote)->client_versions = tor_strdup("0.1.2.14,0.1.2.15");
+ (*vote)->server_versions = tor_strdup("0.1.2.14,0.1.2.15,0.1.2.16");
+ smartlist_split_string((*vote)->known_flags,
+ "Authority Exit Fast Guard Running Stable V2Dir Valid",
+ 0, SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0);
+ voter = tor_malloc_zero(sizeof(networkstatus_voter_info_t));
+ voter->nickname = tor_strdup("Voter1");
+ voter->address = tor_strdup("1.2.3.4");
+ voter->addr = 0x01020304;
+ voter->dir_port = 80;
+ voter->or_port = 9000;
+ voter->contact = tor_strdup("voter@example.com");
+ crypto_pk_get_digest(cert->identity_key, voter->identity_digest);
+ /*
+ * Set up a vote; generate it; try to parse it.
+ */
+ smartlist_add((*vote)->voters, voter);
+ (*vote)->cert = authority_cert_dup(cert);
+ smartlist_split_string((*vote)->net_params, "circuitwindow=101 foo=990",
+ NULL, 0, 0);
+ *n_vrs = 0;
+ /* add routerstatuses */
+ if (!dir_common_add_rs_and_parse(*vote, vote_out, vrs_gen, sign_skey,
+ n_vrs, now, clear_rl))
+ return -1;
+
+ return 0;
+}
+
+/** See dir_common_construct_vote_1.
+ * Produces a vote with slightly different values.
+ */
+int
+dir_common_construct_vote_2(networkstatus_t **vote, authority_cert_t *cert,
+ crypto_pk_t *sign_skey,
+ vote_routerstatus_t * (*vrs_gen)(int idx, time_t now),
+ networkstatus_t **vote_out, int *n_vrs,
+ time_t now, int clear_rl)
+{
+ networkstatus_voter_info_t *voter;
+
+ dir_common_setup_vote(vote, now);
+ (*vote)->type = NS_TYPE_VOTE;
+ (*vote)->published += 1;
+ (*vote)->valid_after = now+1000;
+ (*vote)->fresh_until = now+3005;
+ (*vote)->valid_until = now+3000;
+ (*vote)->vote_seconds = 100;
+ (*vote)->dist_seconds = 300;
+ smartlist_split_string((*vote)->supported_methods, "1 2 3", NULL, 0, -1);
+ smartlist_split_string((*vote)->known_flags,
+ "Authority Exit Fast Guard MadeOfCheese MadeOfTin "
+ "Running Stable V2Dir Valid", 0,
+ SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0);
+ voter = tor_malloc_zero(sizeof(networkstatus_voter_info_t));
+ voter->nickname = tor_strdup("Voter2");
+ voter->address = tor_strdup("2.3.4.5");
+ voter->addr = 0x02030405;
+ voter->dir_port = 80;
+ voter->or_port = 9000;
+ voter->contact = tor_strdup("voter@example.com");
+ crypto_pk_get_digest(cert->identity_key, voter->identity_digest);
+ /*
+ * Set up a vote; generate it; try to parse it.
+ */
+ smartlist_add((*vote)->voters, voter);
+ (*vote)->cert = authority_cert_dup(cert);
+ if (! (*vote)->net_params)
+ (*vote)->net_params = smartlist_new();
+ smartlist_split_string((*vote)->net_params,
+ "bar=2000000000 circuitwindow=20",
+ NULL, 0, 0);
+ /* add routerstatuses */
+ /* dump the vote and try to parse it. */
+ dir_common_add_rs_and_parse(*vote, vote_out, vrs_gen, sign_skey,
+ n_vrs, now, clear_rl);
+
+ return 0;
+}
+
+/** See dir_common_construct_vote_1.
+ * Produces a vote with slightly different values. Adds a legacy key.
+ */
+int
+dir_common_construct_vote_3(networkstatus_t **vote, authority_cert_t *cert,
+ crypto_pk_t *sign_skey,
+ vote_routerstatus_t * (*vrs_gen)(int idx, time_t now),
+ networkstatus_t **vote_out, int *n_vrs,
+ time_t now, int clear_rl)
+{
+ networkstatus_voter_info_t *voter;
+
+ dir_common_setup_vote(vote, now);
+ (*vote)->valid_after = now+1000;
+ (*vote)->fresh_until = now+2003;
+ (*vote)->valid_until = now+3000;
+ (*vote)->vote_seconds = 100;
+ (*vote)->dist_seconds = 250;
+ smartlist_split_string((*vote)->supported_methods, "1 2 3 4", NULL, 0, -1);
+ (*vote)->client_versions = tor_strdup("0.1.2.14,0.1.2.17");
+ (*vote)->server_versions = tor_strdup("0.1.2.10,0.1.2.15,0.1.2.16");
+ smartlist_split_string((*vote)->known_flags,
+ "Authority Exit Fast Guard Running Stable V2Dir Valid",
+ 0, SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0);
+ voter = tor_malloc_zero(sizeof(networkstatus_voter_info_t));
+ voter->nickname = tor_strdup("Voter2");
+ voter->address = tor_strdup("3.4.5.6");
+ voter->addr = 0x03040506;
+ voter->dir_port = 80;
+ voter->or_port = 9000;
+ voter->contact = tor_strdup("voter@example.com");
+ crypto_pk_get_digest(cert->identity_key, voter->identity_digest);
+ memset(voter->legacy_id_digest, (int)'A', DIGEST_LEN);
+ /*
+ * Set up a vote; generate it; try to parse it.
+ */
+ smartlist_add((*vote)->voters, voter);
+ (*vote)->cert = authority_cert_dup(cert);
+ smartlist_split_string((*vote)->net_params, "circuitwindow=80 foo=660",
+ NULL, 0, 0);
+ /* add routerstatuses */
+ /* dump the vote and try to parse it. */
+ dir_common_add_rs_and_parse(*vote, vote_out, vrs_gen, sign_skey,
+ n_vrs, now, clear_rl);
+
+ return 0;
+}
+
diff --git a/src/test/test_dir_common.h b/src/test/test_dir_common.h
new file mode 100644
index 0000000000..9557cb7157
--- /dev/null
+++ b/src/test/test_dir_common.h
@@ -0,0 +1,52 @@
+/* Copyright (c) 2001-2004, Roger Dingledine.
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
+ * Copyright (c) 2007-2014, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+#include "or.h"
+#include "networkstatus.h"
+#include "routerparse.h"
+
+#define TEST_DIR_ROUTER_ID_1 3
+#define TEST_DIR_ROUTER_ID_2 5
+#define TEST_DIR_ROUTER_ID_3 33
+#define TEST_DIR_ROUTER_ID_4 34
+
+#define TEST_DIR_ROUTER_DD_1 78
+#define TEST_DIR_ROUTER_DD_2 77
+#define TEST_DIR_ROUTER_DD_3 79
+#define TEST_DIR_ROUTER_DD_4 44
+
+int dir_common_authority_pk_init(authority_cert_t **cert1,
+ authority_cert_t **cert2,
+ authority_cert_t **cert3,
+ crypto_pk_t **sign_skey_1,
+ crypto_pk_t **sign_skey_2,
+ crypto_pk_t **sign_skey_3);
+
+routerinfo_t * dir_common_generate_ri_from_rs(const vote_routerstatus_t *vrs);
+
+vote_routerstatus_t * dir_common_gen_routerstatus_for_v3ns(int idx,
+ time_t now);
+
+int dir_common_construct_vote_1(networkstatus_t **vote,
+ authority_cert_t *cert1,
+ crypto_pk_t *sign_skey,
+ vote_routerstatus_t * (*vrs_gen)(int idx, time_t now),
+ networkstatus_t **vote_out, int *n_vrs, time_t now,
+ int clear_rl);
+
+int dir_common_construct_vote_2(networkstatus_t **vote,
+ authority_cert_t *cert2,
+ crypto_pk_t *sign_skey,
+ vote_routerstatus_t * (*vrs_gen)(int idx, time_t now),
+ networkstatus_t **vote_out, int *n_vrs, time_t now,
+ int clear_rl);
+
+int dir_common_construct_vote_3(networkstatus_t **vote,
+ authority_cert_t *cert3,
+ crypto_pk_t *sign_skey,
+ vote_routerstatus_t * (*vrs_gen)(int idx, time_t now),
+ networkstatus_t **vote_out, int *n_vrs, time_t now,
+ int clear_rl);
+
diff --git a/src/test/test_dns.c b/src/test/test_dns.c
index b781d6da53..6fdbe905e0 100644
--- a/src/test/test_dns.c
+++ b/src/test/test_dns.c
@@ -738,7 +738,8 @@ NS(test_main)(void *arg)
NS_UNMOCK(launch_resolve);
tor_free(on_circ);
tor_free(TO_CONN(exitconn)->address);
- tor_free(cache_entry->pending_connections);
+ if (cache_entry)
+ tor_free(cache_entry->pending_connections);
tor_free(cache_entry);
tor_free(exitconn);
return;
diff --git a/src/test/test_nodelist.c b/src/test/test_nodelist.c
index a8693ec9b5..b0cb87dc60 100644
--- a/src/test/test_nodelist.c
+++ b/src/test/test_nodelist.c
@@ -60,12 +60,53 @@ test_nodelist_node_get_verbose_nickname_not_named(void *arg)
return;
}
+/** A node should be considered a directory server if it has an open dirport
+ * of it accepts tunnelled directory requests.
+ */
+static void
+test_nodelist_node_is_dir(void *arg)
+{
+ (void)arg;
+
+ routerstatus_t rs;
+ routerinfo_t ri;
+ node_t node;
+ memset(&node, 0, sizeof(node_t));
+ memset(&rs, 0, sizeof(routerstatus_t));
+ memset(&ri, 0, sizeof(routerinfo_t));
+
+ tt_assert(!node_is_dir(&node));
+
+ node.rs = &rs;
+ tt_assert(!node_is_dir(&node));
+
+ rs.is_v2_dir = 1;
+ tt_assert(node_is_dir(&node));
+
+ rs.is_v2_dir = 0;
+ rs.dir_port = 1;
+ tt_assert(! node_is_dir(&node));
+
+ node.rs = NULL;
+ tt_assert(!node_is_dir(&node));
+ node.ri = &ri;
+ ri.supports_tunnelled_dir_requests = 1;
+ tt_assert(node_is_dir(&node));
+ ri.supports_tunnelled_dir_requests = 0;
+ ri.dir_port = 1;
+ tt_assert(! node_is_dir(&node));
+
+ done:
+ return;
+}
+
#define NODE(name, flags) \
{ #name, test_nodelist_##name, (flags), NULL, NULL }
struct testcase_t nodelist_tests[] = {
NODE(node_get_verbose_nickname_by_id_null_node, TT_FORK),
NODE(node_get_verbose_nickname_not_named, TT_FORK),
+ NODE(node_is_dir, TT_FORK),
END_OF_TESTCASES
};
diff --git a/src/test/test_options.c b/src/test/test_options.c
index a8ebadb14b..e00c8020fe 100644
--- a/src/test/test_options.c
+++ b/src/test/test_options.c
@@ -8,6 +8,18 @@
#include "confparse.h"
#include "config.h"
#include "test.h"
+#include "geoip.h"
+
+#define ROUTERSET_PRIVATE
+#include "routerset.h"
+
+#include "log_test_helpers.h"
+
+#include "sandbox.h"
+#include "memarea.h"
+#include "policies.h"
+
+#define NS_MODULE test_options
typedef struct {
int severity;
@@ -38,6 +50,7 @@ setup_log_callback(void)
lst.masks[LOG_WARN - LOG_ERR] = ~0;
lst.masks[LOG_NOTICE - LOG_ERR] = ~0;
add_callback_log(&lst, log_cback);
+ mark_logs_temp();
}
static char *
@@ -69,22 +82,41 @@ clear_log_messages(void)
messages = NULL;
}
+#define setup_options(opt,dflt) \
+ do { \
+ opt = options_new(); \
+ opt->command = CMD_RUN_TOR; \
+ options_init(opt); \
+ \
+ dflt = config_dup(&options_format, opt); \
+ clear_log_messages(); \
+ } while (0)
+
+#define VALID_DIR_AUTH "DirAuthority dizum orport=443 v3ident=E8A9C45" \
+ "EDE6D711294FADF8E7951F4DE6CA56B58 194.109.206.212:80 7EA6 EAD6 FD83" \
+ " 083C 538F 4403 8BBF A077 587D D755\n"
+#define VALID_ALT_BRIDGE_AUTH \
+ "AlternateBridgeAuthority dizum orport=443 v3ident=E8A9C45" \
+ "EDE6D711294FADF8E7951F4DE6CA56B58 194.109.206.212:80 7EA6 EAD6 FD83" \
+ " 083C 538F 4403 8BBF A077 587D D755\n"
+#define VALID_ALT_DIR_AUTH \
+ "AlternateDirAuthority dizum orport=443 v3ident=E8A9C45" \
+ "EDE6D711294FADF8E7951F4DE6CA56B58 194.109.206.212:80 7EA6 EAD6 FD83" \
+ " 083C 538F 4403 8BBF A077 587D D755\n"
+
static void
test_options_validate_impl(const char *configuration,
const char *expect_errmsg,
int expect_log_severity,
const char *expect_log)
{
- or_options_t *opt = options_new();
+ or_options_t *opt=NULL;
or_options_t *dflt;
config_line_t *cl=NULL;
char *msg=NULL;
int r;
- opt->command = CMD_RUN_TOR;
- options_init(opt);
- dflt = config_dup(&options_format, opt);
- clear_log_messages();
+ setup_options(opt, dflt);
r = config_get_lines(configuration, &cl, 1);
tt_int_op(r, OP_EQ, 0);
@@ -126,6 +158,9 @@ test_options_validate_impl(const char *configuration,
}
done:
+ memarea_clear_freelist();
+ escaped(NULL);
+ policies_free_all();
config_free_lines(cl);
or_options_free(opt);
or_options_free(dflt);
@@ -147,6 +182,7 @@ test_options_validate(void *arg)
{
(void)arg;
setup_log_callback();
+ sandbox_disable_getaddrinfo_cache();
WANT_ERR("ExtORPort 500000", "Invalid ExtORPort");
@@ -159,12 +195,4100 @@ test_options_validate(void *arg)
"ServerTransportOptions did not parse",
LOG_WARN, "\"slingsnappy\" is not a k=v");
+ WANT_ERR("DirPort 8080\nDirCache 0",
+ "DirPort configured but DirCache disabled.");
+ WANT_ERR("BridgeRelay 1\nDirCache 0",
+ "We're a bridge but DirCache is disabled.");
+
+ close_temp_logs();
+ clear_log_messages();
+ return;
+}
+
+#define MEGABYTEIFY(mb) (U64_LITERAL(mb) << 20)
+static void
+test_have_enough_mem_for_dircache(void *arg)
+{
+ (void)arg;
+ or_options_t *opt=NULL;
+ or_options_t *dflt;
+ config_line_t *cl=NULL;
+ char *msg=NULL;;
+ int r;
+ const char *configuration = "ORPort 8080\nDirCache 1", *expect_errmsg;
+
+ setup_options(opt, dflt);
+ setup_log_callback();
+ (void)dflt;
+
+ r = config_get_lines(configuration, &cl, 1);
+ tt_int_op(r, OP_EQ, 0);
+
+ r = config_assign(&options_format, opt, cl, 0, 0, &msg);
+ tt_int_op(r, OP_EQ, 0);
+
+ /* 300 MB RAM available, DirCache enabled */
+ r = have_enough_mem_for_dircache(opt, MEGABYTEIFY(300), &msg);
+ tt_int_op(r, OP_EQ, 0);
+ tt_assert(!msg);
+
+ /* 200 MB RAM available, DirCache enabled */
+ r = have_enough_mem_for_dircache(opt, MEGABYTEIFY(200), &msg);
+ tt_int_op(r, OP_EQ, -1);
+ expect_errmsg = "Being a directory cache (default) with less than ";
+ if (!strstr(msg, expect_errmsg)) {
+ TT_DIE(("Expected error message <%s> from <%s>, but got <%s>.",
+ expect_errmsg, configuration, msg));
+ }
+ tor_free(msg);
+
+ configuration = "ORPort 8080\nDirCache 1\nBridgeRelay 1";
+ r = config_get_lines(configuration, &cl, 1);
+ tt_int_op(r, OP_EQ, 0);
+
+ r = config_assign(&options_format, opt, cl, 0, 0, &msg);
+ tt_int_op(r, OP_EQ, 0);
+
+ /* 300 MB RAM available, DirCache enabled, Bridge */
+ r = have_enough_mem_for_dircache(opt, MEGABYTEIFY(300), &msg);
+ tt_int_op(r, OP_EQ, 0);
+ tt_assert(!msg);
+
+ /* 200 MB RAM available, DirCache enabled, Bridge */
+ r = have_enough_mem_for_dircache(opt, MEGABYTEIFY(200), &msg);
+ tt_int_op(r, OP_EQ, -1);
+ expect_errmsg = "Running a Bridge with less than ";
+ if (!strstr(msg, expect_errmsg)) {
+ TT_DIE(("Expected error message <%s> from <%s>, but got <%s>.",
+ expect_errmsg, configuration, msg));
+ }
+ tor_free(msg);
+
+ configuration = "ORPort 8080\nDirCache 0";
+ r = config_get_lines(configuration, &cl, 1);
+ tt_int_op(r, OP_EQ, 0);
+
+ r = config_assign(&options_format, opt, cl, 0, 0, &msg);
+ tt_int_op(r, OP_EQ, 0);
+
+ /* 200 MB RAM available, DirCache disabled */
+ r = have_enough_mem_for_dircache(opt, MEGABYTEIFY(200), &msg);
+ tt_int_op(r, OP_EQ, 0);
+ tt_assert(!msg);
+
+ /* 300 MB RAM available, DirCache disabled */
+ r = have_enough_mem_for_dircache(opt, MEGABYTEIFY(300), &msg);
+ tt_int_op(r, OP_EQ, -1);
+ expect_errmsg = "DirCache is disabled and we are configured as a ";
+ if (!strstr(msg, expect_errmsg)) {
+ TT_DIE(("Expected error message <%s> from <%s>, but got <%s>.",
+ expect_errmsg, configuration, msg));
+ }
+ tor_free(msg);
+
clear_log_messages();
+
+ done:
+ if (msg)
+ tor_free(msg);
+ tor_free(dflt);
+ tor_free(opt);
+ tor_free(cl);
return;
}
+static const char *fixed_get_uname_result = NULL;
+
+static const char *
+fixed_get_uname(void)
+{
+ return fixed_get_uname_result;
+}
+
+#define TEST_OPTIONS_OLD_VALUES "TestingV3AuthInitialVotingInterval 1800\n" \
+ "TestingClientBootstrapConsensusMaxDownloadTries 7\n" \
+ "TestingClientBootstrapConsensusAuthorityOnlyMaxDownloadTries 4\n" \
+ "TestingClientBootstrapConsensusMaxInProgressTries 3\n" \
+ "TestingV3AuthInitialVoteDelay 300\n" \
+ "TestingV3AuthInitialDistDelay 300\n" \
+ "TestingClientMaxIntervalWithoutRequest 600\n" \
+ "TestingDirConnectionMaxStall 600\n" \
+ "TestingConsensusMaxDownloadTries 8\n" \
+ "TestingDescriptorMaxDownloadTries 8\n" \
+ "TestingMicrodescMaxDownloadTries 8\n" \
+ "TestingCertMaxDownloadTries 8\n"
+
+#define TEST_OPTIONS_DEFAULT_VALUES TEST_OPTIONS_OLD_VALUES \
+ "MaxClientCircuitsPending 1\n" \
+ "RendPostPeriod 1000\n" \
+ "KeepAlivePeriod 1\n" \
+ "ConnLimit 1\n" \
+ "V3AuthVotingInterval 300\n" \
+ "V3AuthVoteDelay 20\n" \
+ "V3AuthDistDelay 20\n" \
+ "V3AuthNIntervalsValid 3\n" \
+ "VirtualAddrNetworkIPv4 127.192.0.0/10\n" \
+ "VirtualAddrNetworkIPv6 [FE80::]/10\n" \
+ "SchedulerHighWaterMark__ 42\n" \
+ "SchedulerLowWaterMark__ 10\n"
+
+typedef struct {
+ or_options_t *old_opt;
+ or_options_t *opt;
+ or_options_t *def_opt;
+} options_test_data_t;
+
+static options_test_data_t *
+get_options_test_data(const char *conf)
+{
+ config_line_t *cl=NULL;
+ options_test_data_t *result = tor_malloc(sizeof(options_test_data_t));
+ result->opt = options_new();
+ result->old_opt = options_new();
+ result->def_opt = options_new();
+ config_get_lines(conf, &cl, 1);
+ config_assign(&options_format, result->opt, cl, 0, 0, NULL);
+ config_free_lines(cl);
+ result->opt->LogTimeGranularity = 1;
+ result->opt->TokenBucketRefillInterval = 1;
+ config_get_lines(TEST_OPTIONS_OLD_VALUES, &cl, 1);
+ config_assign(&options_format, result->def_opt, cl, 0, 0, NULL);
+ config_free_lines(cl);
+ return result;
+}
+
+static void
+free_options_test_data(options_test_data_t *td)
+{
+ if (!td) return;
+ or_options_free(td->old_opt);
+ or_options_free(td->opt);
+ or_options_free(td->def_opt);
+ tor_free(td);
+}
+
+static void
+test_options_validate__uname_for_server(void *ignored)
+{
+ (void)ignored;
+ char *msg;
+ options_test_data_t *tdata = get_options_test_data(
+ "ORListenAddress 127.0.0.1:5555");
+ int previous_log = setup_capture_of_logs(LOG_WARN);
+
+ MOCK(get_uname, fixed_get_uname);
+ fixed_get_uname_result = "Windows 95";
+ options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_str_op(mock_saved_log_at(0), OP_EQ, "Tor is running as a server, but you"
+ " are running Windows 95; this probably won't work. See https://www"
+ ".torproject.org/docs/faq.html#BestOSForRelay for details.\n");
+ tor_free(msg);
+
+ fixed_get_uname_result = "Windows 98";
+ mock_clean_saved_logs();
+ options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_str_op(mock_saved_log_at(0), OP_EQ, "Tor is running as a server, but you"
+ " are running Windows 98; this probably won't work. See https://www"
+ ".torproject.org/docs/faq.html#BestOSForRelay for details.\n");
+ tor_free(msg);
+
+ fixed_get_uname_result = "Windows Me";
+ mock_clean_saved_logs();
+ options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_str_op(mock_saved_log_at(0), OP_EQ, "Tor is running as a server, but you"
+ " are running Windows Me; this probably won't work. See https://www"
+ ".torproject.org/docs/faq.html#BestOSForRelay for details.\n");
+ tor_free(msg);
+
+ fixed_get_uname_result = "Windows 2000";
+ mock_clean_saved_logs();
+ options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(mock_saved_log_number(), OP_EQ, 1);
+ tor_free(msg);
+
+ done:
+ UNMOCK(get_uname);
+ free_options_test_data(tdata);
+ tor_free(msg);
+ teardown_capture_of_logs(previous_log);
+}
+
+static void
+test_options_validate__outbound_addresses(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = get_options_test_data(
+ "OutboundBindAddress xxyy!!!sdfaf");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+
+ done:
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__data_directory(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = get_options_test_data(
+ "DataDirectory longreallyl"
+ "ongLONGLONGlongreallylong"
+ "LONGLONGlongreallylongLON"
+ "GLONGlongreallylongLONGLO"
+ "NGlongreallylongLONGLONGl"
+ "ongreallylongLONGLONGlong"
+ "reallylongLONGLONGlongrea"
+ "llylongLONGLONGlongreally"
+ "longLONGLONGlongreallylon"
+ "gLONGLONGlongreallylongLO"
+ "NGLONGlongreallylongLONGL"
+ "ONGlongreallylongLONGLONG"
+ "longreallylongLONGLONGlon"
+ "greallylongLONGLONGlongre"
+ "allylongLONGLONGlongreall"
+ "ylongLONGLONGlongreallylo"
+ "ngLONGLONGlongreallylongL"
+ "ONGLONGlongreallylongLONG"
+ "LONG"); // 440 characters
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "Invalid DataDirectory");
+
+ done:
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__nickname(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = get_options_test_data(
+ "Nickname ThisNickNameIsABitTooLong");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "Nickname 'ThisNickNameIsABitTooLong' is wrong length or"
+ " contains illegal characters.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("Nickname AMoreValidNick");
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_assert(!msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("DataDirectory /tmp/somewhere");
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_assert(!msg);
+
+ done:
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__contactinfo(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = get_options_test_data(
+ "ORListenAddress 127.0.0.1:5555\nORPort 955");
+ int previous_log = setup_capture_of_logs(LOG_DEBUG);
+ tdata->opt->ContactInfo = NULL;
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(mock_saved_log_at(0), OP_EQ,
+ "Your ContactInfo config option is not"
+ " set. Please consider setting it, so we can contact you if your"
+ " server is misconfigured or something else goes wrong.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("ORListenAddress 127.0.0.1:5555\nORPort 955\n"
+ "ContactInfo hella@example.org");
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(mock_saved_log_at(0), OP_NE,
+ "Your ContactInfo config option is not"
+ " set. Please consider setting it, so we can contact you if your"
+ " server is misconfigured or something else goes wrong.\n");
+ tor_free(msg);
+
+ done:
+ teardown_capture_of_logs(previous_log);
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+extern int quiet_level;
+
+static void
+test_options_validate__logs(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ (void)ret;
+ char *msg;
+ int orig_quiet_level = quiet_level;
+ options_test_data_t *tdata = get_options_test_data("");
+ tdata->opt->Logs = NULL;
+ tdata->opt->RunAsDaemon = 0;
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_str_op(tdata->opt->Logs->key, OP_EQ, "Log");
+ tt_str_op(tdata->opt->Logs->value, OP_EQ, "notice stdout");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("");
+ tdata->opt->Logs = NULL;
+ tdata->opt->RunAsDaemon = 0;
+ quiet_level = 1;
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_str_op(tdata->opt->Logs->key, OP_EQ, "Log");
+ tt_str_op(tdata->opt->Logs->value, OP_EQ, "warn stdout");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("");
+ tdata->opt->Logs = NULL;
+ tdata->opt->RunAsDaemon = 0;
+ quiet_level = 2;
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_assert(!tdata->opt->Logs);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("");
+ tdata->opt->Logs = NULL;
+ tdata->opt->RunAsDaemon = 0;
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 1, &msg);
+ tt_assert(!tdata->opt->Logs);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("");
+ tdata->opt->Logs = NULL;
+ tdata->opt->RunAsDaemon = 1;
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_assert(!tdata->opt->Logs);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("");
+ tdata->opt->RunAsDaemon = 0;
+ config_line_t *cl=NULL;
+ config_get_lines("Log foo", &cl, 1);
+ tdata->opt->Logs = cl;
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op((intptr_t)tdata->opt->Logs, OP_EQ, (intptr_t)cl);
+
+ done:
+ quiet_level = orig_quiet_level;
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+/* static config_line_t * */
+/* mock_config_line(const char *key, const char *val) */
+/* { */
+/* config_line_t *config_line = tor_malloc(sizeof(config_line_t)); */
+/* memset(config_line, 0, sizeof(config_line_t)); */
+/* config_line->key = tor_strdup(key); */
+/* config_line->value = tor_strdup(val); */
+/* return config_line; */
+/* } */
+
+static void
+test_options_validate__authdir(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ int previous_log = setup_capture_of_logs(LOG_INFO);
+ options_test_data_t *tdata = get_options_test_data(
+ "AuthoritativeDirectory 1\n"
+ "Address this.should.not_exist.example.org");
+
+ sandbox_disable_getaddrinfo_cache();
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "Failed to resolve/guess local address. See logs for"
+ " details.");
+ tt_str_op(mock_saved_log_at(0), OP_EQ, "Could not resolve local Address "
+ "'this.should.not_exist.example.org'. Failing.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("AuthoritativeDirectory 1\n"
+ "Address 100.200.10.1");
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_assert(!msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("AuthoritativeDirectory 1\n"
+ "Address 100.200.10.1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "Authoritative directory servers must set ContactInfo");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("AuthoritativeDirectory 1\n"
+ "Address 100.200.10.1\n"
+ "TestingTorNetwork 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "AuthoritativeDir is set, but none of (Bridge/V3)"
+ "AuthoritativeDir is set.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("AuthoritativeDirectory 1\n"
+ "Address 100.200.10.1\n"
+ "ContactInfo hello@hello.com\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "AuthoritativeDir is set, but none of (Bridge/V3)"
+ "AuthoritativeDir is set.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("AuthoritativeDirectory 1\n"
+ "Address 100.200.10.1\n"
+ "RecommendedVersions 1.2, 3.14\n"
+ "ContactInfo hello@hello.com\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+ mock_clean_saved_logs();
+ options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_str_op(tdata->opt->RecommendedClientVersions->value, OP_EQ, "1.2, 3.14");
+ tt_str_op(tdata->opt->RecommendedServerVersions->value, OP_EQ, "1.2, 3.14");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("AuthoritativeDirectory 1\n"
+ "Address 100.200.10.1\n"
+ "RecommendedVersions 1.2, 3.14\n"
+ "RecommendedClientVersions 25\n"
+ "RecommendedServerVersions 4.18\n"
+ "ContactInfo hello@hello.com\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+ mock_clean_saved_logs();
+ options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_str_op(tdata->opt->RecommendedClientVersions->value, OP_EQ, "25");
+ tt_str_op(tdata->opt->RecommendedServerVersions->value, OP_EQ, "4.18");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("AuthoritativeDirectory 1\n"
+ "Address 100.200.10.1\n"
+ "VersioningAuthoritativeDirectory 1\n"
+ "RecommendedVersions 1.2, 3.14\n"
+ "RecommendedClientVersions 25\n"
+ "RecommendedServerVersions 4.18\n"
+ "ContactInfo hello@hello.com\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+ mock_clean_saved_logs();
+ options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_str_op(msg, OP_EQ, "AuthoritativeDir is set, but none of (Bridge/V3)"
+ "AuthoritativeDir is set.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("AuthoritativeDirectory 1\n"
+ "Address 100.200.10.1\n"
+ "VersioningAuthoritativeDirectory 1\n"
+ "RecommendedServerVersions 4.18\n"
+ "ContactInfo hello@hello.com\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+ mock_clean_saved_logs();
+ options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_str_op(msg, OP_EQ, "Versioning authoritative dir servers must set "
+ "Recommended*Versions.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("AuthoritativeDirectory 1\n"
+ "Address 100.200.10.1\n"
+ "VersioningAuthoritativeDirectory 1\n"
+ "RecommendedClientVersions 4.18\n"
+ "ContactInfo hello@hello.com\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+ mock_clean_saved_logs();
+ options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_str_op(msg, OP_EQ, "Versioning authoritative dir servers must set "
+ "Recommended*Versions.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("AuthoritativeDirectory 1\n"
+ "Address 100.200.10.1\n"
+ "UseEntryGuards 1\n"
+ "ContactInfo hello@hello.com\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+ mock_clean_saved_logs();
+ options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_str_op(mock_saved_log_at(0), OP_EQ, "Authoritative directory servers "
+ "can't set UseEntryGuards. Disabling.\n");
+ tt_int_op(tdata->opt->UseEntryGuards, OP_EQ, 0);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("AuthoritativeDirectory 1\n"
+ "Address 100.200.10.1\n"
+ "V3AuthoritativeDir 1\n"
+ "ContactInfo hello@hello.com\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+ mock_clean_saved_logs();
+ options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_str_op(mock_saved_log_at(0), OP_EQ, "Authoritative directories always try"
+ " to download extra-info documents. Setting DownloadExtraInfo.\n");
+ tt_int_op(tdata->opt->DownloadExtraInfo, OP_EQ, 1);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("AuthoritativeDirectory 1\n"
+ "Address 100.200.10.1\n"
+ "DownloadExtraInfo 1\n"
+ "V3AuthoritativeDir 1\n"
+ "ContactInfo hello@hello.com\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+ mock_clean_saved_logs();
+ options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_str_op(mock_saved_log_at(0), OP_NE, "Authoritative directories always try"
+ " to download extra-info documents. Setting DownloadExtraInfo.\n");
+ tt_int_op(tdata->opt->DownloadExtraInfo, OP_EQ, 1);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("AuthoritativeDirectory 1\n"
+ "Address 100.200.10.1\n"
+ "ContactInfo hello@hello.com\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+ mock_clean_saved_logs();
+ options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_str_op(msg, OP_EQ, "AuthoritativeDir is set, but none of (Bridge/V3)"
+ "AuthoritativeDir is set.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("AuthoritativeDirectory 1\n"
+ "Address 100.200.10.1\n"
+ "BridgeAuthoritativeDir 1\n"
+ "ContactInfo hello@hello.com\n"
+ "V3BandwidthsFile non-existant-file\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+ mock_clean_saved_logs();
+ options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_str_op(msg, OP_EQ,
+ "Running as authoritative directory, but no DirPort set.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("AuthoritativeDirectory 1\n"
+ "Address 100.200.10.1\n"
+ "BridgeAuthoritativeDir 1\n"
+ "ContactInfo hello@hello.com\n"
+ "V3BandwidthsFile non-existant-file\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+ mock_clean_saved_logs();
+ options_validate(NULL, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_str_op(msg, OP_EQ,
+ "Running as authoritative directory, but no DirPort set.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("AuthoritativeDirectory 1\n"
+ "Address 100.200.10.1\n"
+ "BridgeAuthoritativeDir 1\n"
+ "ContactInfo hello@hello.com\n"
+ "GuardfractionFile non-existant-file\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+ mock_clean_saved_logs();
+ options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_str_op(msg, OP_EQ,
+ "Running as authoritative directory, but no DirPort set.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("AuthoritativeDirectory 1\n"
+ "Address 100.200.10.1\n"
+ "BridgeAuthoritativeDir 1\n"
+ "ContactInfo hello@hello.com\n"
+ "GuardfractionFile non-existant-file\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+ mock_clean_saved_logs();
+ options_validate(NULL, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_str_op(msg, OP_EQ,
+ "Running as authoritative directory, but no DirPort set.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("AuthoritativeDirectory 1\n"
+ "Address 100.200.10.1\n"
+ "BridgeAuthoritativeDir 1\n"
+ "ContactInfo hello@hello.com\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "Running as authoritative directory, but no DirPort set.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("AuthoritativeDirectory 1\n"
+ "Address 100.200.10.1\n"
+ "DirPort 999\n"
+ "BridgeAuthoritativeDir 1\n"
+ "ContactInfo hello@hello.com\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "Running as authoritative directory, but no ORPort set.");
+ tor_free(msg);
+
+ // TODO: This case can't be reached, since clientonly is used to
+ // check when parsing port lines as well.
+ /* free_options_test_data(tdata); */
+ /* tdata = get_options_test_data("AuthoritativeDirectory 1\n" */
+ /* "Address 100.200.10.1\n" */
+ /* "DirPort 999\n" */
+ /* "ORPort 888\n" */
+ /* "ClientOnly 1\n" */
+ /* "BridgeAuthoritativeDir 1\n" */
+ /* "ContactInfo hello@hello.com\n" */
+ /* "SchedulerHighWaterMark__ 42\n" */
+ /* "SchedulerLowWaterMark__ 10\n"); */
+ /* mock_clean_saved_logs(); */
+ /* ret = options_validate(tdata->old_opt, tdata->opt, */
+ /* tdata->def_opt, 0, &msg); */
+ /* tt_int_op(ret, OP_EQ, -1); */
+ /* tt_str_op(msg, OP_EQ, "Running as authoritative directory, " */
+ /* "but ClientOnly also set."); */
+
+ done:
+ teardown_capture_of_logs(previous_log);
+ sandbox_free_getaddrinfo_cache();
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__relay_with_hidden_services(void *ignored)
+{
+ (void)ignored;
+ char *msg;
+ int previous_log = setup_capture_of_logs(LOG_DEBUG);
+ options_test_data_t *tdata = get_options_test_data(
+ "ORListenAddress 127.0.0.1:5555\n"
+ "ORPort 955\n"
+ "HiddenServiceDir "
+ "/Library/Tor/var/lib/tor/hidden_service/\n"
+ "HiddenServicePort 80 127.0.0.1:8080\n"
+ );
+
+ options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_str_op(mock_saved_log_at(1), OP_EQ,
+ "Tor is currently configured as a relay and a hidden service. "
+ "That's not very secure: you should probably run your hidden servi"
+ "ce in a separate Tor process, at least -- see "
+ "https://trac.torproject.org/8742\n");
+
+ done:
+ teardown_capture_of_logs(previous_log);
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+// TODO: it doesn't seem possible to hit the case of having no port lines at
+// all, since there will be a default created for SocksPort
+/* static void */
+/* test_options_validate__ports(void *ignored) */
+/* { */
+/* (void)ignored; */
+/* int ret; */
+/* char *msg; */
+/* int previous_log = setup_capture_of_logs(LOG_WARN); */
+/* options_test_data_t *tdata = get_options_test_data(""); */
+/* ret = options_validate(tdata->old_opt, tdata->opt, */
+/* tdata->def_opt, 0, &msg); */
+/* tt_str_op(mock_saved_log_at(0), OP_EQ, */
+/* "SocksPort, TransPort, NATDPort, DNSPort, and ORPort are all " */
+/* "undefined, and there aren't any hidden services configured. " */
+/* " Tor will still run, but probably won't do anything.\n"); */
+/* done: */
+/* teardown_capture_of_logs(previous_log); */
+/* free_options_test_data(tdata); */
+/* tor_free(msg); */
+/* } */
+
+static void
+test_options_validate__transproxy(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata;
+
+#ifdef USE_TRANSPARENT
+ // Test default trans proxy
+ tdata = get_options_test_data("TransProxyType default\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_int_op(tdata->opt->TransProxyType_parsed, OP_EQ, TPT_DEFAULT);
+ tor_free(msg);
+
+ // Test pf-divert trans proxy
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("TransProxyType pf-divert\n");
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+
+#if !defined(__OpenBSD__) && !defined( DARWIN )
+ tt_str_op(msg, OP_EQ,
+ "pf-divert is a OpenBSD-specific and OS X/Darwin-specific feature.");
+#else
+ tt_int_op(tdata->opt->TransProxyType_parsed, OP_EQ, TPT_PF_DIVERT);
+ tt_str_op(msg, OP_EQ, "Cannot use TransProxyType without "
+ "any valid TransPort or TransListenAddress.");
+#endif
+ tor_free(msg);
+
+ // Test tproxy trans proxy
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("TransProxyType tproxy\n");
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+
+#if !defined(__linux__)
+ tt_str_op(msg, OP_EQ, "TPROXY is a Linux-specific feature.");
+#else
+ tt_int_op(tdata->opt->TransProxyType_parsed, OP_EQ, TPT_TPROXY);
+ tt_str_op(msg, OP_EQ, "Cannot use TransProxyType without any valid "
+ "TransPort or TransListenAddress.");
+#endif
+ tor_free(msg);
+
+ // Test ipfw trans proxy
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("TransProxyType ipfw\n");
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+
+#if !defined(__FreeBSD__) && !defined( DARWIN )
+ tt_str_op(msg, OP_EQ, "ipfw is a FreeBSD-specificand OS X/Darwin-specific "
+ "feature.");
+#else
+ tt_int_op(tdata->opt->TransProxyType_parsed, OP_EQ, TPT_IPFW);
+ tt_str_op(msg, OP_EQ, "Cannot use TransProxyType without any valid "
+ "TransPort or TransListenAddress.");
+#endif
+ tor_free(msg);
+
+ // Test unknown trans proxy
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("TransProxyType non-existant\n");
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "Unrecognized value for TransProxyType");
+ tor_free(msg);
+
+ // Test trans proxy success
+ free_options_test_data(tdata);
+
+#if defined(linux)
+ tdata = get_options_test_data("TransProxyType tproxy\n"
+ "TransPort 127.0.0.1:123\n");
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_assert(!msg);
+#endif
+#if defined(__FreeBSD__) || defined( DARWIN )
+ tdata = get_options_test_data("TransProxyType ipfw\n"
+ "TransPort 127.0.0.1:123\n");
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_assert(!msg);
+#endif
+#if defined(__OpenBSD__)
+ tdata = get_options_test_data("TransProxyType pf-divert\n"
+ "TransPort 127.0.0.1:123\n");
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_assert(!msg);
+#endif
+
+#else
+ tdata = get_options_test_data("TransPort 127.0.0.1:555\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "TransPort and TransListenAddress are disabled in "
+ "this build.");
+ tor_free(msg);
+#endif
+
+ done:
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+NS_DECL(country_t, geoip_get_country, (const char *country));
+
+static country_t
+NS(geoip_get_country)(const char *countrycode)
+{
+ (void)countrycode;
+ CALLED(geoip_get_country)++;
+
+ return 1;
+}
+
+static void
+test_options_validate__exclude_nodes(void *ignored)
+{
+ (void)ignored;
+
+ NS_MOCK(geoip_get_country);
+
+ int ret;
+ char *msg;
+ int previous_log = setup_capture_of_logs(LOG_WARN);
+ options_test_data_t *tdata = get_options_test_data(
+ "ExcludeExitNodes {us}\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_int_op(smartlist_len(tdata->opt->ExcludeExitNodesUnion_->list), OP_EQ, 1);
+ tt_str_op((char *)
+ (smartlist_get(tdata->opt->ExcludeExitNodesUnion_->list, 0)),
+ OP_EQ, "{us}");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("ExcludeNodes {cn}\n");
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_int_op(smartlist_len(tdata->opt->ExcludeExitNodesUnion_->list), OP_EQ, 1);
+ tt_str_op((char *)
+ (smartlist_get(tdata->opt->ExcludeExitNodesUnion_->list, 0)),
+ OP_EQ, "{cn}");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("ExcludeNodes {cn}\n"
+ "ExcludeExitNodes {us} {cn}\n");
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_int_op(smartlist_len(tdata->opt->ExcludeExitNodesUnion_->list), OP_EQ, 2);
+ tt_str_op((char *)
+ (smartlist_get(tdata->opt->ExcludeExitNodesUnion_->list, 0)),
+ OP_EQ, "{us} {cn}");
+ tt_str_op((char *)
+ (smartlist_get(tdata->opt->ExcludeExitNodesUnion_->list, 1)),
+ OP_EQ, "{cn}");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("ExcludeNodes {cn}\n"
+ "StrictNodes 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(mock_saved_log_at(0), OP_EQ,
+ "You have asked to exclude certain relays from all positions "
+ "in your circuits. Expect hidden services and other Tor "
+ "features to be broken in unpredictable ways.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("ExcludeNodes {cn}\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(mock_saved_log_at(0), OP_NE,
+ "You have asked to exclude certain relays from all positions "
+ "in your circuits. Expect hidden services and other Tor "
+ "features to be broken in unpredictable ways.\n");
+ tor_free(msg);
+
+ done:
+ NS_UNMOCK(geoip_get_country);
+ teardown_capture_of_logs(previous_log);
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__scheduler(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ int previous_log = setup_capture_of_logs(LOG_DEBUG);
+ options_test_data_t *tdata = get_options_test_data(
+ "SchedulerLowWaterMark__ 0\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(mock_saved_log_at(0), OP_EQ,
+ "Bad SchedulerLowWaterMark__ option\n");
+ tor_free(msg);
+
+ // TODO: this test cannot run on platforms where UINT32_MAX == UINT64_MAX.
+ // I suspect it's unlikely this branch can actually happen
+ /* free_options_test_data(tdata); */
+ /* tdata = get_options_test_data( */
+ /* "SchedulerLowWaterMark 10000000000000000000\n"); */
+ /* tdata->opt->SchedulerLowWaterMark__ = (uint64_t)UINT32_MAX; */
+ /* tdata->opt->SchedulerLowWaterMark__++; */
+ /* mock_clean_saved_logs(); */
+ /* ret = options_validate(tdata->old_opt, tdata->opt, */
+ /* tdata->def_opt, 0, &msg); */
+ /* tt_int_op(ret, OP_EQ, -1); */
+ /* tt_str_op(mock_saved_log_at(1), OP_EQ, */
+ /* "Bad SchedulerLowWaterMark__ option\n"); */
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("SchedulerLowWaterMark__ 42\n"
+ "SchedulerHighWaterMark__ 42\n");
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(mock_saved_log_at(0), OP_EQ,
+ "Bad SchedulerHighWaterMark option\n");
+ tor_free(msg);
+
+ done:
+ teardown_capture_of_logs(previous_log);
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__node_families(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = get_options_test_data(
+ "NodeFamily flux, flax\n"
+ "NodeFamily somewhere\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_assert(tdata->opt->NodeFamilySets);
+ tt_int_op(smartlist_len(tdata->opt->NodeFamilySets), OP_EQ, 2);
+ tt_str_op((char *)(smartlist_get(
+ ((routerset_t *)smartlist_get(tdata->opt->NodeFamilySets, 0))->list, 0)),
+ OP_EQ, "flux");
+ tt_str_op((char *)(smartlist_get(
+ ((routerset_t *)smartlist_get(tdata->opt->NodeFamilySets, 0))->list, 1)),
+ OP_EQ, "flax");
+ tt_str_op((char *)(smartlist_get(
+ ((routerset_t *)smartlist_get(tdata->opt->NodeFamilySets, 1))->list, 0)),
+ OP_EQ, "somewhere");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_assert(!tdata->opt->NodeFamilySets);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("NodeFamily !flux\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_assert(tdata->opt->NodeFamilySets);
+ tt_int_op(smartlist_len(tdata->opt->NodeFamilySets), OP_EQ, 0);
+ tor_free(msg);
+
+ done:
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__tlsec(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ int previous_log = setup_capture_of_logs(LOG_DEBUG);
+ options_test_data_t *tdata = get_options_test_data(
+ "TLSECGroup ed25519\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(mock_saved_log_at(0), OP_EQ,
+ "Unrecognized TLSECGroup: Falling back to the default.\n");
+ tt_assert(!tdata->opt->TLSECGroup);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("TLSECGroup P224\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(mock_saved_log_at(0), OP_NE,
+ "Unrecognized TLSECGroup: Falling back to the default.\n");
+ tt_assert(tdata->opt->TLSECGroup);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("TLSECGroup P256\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(mock_saved_log_at(0), OP_NE,
+ "Unrecognized TLSECGroup: Falling back to the default.\n");
+ tt_assert(tdata->opt->TLSECGroup);
+ tor_free(msg);
+
+ done:
+ teardown_capture_of_logs(previous_log);
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__token_bucket(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = get_options_test_data("");
+
+ tdata->opt->TokenBucketRefillInterval = 0;
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "TokenBucketRefillInterval must be between 1 and 1000 inclusive.");
+ tor_free(msg);
+
+ tdata->opt->TokenBucketRefillInterval = 1001;
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "TokenBucketRefillInterval must be between 1 and 1000 inclusive.");
+ tor_free(msg);
+
+ done:
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__recommended_packages(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ int previous_log = setup_capture_of_logs(LOG_WARN);
+ options_test_data_t *tdata = get_options_test_data(
+ "RecommendedPackages foo 1.2 http://foo.com sha1=123123123123\n"
+ "RecommendedPackages invalid-package-line\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_int_op(mock_saved_log_number(), OP_EQ, 1);
+ tt_str_op(mock_saved_log_at(0), OP_NE, "Invalid RecommendedPackage line "
+ "invalid-package-line will be ignored\n");
+
+ done:
+ escaped(NULL); // This will free the leaking memory from the previous escaped
+ teardown_capture_of_logs(previous_log);
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__fetch_dir(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = get_options_test_data(
+ "FetchDirInfoExtraEarly 1\n"
+ "FetchDirInfoEarly 0\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "FetchDirInfoExtraEarly requires that you"
+ " also set FetchDirInfoEarly");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("FetchDirInfoExtraEarly 1\n"
+ "FetchDirInfoEarly 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_NE, "FetchDirInfoExtraEarly requires that you"
+ " also set FetchDirInfoEarly");
+ tor_free(msg);
+
+ done:
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__conn_limit(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = get_options_test_data(
+ "ConnLimit 0\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "ConnLimit must be greater than 0, but was set to 0");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "MaxClientCircuitsPending must be between 1 and 1024, "
+ "but was set to 0");
+ tor_free(msg);
+
+ done:
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__paths_needed(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ int previous_log = setup_capture_of_logs(LOG_WARN);
+ options_test_data_t *tdata = get_options_test_data(
+ "PathsNeededToBuildCircuits 0.1\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_assert(tdata->opt->PathsNeededToBuildCircuits > 0.24 &&
+ tdata->opt->PathsNeededToBuildCircuits < 0.26);
+ tt_int_op(mock_saved_log_number(), OP_EQ, 1);
+ tt_str_op(mock_saved_log_at(0), OP_EQ,
+ "PathsNeededToBuildCircuits is too low. Increasing to 0.25\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ mock_clean_saved_logs();
+ tdata = get_options_test_data("PathsNeededToBuildCircuits 0.99\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_assert(tdata->opt->PathsNeededToBuildCircuits > 0.94 &&
+ tdata->opt->PathsNeededToBuildCircuits < 0.96);
+ tt_int_op(mock_saved_log_number(), OP_EQ, 1);
+ tt_str_op(mock_saved_log_at(0), OP_EQ, "PathsNeededToBuildCircuits is "
+ "too high. Decreasing to 0.95\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ mock_clean_saved_logs();
+ tdata = get_options_test_data("PathsNeededToBuildCircuits 0.91\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_assert(tdata->opt->PathsNeededToBuildCircuits > 0.90 &&
+ tdata->opt->PathsNeededToBuildCircuits < 0.92);
+ tt_int_op(mock_saved_log_number(), OP_EQ, 0);
+ tor_free(msg);
+
+ done:
+ teardown_capture_of_logs(previous_log);
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__max_client_circuits(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = get_options_test_data(
+ "MaxClientCircuitsPending 0\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "MaxClientCircuitsPending must be between 1 and 1024,"
+ " but was set to 0");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("MaxClientCircuitsPending 1025\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "MaxClientCircuitsPending must be between 1 and 1024,"
+ " but was set to 1025");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("MaxClientCircuitsPending 1\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "KeepalivePeriod option must be positive.");
+ tor_free(msg);
+
+ done:
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__ports(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = get_options_test_data(
+ "FirewallPorts 65537\n"
+ "MaxClientCircuitsPending 1\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "Port '65537' out of range in FirewallPorts");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("FirewallPorts 1\n"
+ "LongLivedPorts 124444\n"
+ "MaxClientCircuitsPending 1\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "Port '124444' out of range in LongLivedPorts");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("FirewallPorts 1\n"
+ "LongLivedPorts 2\n"
+ "RejectPlaintextPorts 112233\n"
+ "MaxClientCircuitsPending 1\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "Port '112233' out of range in RejectPlaintextPorts");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("FirewallPorts 1\n"
+ "LongLivedPorts 2\n"
+ "RejectPlaintextPorts 3\n"
+ "WarnPlaintextPorts 65536\n"
+ "MaxClientCircuitsPending 1\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "Port '65536' out of range in WarnPlaintextPorts");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("FirewallPorts 1\n"
+ "LongLivedPorts 2\n"
+ "RejectPlaintextPorts 3\n"
+ "WarnPlaintextPorts 4\n"
+ "MaxClientCircuitsPending 1\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "KeepalivePeriod option must be positive.");
+ tor_free(msg);
+
+ done:
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__reachable_addresses(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ int previous_log = setup_capture_of_logs(LOG_NOTICE);
+ options_test_data_t *tdata = get_options_test_data(
+ "FascistFirewall 1\n"
+ "MaxClientCircuitsPending 1\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_int_op(mock_saved_log_number(), OP_EQ, 6);
+ tt_str_op(mock_saved_log_at(1), OP_EQ, "Converting FascistFirewall config "
+ "option to new format: \"ReachableDirAddresses *:80\"\n");
+ tt_str_op(tdata->opt->ReachableDirAddresses->value, OP_EQ, "*:80");
+ tt_str_op(mock_saved_log_at(2), OP_EQ, "Converting FascistFirewall config "
+ "option to new format: \"ReachableORAddresses *:443\"\n");
+ tt_str_op(tdata->opt->ReachableORAddresses->value, OP_EQ, "*:443");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ mock_clean_saved_logs();
+ tdata = get_options_test_data("FascistFirewall 1\n"
+ "ReachableDirAddresses *:81\n"
+ "ReachableORAddresses *:444\n"
+ "MaxClientCircuitsPending 1\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+ tdata->opt->FirewallPorts = smartlist_new();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_int_op(mock_saved_log_number(), OP_EQ, 4);
+ tt_str_op(tdata->opt->ReachableDirAddresses->value, OP_EQ, "*:81");
+ tt_str_op(tdata->opt->ReachableORAddresses->value, OP_EQ, "*:444");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ mock_clean_saved_logs();
+ tdata = get_options_test_data("FascistFirewall 1\n"
+ "FirewallPort 123\n"
+ "MaxClientCircuitsPending 1\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_int_op(mock_saved_log_number(), OP_EQ, 5);
+ tt_str_op(mock_saved_log_at(1), OP_EQ, "Converting FascistFirewall and "
+ "FirewallPorts config options to new format: "
+ "\"ReachableAddresses *:123\"\n");
+ tt_str_op(tdata->opt->ReachableAddresses->value, OP_EQ, "*:123");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ mock_clean_saved_logs();
+ tdata = get_options_test_data("FascistFirewall 1\n"
+ "ReachableAddresses *:82\n"
+ "ReachableAddresses *:83\n"
+ "ReachableAddresses reject *:*\n"
+ "MaxClientCircuitsPending 1\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_int_op(mock_saved_log_number(), OP_EQ, 4);
+ tt_str_op(tdata->opt->ReachableAddresses->value, OP_EQ, "*:82");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("ReachableAddresses *:82\n"
+ "ORListenAddress 127.0.0.1:5555\n"
+ "ORPort 955\n"
+ "MaxClientCircuitsPending 1\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "Servers must be able to freely connect to the rest of"
+ " the Internet, so they must not set Reachable*Addresses or"
+ " FascistFirewall.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("ReachableORAddresses *:82\n"
+ "ORListenAddress 127.0.0.1:5555\n"
+ "ORPort 955\n"
+ "MaxClientCircuitsPending 1\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "Servers must be able to freely connect to the rest of"
+ " the Internet, so they must not set Reachable*Addresses or"
+ " FascistFirewall.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("ReachableDirAddresses *:82\n"
+ "ORListenAddress 127.0.0.1:5555\n"
+ "ORPort 955\n"
+ "MaxClientCircuitsPending 1\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "Servers must be able to freely connect to the rest of"
+ " the Internet, so they must not set Reachable*Addresses or"
+ " FascistFirewall.");
+ tor_free(msg);
+
+ done:
+ teardown_capture_of_logs(previous_log);
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__use_bridges(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = get_options_test_data(
+ "UseBridges 1\n"
+ "ORListenAddress 127.0.0.1:5555\n"
+ "ORPort 955\n"
+ "MaxClientCircuitsPending 1\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "Servers must be able to freely connect to the rest of"
+ " the Internet, so they must not set UseBridges.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("UseBridges 1\n"
+ "MaxClientCircuitsPending 1\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_NE, "Servers must be able to freely connect to the rest of"
+ " the Internet, so they must not set UseBridges.");
+ tor_free(msg);
+
+ NS_MOCK(geoip_get_country);
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("UseBridges 1\n"
+ "EntryNodes {cn}\n"
+ "MaxClientCircuitsPending 1\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "You cannot set both UseBridges and EntryNodes.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "UseBridges 1\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "If you set UseBridges, you must specify at least one bridge.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "UseBridges 1\n"
+ "Bridge 10.0.0.1\n"
+ "Bridge !!!\n"
+ );
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "Bridge line did not parse. See logs for details.");
+ tor_free(msg);
+
+ done:
+ NS_UNMOCK(geoip_get_country);
+ memarea_clear_freelist();
+ policies_free_all();
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__entry_nodes(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ NS_MOCK(geoip_get_country);
+ options_test_data_t *tdata = get_options_test_data(
+ "EntryNodes {cn}\n"
+ "UseEntryGuards 0\n"
+ "MaxClientCircuitsPending 1\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "If EntryNodes is set, UseEntryGuards must be enabled.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("EntryNodes {cn}\n"
+ "UseEntryGuards 1\n"
+ "MaxClientCircuitsPending 1\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "KeepalivePeriod option must be positive.");
+ tor_free(msg);
+
+ done:
+ NS_UNMOCK(geoip_get_country);
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__invalid_nodes(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = get_options_test_data(
+ "AllowInvalidNodes something_stupid\n"
+ "MaxClientCircuitsPending 1\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "Unrecognized value 'something_stupid' in AllowInvalidNodes");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("AllowInvalidNodes entry, middle, exit\n"
+ "MaxClientCircuitsPending 1\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_int_op(tdata->opt->AllowInvalid_, OP_EQ, ALLOW_INVALID_ENTRY |
+ ALLOW_INVALID_EXIT | ALLOW_INVALID_MIDDLE);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("AllowInvalidNodes introduction, rendezvous\n"
+ "MaxClientCircuitsPending 1\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_int_op(tdata->opt->AllowInvalid_, OP_EQ, ALLOW_INVALID_INTRODUCTION |
+ ALLOW_INVALID_RENDEZVOUS);
+ tor_free(msg);
+
+ done:
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__safe_logging(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = get_options_test_data(
+ "MaxClientCircuitsPending 1\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_int_op(tdata->opt->SafeLogging_, OP_EQ, SAFELOG_SCRUB_NONE);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("SafeLogging 0\n"
+ "MaxClientCircuitsPending 1\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_int_op(tdata->opt->SafeLogging_, OP_EQ, SAFELOG_SCRUB_NONE);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("SafeLogging Relay\n"
+ "MaxClientCircuitsPending 1\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_int_op(tdata->opt->SafeLogging_, OP_EQ, SAFELOG_SCRUB_RELAY);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("SafeLogging 1\n"
+ "MaxClientCircuitsPending 1\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_int_op(tdata->opt->SafeLogging_, OP_EQ, SAFELOG_SCRUB_ALL);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("SafeLogging stuffy\n"
+ "MaxClientCircuitsPending 1\n"
+ "ConnLimit 1\n"
+ "SchedulerHighWaterMark__ 42\n"
+ "SchedulerLowWaterMark__ 10\n");
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "Unrecognized value '\"stuffy\"' in SafeLogging");
+ tor_free(msg);
+
+ done:
+ escaped(NULL); // This will free the leaking memory from the previous escaped
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__publish_server_descriptor(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ int previous_log = setup_capture_of_logs(LOG_WARN);
+ options_test_data_t *tdata = get_options_test_data(
+ "PublishServerDescriptor bridge\n" TEST_OPTIONS_DEFAULT_VALUES
+ );
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_assert(!msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("PublishServerDescriptor humma\n"
+ TEST_OPTIONS_DEFAULT_VALUES);
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "Unrecognized value in PublishServerDescriptor");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("PublishServerDescriptor bridge, v3\n"
+ TEST_OPTIONS_DEFAULT_VALUES);
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "Bridges are not supposed to publish router "
+ "descriptors to the directory authorities. Please correct your "
+ "PublishServerDescriptor line.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("BridgeRelay 1\n"
+ "PublishServerDescriptor v3\n"
+ TEST_OPTIONS_DEFAULT_VALUES);
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "Bridges are not supposed to publish router "
+ "descriptors to the directory authorities. Please correct your "
+ "PublishServerDescriptor line.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("BridgeRelay 1\n" TEST_OPTIONS_DEFAULT_VALUES);
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_NE, "Bridges are not supposed to publish router "
+ "descriptors to the directory authorities. Please correct your "
+ "PublishServerDescriptor line.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data("BridgeRelay 1\n"
+ "DirPort 999\n" TEST_OPTIONS_DEFAULT_VALUES);
+
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(mock_saved_log_at(1), OP_EQ, "Can't set a DirPort on a bridge "
+ "relay; disabling DirPort\n");
+ tt_assert(!tdata->opt->DirPort_lines);
+ tt_assert(!tdata->opt->DirPort_set);
+
+ done:
+ teardown_capture_of_logs(previous_log);
+ memarea_clear_freelist();
+ policies_free_all();
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__testing(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = NULL;
+
+#define ENSURE_DEFAULT(varname, varval) \
+ STMT_BEGIN \
+ free_options_test_data(tdata); \
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES \
+ #varname " " #varval "\n"); \
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);\
+ tt_str_op(msg, OP_EQ, \
+ #varname " may only be changed in testing Tor networks!"); \
+ tt_int_op(ret, OP_EQ, -1); \
+ tor_free(msg); \
+ \
+ free_options_test_data(tdata); \
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES \
+ #varname " " #varval "\n" \
+ VALID_DIR_AUTH \
+ "TestingTorNetwork 1\n"); \
+ \
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);\
+ if (msg) { \
+ tt_str_op(msg, OP_NE, \
+ #varname " may only be changed in testing Tor networks!"); \
+ tor_free(msg); \
+ } \
+ \
+ free_options_test_data(tdata); \
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES \
+ #varname " " #varval "\n" \
+ "___UsingTestNetworkDefaults 1\n"); \
+ \
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);\
+ if (msg) { \
+ tt_str_op(msg, OP_NE, \
+ #varname " may only be changed in testing Tor networks!"); \
+ tor_free(msg); \
+ } \
+ STMT_END
+
+ ENSURE_DEFAULT(TestingV3AuthInitialVotingInterval, 3600);
+ ENSURE_DEFAULT(TestingV3AuthInitialVoteDelay, 3000);
+ ENSURE_DEFAULT(TestingV3AuthInitialDistDelay, 3000);
+ ENSURE_DEFAULT(TestingV3AuthVotingStartOffset, 3000);
+ ENSURE_DEFAULT(TestingAuthDirTimeToLearnReachability, 3000);
+ ENSURE_DEFAULT(TestingEstimatedDescriptorPropagationTime, 3000);
+ ENSURE_DEFAULT(TestingServerDownloadSchedule, 3000);
+ ENSURE_DEFAULT(TestingClientDownloadSchedule, 3000);
+ ENSURE_DEFAULT(TestingServerConsensusDownloadSchedule, 3000);
+ ENSURE_DEFAULT(TestingClientConsensusDownloadSchedule, 3000);
+ ENSURE_DEFAULT(TestingBridgeDownloadSchedule, 3000);
+ ENSURE_DEFAULT(TestingClientMaxIntervalWithoutRequest, 3000);
+ ENSURE_DEFAULT(TestingDirConnectionMaxStall, 3000);
+ ENSURE_DEFAULT(TestingConsensusMaxDownloadTries, 3000);
+ ENSURE_DEFAULT(TestingDescriptorMaxDownloadTries, 3000);
+ ENSURE_DEFAULT(TestingMicrodescMaxDownloadTries, 3000);
+ ENSURE_DEFAULT(TestingCertMaxDownloadTries, 3000);
+ ENSURE_DEFAULT(TestingAuthKeyLifetime, 3000);
+ ENSURE_DEFAULT(TestingLinkCertLifetime, 3000);
+ ENSURE_DEFAULT(TestingSigningKeySlop, 3000);
+ ENSURE_DEFAULT(TestingAuthKeySlop, 3000);
+ ENSURE_DEFAULT(TestingLinkKeySlop, 3000);
+
+ done:
+ escaped(NULL); // This will free the leaking memory from the previous escaped
+ memarea_clear_freelist();
+ policies_free_all();
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__hidserv(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ int previous_log = setup_capture_of_logs(LOG_WARN);
+
+ options_test_data_t *tdata = get_options_test_data(
+ TEST_OPTIONS_DEFAULT_VALUES);
+ tdata->opt->MinUptimeHidServDirectoryV2 = -1;
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(1), OP_EQ, "MinUptimeHidServDirectoryV2 "
+ "option must be at least 0 seconds. Changing to 0.\n");
+ tt_int_op(tdata->opt->MinUptimeHidServDirectoryV2, OP_EQ, 0);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "RendPostPeriod 1\n" );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(1), OP_EQ, "RendPostPeriod option is too short;"
+ " raising to 600 seconds.\n");
+ tt_int_op(tdata->opt->RendPostPeriod, OP_EQ, 600);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "RendPostPeriod 302401\n" );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(1), OP_EQ, "RendPostPeriod is too large; "
+ "clipping to 302400s.\n");
+ tt_int_op(tdata->opt->RendPostPeriod, OP_EQ, 302400);
+ tor_free(msg);
+
+ done:
+ teardown_capture_of_logs(previous_log);
+ memarea_clear_freelist();
+ policies_free_all();
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__predicted_ports(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ int previous_log = setup_capture_of_logs(LOG_WARN);
+
+ options_test_data_t *tdata = get_options_test_data(
+ "PredictedPortsRelevanceTime 100000000\n"
+ TEST_OPTIONS_DEFAULT_VALUES);
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(1), OP_EQ, "PredictedPortsRelevanceTime is too "
+ "large; clipping to 3600s.\n");
+ tt_int_op(tdata->opt->PredictedPortsRelevanceTime, OP_EQ, 3600);
+
+ done:
+ teardown_capture_of_logs(previous_log);
+ memarea_clear_freelist();
+ policies_free_all();
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__path_bias(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+
+ options_test_data_t *tdata = get_options_test_data(
+ TEST_OPTIONS_DEFAULT_VALUES
+ "PathBiasNoticeRate 1.1\n");
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "PathBiasNoticeRate is too high. It must be between 0 and 1.0");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "PathBiasWarnRate 1.1\n");
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "PathBiasWarnRate is too high. It must be between 0 and 1.0");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "PathBiasExtremeRate 1.1\n");
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "PathBiasExtremeRate is too high. It must be between 0 and 1.0");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "PathBiasNoticeUseRate 1.1\n");
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "PathBiasNoticeUseRate is too high. It must be between 0 and 1.0");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "PathBiasExtremeUseRate 1.1\n");
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "PathBiasExtremeUseRate is too high. It must be between 0 and 1.0");
+ tor_free(msg);
+
+ done:
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__bandwidth(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = NULL;
+
+#define ENSURE_BANDWIDTH_PARAM(p) \
+ STMT_BEGIN \
+ free_options_test_data(tdata); \
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES #p " 3Gb\n"); \
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);\
+ tt_int_op(ret, OP_EQ, -1); \
+ tt_mem_op(msg, OP_EQ, #p " (3221225471) must be at most 2147483647", 40); \
+ tor_free(msg); \
+ STMT_END
+
+ ENSURE_BANDWIDTH_PARAM(BandwidthRate);
+ ENSURE_BANDWIDTH_PARAM(BandwidthBurst);
+ ENSURE_BANDWIDTH_PARAM(MaxAdvertisedBandwidth);
+ ENSURE_BANDWIDTH_PARAM(RelayBandwidthRate);
+ ENSURE_BANDWIDTH_PARAM(RelayBandwidthBurst);
+ ENSURE_BANDWIDTH_PARAM(PerConnBWRate);
+ ENSURE_BANDWIDTH_PARAM(PerConnBWBurst);
+ ENSURE_BANDWIDTH_PARAM(AuthDirFastGuarantee);
+ ENSURE_BANDWIDTH_PARAM(AuthDirGuardBWGuarantee);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "RelayBandwidthRate 1000\n");
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_u64_op(tdata->opt->RelayBandwidthBurst, OP_EQ, 1000);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "RelayBandwidthBurst 1001\n");
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_u64_op(tdata->opt->RelayBandwidthRate, OP_EQ, 1001);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "RelayBandwidthRate 1001\n"
+ "RelayBandwidthBurst 1000\n");
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "RelayBandwidthBurst must be at least equal to "
+ "RelayBandwidthRate.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "BandwidthRate 1001\n"
+ "BandwidthBurst 1000\n");
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "BandwidthBurst must be at least equal to BandwidthRate.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "RelayBandwidthRate 1001\n"
+ "BandwidthRate 1000\n"
+ "BandwidthBurst 1000\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_u64_op(tdata->opt->BandwidthRate, OP_EQ, 1001);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "RelayBandwidthRate 1001\n"
+ "BandwidthRate 1000\n"
+ "RelayBandwidthBurst 1001\n"
+ "BandwidthBurst 1000\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_u64_op(tdata->opt->BandwidthBurst, OP_EQ, 1001);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "ORListenAddress 127.0.0.1:5555\n"
+ "ORPort 955\n"
+ "BandwidthRate 1\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "BandwidthRate is set to 1 bytes/second. For servers,"
+ " it must be at least 76800.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "ORListenAddress 127.0.0.1:5555\n"
+ "ORPort 955\n"
+ "BandwidthRate 76800\n"
+ "MaxAdvertisedBandwidth 30000\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "MaxAdvertisedBandwidth is set to 30000 bytes/second."
+ " For servers, it must be at least 38400.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "ORListenAddress 127.0.0.1:5555\n"
+ "ORPort 955\n"
+ "BandwidthRate 76800\n"
+ "RelayBandwidthRate 1\n"
+ "MaxAdvertisedBandwidth 38400\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "RelayBandwidthRate is set to 1 bytes/second. For "
+ "servers, it must be at least 76800.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "ORListenAddress 127.0.0.1:5555\n"
+ "ORPort 955\n"
+ "BandwidthRate 76800\n"
+ "BandwidthBurst 76800\n"
+ "RelayBandwidthRate 76800\n"
+ "MaxAdvertisedBandwidth 38400\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tor_free(msg);
+
+ done:
+ memarea_clear_freelist();
+ policies_free_all();
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__circuits(void *ignored)
+{
+ (void)ignored;
+ char *msg;
+ options_test_data_t *tdata = NULL;
+ int previous_log = setup_capture_of_logs(LOG_WARN);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "MaxCircuitDirtiness 2592001\n");
+ options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_str_op(mock_saved_log_at(1), OP_EQ, "MaxCircuitDirtiness option is too "
+ "high; setting to 30 days.\n");
+ tt_int_op(tdata->opt->MaxCircuitDirtiness, OP_EQ, 2592000);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ mock_clean_saved_logs();
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "CircuitStreamTimeout 1\n");
+ options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_str_op(mock_saved_log_at(2), OP_EQ, "CircuitStreamTimeout option is too"
+ " short; raising to 10 seconds.\n");
+ tt_int_op(tdata->opt->CircuitStreamTimeout, OP_EQ, 10);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ mock_clean_saved_logs();
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "CircuitStreamTimeout 111\n");
+ options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_str_op(mock_saved_log_at(2), OP_NE, "CircuitStreamTimeout option is too"
+ " short; raising to 10 seconds.\n");
+ tt_int_op(tdata->opt->CircuitStreamTimeout, OP_EQ, 111);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ mock_clean_saved_logs();
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "HeartbeatPeriod 1\n");
+ options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_str_op(mock_saved_log_at(2), OP_EQ, "HeartbeatPeriod option is too short;"
+ " raising to 1800 seconds.\n");
+ tt_int_op(tdata->opt->HeartbeatPeriod, OP_EQ, 1800);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ mock_clean_saved_logs();
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "HeartbeatPeriod 1982\n");
+ options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_str_op(mock_saved_log_at(2), OP_NE, "HeartbeatPeriod option is too short;"
+ " raising to 1800 seconds.\n");
+ tt_int_op(tdata->opt->HeartbeatPeriod, OP_EQ, 1982);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ mock_clean_saved_logs();
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "CircuitBuildTimeout 1\n"
+ );
+ options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_str_op(mock_saved_log_at(1), OP_EQ, "CircuitBuildTimeout is shorter (1"
+ " seconds) than the recommended minimum (10 seconds), and "
+ "LearnCircuitBuildTimeout is disabled. If tor isn't working, "
+ "raise this value or enable LearnCircuitBuildTimeout.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ mock_clean_saved_logs();
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "CircuitBuildTimeout 11\n"
+ );
+ options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_str_op(mock_saved_log_at(1), OP_NE, "CircuitBuildTimeout is shorter (1 "
+ "seconds) than the recommended minimum (10 seconds), and "
+ "LearnCircuitBuildTimeout is disabled. If tor isn't working, "
+ "raise this value or enable LearnCircuitBuildTimeout.\n");
+ tor_free(msg);
+
+ done:
+ memarea_clear_freelist();
+ policies_free_all();
+ teardown_capture_of_logs(previous_log);
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__port_forwarding(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = NULL;
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "PortForwarding 1\nSandbox 1\n");
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "PortForwarding is not compatible with Sandbox;"
+ " at most one can be set");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "PortForwarding 1\nSandbox 0\n");
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_assert(!msg);
+ tor_free(msg);
+
+ done:
+ free_options_test_data(tdata);
+ memarea_clear_freelist();
+ policies_free_all();
+ tor_free(msg);
+}
+
+static void
+test_options_validate__tor2web(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = NULL;
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "Tor2webRendezvousPoints 1\n");
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "Tor2webRendezvousPoints cannot be set without Tor2webMode.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "Tor2webRendezvousPoints 1\nTor2webMode 1\n");
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tor_free(msg);
+
+ done:
+ memarea_clear_freelist();
+ policies_free_all();
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__rend(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = NULL;
+ int previous_log = setup_capture_of_logs(LOG_WARN);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "UseEntryGuards 0\n"
+ "HiddenServiceDir /Library/Tor/var/lib/tor/hidden_service/\n"
+ "HiddenServicePort 80 127.0.0.1:8080\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(1), OP_EQ, "UseEntryGuards is disabled, but you"
+ " have configured one or more hidden services on this Tor "
+ "instance. Your hidden services will be very easy to locate using"
+ " a well-known attack -- see http://freehaven.net/anonbib/#hs-"
+ "attack06 for details.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(
+ TEST_OPTIONS_DEFAULT_VALUES
+ "UseEntryGuards 1\n"
+ "HiddenServiceDir /Library/Tor/var/lib/tor/hidden_service/\n"
+ "HiddenServicePort 80 127.0.0.1:8080\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(1), OP_NE, "UseEntryGuards is disabled, but you"
+ " have configured one or more hidden services on this Tor "
+ "instance. Your hidden services will be very easy to locate using"
+ " a well-known attack -- see http://freehaven.net/anonbib/#hs-"
+ "attack06 for details.\n");
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "HiddenServicePort 80 127.0.0.1:8080\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "Failed to configure rendezvous options. See logs for details.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "HidServAuth failed\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "Failed to configure client authorization for hidden "
+ "services. See logs for details.");
+ tor_free(msg);
+
+ done:
+ memarea_clear_freelist();
+ policies_free_all();
+ teardown_capture_of_logs(previous_log);
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__accounting(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = NULL;
+ int previous_log = setup_capture_of_logs(LOG_WARN);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "AccountingRule something_bad\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "AccountingRule must be 'sum', 'max', 'in', or 'out'");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "AccountingRule sum\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(tdata->opt->AccountingRule, OP_EQ, ACCT_SUM);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "AccountingRule max\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(tdata->opt->AccountingRule, OP_EQ, ACCT_MAX);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "AccountingStart fail\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "Failed to parse accounting options. See logs for details.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "AccountingMax 10\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(
+ TEST_OPTIONS_DEFAULT_VALUES
+ "ORListenAddress 127.0.0.1:5555\n"
+ "ORPort 955\n"
+ "BandwidthRate 76800\n"
+ "BandwidthBurst 76800\n"
+ "MaxAdvertisedBandwidth 38400\n"
+ "HiddenServiceDir /Library/Tor/var/lib/tor/hidden_service/\n"
+ "HiddenServicePort 80 127.0.0.1:8080\n"
+ "AccountingMax 10\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(4), OP_EQ, "Using accounting with a hidden "
+ "service and an ORPort is risky: your hidden service(s) and "
+ "your public address will all turn off at the same time, "
+ "which may alert observers that they are being run by the "
+ "same party.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(
+ TEST_OPTIONS_DEFAULT_VALUES
+ "HiddenServiceDir /Library/Tor/var/lib/tor/hidden_service/\n"
+ "HiddenServicePort 80 127.0.0.1:8080\n"
+ "AccountingMax 10\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(4), OP_NE, "Using accounting with a hidden "
+ "service and an ORPort is risky: your hidden service(s) and "
+ "your public address will all turn off at the same time, "
+ "which may alert observers that they are being run by the "
+ "same party.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(
+ TEST_OPTIONS_DEFAULT_VALUES
+ "HiddenServiceDir /Library/Tor/var/lib/tor/hidden_service/\n"
+ "HiddenServicePort 80 127.0.0.1:8080\n"
+ "HiddenServiceDir /Library/Tor/var/lib/tor/hidden_service2/\n"
+ "HiddenServicePort 81 127.0.0.1:8081\n"
+ "AccountingMax 10\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(3), OP_EQ, "Using accounting with multiple "
+ "hidden services is risky: they will all turn off at the same"
+ " time, which may alert observers that they are being run by "
+ "the same party.\n");
+ tor_free(msg);
+
+ done:
+ teardown_capture_of_logs(previous_log);
+ memarea_clear_freelist();
+ policies_free_all();
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__proxy(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = NULL;
+ sandbox_disable_getaddrinfo_cache();
+ int previous_log = setup_capture_of_logs(LOG_WARN);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "HttpProxy 127.0.42.1\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(tdata->opt->HTTPProxyPort, OP_EQ, 80);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "HttpProxy 127.0.42.1:444\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(tdata->opt->HTTPProxyPort, OP_EQ, 444);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "HttpProxy not_so_valid!\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "HTTPProxy failed to parse or resolve. Please fix.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "HttpProxyAuthenticator "
+ "onetwothreonetwothreonetwothreonetwothreonetw"
+ "othreonetwothreonetwothreonetwothreonetwothre"
+ "onetwothreonetwothreonetwothreonetwothreonetw"
+ "othreonetwothreonetwothreonetwothreonetwothre"
+ "onetwothreonetwothreonetwothreonetwothreonetw"
+ "othreonetwothreonetwothreonetwothreonetwothre"
+ "onetwothreonetwothreonetwothreonetwothreonetw"
+ "othreonetwothreonetwothreonetwothreonetwothre"
+ "onetwothreonetwothreonetwothreonetwothreonetw"
+ "othreonetwothreonetwothreonetwothreonetwothre"
+ "onetwothreonetwothreonetwothreonetwothreonetw"
+ "othreonetwothreeonetwothreeonetwothree"
+
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "HTTPProxyAuthenticator is too long (>= 512 chars).");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "HttpProxyAuthenticator validauth\n"
+
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "HttpsProxy 127.0.42.1\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(tdata->opt->HTTPSProxyPort, OP_EQ, 443);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "HttpsProxy 127.0.42.1:444\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(tdata->opt->HTTPSProxyPort, OP_EQ, 444);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "HttpsProxy not_so_valid!\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "HTTPSProxy failed to parse or resolve. Please fix.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "HttpsProxyAuthenticator "
+ "onetwothreonetwothreonetwothreonetwothreonetw"
+ "othreonetwothreonetwothreonetwothreonetwothre"
+ "onetwothreonetwothreonetwothreonetwothreonetw"
+ "othreonetwothreonetwothreonetwothreonetwothre"
+ "onetwothreonetwothreonetwothreonetwothreonetw"
+ "othreonetwothreonetwothreonetwothreonetwothre"
+ "onetwothreonetwothreonetwothreonetwothreonetw"
+ "othreonetwothreonetwothreonetwothreonetwothre"
+ "onetwothreonetwothreonetwothreonetwothreonetw"
+ "othreonetwothreonetwothreonetwothreonetwothre"
+ "onetwothreonetwothreonetwothreonetwothreonetw"
+ "othreonetwothreeonetwothreeonetwothree"
+
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "HTTPSProxyAuthenticator is too long (>= 512 chars).");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "HttpsProxyAuthenticator validauth\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "Socks4Proxy 127.0.42.1\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(tdata->opt->Socks4ProxyPort, OP_EQ, 1080);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "Socks4Proxy 127.0.42.1:444\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(tdata->opt->Socks4ProxyPort, OP_EQ, 444);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "Socks4Proxy not_so_valid!\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "Socks4Proxy failed to parse or resolve. Please fix.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "Socks5Proxy 127.0.42.1\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(tdata->opt->Socks5ProxyPort, OP_EQ, 1080);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "Socks5Proxy 127.0.42.1:444\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(tdata->opt->Socks5ProxyPort, OP_EQ, 444);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "Socks5Proxy not_so_valid!\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "Socks5Proxy failed to parse or resolve. Please fix.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "Socks4Proxy 215.1.1.1\n"
+ "Socks5Proxy 215.1.1.2\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "You have configured more than one proxy type. "
+ "(Socks4Proxy|Socks5Proxy|HTTPSProxy)");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "HttpProxy 215.1.1.1\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(2), OP_EQ, "HTTPProxy configured, but no SOCKS "
+ "proxy or HTTPS proxy configured. Watch out: this configuration "
+ "will proxy unencrypted directory connections only.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "HttpProxy 215.1.1.1\n"
+ "Socks4Proxy 215.1.1.1\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(2), OP_NE, "HTTPProxy configured, but no SOCKS "
+ "proxy or HTTPS proxy configured. Watch out: this configuration "
+ "will proxy unencrypted directory connections only.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "HttpProxy 215.1.1.1\n"
+ "Socks5Proxy 215.1.1.1\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(2), OP_NE, "HTTPProxy configured, but no SOCKS "
+ "proxy or HTTPS proxy configured. Watch out: this configuration "
+ "will proxy unencrypted directory connections only.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "HttpProxy 215.1.1.1\n"
+ "HttpsProxy 215.1.1.1\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(2), OP_NE,
+ "HTTPProxy configured, but no SOCKS proxy or HTTPS proxy "
+ "configured. Watch out: this configuration will proxy "
+ "unencrypted directory connections only.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ );
+ tdata->opt->Socks5ProxyUsername = tor_strdup("");
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "Socks5ProxyUsername must be between 1 and 255 characters.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ );
+ tdata->opt->Socks5ProxyUsername =
+ tor_strdup("ABCDEABCDE0123456789ABCDEABCDE0123456789ABCDEABCDE0123456789AB"
+ "CDEABCDE0123456789ABCDEABCDE0123456789ABCDEABCDE0123456789ABCD"
+ "EABCDE0123456789ABCDEABCDE0123456789ABCDEABCDE0123456789ABCDEA"
+ "BCDE0123456789ABCDEABCDE0123456789ABCDEABCDE0123456789ABCDEABC"
+ "DE0123456789ABCDEABCDE0123456789ABCDEABCDE0123456789");
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "Socks5ProxyUsername must be between 1 and 255 characters.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "Socks5ProxyUsername hello_world\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "Socks5ProxyPassword must be included with "
+ "Socks5ProxyUsername.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "Socks5ProxyUsername hello_world\n"
+ );
+ tdata->opt->Socks5ProxyPassword = tor_strdup("");
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "Socks5ProxyPassword must be between 1 and 255 characters.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "Socks5ProxyUsername hello_world\n"
+ );
+ tdata->opt->Socks5ProxyPassword =
+ tor_strdup("ABCDEABCDE0123456789ABCDEABCDE0123456789ABCDEABCDE0123456789AB"
+ "CDEABCDE0123456789ABCDEABCDE0123456789ABCDEABCDE0123456789ABCD"
+ "EABCDE0123456789ABCDEABCDE0123456789ABCDEABCDE0123456789ABCDEA"
+ "BCDE0123456789ABCDEABCDE0123456789ABCDEABCDE0123456789ABCDEABC"
+ "DE0123456789ABCDEABCDE0123456789ABCDEABCDE0123456789");
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "Socks5ProxyPassword must be between 1 and 255 characters.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "Socks5ProxyUsername hello_world\n"
+ "Socks5ProxyPassword world_hello\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "Socks5ProxyPassword hello_world\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "Socks5ProxyPassword must be included with "
+ "Socks5ProxyUsername.");
+ tor_free(msg);
+
+ done:
+ teardown_capture_of_logs(previous_log);
+ free_options_test_data(tdata);
+ memarea_clear_freelist();
+ policies_free_all();
+ sandbox_free_getaddrinfo_cache();
+ tor_free(msg);
+}
+
+static void
+test_options_validate__control(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = NULL;
+ int previous_log = setup_capture_of_logs(LOG_WARN);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "HashedControlPassword something_incorrect\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "Bad HashedControlPassword: wrong length or bad encoding");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "HashedControlPassword 16:872860B76453A77D60CA"
+ "2BB8C1A7042072093276A3D701AD684053EC4C\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(
+ TEST_OPTIONS_DEFAULT_VALUES
+ "__HashedControlSessionPassword something_incorrect\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "Bad HashedControlSessionPassword: wrong length or "
+ "bad encoding");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "__HashedControlSessionPassword 16:872860B7645"
+ "3A77D60CA2BB8C1A7042072093276A3D701AD684053EC"
+ "4C\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(
+ TEST_OPTIONS_DEFAULT_VALUES
+ "__OwningControllerProcess something_incorrect\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "Bad OwningControllerProcess: invalid PID");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "__OwningControllerProcess 123\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "ControlPort 127.0.0.1:1234\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(2), OP_EQ,
+ "ControlPort is open, but no authentication method has been "
+ "configured. This means that any program on your computer can "
+ "reconfigure your Tor. That's bad! You should upgrade your Tor"
+ " controller as soon as possible.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "ControlPort 127.0.0.1:1234\n"
+ "HashedControlPassword 16:872860B76453A77D60CA"
+ "2BB8C1A7042072093276A3D701AD684053EC4C\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(2), OP_NE,
+ "ControlPort is open, but no authentication method has been "
+ "configured. This means that any program on your computer can "
+ "reconfigure your Tor. That's bad! You should upgrade your Tor "
+ "controller as soon as possible.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "ControlPort 127.0.0.1:1234\n"
+ "__HashedControlSessionPassword 16:872860B7645"
+ "3A77D60CA2BB8C1A7042072093276A3D701AD684053EC"
+ "4C\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(2), OP_NE,
+ "ControlPort is open, but no authentication method has been "
+ "configured. This means that any program on your computer can "
+ "reconfigure your Tor. That's bad! You should upgrade your Tor "
+ "controller as soon as possible.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "ControlPort 127.0.0.1:1234\n"
+ "CookieAuthentication 1\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(2), OP_NE,
+ "ControlPort is open, but no authentication method has been "
+ "configured. This means that any program on your computer can "
+ "reconfigure your Tor. That's bad! You should upgrade your Tor "
+ "controller as soon as possible.\n");
+ tor_free(msg);
+
+#ifdef HAVE_SYS_UN_H
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "ControlSocket unix:/tmp WorldWritable\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(2), OP_EQ,
+ "ControlSocket is world writable, but no authentication method has"
+ " been configured. This means that any program on your computer "
+ "can reconfigure your Tor. That's bad! You should upgrade your "
+ "Tor controller as soon as possible.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "ControlSocket unix:/tmp WorldWritable\n"
+ "HashedControlPassword 16:872860B76453A77D60CA"
+ "2BB8C1A7042072093276A3D701AD684053EC4C\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(2), OP_NE,
+ "ControlSocket is world writable, but no authentication method has"
+ " been configured. This means that any program on your computer "
+ "can reconfigure your Tor. That's bad! You should upgrade your "
+ "Tor controller as soon as possible.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "ControlSocket unix:/tmp WorldWritable\n"
+ "__HashedControlSessionPassword 16:872860B7645"
+ "3A77D60CA2BB8C1A7042072093276A3D701AD684053EC"
+ "4C\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(2), OP_NE,
+ "ControlSocket is world writable, but no authentication method has"
+ " been configured. This means that any program on your computer "
+ "can reconfigure your Tor. That's bad! You should upgrade your "
+ "Tor controller as soon as possible.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "ControlSocket unix:/tmp WorldWritable\n"
+ "CookieAuthentication 1\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(2), OP_NE,
+ "ControlSocket is world writable, but no authentication method has"
+ " been configured. This means that any program on your computer "
+ "can reconfigure your Tor. That's bad! You should upgrade your "
+ "Tor controller as soon as possible.\n");
+ tor_free(msg);
+#endif
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "CookieAuthFileGroupReadable 1\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(2), OP_EQ,
+ "CookieAuthFileGroupReadable is set, but will have no effect: you "
+ "must specify an explicit CookieAuthFile to have it "
+ "group-readable.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "CookieAuthFileGroupReadable 1\n"
+ "CookieAuthFile /tmp/somewhere\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(2), OP_NE,
+ "CookieAuthFileGroupReadable is set, but will have no effect: you "
+ "must specify an explicit CookieAuthFile to have it "
+ "group-readable.\n");
+ tor_free(msg);
+
+ done:
+ teardown_capture_of_logs(previous_log);
+ memarea_clear_freelist();
+ policies_free_all();
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__families(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = NULL;
+ int previous_log = setup_capture_of_logs(LOG_WARN);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "MyFamily home\n"
+ "BridgeRelay 1\n"
+ "ORListenAddress 127.0.0.1:5555\n"
+ "ORPort 955\n"
+ "BandwidthRate 51300\n"
+ "BandwidthBurst 51300\n"
+ "MaxAdvertisedBandwidth 25700\n"
+ "DirCache 1\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(2), OP_EQ,
+ "Listing a family for a bridge relay is not supported: it can "
+ "reveal bridge fingerprints to censors. You should also make sure "
+ "you aren't listing this bridge's fingerprint in any other "
+ "MyFamily.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "MyFamily home\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(2), OP_NE,
+ "Listing a family for a bridge relay is not supported: it can "
+ "reveal bridge fingerprints to censors. You should also make sure "
+ "you aren't listing this bridge's fingerprint in any other "
+ "MyFamily.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "MyFamily !\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "Invalid nickname '!' in MyFamily line");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "NodeFamily foo\n"
+ "NodeFamily !\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_assert(!msg);
+ tor_free(msg);
+
+ done:
+ teardown_capture_of_logs(previous_log);
+ memarea_clear_freelist();
+ policies_free_all();
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__addr_policies(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = NULL;
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "ExitPolicy !!!\n"
+ "ExitRelay 1\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "Error in ExitPolicy entry.");
+ tor_free(msg);
+
+ done:
+ memarea_clear_freelist();
+ policies_free_all();
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__dir_auth(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = NULL;
+ int previous_log = setup_capture_of_logs(LOG_WARN);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ VALID_DIR_AUTH
+ VALID_ALT_DIR_AUTH
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "Directory authority/fallback line did not parse. See logs for "
+ "details.");
+ tt_str_op(mock_saved_log_at(2), OP_EQ,
+ "You cannot set both DirAuthority and Alternate*Authority.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "TestingTorNetwork 1\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "TestingTorNetwork may only be configured in combination with a "
+ "non-default set of DirAuthority or both of AlternateDirAuthority "
+ "and AlternateBridgeAuthority configured.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ VALID_DIR_AUTH
+ "TestingTorNetwork 1\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "TestingTorNetwork 1\n"
+ VALID_ALT_DIR_AUTH
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "TestingTorNetwork may only be configured in combination with a "
+ "non-default set of DirAuthority or both of AlternateDirAuthority "
+ "and AlternateBridgeAuthority configured.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "TestingTorNetwork 1\n"
+ VALID_ALT_BRIDGE_AUTH
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "TestingTorNetwork may only be configured in "
+ "combination with a non-default set of DirAuthority or both of "
+ "AlternateDirAuthority and AlternateBridgeAuthority configured.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ VALID_ALT_DIR_AUTH
+ VALID_ALT_BRIDGE_AUTH
+ "TestingTorNetwork 1\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tor_free(msg);
+
+ done:
+ memarea_clear_freelist();
+ policies_free_all();
+ teardown_capture_of_logs(previous_log);
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__transport(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = NULL;
+ int previous_log = setup_capture_of_logs(LOG_NOTICE);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "ClientTransportPlugin !!\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "Invalid client transport line. See logs for details.");
+ tt_str_op(mock_saved_log_at(3), OP_EQ,
+ "Too few arguments on ClientTransportPlugin line.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "ClientTransportPlugin foo exec bar\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "ServerTransportPlugin !!\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "Invalid server transport line. See logs for details.");
+ tt_str_op(mock_saved_log_at(3), OP_EQ,
+ "Too few arguments on ServerTransportPlugin line.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "ServerTransportPlugin foo exec bar\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(3), OP_EQ,
+ "Tor is not configured as a relay but you specified a "
+ "ServerTransportPlugin line (\"foo exec bar\"). The "
+ "ServerTransportPlugin line will be ignored.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "ServerTransportPlugin foo exec bar\n"
+ "ORListenAddress 127.0.0.1:5555\n"
+ "ORPort 955\n"
+ "BandwidthRate 76900\n"
+ "BandwidthBurst 76900\n"
+ "MaxAdvertisedBandwidth 38500\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(3), OP_NE,
+ "Tor is not configured as a relay but you specified a "
+ "ServerTransportPlugin line (\"foo exec bar\"). The "
+ "ServerTransportPlugin line will be ignored.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "ServerTransportListenAddr foo 127.0.0.42:55\n"
+ "ServerTransportListenAddr !\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "ServerTransportListenAddr did not parse. See logs for details.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "ServerTransportListenAddr foo 127.0.0.42:55\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(3), OP_EQ,
+ "You need at least a single managed-proxy to specify a transport "
+ "listen address. The ServerTransportListenAddr line will be "
+ "ignored.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "ServerTransportListenAddr foo 127.0.0.42:55\n"
+ "ServerTransportPlugin foo exec bar\n"
+ "ORListenAddress 127.0.0.1:5555\n"
+ "ORPort 955\n"
+ "BandwidthRate 76900\n"
+ "BandwidthBurst 76900\n"
+ "MaxAdvertisedBandwidth 38500\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(3), OP_NE,
+ "You need at least a single managed-proxy to specify a transport "
+ "listen address. The ServerTransportListenAddr line will be "
+ "ignored.\n");
+
+ done:
+ escaped(NULL); // This will free the leaking memory from the previous escaped
+ memarea_clear_freelist();
+ policies_free_all();
+ teardown_capture_of_logs(previous_log);
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__constrained_sockets(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = NULL;
+ int previous_log = setup_capture_of_logs(LOG_WARN);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "ConstrainedSockets 1\n"
+ "ConstrainedSockSize 0\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "ConstrainedSockSize is invalid. Must be a value "
+ "between 2048 and 262144 in 1024 byte increments.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "ConstrainedSockets 1\n"
+ "ConstrainedSockSize 263168\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "ConstrainedSockSize is invalid. Must be a value "
+ "between 2048 and 262144 in 1024 byte increments.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "ConstrainedSockets 1\n"
+ "ConstrainedSockSize 2047\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "ConstrainedSockSize is invalid. Must be a value "
+ "between 2048 and 262144 in 1024 byte increments.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "ConstrainedSockets 1\n"
+ "ConstrainedSockSize 2048\n"
+ "DirPort 999\n"
+ "DirCache 1\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(2), OP_EQ, "You have requested constrained "
+ "socket buffers while also serving directory entries via DirPort."
+ " It is strongly suggested that you disable serving directory"
+ " requests when system TCP buffer resources are scarce.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "ConstrainedSockets 1\n"
+ "ConstrainedSockSize 2048\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(2), OP_NE,
+ "You have requested constrained socket buffers while also serving"
+ " directory entries via DirPort. It is strongly suggested that "
+ "you disable serving directory requests when system TCP buffer "
+ "resources are scarce.\n");
+ tor_free(msg);
+
+ done:
+ memarea_clear_freelist();
+ policies_free_all();
+ teardown_capture_of_logs(previous_log);
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__v3_auth(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = NULL;
+ int previous_log = setup_capture_of_logs(LOG_WARN);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "V3AuthVoteDelay 1000\n"
+ "V3AuthDistDelay 1000\n"
+ "V3AuthVotingInterval 1000\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "V3AuthVoteDelay plus V3AuthDistDelay must be less than half "
+ "V3AuthVotingInterval");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "V3AuthVoteDelay 1\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "V3AuthVoteDelay is way too low.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "V3AuthVoteDelay 1\n"
+ "TestingTorNetwork 1\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "V3AuthVoteDelay is way too low.");
+ tor_free(msg);
+
+ // TODO: we can't reach the case of v3authvotedelay lower
+ // than MIN_VOTE_SECONDS but not lower than MIN_VOTE_SECONDS_TESTING,
+ // since they are the same
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "V3AuthDistDelay 1\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "V3AuthDistDelay is way too low.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "V3AuthDistDelay 1\n"
+ "TestingTorNetwork 1\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "V3AuthDistDelay is way too low.");
+ tor_free(msg);
+
+ // TODO: we can't reach the case of v3authdistdelay lower than
+ // MIN_DIST_SECONDS but not lower than MIN_DIST_SECONDS_TESTING,
+ // since they are the same
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "V3AuthNIntervalsValid 1\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "V3AuthNIntervalsValid must be at least 2.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "V3AuthVoteDelay 49\n"
+ "V3AuthDistDelay 49\n"
+ "V3AuthVotingInterval 200\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "V3AuthVotingInterval is insanely low.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "V3AuthVoteDelay 49\n"
+ "V3AuthDistDelay 49\n"
+ "V3AuthVotingInterval 200000\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "V3AuthVotingInterval is insanely high.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "V3AuthVoteDelay 49\n"
+ "V3AuthDistDelay 49\n"
+ "V3AuthVotingInterval 1441\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(2), OP_EQ, "V3AuthVotingInterval does not divide"
+ " evenly into 24 hours.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "V3AuthVoteDelay 49\n"
+ "V3AuthDistDelay 49\n"
+ "V3AuthVotingInterval 1440\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(2), OP_NE, "V3AuthVotingInterval does not divide"
+ " evenly into 24 hours.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "V3AuthVoteDelay 49\n"
+ "V3AuthDistDelay 49\n"
+ "V3AuthVotingInterval 299\n"
+ VALID_DIR_AUTH
+ "TestingTorNetwork 1\n"
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(3), OP_EQ, "V3AuthVotingInterval is very low. "
+ "This may lead to failure to synchronise for a consensus.\n");
+ tor_free(msg);
+
+ // TODO: It is impossible to reach the case of testingtor network, with
+ // v3authvotinginterval too low
+ /* free_options_test_data(tdata); */
+ /* tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES */
+ /* "V3AuthVoteDelay 1\n" */
+ /* "V3AuthDistDelay 1\n" */
+ /* "V3AuthVotingInterval 9\n" */
+ /* VALID_DIR_AUTH */
+ /* "TestingTorNetwork 1\n" */
+ /* ); */
+ /* ret = options_validate(tdata->old_opt, tdata->opt, */
+ /* tdata->def_opt, 0, &msg); */
+ /* tt_int_op(ret, OP_EQ, -1); */
+ /* tt_str_op(msg, OP_EQ, "V3AuthVotingInterval is insanely low."); */
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "TestingV3AuthInitialVoteDelay 1\n"
+ VALID_DIR_AUTH
+ "TestingTorNetwork 1\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "TestingV3AuthInitialVoteDelay is way too low.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "TestingV3AuthInitialDistDelay 1\n"
+ VALID_DIR_AUTH
+ "TestingTorNetwork 1\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "TestingV3AuthInitialDistDelay is way too low.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ VALID_DIR_AUTH
+ "TestingTorNetwork 1\n"
+ );
+ tdata->opt->TestingV3AuthVotingStartOffset = 100000;
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "TestingV3AuthVotingStartOffset is higher than the "
+ "voting interval.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ VALID_DIR_AUTH
+ "TestingTorNetwork 1\n"
+ );
+ tdata->opt->TestingV3AuthVotingStartOffset = -1;
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "TestingV3AuthVotingStartOffset must be non-negative.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ VALID_DIR_AUTH
+ "TestingTorNetwork 1\n"
+ "TestingV3AuthInitialVotingInterval 4\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "TestingV3AuthInitialVotingInterval is insanely low.");
+ tor_free(msg);
+
+ done:
+ memarea_clear_freelist();
+ policies_free_all();
+ teardown_capture_of_logs(previous_log);
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__virtual_addr(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = NULL;
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "VirtualAddrNetworkIPv4 !!"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "Error parsing VirtualAddressNetwork !!");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "VirtualAddrNetworkIPv6 !!"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "Error parsing VirtualAddressNetworkIPv6 !!");
+ tor_free(msg);
+
+ done:
+ escaped(NULL); // This will free the leaking memory from the previous escaped
+ memarea_clear_freelist();
+ policies_free_all();
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__exits(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = NULL;
+ int previous_log = setup_capture_of_logs(LOG_WARN);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "AllowSingleHopExits 1"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(2), OP_EQ, "You have set AllowSingleHopExits; "
+ "now your relay will allow others to make one-hop exits. However,"
+ " since by default most clients avoid relays that set this option,"
+ " most clients will ignore you.\n");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "AllowSingleHopExits 1\n"
+ VALID_DIR_AUTH
+ );
+ mock_clean_saved_logs();
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_str_op(mock_saved_log_at(2), OP_NE, "You have set AllowSingleHopExits; "
+ "now your relay will allow others to make one-hop exits. However,"
+ " since by default most clients avoid relays that set this option,"
+ " most clients will ignore you.\n");
+ tor_free(msg);
+
+ done:
+ memarea_clear_freelist();
+ policies_free_all();
+ teardown_capture_of_logs(previous_log);
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__testing_options(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = NULL;
+ int previous_log = setup_capture_of_logs(LOG_WARN);
+
+#define TEST_TESTING_OPTION(name, low_val, high_val, err_low) \
+ STMT_BEGIN \
+ free_options_test_data(tdata); \
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES \
+ VALID_DIR_AUTH \
+ "TestingTorNetwork 1\n" \
+ ); \
+ tdata->opt-> name = low_val; \
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);\
+ tt_int_op(ret, OP_EQ, -1); \
+ tt_str_op(msg, OP_EQ, #name " " err_low); \
+ tor_free(msg); \
+ \
+ free_options_test_data(tdata); \
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES \
+ VALID_DIR_AUTH \
+ "TestingTorNetwork 1\n" \
+ ); \
+ tdata->opt-> name = high_val; \
+ mock_clean_saved_logs(); \
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);\
+ tt_int_op(ret, OP_EQ, 0); \
+ tt_str_op(mock_saved_log_at(3), OP_EQ, #name " is insanely high.\n"); \
+ tor_free(msg); \
+ STMT_END
+
+ TEST_TESTING_OPTION(TestingAuthDirTimeToLearnReachability, -1, 8000,
+ "must be non-negative.");
+ TEST_TESTING_OPTION(TestingEstimatedDescriptorPropagationTime, -1, 3601,
+ "must be non-negative.");
+ TEST_TESTING_OPTION(TestingClientMaxIntervalWithoutRequest, -1, 3601,
+ "is way too low.");
+ TEST_TESTING_OPTION(TestingDirConnectionMaxStall, 1, 3601,
+ "is way too low.");
+ // TODO: I think this points to a bug/regression in options_validate
+ TEST_TESTING_OPTION(TestingConsensusMaxDownloadTries, 1, 801,
+ "must be greater than 2.");
+ TEST_TESTING_OPTION(TestingDescriptorMaxDownloadTries, 1, 801,
+ "must be greater than 1.");
+ TEST_TESTING_OPTION(TestingMicrodescMaxDownloadTries, 1, 801,
+ "must be greater than 1.");
+ TEST_TESTING_OPTION(TestingCertMaxDownloadTries, 1, 801,
+ "must be greater than 1.");
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "TestingEnableConnBwEvent 1\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "TestingEnableConnBwEvent may only be changed in "
+ "testing Tor networks!");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "TestingEnableConnBwEvent 1\n"
+ VALID_DIR_AUTH
+ "TestingTorNetwork 1\n"
+ "___UsingTestNetworkDefaults 0\n"
+ );
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_assert(!msg);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "TestingEnableConnBwEvent 1\n"
+ VALID_DIR_AUTH
+ "TestingTorNetwork 0\n"
+ "___UsingTestNetworkDefaults 1\n"
+ );
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_assert(!msg);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "TestingEnableCellStatsEvent 1\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "TestingEnableCellStatsEvent may only be changed in "
+ "testing Tor networks!");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "TestingEnableCellStatsEvent 1\n"
+ VALID_DIR_AUTH
+ "TestingTorNetwork 1\n"
+ "___UsingTestNetworkDefaults 0\n"
+ );
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_assert(!msg);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "TestingEnableCellStatsEvent 1\n"
+ VALID_DIR_AUTH
+ "TestingTorNetwork 0\n"
+ "___UsingTestNetworkDefaults 1\n"
+ );
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_assert(!msg);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "TestingEnableTbEmptyEvent 1\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ, "TestingEnableTbEmptyEvent may only be changed "
+ "in testing Tor networks!");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "TestingEnableTbEmptyEvent 1\n"
+ VALID_DIR_AUTH
+ "TestingTorNetwork 1\n"
+ "___UsingTestNetworkDefaults 0\n"
+ );
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_assert(!msg);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "TestingEnableTbEmptyEvent 1\n"
+ VALID_DIR_AUTH
+ "TestingTorNetwork 0\n"
+ "___UsingTestNetworkDefaults 1\n"
+ );
+
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_assert(!msg);
+ tor_free(msg);
+
+ done:
+ memarea_clear_freelist();
+ policies_free_all();
+ teardown_capture_of_logs(previous_log);
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+static void
+test_options_validate__accel(void *ignored)
+{
+ (void)ignored;
+ int ret;
+ char *msg;
+ options_test_data_t *tdata = NULL;
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "AccelName foo\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(tdata->opt->HardwareAccel, OP_EQ, 1);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "AccelName foo\n"
+ );
+ tdata->opt->HardwareAccel = 2;
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tt_int_op(tdata->opt->HardwareAccel, OP_EQ, 2);
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "AccelDir 1\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(msg, OP_EQ,
+ "Can't use hardware crypto accelerator dir without engine name.");
+ tor_free(msg);
+
+ free_options_test_data(tdata);
+ tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES
+ "AccelDir 1\n"
+ "AccelName something\n"
+ );
+ ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
+ tt_int_op(ret, OP_EQ, 0);
+ tor_free(msg);
+
+ done:
+ memarea_clear_freelist();
+ policies_free_all();
+ free_options_test_data(tdata);
+ tor_free(msg);
+}
+
+#define LOCAL_VALIDATE_TEST(name) \
+ { "validate__" #name, test_options_validate__ ## name, TT_FORK, NULL, NULL }
+
struct testcase_t options_tests[] = {
{ "validate", test_options_validate, TT_FORK, NULL, NULL },
- END_OF_TESTCASES
+ { "mem_dircache", test_have_enough_mem_for_dircache, TT_FORK, NULL, NULL },
+ LOCAL_VALIDATE_TEST(uname_for_server),
+ LOCAL_VALIDATE_TEST(outbound_addresses),
+ LOCAL_VALIDATE_TEST(data_directory),
+ LOCAL_VALIDATE_TEST(nickname),
+ LOCAL_VALIDATE_TEST(contactinfo),
+ LOCAL_VALIDATE_TEST(logs),
+ LOCAL_VALIDATE_TEST(authdir),
+ LOCAL_VALIDATE_TEST(relay_with_hidden_services),
+ LOCAL_VALIDATE_TEST(transproxy),
+ LOCAL_VALIDATE_TEST(exclude_nodes),
+ LOCAL_VALIDATE_TEST(scheduler),
+ LOCAL_VALIDATE_TEST(node_families),
+ LOCAL_VALIDATE_TEST(tlsec),
+ LOCAL_VALIDATE_TEST(token_bucket),
+ LOCAL_VALIDATE_TEST(recommended_packages),
+ LOCAL_VALIDATE_TEST(fetch_dir),
+ LOCAL_VALIDATE_TEST(conn_limit),
+ LOCAL_VALIDATE_TEST(paths_needed),
+ LOCAL_VALIDATE_TEST(max_client_circuits),
+ LOCAL_VALIDATE_TEST(ports),
+ LOCAL_VALIDATE_TEST(reachable_addresses),
+ LOCAL_VALIDATE_TEST(use_bridges),
+ LOCAL_VALIDATE_TEST(entry_nodes),
+ LOCAL_VALIDATE_TEST(invalid_nodes),
+ LOCAL_VALIDATE_TEST(safe_logging),
+ LOCAL_VALIDATE_TEST(publish_server_descriptor),
+ LOCAL_VALIDATE_TEST(testing),
+ LOCAL_VALIDATE_TEST(hidserv),
+ LOCAL_VALIDATE_TEST(predicted_ports),
+ LOCAL_VALIDATE_TEST(path_bias),
+ LOCAL_VALIDATE_TEST(bandwidth),
+ LOCAL_VALIDATE_TEST(circuits),
+ LOCAL_VALIDATE_TEST(port_forwarding),
+ LOCAL_VALIDATE_TEST(tor2web),
+ LOCAL_VALIDATE_TEST(rend),
+ LOCAL_VALIDATE_TEST(accounting),
+ LOCAL_VALIDATE_TEST(proxy),
+ LOCAL_VALIDATE_TEST(control),
+ LOCAL_VALIDATE_TEST(families),
+ LOCAL_VALIDATE_TEST(addr_policies),
+ LOCAL_VALIDATE_TEST(dir_auth),
+ LOCAL_VALIDATE_TEST(transport),
+ LOCAL_VALIDATE_TEST(constrained_sockets),
+ LOCAL_VALIDATE_TEST(v3_auth),
+ LOCAL_VALIDATE_TEST(virtual_addr),
+ LOCAL_VALIDATE_TEST(exits),
+ LOCAL_VALIDATE_TEST(testing_options),
+ LOCAL_VALIDATE_TEST(accel),
+ END_OF_TESTCASES /* */
};
diff --git a/src/test/test_policy.c b/src/test/test_policy.c
index 2e87f13fc0..b4cbfb2579 100644
--- a/src/test/test_policy.c
+++ b/src/test/test_policy.c
@@ -1021,6 +1021,8 @@ test_policies_getinfo_helper_policies(void *arg)
const char *errmsg = NULL;
routerinfo_t mock_my_routerinfo;
+ memset(&mock_my_routerinfo, 0, sizeof(mock_my_routerinfo));
+
rv = getinfo_helper_policies(NULL, "exit-policy/default", &answer, &errmsg);
tt_assert(rv == 0);
tt_assert(answer != NULL);
diff --git a/src/test/test_routerlist.c b/src/test/test_routerlist.c
index 7ec6525ffb..193e3fa8c1 100644
--- a/src/test/test_routerlist.c
+++ b/src/test/test_routerlist.c
@@ -1,12 +1,36 @@
/* Copyright (c) 2014, The Tor Project, Inc. */
/* See LICENSE for licensing information */
+#include "orconfig.h"
+#include <math.h>
+#include <time.h>
+
+#define DIRVOTE_PRIVATE
+#define NETWORKSTATUS_PRIVATE
#define ROUTERLIST_PRIVATE
+#define TOR_UNIT_TESTING
#include "or.h"
-#include "routerlist.h"
-#include "directory.h"
+#include "config.h"
#include "connection.h"
+#include "container.h"
+#include "directory.h"
+#include "dirvote.h"
+#include "networkstatus.h"
+#include "nodelist.h"
+#include "policies.h"
+#include "routerlist.h"
+#include "routerparse.h"
#include "test.h"
+#include "test_dir_common.h"
+
+extern const char AUTHORITY_CERT_1[];
+extern const char AUTHORITY_SIGNKEY_1[];
+extern const char AUTHORITY_CERT_2[];
+extern const char AUTHORITY_SIGNKEY_2[];
+extern const char AUTHORITY_CERT_3[];
+extern const char AUTHORITY_SIGNKEY_3[];
+
+void construct_consensus(const char **consensus_text_md);
/* 4 digests + 3 sep + pre + post + NULL */
static char output[4*BASE64_DIGEST256_LEN+3+2+2+1];
@@ -95,6 +119,259 @@ test_routerlist_launch_descriptor_downloads(void *arg)
smartlist_free(downloadable);
}
+void
+construct_consensus(const char **consensus_text_md)
+{
+ networkstatus_t *vote = NULL;
+ networkstatus_t *v1 = NULL, *v2 = NULL, *v3 = NULL;
+ networkstatus_voter_info_t *voter = NULL;
+ authority_cert_t *cert1=NULL, *cert2=NULL, *cert3=NULL;
+ crypto_pk_t *sign_skey_1=NULL, *sign_skey_2=NULL, *sign_skey_3=NULL;
+ crypto_pk_t *sign_skey_leg=NULL;
+ time_t now = time(NULL);
+ smartlist_t *votes = NULL;
+ addr_policy_t *pol1 = NULL, *pol2 = NULL, *pol3 = NULL;
+ int n_vrs;
+
+ tt_assert(!dir_common_authority_pk_init(&cert1, &cert2, &cert3,
+ &sign_skey_1, &sign_skey_2,
+ &sign_skey_3));
+ sign_skey_leg = pk_generate(4);
+
+ dir_common_construct_vote_1(&vote, cert1, sign_skey_1,
+ &dir_common_gen_routerstatus_for_v3ns,
+ &v1, &n_vrs, now, 1);
+
+ tt_assert(v1);
+ tt_int_op(n_vrs, ==, 4);
+ tt_int_op(smartlist_len(v1->routerstatus_list), ==, 4);
+
+ dir_common_construct_vote_2(&vote, cert2, sign_skey_2,
+ &dir_common_gen_routerstatus_for_v3ns,
+ &v2, &n_vrs, now, 1);
+
+ tt_assert(v2);
+ tt_int_op(n_vrs, ==, 4);
+ tt_int_op(smartlist_len(v2->routerstatus_list), ==, 4);
+
+ dir_common_construct_vote_3(&vote, cert3, sign_skey_3,
+ &dir_common_gen_routerstatus_for_v3ns,
+ &v3, &n_vrs, now, 1);
+
+ tt_assert(v3);
+ tt_int_op(n_vrs, ==, 4);
+ tt_int_op(smartlist_len(v3->routerstatus_list), ==, 4);
+
+ votes = smartlist_new();
+ smartlist_add(votes, v1);
+ smartlist_add(votes, v2);
+ smartlist_add(votes, v3);
+
+ *consensus_text_md = networkstatus_compute_consensus(votes, 3,
+ cert1->identity_key,
+ sign_skey_1,
+ "AAAAAAAAAAAAAAAAAAAA",
+ sign_skey_leg,
+ FLAV_MICRODESC);
+
+ tt_assert(*consensus_text_md);
+
+ done:
+ if (vote)
+ tor_free(vote);
+ if (voter)
+ tor_free(voter);
+ if (pol1)
+ tor_free(pol1);
+ if (pol2)
+ tor_free(pol2);
+ if (pol3)
+ tor_free(pol3);
+}
+
+static void
+test_router_pick_directory_server_impl(void *arg)
+{
+ (void)arg;
+
+ networkstatus_t *con_md = NULL;
+ const char *consensus_text_md = NULL;
+ int flags = PDS_IGNORE_FASCISTFIREWALL|PDS_RETRY_IF_NO_SERVERS;
+ or_options_t *options = get_options_mutable();
+ const routerstatus_t *rs = NULL;
+ options->UseMicrodescriptors = 1;
+ char *router1_id = NULL, *router2_id = NULL, *router3_id = NULL;
+ node_t *node_router1 = NULL, *node_router2 = NULL, *node_router3 = NULL;
+ config_line_t *policy_line = NULL;
+ time_t now = time(NULL);
+ int tmp_dirport1, tmp_dirport3;
+
+ (void)arg;
+
+ /* No consensus available, fail early */
+ rs = router_pick_directory_server_impl(V3_DIRINFO, (const int) 0, NULL);
+ tt_assert(rs == NULL);
+
+ construct_consensus(&consensus_text_md);
+ tt_assert(consensus_text_md);
+ con_md = networkstatus_parse_vote_from_string(consensus_text_md, NULL,
+ NS_TYPE_CONSENSUS);
+ tt_assert(con_md);
+ tt_int_op(con_md->flavor,==, FLAV_MICRODESC);
+ tt_assert(con_md->routerstatus_list);
+ tt_int_op(smartlist_len(con_md->routerstatus_list), ==, 3);
+ tt_assert(!networkstatus_set_current_consensus_from_ns(con_md,
+ "microdesc"));
+ nodelist_set_consensus(con_md);
+ nodelist_assert_ok();
+
+ rs = router_pick_directory_server_impl(V3_DIRINFO, flags, NULL);
+ /* We should not fail now we have a consensus and routerstatus_list
+ * and nodelist are populated. */
+ tt_assert(rs != NULL);
+
+ /* Manipulate the nodes so we get the dir server we expect */
+ router1_id = tor_malloc(DIGEST_LEN);
+ memset(router1_id, TEST_DIR_ROUTER_ID_1, DIGEST_LEN);
+ router2_id = tor_malloc(DIGEST_LEN);
+ memset(router2_id, TEST_DIR_ROUTER_ID_2, DIGEST_LEN);
+ router3_id = tor_malloc(DIGEST_LEN);
+ memset(router3_id, TEST_DIR_ROUTER_ID_3, DIGEST_LEN);
+
+ node_router1 = node_get_mutable_by_id(router1_id);
+ node_router2 = node_get_mutable_by_id(router2_id);
+ node_router3 = node_get_mutable_by_id(router3_id);
+
+ node_router1->is_possible_guard = 1;
+
+ node_router1->is_running = 0;
+ node_router3->is_running = 0;
+ rs = router_pick_directory_server_impl(V3_DIRINFO, flags, NULL);
+ tt_assert(rs != NULL);
+ tt_assert(tor_memeq(rs->identity_digest, router2_id, DIGEST_LEN));
+ rs = NULL;
+ node_router1->is_running = 1;
+ node_router3->is_running = 1;
+
+ node_router1->rs->is_v2_dir = 0;
+ node_router3->rs->is_v2_dir = 0;
+ tmp_dirport1 = node_router1->rs->dir_port;
+ tmp_dirport3 = node_router3->rs->dir_port;
+ node_router1->rs->dir_port = 0;
+ node_router3->rs->dir_port = 0;
+ rs = router_pick_directory_server_impl(V3_DIRINFO, flags, NULL);
+ tt_assert(rs != NULL);
+ tt_assert(tor_memeq(rs->identity_digest, router2_id, DIGEST_LEN));
+ rs = NULL;
+ node_router1->rs->is_v2_dir = 1;
+ node_router3->rs->is_v2_dir = 1;
+ node_router1->rs->dir_port = tmp_dirport1;
+ node_router3->rs->dir_port = tmp_dirport3;
+
+ node_router1->is_valid = 0;
+ node_router3->is_valid = 0;
+ rs = router_pick_directory_server_impl(V3_DIRINFO, flags, NULL);
+ tt_assert(rs != NULL);
+ tt_assert(tor_memeq(rs->identity_digest, router2_id, DIGEST_LEN));
+ rs = NULL;
+ node_router1->is_valid = 1;
+ node_router3->is_valid = 1;
+
+ flags |= PDS_FOR_GUARD;
+ node_router1->using_as_guard = 1;
+ node_router2->using_as_guard = 1;
+ node_router3->using_as_guard = 1;
+ rs = router_pick_directory_server_impl(V3_DIRINFO, flags, NULL);
+ tt_assert(rs == NULL);
+ node_router1->using_as_guard = 0;
+ rs = router_pick_directory_server_impl(V3_DIRINFO, flags, NULL);
+ tt_assert(rs != NULL);
+ tt_assert(tor_memeq(rs->identity_digest, router1_id, DIGEST_LEN));
+ rs = NULL;
+ node_router2->using_as_guard = 0;
+ node_router3->using_as_guard = 0;
+
+ /* One not valid, one guard. This should leave one remaining */
+ node_router1->is_valid = 0;
+ node_router2->using_as_guard = 1;
+ rs = router_pick_directory_server_impl(V3_DIRINFO, flags, NULL);
+ tt_assert(rs != NULL);
+ tt_assert(tor_memeq(rs->identity_digest, router3_id, DIGEST_LEN));
+ rs = NULL;
+ node_router1->is_valid = 1;
+ node_router2->using_as_guard = 0;
+
+ /* Manipulate overloaded */
+
+ node_router2->rs->last_dir_503_at = now;
+ node_router3->rs->last_dir_503_at = now;
+ rs = router_pick_directory_server_impl(V3_DIRINFO, flags, NULL);
+ tt_assert(rs != NULL);
+ tt_assert(tor_memeq(rs->identity_digest, router1_id, DIGEST_LEN));
+ node_router2->rs->last_dir_503_at = 0;
+ node_router3->rs->last_dir_503_at = 0;
+
+ /* Set a Fascist firewall */
+ flags &= ! PDS_IGNORE_FASCISTFIREWALL;
+ policy_line = tor_malloc_zero(sizeof(config_line_t));
+ policy_line->key = tor_strdup("ReachableORAddresses");
+ policy_line->value = tor_strdup("accept *:442, reject *:*");
+ options->ReachableORAddresses = policy_line;
+ policies_parse_from_options(options);
+
+ node_router1->rs->or_port = 444;
+ node_router2->rs->or_port = 443;
+ node_router3->rs->or_port = 442;
+ rs = router_pick_directory_server_impl(V3_DIRINFO, flags, NULL);
+ tt_assert(rs != NULL);
+ tt_assert(tor_memeq(rs->identity_digest, router3_id, DIGEST_LEN));
+ node_router1->rs->or_port = 442;
+ node_router2->rs->or_port = 443;
+ node_router3->rs->or_port = 444;
+ rs = router_pick_directory_server_impl(V3_DIRINFO, flags, NULL);
+ tt_assert(rs != NULL);
+ tt_assert(tor_memeq(rs->identity_digest, router1_id, DIGEST_LEN));
+
+ /* Fascist firewall and overloaded */
+ node_router1->rs->or_port = 442;
+ node_router2->rs->or_port = 443;
+ node_router3->rs->or_port = 442;
+ node_router3->rs->last_dir_503_at = now;
+ rs = router_pick_directory_server_impl(V3_DIRINFO, flags, NULL);
+ tt_assert(rs != NULL);
+ tt_assert(tor_memeq(rs->identity_digest, router1_id, DIGEST_LEN));
+ node_router3->rs->last_dir_503_at = 0;
+
+ /* Fascists against OR and Dir */
+ policy_line = tor_malloc_zero(sizeof(config_line_t));
+ policy_line->key = tor_strdup("ReachableAddresses");
+ policy_line->value = tor_strdup("accept *:80, reject *:*");
+ options->ReachableDirAddresses = policy_line;
+ policies_parse_from_options(options);
+ node_router1->rs->or_port = 442;
+ node_router2->rs->or_port = 441;
+ node_router3->rs->or_port = 443;
+ node_router1->rs->dir_port = 80;
+ node_router2->rs->dir_port = 80;
+ node_router3->rs->dir_port = 81;
+ node_router1->rs->last_dir_503_at = now;
+ rs = router_pick_directory_server_impl(V3_DIRINFO, flags, NULL);
+ tt_assert(rs != NULL);
+ tt_assert(tor_memeq(rs->identity_digest, router1_id, DIGEST_LEN));
+ node_router1->rs->last_dir_503_at = 0;
+
+ done:
+ if (router1_id)
+ tor_free(router1_id);
+ if (router2_id)
+ tor_free(router2_id);
+ if (router3_id)
+ tor_free(router3_id);
+ if (options->ReachableORAddresses ||
+ options->ReachableDirAddresses)
+ policies_free_all();
+}
+
connection_t *mocked_connection = NULL;
/* Mock connection_get_by_type_addr_port_purpose by returning
@@ -168,11 +445,14 @@ test_routerlist_router_is_already_dir_fetching(void *arg)
#define NODE(name, flags) \
{ #name, test_routerlist_##name, (flags), NULL, NULL }
+#define ROUTER(name,flags) \
+ { #name, test_router_##name, (flags), NULL, NULL }
struct testcase_t routerlist_tests[] = {
NODE(initiate_descriptor_downloads, 0),
NODE(launch_descriptor_downloads, 0),
NODE(router_is_already_dir_fetching, TT_FORK),
+ ROUTER(pick_directory_server_impl, TT_FORK),
END_OF_TESTCASES
};
diff --git a/src/test/test_status.c b/src/test/test_status.c
index cbc8af188c..84a0f6c024 100644
--- a/src/test/test_status.c
+++ b/src/test/test_status.c
@@ -707,15 +707,18 @@ NS(logv)(int severity, log_domain_mask_t domain,
tt_ptr_op(strstr(funcname, "log_accounting"), OP_NE, NULL);
tt_ptr_op(suffix, OP_EQ, NULL);
tt_str_op(format, OP_EQ,
- "Heartbeat: Accounting enabled. Sent: %s / %s, Received: %s / %s. "
- "The current accounting interval ends on %s, in %s.");
+ "Heartbeat: Accounting enabled. Sent: %s, Received: %s, Used: %s / "
+ "%s, Rule: %s. The current accounting interval ends on %s, in %s.");
tt_str_op(va_arg(ap, char *), OP_EQ, "0 kB"); /* acc_sent */
- tt_str_op(va_arg(ap, char *), OP_EQ, "0 kB"); /* acc_max */
tt_str_op(va_arg(ap, char *), OP_EQ, "0 kB"); /* acc_rcvd */
+ tt_str_op(va_arg(ap, char *), OP_EQ, "0 kB"); /* acc_used */
tt_str_op(va_arg(ap, char *), OP_EQ, "0 kB"); /* acc_max */
- /* format_local_iso_time uses local tz, just check mins and secs. */
- tt_ptr_op(strstr(va_arg(ap, char *), ":01:00"),
- OP_NE, NULL); /* end_buf */
+ tt_str_op(va_arg(ap, char *), OP_EQ, "max"); /* acc_rule */
+ /* format_local_iso_time uses local tz, so we can't just compare
+ * the string against a constant */
+ char datetime[ISO_TIME_LEN+1];
+ format_local_iso_time(datetime, 60);
+ tt_str_op(va_arg(ap, char *), OP_EQ, datetime); /* end_buf */
tt_str_op(va_arg(ap, char *), OP_EQ, "0:01 hours"); /* remaining */
break;
case 2:
diff --git a/src/test/test_switch_id.c b/src/test/test_switch_id.c
index e85025c3b5..3d9c1c8bba 100644
--- a/src/test/test_switch_id.c
+++ b/src/test/test_switch_id.c
@@ -14,8 +14,6 @@
#define TEST_SETUID_KEEPCAPS 4
#define TEST_SETUID_STRICT 5
-static const char *username;
-
static const struct {
const char *name;
int test_id;
@@ -29,6 +27,7 @@ static const struct {
{ NULL, 0 }
};
+#if !defined(_WIN32)
/* 0 on no, 1 on yes, -1 on failure. */
static int
check_can_bind_low_ports(void)
@@ -47,7 +46,8 @@ check_can_bind_low_ports(void)
}
int one = 1;
- if (setsockopt(fd, SOL_SOCKET,SO_REUSEADDR, &one, sizeof(one))) {
+ if (setsockopt(fd, SOL_SOCKET,SO_REUSEADDR, (void*)&one,
+ (socklen_t)sizeof(one))) {
perror("setsockopt");
tor_close_socket_simple(fd);
return -1;
@@ -71,10 +71,19 @@ check_can_bind_low_ports(void)
return -1;
}
+#endif
int
main(int argc, char **argv)
{
+#if defined(_WIN32)
+ (void) argc;
+ (void) argv;
+
+ fprintf(stderr, "This test is not supported on your OS.\n");
+ return 77;
+#else
+ const char *username;
const char *testname;
if (argc != 3) {
fprintf(stderr, "I want 2 arguments: a username and a command.\n");
@@ -177,5 +186,6 @@ main(int argc, char **argv)
}
return (okay ? 0 : 1);
+#endif
}
diff --git a/src/test/test_tortls.c b/src/test/test_tortls.c
index 8602d9ef15..add020e9f4 100644
--- a/src/test/test_tortls.c
+++ b/src/test/test_tortls.c
@@ -1128,7 +1128,9 @@ test_tortls_check_lifetime(void *ignored)
ret = tor_tls_check_lifetime(LOG_WARN, tls, 0, 0);
tt_int_op(ret, OP_EQ, 0);
+ ASN1_STRING_free(validCert->cert_info->validity->notBefore);
validCert->cert_info->validity->notBefore = ASN1_TIME_set(NULL, now-10);
+ ASN1_STRING_free(validCert->cert_info->validity->notAfter);
validCert->cert_info->validity->notAfter = ASN1_TIME_set(NULL, now+60);
ret = tor_tls_check_lifetime(LOG_WARN, tls, 0, -1000);
@@ -1454,17 +1456,21 @@ test_tortls_try_to_extract_certs_from_tls(void *ignored)
try_to_extract_certs_from_tls(LOG_WARN, tls, &cert, &id_cert);
tt_assert(cert == c1);
tt_assert(!id_cert);
+ X509_free(cert); /* decrease refcnt */
sess->cert_chain = sk_X509_new_null();
try_to_extract_certs_from_tls(LOG_WARN, tls, &cert, &id_cert);
tt_assert(cert == c1);
tt_assert(!id_cert);
+ X509_free(cert); /* decrease refcnt */
sk_X509_push(sess->cert_chain, c1);
sk_X509_push(sess->cert_chain, c2);
+
try_to_extract_certs_from_tls(LOG_WARN, tls, &cert, &id_cert);
tt_assert(cert == c1);
tt_assert(id_cert);
+ X509_free(cert); /* decrease refcnt */
done:
sk_X509_free(sess->cert_chain);
@@ -1472,6 +1478,8 @@ test_tortls_try_to_extract_certs_from_tls(void *ignored)
tor_free(tls->ssl->session);
tor_free(tls->ssl);
tor_free(tls);
+ X509_free(c1);
+ X509_free(c2);
}
#endif
@@ -2672,7 +2680,12 @@ test_tortls_cert_is_valid(void *ignored)
scert = tor_malloc_zero(sizeof(tor_x509_cert_t));
ret = tor_tls_cert_is_valid(LOG_WARN, cert, scert, 0);
tt_int_op(ret, OP_EQ, 0);
+
+ cert = tor_malloc_zero(sizeof(tor_x509_cert_t));
+ ret = tor_tls_cert_is_valid(LOG_WARN, cert, scert, 0);
+ tt_int_op(ret, OP_EQ, 0);
tor_free(scert);
+ tor_free(cert);
cert = tor_x509_cert_new(read_cert_from(validCertString));
scert = tor_x509_cert_new(read_cert_from(caCertString));
diff --git a/src/test/test_util.c b/src/test/test_util.c
index 4cf2f9bda1..37f7d938ea 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -14,6 +14,15 @@
#include "memarea.h"
#include "util_process.h"
+#ifdef HAVE_PWD_H
+#include <pwd.h>
+#endif
+#ifdef HAVE_SYS_UTIME_H
+#include <sys/utime.h>
+#endif
+#ifdef HAVE_UTIME_H
+#include <utime.h>
+#endif
#ifdef _WIN32
#include <tchar.h>
#endif
@@ -4316,12 +4325,6 @@ test_util_clamp_double_to_int64(void *arg)
;
}
-#define UTIL_LEGACY(name) \
- { #name, test_util_ ## name , 0, NULL, NULL }
-
-#define UTIL_TEST(name, flags) \
- { #name, test_util_ ## name, flags, NULL, NULL }
-
#ifdef FD_CLOEXEC
#define CAN_CHECK_CLOEXEC
static int
@@ -4599,6 +4602,92 @@ test_util_get_avail_disk_space(void *arg)
;
}
+static void
+test_util_touch_file(void *arg)
+{
+ (void) arg;
+ const char *fname = get_fname("touch");
+
+ const time_t now = time(NULL);
+ struct stat st;
+ write_bytes_to_file(fname, "abc", 3, 1);
+ tt_int_op(0, OP_EQ, stat(fname, &st));
+ /* A subtle point: the filesystem time is not necessarily equal to the
+ * system clock time, since one can be using a monotonic clock, or coarse
+ * monotonic clock, or whatever. So we might wind up with an mtime a few
+ * microseconds ago. Let's just give it a lot of wiggle room. */
+ tt_i64_op(st.st_mtime, OP_GE, now - 1);
+
+ const time_t five_sec_ago = now - 5;
+ struct utimbuf u = { five_sec_ago, five_sec_ago };
+ tt_int_op(0, OP_EQ, utime(fname, &u));
+ tt_int_op(0, OP_EQ, stat(fname, &st));
+ /* Let's hope that utime/stat give the same second as a round-trip? */
+ tt_i64_op(st.st_mtime, OP_EQ, five_sec_ago);
+
+ /* Finally we can touch the file */
+ tt_int_op(0, OP_EQ, touch_file(fname));
+ tt_int_op(0, OP_EQ, stat(fname, &st));
+ tt_i64_op(st.st_mtime, OP_GE, now-1);
+
+ done:
+ ;
+}
+
+#ifndef _WIN32
+static void
+test_util_pwdb(void *arg)
+{
+ (void) arg;
+ const struct passwd *me = NULL, *me2, *me3;
+ char *name = NULL;
+ char *dir = NULL;
+
+ /* Uncached case. */
+ /* Let's assume that we exist. */
+ me = tor_getpwuid(getuid());
+ tt_assert(me != NULL);
+ name = tor_strdup(me->pw_name);
+
+ /* Uncached case */
+ me2 = tor_getpwnam(name);
+ tt_assert(me2 != NULL);
+ tt_int_op(me2->pw_uid, OP_EQ, getuid());
+
+ /* Cached case */
+ me3 = tor_getpwuid(getuid());
+ tt_assert(me3 != NULL);
+ tt_str_op(me3->pw_name, OP_EQ, name);
+
+ me3 = tor_getpwnam(name);
+ tt_assert(me3 != NULL);
+ tt_int_op(me3->pw_uid, OP_EQ, getuid());
+
+ dir = get_user_homedir(name);
+ tt_assert(dir != NULL);
+
+ done:
+ tor_free(name);
+ tor_free(dir);
+}
+#endif
+
+#define UTIL_LEGACY(name) \
+ { #name, test_util_ ## name , 0, NULL, NULL }
+
+#define UTIL_TEST(name, flags) \
+ { #name, test_util_ ## name, flags, NULL, NULL }
+
+#ifdef _WIN32
+#define UTIL_TEST_NO_WIN(n, f) { #n, NULL, TT_SKIP, NULL, NULL }
+#define UTIL_TEST_WIN_ONLY(n, f) UTIL_TEST(n, (f))
+#define UTIL_LEGACY_NO_WIN(n) UTIL_TEST_NO_WIN(n, 0)
+#else
+#define UTIL_TEST_NO_WIN(n, f) UTIL_TEST(n, (f))
+#define UTIL_TEST_WIN_ONLY(n, f) { #n, NULL, TT_SKIP, NULL, NULL }
+#define UTIL_LEGACY_NO_WIN(n) UTIL_LEGACY(n)
+#endif
+
struct testcase_t util_tests[] = {
UTIL_LEGACY(time),
UTIL_TEST(parse_http_time, 0),
@@ -4606,9 +4695,7 @@ struct testcase_t util_tests[] = {
UTIL_LEGACY(config_line_quotes),
UTIL_LEGACY(config_line_comment_character),
UTIL_LEGACY(config_line_escaped_content),
-#ifndef _WIN32
- UTIL_LEGACY(expand_filename),
-#endif
+ UTIL_LEGACY_NO_WIN(expand_filename),
UTIL_LEGACY(escape_string_socks),
UTIL_LEGACY(string_is_key_value),
UTIL_LEGACY(strmisc),
@@ -4633,13 +4720,9 @@ struct testcase_t util_tests[] = {
UTIL_TEST(listdir, 0),
UTIL_TEST(parent_dir, 0),
UTIL_TEST(ftruncate, 0),
-#ifdef _WIN32
- UTIL_TEST(load_win_lib, 0),
-#endif
-#ifndef _WIN32
- UTIL_TEST(exit_status, 0),
- UTIL_TEST(fgets_eagain, 0),
-#endif
+ UTIL_TEST_WIN_ONLY(load_win_lib, 0),
+ UTIL_TEST_NO_WIN(exit_status, 0),
+ UTIL_TEST_NO_WIN(fgets_eagain, 0),
UTIL_TEST(format_hex_number, 0),
UTIL_TEST(format_dec_number, 0),
UTIL_TEST(join_win_cmdline, 0),
@@ -4672,6 +4755,8 @@ struct testcase_t util_tests[] = {
UTIL_TEST(ipv4_validation, 0),
UTIL_TEST(writepid, 0),
UTIL_TEST(get_avail_disk_space, 0),
+ UTIL_TEST(touch_file, 0),
+ UTIL_TEST_NO_WIN(pwdb, TT_FORK),
END_OF_TESTCASES
};
diff --git a/src/test/test_util_format.c b/src/test/test_util_format.c
index 705dfcf605..45a28ccaac 100644
--- a/src/test/test_util_format.c
+++ b/src/test/test_util_format.c
@@ -11,6 +11,44 @@
#define NS_MODULE util_format
+#if !defined(HAVE_HTONLL) && !defined(htonll)
+#ifdef WORDS_BIGENDIAN
+#define htonll(x) (x)
+#else
+static uint64_t
+htonll(uint64_t a)
+{
+ return htonl((uint32_t)(a>>32)) | (((uint64_t)htonl((uint32_t)a))<<32);
+}
+#endif
+#endif
+
+static void
+test_util_format_unaligned_accessors(void *ignored)
+{
+ (void)ignored;
+ char buf[9] = "onionsoup"; // 6f6e696f6e736f7570
+
+ tt_u64_op(get_uint64(buf+1), OP_EQ, htonll(U64_LITERAL(0x6e696f6e736f7570)));
+ tt_uint_op(get_uint32(buf+1), OP_EQ, htonl(0x6e696f6e));
+ tt_uint_op(get_uint16(buf+1), OP_EQ, htons(0x6e69));
+ tt_uint_op(get_uint8(buf+1), OP_EQ, 0x6e);
+
+ set_uint8(buf+7, 0x61);
+ tt_mem_op(buf, OP_EQ, "onionsoap", 9);
+
+ set_uint16(buf+6, htons(0x746f));
+ tt_mem_op(buf, OP_EQ, "onionstop", 9);
+
+ set_uint32(buf+1, htonl(0x78696465));
+ tt_mem_op(buf, OP_EQ, "oxidestop", 9);
+
+ set_uint64(buf+1, htonll(U64_LITERAL(0x6266757363617465)));
+ tt_mem_op(buf, OP_EQ, "obfuscate", 9);
+ done:
+ ;
+}
+
static void
test_util_format_base64_encode(void *ignored)
{
@@ -252,6 +290,8 @@ test_util_format_base16_decode(void *ignored)
}
struct testcase_t util_format_tests[] = {
+ { "unaligned_accessors", test_util_format_unaligned_accessors, 0,
+ NULL, NULL },
{ "base64_encode", test_util_format_base64_encode, 0, NULL, NULL },
{ "base64_decode_nopad", test_util_format_base64_decode_nopad, 0,
NULL, NULL },
diff --git a/src/tools/include.am b/src/tools/include.am
index ebdd349cb1..38ed57546f 100644
--- a/src/tools/include.am
+++ b/src/tools/include.am
@@ -20,6 +20,7 @@ endif
src_tools_tor_gencert_SOURCES = src/tools/tor-gencert.c
src_tools_tor_gencert_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@
src_tools_tor_gencert_LDADD = src/common/libor.a src/common/libor-crypto.a \
+ $(LIBKECCAK_TINY) \
$(LIBDONNA) \
@TOR_LIB_MATH@ @TOR_ZLIB_LIBS@ @TOR_OPENSSL_LIBS@ \
@TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@
@@ -31,6 +32,7 @@ src_tools_tor_cov_gencert_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
src_tools_tor_cov_gencert_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@
src_tools_tor_cov_gencert_LDADD = src/common/libor-testing.a \
src/common/libor-crypto-testing.a \
+ $(LIBKECCAK_TINY) \
$(LIBDONNA) \
@TOR_LIB_MATH@ @TOR_ZLIB_LIBS@ @TOR_OPENSSL_LIBS@ \
@TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@
@@ -39,6 +41,7 @@ endif
src_tools_tor_checkkey_SOURCES = src/tools/tor-checkkey.c
src_tools_tor_checkkey_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@
src_tools_tor_checkkey_LDADD = src/common/libor.a src/common/libor-crypto.a \
+ $(LIBKECCAK_TINY) \
$(LIBDONNA) \
@TOR_LIB_MATH@ @TOR_ZLIB_LIBS@ @TOR_OPENSSL_LIBS@ \
@TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@