[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #30092 [Core Tor/Tor]: Add a probability-to-apply field for circuitpadidng machines



#30092: Add a probability-to-apply field for circuitpadidng machines
-------------------------------------------------+-------------------------
 Reporter:  mikeperry                            |          Owner:  (none)
     Type:  enhancement                          |         Status:
                                                 |  needs_review
 Priority:  Medium                               |      Milestone:  Tor:
                                                 |  0.4.1.x-final
Component:  Core Tor/Tor                         |        Version:
 Severity:  Normal                               |     Resolution:
 Keywords:  wtf-pad, tor-relay, tor-cell,        |  Actual Points:  0.5
  padding, 041-proposed                          |
Parent ID:  #28634                               |         Points:  2
 Reviewer:  asn                                  |        Sponsor:
                                                 |  Sponsor2-can
-------------------------------------------------+-------------------------

Comment (by asn):

 OK this LGTM.

 I think a test would be nice tho since it has grown to non-trivial
 complexity after the last commit. Here is an easy way to test this:

 - Put the body of `if (machine->conditions.apply_with_probability > 0) {`
 into its own function which is gonna be unittested.
 - Create a mock machine and a mock circuit.
 - Call the new function a few times and check that
 `circ->padding_apply_coin_tossed` is behaving properly.

 I think this can be done without mocking `crypto_rand_double()` but you
 could also mock it so that it returns predictable stuff to make it more
 easy.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/30092#comment:5>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs