diff options
| author | Nsable-sh <nsable-sh@noreply.git.bitflash.network> | 2026-08-13 11:11:59 -0300 |
|---|---|---|
| committer | Nsable-sh <nsable-sh@noreply.git.bitflash.network> | 2026-08-13 11:11:59 -0300 |
| commit | d2b86473a267c960a1f0c012a983176e5d962187 (patch) | |
| tree | 002423e5987a3c544f469befae83519ccb29fffb /src/selftest.cpp | |
| parent | 851811b43be38bea48ba5d04d16987bd541dca53 (diff) | |
net: add signed direct onion peer endpoints
Diffstat (limited to 'src/selftest.cpp')
| -rw-r--r-- | src/selftest.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/selftest.cpp b/src/selftest.cpp index bcbf9d3..a0d9edd 100644 --- a/src/selftest.cpp +++ b/src/selftest.cpp | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | // and against a temporary data directory. | 6 | // and against a temporary data directory. |
| 7 | 7 | ||
| 8 | #include "headers_core.h" | 8 | #include "headers_core.h" |
| 9 | #include "btfaddr.h" | ||
| 9 | #include "bip32.h" | 10 | #include "bip32.h" |
| 10 | #include "proxy.h" | 11 | #include "proxy.h" |
| 11 | #include "selftest.h" | 12 | #include "selftest.h" |
| @@ -1507,6 +1508,14 @@ static int RunSocks5ProxySelfTest() | |||
| 1507 | !BtfIsTorOnionHost("relay.example") && | 1508 | !BtfIsTorOnionHost("relay.example") && |
| 1508 | !BtfIsTorOnionHost(".onion"), | 1509 | !BtfIsTorOnionHost(".onion"), |
| 1509 | "detects .onion hosts without accepting lookalikes") ? 0 : 1; | 1510 | "detects .onion hosts without accepting lookalikes") ? 0 : 1; |
| 1511 | std::string onion; | ||
| 1512 | nFail += Check(btf::NormalizeOnionEndpoint("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCD.onion.:8433", onion) && | ||
| 1513 | onion == "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd.onion:8433", | ||
| 1514 | "normalizes v3 onion peer endpoint") ? 0 : 1; | ||
| 1515 | nFail += Check(!btf::NormalizeOnionEndpoint("short.onion:8433", onion) && | ||
| 1516 | !btf::NormalizeOnionEndpoint("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd.onion:0", onion) && | ||
| 1517 | !btf::NormalizeOnionEndpoint("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabc1.onion:8433", onion), | ||
| 1518 | "rejects malformed onion peer endpoints") ? 0 : 1; | ||
| 1510 | 1519 | ||
| 1511 | BtfClearSocks5Proxy(); | 1520 | BtfClearSocks5Proxy(); |
| 1512 | nFail += Check(!BtfSocks5ProxyEnabled(), "starts disabled after clear") ? 0 : 1; | 1521 | nFail += Check(!BtfSocks5ProxyEnabled(), "starts disabled after clear") ? 0 : 1; |