upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/selftest.cpp
diff options
context:
space:
mode:
authorBitflash <admin@bitflash.network>2026-08-13 11:38:50 -0300
committerBitflash <admin@bitflash.network>2026-08-13 11:38:50 -0300
commitc009e7cc0c5093f4c4add741cb9d131d19956871 (patch)
tree002423e5987a3c544f469befae83519ccb29fffb /src/selftest.cpp
parent851811b43be38bea48ba5d04d16987bd541dca53 (diff)
parentd2b86473a267c960a1f0c012a983176e5d962187 (diff)
Merge pull request 'net: add signed direct onion peer endpoints' (#32) from onion-direct-peers into main
Diffstat (limited to 'src/selftest.cpp')
-rw-r--r--src/selftest.cpp9
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;