Opened 3 years ago

Closed 3 months ago

#13043 closed defect (fixed)

torspec lies about accepting both IPv4 and IPv6 for ORAddress lines

Reported by: isis Owned by: teor
Priority: Medium Milestone: Tor: 0.3.3.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-spec, spec, 032-unreached, ipv6, review-group-26
Cc: isis, nickm Actual Points:
Parent ID: #23898 Points: .1
Reviewer: nickm Sponsor:

Description

(From this comment on #9380)

tl;dr: The "a"/"or-address" lines, in implementation, only happen once each per router, and only ever contain IPv6 addresses, despite what dir-spec.txt says.


The spec says:

     "a" SP address ":" port NL

        [Any number]

        The "or-address" element as specified in section 2.1.1.

and:

   "or-address" SP ADDRESS ":" PORT NL

       [Any number]
      
       ADDRESS = IP6ADDR | IP4ADDR
       IPV6ADDR = an ipv6 address, surrounded by square brackets.
       IPV4ADDR = an ipv4 address, represented as a dotted quad.
       PORT = a number between 1 and 65535 inclusive.                
       An alternative for the address and ORPort of the "router" line, but with
       two added capabilities:  
      
         * or-address can be either an IPv4 or IPv6 address
         * or-address allows for multiple ORPorts and addresses

       A descriptor SHOULD NOT include an or-address line that does nothing but
       duplicate the address:port pair from its "router" line.

       The ordering of or-address lines and their PORT entries matter because
       Tor MAY accept a limited number of addresses or ports. As of Tor 0.2.3.x
       only the first address and the first port are used.


  • In terms of how many "a"/"or-address" lines there may be, the spec is only correct if you pay super close attention to the last sentence (this is actually the first time I've noticed it :) ).
  • In terms of whether IPv4 and/or IPv6 addresses are acceptable, the spec is currently wrong, according to the functions router_rebuild_descriptor() [source] and router_dump_router_to_string() [source] in src/or/router.c in tor's source code.


Child Tickets

Change History (25)

comment:1 Changed 3 years ago by nickm

Milestone: Tor: 0.2.6.x-final

comment:2 Changed 3 years ago by teor

Keywords: lorax added
Milestone: Tor: 0.2.6.x-finalTor: 0.2.???

comment:3 Changed 3 years ago by teor

Owner: set to massar
Status: newassigned

comment:4 Changed 3 years ago by nickm

Milestone: Tor: 0.2.???Tor: 0.2.7.x-final

Tentatively move some tickets to 0.2.7

comment:5 Changed 3 years ago by nickm

Keywords: 027-triaged-1-out added

Marking triaged-out items from first round of 0.2.7 triage.

comment:6 Changed 3 years ago by nickm

Milestone: Tor: 0.2.7.x-finalTor: 0.2.???

Make all non-needs_review, non-needs_revision, 027-triaged-1-out items belong to 0.2.???

comment:7 Changed 15 months ago by teor

Milestone: Tor: 0.2.???Tor: 0.3.???

Milestone renamed

comment:8 Changed 14 months ago by nickm

Keywords: tor-03-unspecified-201612 added
Milestone: Tor: 0.3.???Tor: unspecified

Finally admitting that 0.3.??? was a euphemism for Tor: unspecified all along.

comment:9 Changed 9 months ago by nickm

Keywords: tor-03-unspecified-201612 removed

Remove an old triaging keyword.

comment:10 Changed 9 months ago by nickm

Keywords: 027-triaged-in added

comment:11 Changed 9 months ago by nickm

Keywords: 027-triaged-in removed

comment:12 Changed 9 months ago by nickm

Keywords: 027-triaged-1-out removed

comment:13 Changed 9 months ago by nickm

Keywords: tor-spec added; torspec bridgedb-parsers lorax removed
Milestone: Tor: unspecifiedTor: 0.3.2.x-final
Points: .1
Severity: Normal
Status: assignednew

comment:14 Changed 5 months ago by nickm

Keywords: spec added

Add 'spec' keyword to items that are just spec fixes. These can land after the feature-freeze.

comment:15 Changed 5 months ago by nickm

Keywords: 032-unreached added
Milestone: Tor: 0.3.2.x-finalTor: unspecified

Mark a large number of tickets that I do not think we will do for 0.3.2.

comment:16 Changed 4 months ago by teor

Keywords: ipv6 added
Milestone: Tor: unspecifiedTor: 0.3.3.x-final
Parent ID: #20916

comment:17 Changed 4 months ago by teor

This is fixed by #23898

comment:18 Changed 4 months ago by teor

Parent ID: #20916#23898

#23898 fixes this.

comment:19 Changed 3 months ago by teor

Status: newneeds_review

comment:20 Changed 3 months ago by nickm

Keywords: review-group-26 added

Creating review-group-26.

comment:21 Changed 3 months ago by nickm

Reviewer: nickm

comment:22 Changed 3 months ago by nickm

Owner: changed from massar to teor
Status: needs_reviewassigned

setting owner

comment:23 Changed 3 months ago by nickm

Status: assignedneeds_review

comment:24 Changed 3 months ago by nickm

Status: needs_reviewmerge_ready

The spec and proposal changes in that branch look okay to me.

comment:25 Changed 3 months ago by nickm

Resolution: fixed
Status: merge_readyclosed

Merged #23898 to torspec.

Note: See TracTickets for help on using tickets.