tor-proto: add a backend to detect reported clock skew.
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.
Showing
- crates/tor-cell/src/chancell/msg.rs 14 additions, 2 deletionscrates/tor-cell/src/chancell/msg.rs
- crates/tor-chanmgr/src/builder.rs 4 additions, 1 deletioncrates/tor-chanmgr/src/builder.rs
- crates/tor-proto/src/channel/handshake.rs 64 additions, 10 deletionscrates/tor-proto/src/channel/handshake.rs
- crates/tor-proto/src/lib.rs 1 addition, 0 deletionscrates/tor-proto/src/lib.rs
- crates/tor-proto/src/util.rs 1 addition, 0 deletionscrates/tor-proto/src/util.rs
- crates/tor-proto/src/util/skew.rs 102 additions, 0 deletionscrates/tor-proto/src/util/skew.rs
- doc/semver_status.md 6 additions, 0 deletionsdoc/semver_status.md
Loading
Please register or sign in to comment