feat: add ratchet, streaming, SU3 reseed, and router floodfill
- Add ratchet/ with ECIES-X25519-AEAD-Ratchet (Proposal 144), Garlic cloves, and ECIES DatabaseLookup replies - Add streaming/ with Ed25519-signed I2P Streaming (SYN/ACK/NACK/CLOSE/RESET, retransmit, window) and Repliable/Raw Datagrams - Add common/su3.mbt to parse and verify reseed .su3 bundles - Add Elligator2 encoding in crypto/ and OfflineSignature support in LeaseSet2 (flags bit 0) - Router: NTCP2 peer pool, floodfill NetDB crawl, transit tunnel relay, and Garlic/Streaming bridge - cmd/router: add --peer-dir, --su3, --reseed, --floodfill, --no-clock-skew - cmd/client: add --dest for persistent destination keys - Mark Phase 6 complete in README and document the transport scope (NTCP2 only, no SSU2)
This commit is contained in:
1 parent
8eafa11b22
commit
ae72b00323
54 files changed
+9607
-704
No files matched your search
@@ -128,6 +128,7 @@ test "NetDB LeaseSet2 store, .b32.i2p lookup, and expiration pruning" {
|
||||
published_sec: 1700000000U,
|
||||
expires_offset: 300U,
|
||||
flags: 0U,
|
||||
offline_sig: None,
|
||||
options: @common.Mapping::new(),
|
||||
encryption_keys: [{ key_type: X25519, key_data: x_pub, }],
|
||||
leases: [
|
||||
@@ -151,3 +152,35 @@ test "NetDB LeaseSet2 store, .b32.i2p lookup, and expiration pruning" {
|
||||
assert_eq(db.prune_expired(1700000301U), 1)
|
||||
assert_eq(db.leaseset_count(), 0)
|
||||
}
|
||||
|
||||
///|
|
||||
test "NetDB canonical gzipped DatabaseStore type 0 round-trip" {
|
||||
let src = @netdb.NetDb::new()
|
||||
let dst = @netdb.NetDb::new()
|
||||
let r1 = make_signed_router(b'\x0a', "XfR", 1700000000000UL)
|
||||
let r2 = make_signed_router(b'\x0b', "LR", 1700000000000UL)
|
||||
assert_eq(src.store_router_info(r1), true)
|
||||
assert_eq(src.store_router_info(r2), true)
|
||||
|
||||
let resp = src.handle_database_lookup(
|
||||
r1.identity.hash(),
|
||||
r2.identity.hash(),
|
||||
b'\x08',
|
||||
[],
|
||||
1700000010U,
|
||||
)
|
||||
match resp {
|
||||
DatabaseStore(key~, store_type~, data~, ..) => {
|
||||
assert_eq(store_type, b'\x00')
|
||||
// Canonical DatabaseStore type 0 starts with 2-byte BE length + gzip magic 0x1f 0x8b
|
||||
assert_eq(data[2], b'\x1f')
|
||||
assert_eq(data[3], b'\x8b')
|
||||
assert_eq(
|
||||
dst.handle_database_store(store_type, key, data, 1700000010U),
|
||||
true,
|
||||
)
|
||||
assert_eq(dst.get_router_info(r2.identity.hash()), Some(r2))
|
||||
}
|
||||
_ => fail("expected gzipped DatabaseStore")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user