[tor-bugs] #27380 [Core Tor/Tor]: require torrc to be UTF-8

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Nov 1 01:27:56 UTC 2018


#27380: require torrc to be UTF-8
---------------------------------+------------------------------------
 Reporter:  cyberpunks           |          Owner:  (none)
     Type:  defect               |         Status:  needs_information
 Priority:  Medium               |      Milestone:  Tor: 0.3.6.x-final
Component:  Core Tor/Tor         |        Version:
 Severity:  Normal               |     Resolution:
 Keywords:  rust-wants, prop285  |  Actual Points:
Parent ID:  #24033               |         Points:
 Reviewer:  dgoulet              |        Sponsor:
---------------------------------+------------------------------------

Comment (by teor):

 Replying to [comment:14 dgoulet]:
 > Replying to [comment:13 teor]:
 > > Replying to [comment:12 dgoulet]:
 > > > Created a PR based on 036 branch:
 https://github.com/torproject/tor/pull/459
 > > >
 > > > Waiting for CI to pass... The code lgtm;
 > > >
 > > > However, how many tor will we break with this? In other words, if
 bunch of relays update to 036 stable and then tor doesn't start because
 torrc not in UTF-8... bad?
 > >
 > > We found one relay that has a ContactInfo that's not UTF-8.
 >
 > Well that is fixed and merged with #27428
 >
 > >
 > > But we also need to fix Windows to use UTF-8 encoded paths before we
 make this change (see #25729). Otherwise, Windows users with non-ASCII
 usernames won't be able to use Tor.
 >
 > That sounds fine.
 >
 > But `ContactInfo` and `Nickname` are unfortunately optional so if they
 do not appear, I do not see a reason why we have to enforce UTF-8 on the
 entire torrc...?

 Nickname is required to be ASCII:
 https://gitweb.torproject.org/torspec.git/tree/dir-spec.txt#n1271

 ContactInfo and Platform can be non-ASCII, but platform is set by code,
 not the torrc.

 > If someone then *adds* `ContactInfo` then we'll be enforcing UTF-8 which
 is good but before the operator does that, what is the rationale?

 You're right - there isn't a good reason to make the whole torrc UTF-8.
 Directory documents should be UTF-8 for consistency.
 But we shouldn't break someone's tor just because their comments are in a
 legacy encoding.

 That said, we will eventually want to do torrc processing with Rust, and
 Rust's strings are UTF-8. (There are ways around that, but they will make
 our code more complicated.)

 Do you want to downgrade this error to a warning that the torrc may not
 work with future tor versions?
 Or should we defer this task until a later release, and decide then?

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


More information about the tor-bugs mailing list