[tor-bugs] #11045 [Stem]: Check consensus signatures

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Aug 23 21:54:25 UTC 2014


#11045: Check consensus signatures
-----------------------------+----------------------------
     Reporter:  atagar       |      Owner:  nickm
         Type:  enhancement  |     Status:  needs_revision
     Priority:  minor        |  Milestone:
    Component:  Stem         |    Version:
   Resolution:               |   Keywords:
Actual Points:               |  Parent ID:
       Points:               |
-----------------------------+----------------------------
Changes (by atagar):

 * status:  needs_review => needs_revision


Comment:

 Hi Nick, sunk in a few more hours and now have a patch I'm really itching
 to merge
 [https://gitweb.torproject.org/user/atagar/stem.git/commitdiff/b012071?hp=6c78d9a
 in my consensus_validation branch]. You should be able to try it out with
 something like...

 {{{
 % git remote add atagar git://git.torproject.org/user/atagar/stem.git
 % git fetch atagar
 % git checkout atagar/consensus_validation
 }}}

 The code now looks good to me. Trouble is it's not actually used at all,
 and when it is it understandably breaks our tests really badly.

 See the RelayDescriptor for an example. Its init method calls
 self._validate_content() so we always verify its integrity. Our unit tests
 then do a couple approaches to account for this...

   1. They generate validly signed descriptor content with the
 [https://gitweb.torproject.org/stem.git/blob/HEAD:/test/mocking.py#l649
 sign_descriptor_content() function].

   2. When making test data
 [https://gitweb.torproject.org/stem.git/blob/HEAD:/test/mocking.py#l335 we
 mocked out the _verify_digest() method].

 So there's a couple things that need to happen before we merge this.

   1. The KeyCertificate's init method should call check_certificate()
 without a date to verify its integrity. That's trivial - the trick will be
 getting the tests to pass.

   2. We need tests for verify_consensus(). Presently it has zero coverage
 so it might be completely broken right now and we wouldn't have a clue.

 Ball is now back in your court. I've invested quite a bit of time into
 this but it's now out of the realm of code cleanup and back to needing
 some missing bits.

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


More information about the tor-bugs mailing list