commit d326f4d1e39640ed9ef8ee17e4c28119c391e097 Author: Damian Johnson atagar@torproject.org Date: Wed Feb 7 09:48:19 2018 -0800
Clarify what the RELAY cell's 'recognized' field is for
Our tor-spec left me pretty mystified what the 'recognized' field actually was. It discussed what to do when it was zero, but not what the field *was* or what non-zero meant. Thankfully Roger filled me in over tasty, tasty pizza. --- tor-spec.txt | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/tor-spec.txt b/tor-spec.txt index 061cc08..2272c28 100644 --- a/tor-spec.txt +++ b/tor-spec.txt @@ -1443,13 +1443,19 @@ see tor-design.pdf. other nodes in the circuit back to the originator. Commands marked as either can be sent either by the originator or other nodes.
- The 'recognized' field in any unencrypted relay payload is always set - to zero; the 'digest' field is computed as the first four bytes of - the running digest of all the bytes that have been destined for - this hop of the circuit or originated from this hop of the circuit, - seeded from Df or Db respectively (obtained in section 5.2 above), - and including this RELAY cell's entire payload (taken with the digest - field set to zero). + The 'recognized' field is used for a simple indication for if the + cell still encrypted or not. When sending cells the unencrypted + 'recognized' MUST be set to zero. When receiving and decrypting + cells the 'recognized' will be zero if we're the endpoint the cell + is destined for, and non-zero otherwise. + + When 'recognized' in an unencrypted relay payload is zero the + 'digest' field is computed as the first four bytes of the running + digest of all the bytes that have been destined for this hop of + the circuit or originated from this hop of the circuit, seeded from + Df or Db respectively (obtained in section 5.2 above), and including + this RELAY cell's entire payload (taken with the digest field set to + zero).
When the 'recognized' field of a RELAY cell is zero, and the digest is correct, the cell is considered "recognized" for the purposes of
tor-commits@lists.torproject.org