Skip to content

Commit

Permalink
Clarify what the RELAY cell's 'recognized' field is for
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
atagar committed Feb 7, 2018
1 parent 6bd0a69 commit d326f4d
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions tor-spec.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d326f4d

Please sign in to comment.