From b5ab5cd4a9a90324727c961e53e39d703d7ac4c9 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 17 Sep 2020 10:45:10 -0400 Subject: dir-spec: Correct description for keyword, beginline, endline. A keyword may not begin with '-'. Otherwise, "-----BEGIN" would be a keyword, and the grammar would be ambiguous. A beginline or endline may have multiple words in its tag. --- dir-spec.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'dir-spec.txt') diff --git a/dir-spec.txt b/dir-spec.txt index 7ae5acd..2314974 100644 --- a/dir-spec.txt +++ b/dir-spec.txt @@ -200,7 +200,8 @@ Items. Every Item begins with a KeywordLine, followed by zero or more Objects. A KeywordLine begins with a Keyword, optionally followed by whitespace and more non-newline characters, and ends with a newline. A - Keyword is a sequence of one or more characters in the set [A-Za-z0-9-]. + Keyword is a sequence of one or more characters in the set [A-Za-z0-9-], + but may not start with -. An Object is a block of encoded data in pseudo-Privacy-Enhanced-Mail (PEM) style format: that is, lines of encoded data MAY be wrapped by inserting an ascii linefeed ("LF", also called newline, or "NL" here) character @@ -214,13 +215,14 @@ Document ::= (Item | NL)+ Item ::= KeywordLine Object* KeywordLine ::= Keyword NL | Keyword WS ArgumentChar+ NL - Keyword = KeywordChar+ - KeywordChar ::= 'A' ... 'Z' | 'a' ... 'z' | '0' ... '9' | '-' + Keyword = KeywordStart KeywordChar* + KeywordStart ::= 'A' ... 'Z' | 'a' ... 'z' | '0' ... '9' + KeywordChar ::= KeywordStart | '-' ArgumentChar ::= any printing ASCII character except NL. WS = (SP | TAB)+ Object ::= BeginLine Base64-encoded-data EndLine - BeginLine ::= "-----BEGIN " Keyword "-----" NL - EndLine ::= "-----END " Keyword "-----" NL + BeginLine ::= "-----BEGIN " Keyword (" " Keyword)* "-----" NL + EndLine ::= "-----END " Keyword (" " Keyword)* "-----" NL A Keyword may not be "-----BEGIN". -- cgit v1.2.3-54-g00ecf From 01122c5bd7d2f0fbb45991dcdddede30a358130f Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 17 Sep 2020 10:48:45 -0400 Subject: Clarify ed25519 signatures on routerdescs. --- dir-spec.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'dir-spec.txt') diff --git a/dir-spec.txt b/dir-spec.txt index 2314974..74493ad 100644 --- a/dir-spec.txt +++ b/dir-spec.txt @@ -627,12 +627,13 @@ It MUST be the next-to-last element in the descriptor, appearing immediately before the RSA signature. It MUST contain an Ed25519 - signature of a SHA256 digest of the entire document, from the - first character up to and including the first space after the - "router-sig-ed25519" string, prefixed with the string "Tor - router descriptor signature v1". Its format is: + signature of a SHA256 digest of the entire document. This digest is + taken from the first character up to and including the first space + after the "router-sig-ed25519" string. Before computing the digest, + the string "Tor router descriptor signature v1" is prefixed to the + document. - The signature is encoded in Base64 with terminating =s removed. + The signature is encoded in Base64, with terminating =s removed. The signing key in the identity-ed25519 certificate MUST be the one used to sign the document. -- cgit v1.2.3-54-g00ecf From c2e507b42a64b554db5936f481e9b5ca54ef13c7 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 17 Sep 2020 10:59:09 -0400 Subject: Clarify routerdesc expiration. --- dir-spec.txt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'dir-spec.txt') diff --git a/dir-spec.txt b/dir-spec.txt index 74493ad..ac0cc41 100644 --- a/dir-spec.txt +++ b/dir-spec.txt @@ -3789,12 +3789,11 @@ failure count. Clients retain the most recent descriptor they have downloaded for each - router so long as it is not too old (currently, 48 hours), OR so long as - no better descriptor has been downloaded for the same router. - - [Versions of Tor before 0.1.2.3-alpha would discard descriptors simply for - being published too far in the past.] [The code seems to discard - descriptors in all cases after they're 5 days old. True? -RD] + router so long as it is listed in the consensus. If it is not listed, + they keep it so long as it is not too old (currently, ROUTER_MAX_AGE=48 + hours) and no better router descriptor has been downloaded for the same + relay. Caches retain descriptors until they are at least + OLD_ROUTER_DESC_MAX_AGE=5 days old. Clients which chose to download the microdescriptor consensus instead of the general consensus must download the referenced microdescriptors -- cgit v1.2.3-54-g00ecf From 61b5da1756ad78acbc5ee033b8d4c4579649187b Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 17 Sep 2020 10:59:48 -0400 Subject: remove reference to a missing "download all microdescs" feature. --- dir-spec.txt | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'dir-spec.txt') diff --git a/dir-spec.txt b/dir-spec.txt index ac0cc41..47a4ee7 100644 --- a/dir-spec.txt +++ b/dir-spec.txt @@ -3803,13 +3803,8 @@ need to fetch the microdescriptors that have changed. When a client gets a new microdescriptor consensus, it looks to see if - there are any microdescriptors it needs to learn. If it needs to learn - more than half of the microdescriptors, it requests 'all', else it - requests only the missing ones. Clients MAY try to determine whether - the upload bandwidth for listing the microdescriptors they want is more - or less than the download bandwidth for the microdescriptors they do - not want. - [XXX The 'all' URL is not implemented yet. -KL] + there are any microdescriptors it needs to learn, and launches a request + for them. Clients maintain a cache of microdescriptors along with metadata like when it was last referenced by a consensus, and which identity key -- cgit v1.2.3-54-g00ecf From b92dd338887ac023da4b5d1aa27b7b3c8ad552bd Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 17 Sep 2020 13:31:42 -0400 Subject: Update dirspec to reflect REASONABLY_LIVE_TIME. --- dir-spec.txt | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'dir-spec.txt') diff --git a/dir-spec.txt b/dir-spec.txt index 47a4ee7..6b0f438 100644 --- a/dir-spec.txt +++ b/dir-spec.txt @@ -362,7 +362,10 @@ (See note above: clients guess that the next consensus's FU will be two intervals after the current VA.) - VU: The consensus is no longer valid. + VU: The consensus is no longer valid; clients should continue to try to + download a new consensus if they have not done so already. + + VU + 24 hours: Clients will no longer use the consensus at all. VoteSeconds and DistSeconds MUST each be at least 20 seconds; FU-VA and VU-FU MUST each be at least 5 minutes. @@ -1770,10 +1773,14 @@ [Exactly once.] - The end of the Interval for this vote. After this time, the - consensus produced by this vote should not be used. See section 1.4 + The end of the Interval for this vote. After this time, all + clients should try to find a more recent consensus. See section 1.4 for voting timeline information. + In practice, clients continue to use the consensus for up to 24 hours + after it is no longer valid, if no more recent consensus can be + downloaded. + "voting-delay" SP VoteSeconds SP DistSeconds NL [Exactly once.] -- cgit v1.2.3-54-g00ecf