[tor-bugs] #28181 [Core Tor/Tor]: spec: Add to pt-spec.txt control messages going back to main process (tor)

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Jan 10 01:55:49 UTC 2019


#28181: spec: Add to pt-spec.txt control messages going back to main process (tor)
-------------------------------------------------+-------------------------
 Reporter:  dgoulet                              |          Owner:  dgoulet
     Type:  enhancement                          |         Status:
                                                 |  needs_review
 Priority:  Medium                               |      Milestone:  Tor:
                                                 |  0.4.0.x-final
Component:  Core Tor/Tor                         |        Version:
 Severity:  Normal                               |     Resolution:
 Keywords:  tor-spec, tor-pt, 040-roadmap-       |  Actual Points:
  subtask                                        |
Parent ID:  #28180                               |         Points:
 Reviewer:  ahf                                  |        Sponsor:
                                                 |  Sponsor8
-------------------------------------------------+-------------------------

Comment (by dcf):

 Replying to [comment:20 dcf]:
 > The quoting rules (String or QuotedString) are fine with me. That was my
 biggest question at comment:2:ticket:28940. I might even suggest that you
 make it easier on implementers by not allowing String, only QuotedString
 (reduces code complexity on the parsing side especially).

 Oh, but I just remembered, there's the additional constraint of the PT
 meta-syntax. It would make lots of strings inexpressible using
 QuotedString. See [https://gitweb.torproject.org/torspec.git/tree/pt-
 spec.txt?id=86480728d816474a0771a3b3aba5d223a32f0705#n368 §3.3]:
 {{{
 <Line> ::= <Keyword> <OptArgs> <NL>
 <Keyword> ::= <KeywordChar> | <Keyword> <KeywordChar>
 <KeywordChar> ::= <any US-ASCII alphanumeric, dash, and underscore>
 <OptArgs> ::= <Args>*
 <Args> ::= <SP> <ArgChar> | <Args> <ArgChar>
 <ArgChar> ::= <any US-ASCII character but NUL or NL>
 <SP> ::= <US-ASCII whitespace symbol (32)>
 <NL> ::= <US-ASCII newline (line feed) character (10)>
 }}}
 Because in QuotedString, [https://gitweb.torproject.org/torspec.git/tree
 /control-spec.txt?id=139b5d05b038aec9ea2ba91b9fc371119a7e8fd1#n101 "all
 8-bit characters are permitted unless explicitly disallowed"] and
 [https://gitweb.torproject.org/torspec.git/tree/control-
 spec.txt?id=139b5d05b038aec9ea2ba91b9fc371119a7e8fd1#n115 "a backslash
 followed by any character represents that character"], it wouldn't be
 possible to represent strings that contain byte values ≥ 0x80, for
 example.

 I think it's important that any byte sequence be representable, especially
 in log messages that may contain e.g. filenames that could be in some
 weird encoding. I would suggest CString `"abc\n\t\0\377"` or some hex
 encoding like `"abc\x0a\x09\x00\xff"` instead.

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


More information about the tor-bugs mailing list