From bf0565230a5757e50558e4e34179790f84888d21 Mon Sep 17 00:00:00 2001
From: zzz <zzz@i2pmail.org>
Date: Mon, 19 Dec 2022 06:17:44 -0500
Subject: [PATCH] SSU2/NTCP2 and props. 160/161 minor updates

---
 i2p2www/spec/common-structures.rst            |  4 ++--
 i2p2www/spec/ntcp2.rst                        |  6 +++--
 i2p2www/spec/proposals/159-ssu2.rst           | 19 ++++++++++-----
 i2p2www/spec/proposals/160-udp-trackers.rst   | 24 +++++++++++++++----
 .../spec/proposals/161-ri-dest-padding.rst    |  7 +++++-
 i2p2www/spec/ssu2.rst                         | 12 ++++++----
 6 files changed, 52 insertions(+), 20 deletions(-)

diff --git a/i2p2www/spec/common-structures.rst b/i2p2www/spec/common-structures.rst
index b7e6f3aa7..63dd1fa97 100644
--- a/i2p2www/spec/common-structures.rst
+++ b/i2p2www/spec/common-structures.rst
@@ -3,8 +3,8 @@ Common structures Specification
 ===============================
 .. meta::
     :category: Design
-    :lastupdated: 2021-04
-    :accuratefor: 0.9.49
+    :lastupdated: 2022-11
+    :accuratefor: 0.9.56
 
 .. contents::
 
diff --git a/i2p2www/spec/ntcp2.rst b/i2p2www/spec/ntcp2.rst
index a64cb02db..cd9b23929 100644
--- a/i2p2www/spec/ntcp2.rst
+++ b/i2p2www/spec/ntcp2.rst
@@ -3,8 +3,8 @@ NTCP 2
 ======
 .. meta::
     :category: Transports
-    :lastupdated: 2022-01
-    :accuratefor: 0.9.53
+    :lastupdated: 2022-12
+    :accuratefor: 0.9.56
 
 .. contents::
 
@@ -1475,6 +1475,7 @@ Special case for time synchronization:
 
 {% endhighlight %}
 
+NOTE: Implementations must round to the nearest second to prevent clock bias in the network.
 
 Options
 ```````
@@ -1748,6 +1749,7 @@ If present, this must be the last block in the frame.
 
 Notes
 `````
+- Size = 0 is allowed.
 - Padding strategies TBD.
 - Minimum padding TBD.
 - Padding-only frames are allowed.
diff --git a/i2p2www/spec/proposals/159-ssu2.rst b/i2p2www/spec/proposals/159-ssu2.rst
index c22e773fd..ee28f30c7 100644
--- a/i2p2www/spec/proposals/159-ssu2.rst
+++ b/i2p2www/spec/proposals/159-ssu2.rst
@@ -5,7 +5,7 @@ SSU2
     :author: eyedeekay, orignal, zlatinb, zzz
     :created: 2021-09-12
     :thread: http://zzz.i2p/topics/2612
-    :lastupdated: 2022-10-16
+    :lastupdated: 2022-12-19
     :status: Open
     :target: 0.9.56
 
@@ -5215,10 +5215,11 @@ For time synchronization:
 
 Notes:
 
-Unlike in SSU 1, there is no timestamp in the packet header
-for the data phase in SSU 2.
-Implementations should periodically send DateTime blocks
-in the data phase.
+- Unlike in SSU 1, there is no timestamp in the packet header
+  for the data phase in SSU 2.
+- Implementations should periodically send DateTime blocks
+  in the data phase.
+- Implementations must round to the nearest second to prevent clock bias in the network.
 
 
 Options
@@ -6389,6 +6390,7 @@ If present, this must be the last block in the payload.
 
 Notes:
 
+- Size = 0 is allowed.
 - Padding strategies TBD.
 - Minimum padding TBD.
 - Padding-only payloads are allowed.
@@ -6546,7 +6548,7 @@ Recommended timeout: 15 seconds total
 
 Retry
 ---------
-If no Session Confirmed is received by Bob:
+If no Session Request is received by Bob:
 
 A Retry message is not retransmitted on timeout, to reduce the impacts
 of spoofed source addresses.
@@ -6778,8 +6780,13 @@ EXCEPT for the following are ack-eliciting:
 - DateTime block
 - Padding block
 - Termination block
+- Any blocks in the same packet as a Termination block
 - Others?
 
+Packets containing a Termination block with a reason other than
+"termination received" are acknowledged with a packet containing
+a Termination block with "termination received".
+
 Out-of session packets, including handshake messages
 and peer test messages 5-7, have their own acknowledgement mechanisms.
 See below.
diff --git a/i2p2www/spec/proposals/160-udp-trackers.rst b/i2p2www/spec/proposals/160-udp-trackers.rst
index 2bb9dd798..8d7da5f8e 100644
--- a/i2p2www/spec/proposals/160-udp-trackers.rst
+++ b/i2p2www/spec/proposals/160-udp-trackers.rst
@@ -5,9 +5,9 @@ UDP Trackers
     :author: zzz
     :created: 2022-01-03
     :thread: http://zzz.i2p/topics/1634
-    :lastupdated: 2022-01-17
+    :lastupdated: 2022-12-19
     :status: Open
-    :target: 0.9.54
+    :target: 0.9.58
 
 .. contents::
 
@@ -116,6 +116,22 @@ Client                        Tracker
 This mode omits a round-trip, but requires every announce request to be repliable.
 
 
+Security Analysis
+------------------
+
+The primary goal of an announce protocol is to impose a cost on address spoofing.
+In compatibility mode, the client must actually exist and bundle a real leaseset.
+It must have inbound tunnels to receive the Connect Response.
+These tunnels could be zero-hop and built instantly, but that would
+expose the creator.
+
+However, in fast mode, the destination and leaseset could be fake.
+Multiple fake destinations and leasesets can be rapidly generated without
+actually building tunnels. The Announce Request messages could then be sent out
+any tunnel.
+
+
+
 
 Specification
 =============
@@ -231,9 +247,9 @@ Offset  Size            Name            Value
   12          32-bit integer  leechers
   16          32-bit integer  seeders
   20          16-bit integer  count of hashes to follow
-  22 + 32 * n 32-byte hash    binary hashes
+  22   32 * n 32-byte hash    binary hashes
   ...
-  22 + 32 * c TBD             additional data TBD
+  22 + 32 * n TBD             additional data TBD
 
 {% endhighlight %}
 
diff --git a/i2p2www/spec/proposals/161-ri-dest-padding.rst b/i2p2www/spec/proposals/161-ri-dest-padding.rst
index 7afdd204d..911451395 100644
--- a/i2p2www/spec/proposals/161-ri-dest-padding.rst
+++ b/i2p2www/spec/proposals/161-ri-dest-padding.rst
@@ -5,7 +5,7 @@ RI and Destination Padding
     :author: zzz
     :created: 2022-09-28
     :thread: http://zzz.i2p/topics/3279
-    :lastupdated: 2022-09-28
+    :lastupdated: 2022-12-19
     :status: Open
     :target: 0.9.57
 
@@ -272,6 +272,8 @@ Subject to backward compatibility issues, and after disabling SSU,
 implementations may remove ElGamal code completely.
 Approximately 14% of routers in the network are ElGamal encryption type, including many floodfills.
 
+A draft merge request for Java I2P is at [MR]_.
+
 
 References
 ==========
@@ -288,6 +290,9 @@ References
 .. [I2NP]
     {{ spec_url('i2np') }}
 
+.. [MR]
+    http://git.idk.i2p/i2p-hackers/i2p.i2p/-/merge_requests/66
+
 .. [NTCP2]
     {{ spec_url('ntcp2') }}
 
diff --git a/i2p2www/spec/ssu2.rst b/i2p2www/spec/ssu2.rst
index 180fa3f34..2f720397b 100644
--- a/i2p2www/spec/ssu2.rst
+++ b/i2p2www/spec/ssu2.rst
@@ -3,7 +3,7 @@ SSU2
 ======
 .. meta::
     :category: Transports
-    :lastupdated: 2022-10
+    :lastupdated: 2022-12
     :accuratefor: 0.9.56
 
 .. contents::
@@ -2825,10 +2825,11 @@ For time synchronization:
 
 Notes:
 
-Unlike in SSU 1, there is no timestamp in the packet header
-for the data phase in SSU 2.
-Implementations should periodically send DateTime blocks
-in the data phase.
+- Unlike in SSU 1, there is no timestamp in the packet header
+  for the data phase in SSU 2.
+- Implementations should periodically send DateTime blocks
+  in the data phase.
+- Implementations must round to the nearest second to prevent clock bias in the network.
 
 
 Options
@@ -3999,6 +4000,7 @@ If present, this must be the last block in the payload.
 
 Notes:
 
+- Size = 0 is allowed.
 - Padding strategies TBD.
 - Minimum padding TBD.
 - Padding-only payloads are allowed.
-- 
GitLab