This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository torspec.
The following commit(s) were added to refs/heads/main by this push: new d612d23 tor-spec: Revise the CircID selection section new 646fbf7 Merge branch 'tor-gitlab/mr/125' d612d23 is described below
commit d612d2344a4fe388401af35003ce695616845a97 Author: Emil Engler me@emilengler.com AuthorDate: Tue May 2 08:48:58 2023 +0200
tor-spec: Revise the CircID selection section
This commit updates the "5.1.1. Choosing circuit IDs in create cells" section, in order to clarify its importance, as well as to adjust it to modern link protocol versions.
The first goal is achieved, by directly adding a "MUST" in the first paragraph, alongside a reformulation in the paragraph explaining the method in link protocol version 4 or higher.
The second goal is achieved by merging the second paragraph with the third paragraph, as the second paragraph only applies to the link protocol versions addressed in the third one. --- tor-spec.txt | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/tor-spec.txt b/tor-spec.txt index 8f30624..c6dbcfd 100644 --- a/tor-spec.txt +++ b/tor-spec.txt @@ -1068,28 +1068,28 @@ see tor-design.pdf.
5.1.1. Choosing circuit IDs in create cells
- The CircID for a CREATE/CREATE2 cell is an arbitrarily chosen - nonzero integer, selected by the node (OP or OR) that sends the - CREATE/CREATE2 cell. In link protocol 3 or lower, CircIDs are 2 - bytes long; in protocol 4 or higher, CircIDs are 4 bytes long. - - To prevent CircID collisions, when one node sends a CREATE/CREATE2 - cell to another, it chooses from only one half of the possible - values based on the ORs' public identity keys. - - In link protocol version 3 or lower, if the sending node has a lower - key, it chooses a CircID with an MSB of 0; otherwise, it chooses a - CircID with an MSB of 1. (Public keys are compared numerically by - modulus.) With protocol version 3 or lower, a client with no public key - MAY choose any CircID it wishes, since clients never need to process a - CREATE/CREATE2 cell. + The CircID for a CREATE/CREATE2 cell is a nonzero integer, selected + by the node (OP or OR) that sends the CREATE/CREATED2 cell. + Depending on the link protocol version, there are certain rules for + choosing the value of CircID which MUST be obeyed, as implementations + MAY decide to refuse in case of a violation. In link protocol 3 or + lower, CircIDs are 2 bytes long; in protocol 4 or higher, CircIDs are + 4 bytes long. + + In link protocol version 3 or lower, the nodes choose from only one + half of the possible values based on the ORs' public identity keys, + in order to avoid collisions. If the sending node has a lower key, + it chooses a CircID with an MSB of 0; otherwise, it chooses a CircID + with an MSB of 1. (Public keys are compared numerically by modulus.) + A client with no public key MAY choose any CircID it wishes, since + clients never need to process CREATE/CREATE2 cells.
In link protocol version 4 or higher, whichever node initiated the - connection sets its MSB to 1, and whichever node didn't initiate the - connection sets its MSB to 0. + connection MUST set its MSB to 1, and whichever node didn't initiate + the connection MUST set its MSB to 0.
The CircID value 0 is specifically reserved for cells that do not - belong to any circuit: CircID 0 must not be used for circuits. No + belong to any circuit: CircID 0 MUST not be used for circuits. No other CircID value, including 0x8000 or 0x80000000, is reserved.
Existing Tor implementations choose their CircID values at random from