aboutsummaryrefslogtreecommitdiff
path: root/tor-spec.txt
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2018-07-19 13:05:22 +1000
committerNick Mathewson <nickm@torproject.org>2018-07-30 10:10:02 -0400
commit42d93671d424d4811fbebc8f283326634db51045 (patch)
treea804751c09fe7421ac3aac892274d588f7719f17 /tor-spec.txt
parent7b1a76c734e186e50858de52675c50468bd8306a (diff)
downloadtorspec-42d93671d424d4811fbebc8f283326634db51045.tar.gz
torspec-42d93671d424d4811fbebc8f283326634db51045.zip
tor-spec: Clarify padding bytes in VPADDING, PADDING, and DROP cells
Closes 26870.
Diffstat (limited to 'tor-spec.txt')
-rw-r--r--tor-spec.txt16
1 files 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