Skip to content
Snippets Groups Projects
  1. Apr 25, 2022
  2. Apr 22, 2022
    • Ian Jackson's avatar
      logfiles: Introduce LogfileListConfigBuilder · 79decd4a
      Ian Jackson authored
      In
        tpo/core/arti!462 (comment 2797697)
      we decided not to do this.
      
      However, having looked again at the way the FallbackList works, I
      think there is a lot of value in making these two things (and anything
      else like them[1]) as similar as possible.
      
      [1] At least PreemptiveCircuitConfig.initial_predicted_ports and
      NetworkConfig.authorities need the same treatment, and perhaps also
      GuardUsage.restrictions (although there is no
      GuardRestrictionBuilder).
      
      In the irc discussion I imagined `LogfilesConfigBuilder` as opposed to
      `LogfileConfigBuilder` (differing only in the `s`) which would be bad,
      but we can use `List` instead.
      
      We do *not* need to abstract away the validated version of the config.
      Providing a type alias helps the derive_builder sub_builder DTRT
      without needing special overrides.
      
      I have split this commit so that we can drop it, if we conclude it's
      not wanted.
      79decd4a
    • Ian Jackson's avatar
      fallback list: Introduce and use FallbackListBuilder · 962b6c32
      Ian Jackson authored
      Now the network fallbacks configuration wants to Deserialize
      a Vec<FallbackDirBuilder>, rather than validated Vec<FallbackDir>.
      
      Methods on FallbackListBuilder are as per
        tpo/core/arti!462 (comment 2797697)
      mutatis mutandi for the fact that this struct has only fallbacks in it.
      962b6c32
  3. Apr 20, 2022
  4. Apr 12, 2022
  5. Apr 11, 2022
    • Nick Mathewson's avatar
      Implement a better clock skew estimator. · cf362fac
      Nick Mathewson authored
      This time, our estimator discards outliers, takes the mean of what's
      left, and uses the standard deviation to try to figure out how
      seriously to take our report of skew/not-skew.
      
      These estimates are still not actually used.
      cf362fac
  6. Apr 07, 2022
  7. Apr 04, 2022
    • Nick Mathewson's avatar
      Add RetrySchedule::reset() · 57608f96
      Nick Mathewson authored
      Previously the code would do stuff like
      
      ```
          schedule = RetrySchedule::new(INITIAL_DELAY);
      ```
      
      which is needlessly verbose, since the schedule already keeps track
      of its initial delay.
      57608f96
    • Nick Mathewson's avatar
      circmgr: Avoid a race condition in circuit usage restriction · 86c59dd1
      Nick Mathewson authored
      We were treating restrict_mut() failures as internal errors, and
      using internal errors to represent them.  But in fact, these
      failures are entirely possible based on timing.  Here's how it
      happens:
      
      * Two different circuit requests arrive at the same time, and both
        notice a pending circuit that they could use.
      * The pending circuit completes; both pending requests are notified.
      * The first request calls restrict_mut(), and restricts the request
        in such a way that the second couldn't use it.
      * The second request calls restrict_mut(), and gets a failure.
      
      Because of this issue, we treat these errors as transient failures
      and just wait for another circuit.
      
      Closes #427.
      
      (This is not a breaking API change, since `AbstractSpec` is a
      crate-private trait.)
      86c59dd1
  8. Apr 02, 2022
  9. Apr 01, 2022
  10. Mar 30, 2022
    • Nick Mathewson's avatar
      Implement Ord for Ed25519Identity. · ea520898
      Nick Mathewson authored
      ea520898
    • Nick Mathewson's avatar
      b28863f0
    • Nick Mathewson's avatar
      Move fallback.rs into guardmgr. · 80b65c3a
      Nick Mathewson authored
      This is the logical place for it, I think: the GuardMgr's job is to
      pick the first hop for a circuit depending on remembered status for
      possible first hops.  Making this change will let us streamline the
      code that interacts with these objects.
      80b65c3a
    • eta's avatar
      Make daemon tasks self-contained; introduce NetDirProvider · ac64bdea
      eta authored
      The various background daemon tasks that `arti-client` used to spawn are
      now handled inside their respective crates instead, with functions
      provided to spawn them that return `TaskHandle`s.
      
      This required introducing a new trait, `NetDirProvider`, which steals
      some functionality from the `DirProvider` trait to enable `tor-circmgr`
      to depend on it (`tor-circmgr` is a dependency of `tor-dirmgr`, so it
      can't depend on `DirProvider` directly).
      
      While we're at it, we also make some of the tasks wait for events from
      the `NetDirProvider` instead of sleeping, slightly increasing
      efficiency.
      ac64bdea
  11. Mar 23, 2022
    • Nick Mathewson's avatar
      tor-proto: better errors when handshake fails due to untimely certs · 0b2cf533
      Nick Mathewson authored
      We now check the handshake certificates unconditionally, and only
      report them as _expired_ as a last resort.
      
      (Rationale: if somebody is presenting the wrong identity from a year
      ago, it is more interesting that they are presenting the wrong ID
      than it is that they are doing so with an expired cert.
      
      We also now report a different error if the certificate is expired,
      but its expiration is within the range of reported clock skew.
      
      (Rationale: it's helpful to distinguish this case, so that we can
      blame the failure on possible clock skew rather than definitely
      attributing it to a misbehaving relay.)
      
      Part of #405.
      0b2cf533
    • Nick Mathewson's avatar
      tor-proto: add a backend to detect reported clock skew. · 3885a2c0
      Nick Mathewson authored
      NETINFO cells, which are sent in every handshake, may contain
      timestamps.  This patch adds an accessor for the timestamp in the
      Netinfo messages, and teaches the tor-proto code how to compute the
      minimum clock skew in the code.
      
      The computation isn't terribly precise, but it doesn't need to be:
      Tor should work fine if your clock is accurate to within a few
      hours.
      
      This patch also notes a Y2038 problem in the protocol: see
      torspec#80.
      
      Part of #405.
      3885a2c0
  12. Mar 21, 2022
    • Nick Mathewson's avatar
      dirclient: Collect and expose peer information from errors. · acfa0f77
      Nick Mathewson authored
      This commit refactors the dirclient error type into two cases:
      errors when constructing a circuit, and errors that occur once we
      already have a one-hop circuit.  The latter can usually be
      attributed to the specific cache we're talking to.
      
      This commit also adds a function to expose the information about
      which directory gave us the info.
      acfa0f77
    • Nick Mathewson's avatar
      Expose more peer information from circuit build failures · d38aafa0
      Nick Mathewson authored
      We already have the ability to get peer information from ChanMgr
      errors, and therefore from any RetryErrors that contain ChanMgr
      errors.
      
      This commit adds optional peer information to tor-proto errors, and
      a function to expose whatever peer information is available.
      d38aafa0
    • Nick Mathewson's avatar
      circmgr: Change API for using FallbackDirs · d778a922
      Nick Mathewson authored
      It'll soon more convenient to pass in FallbackDirs as a slice of
      references, rather than just a slice of FallbackDirs: I'm going to
      be changing how we handle these in tor-dirmgr.
      d778a922
  13. Mar 18, 2022
  14. Mar 17, 2022
  15. Mar 16, 2022
  16. Mar 14, 2022
  17. Mar 11, 2022
  18. Mar 07, 2022
Loading