More proposal 147 updates

This commit is contained in:
zzz
2019-08-13 21:29:02 +00:00
parent ecb69fbc15
commit 647eca9704
3 changed files with 20 additions and 8 deletions

View File

@@ -88,7 +88,7 @@ Add the following specification for valid network id values:
================================== ==============
Payload Block Type NetID Number
Usage NetID Number
================================== ==============
Reserved 0
Reserved 1
@@ -139,9 +139,9 @@ New:
HMAC-MD5(encryptedPayload + IV + (payloadLength ^ protocolVersion ^ ((netid - 2) << 8)), macKey)
'+' means append, '^' means exclusive-or, '<<' means left shift.
payloadLength is a 2 byte unsigned integer
protocolVersion is one byte 0x00
netid is a 1 byte unsigned integer
payloadLength is a two byte unsigned integer, big endian
protocolVersion is two bytes 0x0000, big endian
netid is a two byte unsigned integer, big endian, legal values are 2-254
{% endhighlight %}

View File

@@ -43,7 +43,7 @@ where '+' means append and '^' means exclusive-or.
The IV is generated randomly for each packet. The encryptedPayload is the
encrypted version of the message starting with the flag byte
(encrypt-then-MAC). The payloadLength used in the MAC is a 2 byte unsigned
integer. Note that protocolVersion is 0, so the exclusive-or is a no-op. The
integer, big endian. Note that protocolVersion is 0, so the exclusive-or is a no-op. The
macKey is either the introduction key or is constructed from the exchanged DH
key (see details below), as specified for each message below.
@@ -54,11 +54,12 @@ The payload itself (that is, the message starting with the flag byte) is
AES256/CBC encrypted with the IV and the sessionKey, with replay prevention
addressed within its body, explained below.
The protocolVersion is a 2 byte unsigned integer and is currently set to 0.
The protocolVersion is a 2 byte unsigned integer, big endian, and is currently set to 0.
Peers using a different protocol version will not be able to communicate with
this peer, though earlier versions not using this flag are.
The exclusive OR of ((netid - 2) << 8) is used to quickly identify cross-network connections.
The netid is a 2 byte unsigned integer, big endian, and is currently set to 2.
As of 0.9.42. See proposal 147 for more information.
As the current network ID is 2, this is a no-op for the current network and is backward compatible.
Any connections from test networks should have a different ID and will fail the HMAC.