On Tue, Jan 06, 2015 at 05:51:53PM +0000, Andrea Shepard wrote: > Here's a proposal Nick Mathewson and I just wrote for ticket #11157. > > --- Begin proposal body --- > Filename: xxx-consensus-hash-chaining.txt > Title: Consensus Hash Chaining > Author: Nick Mathewson, Andrea Shepard > Created: 06-Jan-2015 > Status: Draft > > 1. Introduction and overview > > To avoid some categories of attacks against directory authorities and their > keys, it would be handy to have an explicit hash chain in consensuses. > > 2. Directory authority operation > > We add the following field to votes and consensuses: > > previous-consensus ISOTIME [SP HashName "=" Base16]* NL > > where HashName is any keyword. > > This field may occur any number of times. > > The date in a previous-consensus line in a vote is the valid-after date of > the consensus the line refers to. The hash should be computed over the > signed portion of the consensus document. A directory authority should > include a previous-consensus line for a consensus using all hashes it supports > for all consensuses it knows which are still valid, together with the two > most recently expired ones. > > When this proposal is implemented, a new consensus method should be allocated > for adding previous-consensus lines to the consensus. > > A previous-consensus line is included in the consensus if and only if a line > with that date was listed by more than half of the authorities whose votes > are under consideration. A hash is included in that line if the hash was > listed by more than half of the authorities whose votes are under > consideration. Hashes are sorted lexically with a line by hashname; dates > are sorted in temporal order. > > If, when computing a consensus, the authorities find that any > previous-consensus line is *incompatible* with another, they must issue a > loud warning. Two lines are incompatible if they have the same ISOTIME, but > different values for the the same HashName. > > The hash "sha256" is mandatory. > > 3. Client and cache operation > > All parties receiving consensus documents should validate previous-consensus > lines, and complain loudly if a hash fails to match. > > When a party receives a consensus document, it SHOULD check all > previous-consensus lines against any previous consensuses it has retained, > and if a hash fails to match it SHOULD warn loudly in the log mentioning the > specific hashes and valid-after times in question, and store both the new > consensus containing the mismatching hashes and the old consensus being > checked for later analysis. An option SHOULD be provided to disable > operation as a client or as a hidden service if this occurs. > > All relying parties SHOULD by default retain all valid consensuses they > download plus two; but see "Security considerations" below. > > If a hash is not mismatched, the relying party may nonetheless be unable to > validate the chain: either because there is a gap in the chain itself, or > because the relying party does not have any of the consensuses that the latest > consensus mentions. If this happens, the relying party should log a warning > stating the specific cause, the hashes and valid-after time of both the > consensus containing the unverifiable previous-consensus line and the hashes > and valid-after time of the line for each such line, and retain a copy of > the consensus document in question. A relying party MAY provide an option > to disable operation as a client or hidden service in this event, but due to > the risk that breaks in the chain may occur accidentally, such an option > SHOULD be disabled by default if provided. > > If a relying party starts up and finds only very old consensuses such that > no previous-consensus lines can be verified, it should log a notice of the > gap along the lines of "consensus (date, hash) is quite new. Can't chain back > to old consensus (date, hash)". If it has no old consensuses at all, it > should log an info-level message of the form "we got consensus (date, hash). > We haven't got any older consensuses, so we won't do any hash chain > verification" > > 4. Security Considerations: > > * Retaining consensus documents on clients might leak information about when > the client was active if a disk is later stolen or the client compromised. > This should be documented somewhere and an option to disable (but thereby > also disable verifying previous-consensus hashes) should be provided. > > * Clients MAY offer the option to retain previous consensuses in memory only > to allow for validation without the potential disk leak. > --- End proposal body --- Thank you Andrea and Nick for working on this! I think it's very important, but I'm not a fan of the design specified above. I think it would be preferable to do something similar to what other blockchains do: have a header structure in the consensus document which contains the hash of the body and the hash of the header of the immediately previous consensus. That way, clients could afford to download, store, and verify all of the headers of the whole chain going back (at least) to the release date of their tor binary. They wouldn't need to store multiple full consensus documents (except in the case of a hash mismatch, in which case they should of course keep everything they have and raise the alarm). ~leif
Attachment:
signature.asc
Description: Digital signature
_______________________________________________ tor-dev mailing list tor-dev@xxxxxxxxxxxxxxxxxxxx https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev