commit 42d93671d424d4811fbebc8f283326634db51045 Author: teor <t...@torproject.org> Date: Thu Jul 19 13:05:22 2018 +1000
tor-spec: Clarify padding bytes in VPADDING, PADDING, and DROP cells Closes 26870. --- tor-spec.txt | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tor-spec.txt b/tor-spec.txt index 705b159..666bc93 100644 --- a/tor-spec.txt +++ b/tor-spec.txt @@ -420,7 +420,7 @@ see tor-design.pdf. CircID [CIRCID_LEN bytes] Command [1 byte] - Payload (padded with 0 bytes) [PAYLOAD_LEN bytes] + Payload (padded with padding bytes) [PAYLOAD_LEN bytes] On a version 2 or higher connection, all cells are as in version 1 connections, except for variable-length cells, whose format is: @@ -428,7 +428,11 @@ see tor-design.pdf. CircID [CIRCID_LEN octets] Command [1 octet] Length [2 octets; big-endian integer] - Payload [Length bytes] + Payload (some commands MAY pad) [Length bytes] + + Most variable-length cells MAY be padded with padding bytes, except + for VERSIONS cells, which MUST NOT contain any additional bytes. + (The payload of VPADDING cells consists of padding bytes.) On a version 2 connection, variable-length cells are indicated by a command byte equal to 7 ("VERSIONS"). On a version 3 or @@ -467,7 +471,8 @@ see tor-design.pdf. 132 -- AUTHORIZE (Client authorization) (Not yet used) The interpretation of 'Payload' depends on the type of the cell. - PADDING: Payload is unused. + VPADDING/PADDING: + Payload contains padding bytes. CREATE: Payload contains the handshake challenge. CREATED: Payload contains the handshake response. RELAY: Payload contains the relay header and relay body. @@ -838,6 +843,7 @@ see tor-design.pdf. The address format is a type/length/value sequence as given in section 6.4 below, without the final TTL. The timestamp is a big-endian unsigned integer number of seconds since the Unix epoch. + Implementations MUST ignore unexpected bytes at the end of the cell. Implementations MAY use the timestamp value to help decide if their clocks are skewed. Initiators MAY use "other OR's address" to help @@ -1725,8 +1731,8 @@ see tor-design.pdf. Link padding can be created by sending PADDING or VPADDING cells along the connection; relay cells of type "DROP" can be used for - long-range padding. The contents of a PADDING, VPADDING, or DROP - cell SHOULD be chosen randomly, and MUST be ignored. + long-range padding. The payloads of PADDING, VPADDING, or DROP + cells are filled with padding bytes. See Section 3. If the link protocol is version 5 or higher, link level padding is enabled as per padding-spec.txt. On these connections, clients may _______________________________________________ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits