Skip to content
Snippets Groups Projects
  1. May 25, 2023
  2. May 24, 2023
    • David Goulet's avatar
      Merge branch 'tor-gitlab/mr/711' · a2ec9a11
      David Goulet authored
      a2ec9a11
    • Micah Elizabeth Scott's avatar
      token_bucket_ctr: replace 32-bit wallclock time with monotime · 23f4a28f
      Micah Elizabeth Scott authored and David Goulet's avatar David Goulet committed
      
      This started as a response to ticket #40792 where Coverity is
      complaining about a potential year 2038 bug where we cast time_t from
      approx_time() to uint32_t for use in token_bucket_ctr.
      
      There was a larger can of worms though, since token_bucket really
      doesn't want to be using wallclock time here. I audited the call sites
      for approx_time() and changed any that used a 32-bit cast or made
      inappropriate use of wallclock time. Things like certificate lifetime,
      consensus intervals, etc. need wallclock time. Measurements of rates
      over time, however, are better served with a monotonic timer that does
      not try and sync with wallclock ever.
      
      Looking closer at token_bucket, its design is a bit odd because it was
      initially intended for use with tick units but later forked into
      token_bucket_rw which uses ticks to count bytes per second, and
      token_bucket_ctr which uses seconds to count slower events. The rates
      represented by either token bucket can't be lower than 1 per second, so
      the slower timer in 'ctr' is necessary to represent the slower rates of
      things like connections or introduction packets or rendezvous attempts.
      
      I considered modifying token_bucket to use 64-bit timestamps overall
      instead of 32-bit, but that seemed like an unnecessarily invasive change
      that would grant some peace of mind but probably not help much. I was
      more interested in removing the dependency on wallclock time. The
      token_bucket_rw timer already uses monotonic time. This patch converts
      token_bucket_ctr to use monotonic time as well. It introduces a new
      monotime_coarse_absolute_sec(), which is currently the same as nsec
      divided by a billion but could be optimized easily if we ever need to.
      
      This patch also might fix a rollover bug.. I haven't tested this
      extensively but I don't think the previous version of the rollover code
      on either token bucket was correct, and I would expect it to get stuck
      after the first rollover.
      
      Signed-off-by: default avatarMicah Elizabeth Scott <beth@torproject.org>
      23f4a28f
    • David Goulet's avatar
      Merge branch 'tor-gitlab/mr/709' · 9976da93
      David Goulet authored
      9976da93
    • David Goulet's avatar
      Merge branch 'tor-gitlab/mr/710' · 0781c296
      David Goulet authored
      0781c296
    • Micah Elizabeth Scott's avatar
      test_hs_descriptor: Add a test case that fails without the fix for 40793 · 71b2958a
      Micah Elizabeth Scott authored and David Goulet's avatar David Goulet committed
      
      This adds a bit more to hs_descriptor/test_decode_descriptor, mostly
      testing pow-params and triggering the tor_assert() in issue #40793.
      
      There was no mechanism for adding arbitrary test strings to the
      encrypted portion of the desc without duplicating encode logic. One
      option might be to publicize get_inner_encrypted_layer_plaintext enough
      to add a mock implementation. In this patch I opt for what seems like
      the simplest solution, at the cost of a small amount of #ifdef noise.
      The unpacked descriptor grows a new test-only member that's used for
      dropping arbitrary data in at encode time.
      
      Signed-off-by: default avatarMicah Elizabeth Scott <beth@torproject.org>
      71b2958a
    • David Goulet's avatar
      Merge branch 'tor-gitlab/mr/708' · 6afe03aa
      David Goulet authored
      6afe03aa
    • agowa338's avatar
      ipv6: Flip ClientUseIPv6 to 1 · ffb76494
      agowa338 authored and David Goulet's avatar David Goulet committed
      
      Fixes #40785
      
      Signed-off-by: David Goulet's avatarDavid Goulet <dgoulet@torproject.org>
      ffb76494
    • David Goulet's avatar
      metrics: Add ticket 40546 changes file and code fix · 8eae9f17
      David Goulet authored
      
      The MR was using an old function definition so the code fix is for that.
      
      Closes #40546
      
      Signed-off-by: David Goulet's avatarDavid Goulet <dgoulet@torproject.org>
      8eae9f17
    • David Goulet's avatar
      Merge branch 'tor-gitlab/mr/698' · 21ec9017
      David Goulet authored
      21ec9017
    • David Goulet's avatar
      Merge branch 'tor-gitlab/mr/703' · 6bf56ac3
      David Goulet authored
      6bf56ac3
  3. May 15, 2023
  4. May 11, 2023
  5. May 10, 2023
Loading