feat: add public I2P network mode to router daemon
- Add `--public`, `--hops`, `--hosts`, and `--debug` router flags; `--public` auto-reseeds from the live network and keeps a status loop running. - Route NetDB lookups through tunnels with Noise_N garlic wrapping, fan out to two floodfills, and fetch unknown RouterInfos in the background. - Back off failed NTCP2 peers and fall back to IPv6 addresses when no IPv4 NTCP2 address is available. - Size session LeaseSet2 expiry from lease end dates and use the destination's X25519 key when present. - Add canonical Ed25519 Destination KeyCertificate constructors with round-trip tests. - Fix DatabaseStore gzip handling to honor the length prefix, and send `Wget/1.11.4` as the reseed User-Agent.
This commit is contained in:
1 parent
ae72b00323
commit
54cfb2faa9
25 files changed
+2033
-191
No files matched your search
@@ -45,6 +45,28 @@ test "Destination X25519+Ed25519 key extraction, Base64, and .b32.i2p address" {
|
||||
assert_true(b32.has_suffix(".b32.i2p"))
|
||||
}
|
||||
|
||||
///|
|
||||
test "Destination Ed25519 canonical KeyCertificate (sig=7, crypto=0) round-trip" {
|
||||
let sig_pub = Bytes::make(32, b'\x37')
|
||||
let pad = Bytes::make(352, b'\x9a')
|
||||
let dest = @common.Destination::new_ed25519(sig_pub, padding=pad)
|
||||
let raw = dest.to_bytes()
|
||||
assert_eq(raw.length(), 391)
|
||||
// Trailing KeyCertificate: 05 (Key) | 00 04 (len=4) | 00 07 (Ed25519) | 00 00 (ElGamal)
|
||||
assert_eq(raw[384], b'\x05')
|
||||
assert_eq(raw[385], b'\x00')
|
||||
assert_eq(raw[386], b'\x04')
|
||||
assert_eq(raw[387], b'\x00')
|
||||
assert_eq(raw[388], b'\x07')
|
||||
assert_eq(raw[389], b'\x00')
|
||||
assert_eq(raw[390], b'\x00')
|
||||
assert_eq(dest.inner.crypto_type(), ElGamal)
|
||||
assert_eq(dest.inner.signing_type(), EdDsaSha512Ed25519)
|
||||
assert_eq(dest.inner.signing_public_key(), sig_pub)
|
||||
let decoded = @common.Destination::decode(@encoding.Reader::new(raw))
|
||||
assert_eq(decoded, dest)
|
||||
}
|
||||
|
||||
///|
|
||||
test "RouterInfo encode and decode round-trip" {
|
||||
let ri_id = @common.RouterIdentity::new_x25519_ed25519(
|
||||
|
||||
Reference in new issue
Block a user