[tor-bugs] #14312 [Tor]: tor-spec says additional fields in exitpolicy response are "optional" when they're not

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Jan 20 17:43:47 UTC 2015


#14312: tor-spec says additional fields in exitpolicy response are "optional" when
they're not
----------------------+---------------------
 Reporter:  arma      |          Owner:
     Type:  defect    |         Status:  new
 Priority:  normal    |      Milestone:
Component:  Tor       |        Version:
 Keywords:  tor-spec  |  Actual Points:
Parent ID:            |         Points:
----------------------+---------------------
 A #tor user reported seeing
 {{{
     if (rh.length < 9) { /* reason+ipv4+dns_ttl */
       log_notice(LD_PROTOCOL,
              "Short path bias probe response length field (%d).",
 rh.length);
       return - END_CIRC_REASON_TORPROTOCOL;
     }
 }}}

 I think this was triggered by Tom's new relay implementation.

 It turns out our spec says
 {{{
    The payload of a RELAY_END cell begins with a single 'reason' byte to
    describe why the stream is closing, plus optional data (depending on
    the reason.)
    [...]
    (With REASON_EXITPOLICY, the 4-byte IPv4 address or 16-byte IPv6
 address
    forms the optional data, along with a 4-byte TTL; no other reason
    currently has extra data.)
 }}}

 Tom and I are now thinking that this word 'optional' means 'required for
 some types of end cells but not included in others'. But he misinterpreted
 'optional' to mean 'you don't have to implement it'. Which is a fine
 interpretation, except Tor clients complain at log-level notice when you
 don't.

 I think it was originally optional because some very old Tor versions
 didn't implement it. But now they all do (well, up until yesterday, when
 Tom's version came online). Should we just make this extra data for
 reason-exitpolicy be optionally mandatory?

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/14312>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list