Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: fix time-purity by introducing Instant parameters #417

Closed
Closed
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
d5da1de
ci: enforce semver (#2)
thomaseizinger Oct 22, 2024
738830d
ci: enable merge queue (#13)
thomaseizinger Oct 22, 2024
ecf2806
docs: explain how to use fork (#12)
thomaseizinger Oct 22, 2024
79e948e
build(deps): bump actions/checkout from 3 to 4 (#6)
dependabot[bot] Oct 22, 2024
491f06b
build(deps): bump blake2 from 0.10.4 to 0.10.6 (#11)
dependabot[bot] Oct 22, 2024
ad2364b
build(deps): bump libc from 0.2.149 to 0.2.161 (#10)
dependabot[bot] Oct 22, 2024
e4f4aa6
build(deps): bump thiserror from 1.0.50 to 1.0.55 (#9)
dependabot[bot] Oct 22, 2024
6ae20ca
build(deps): bump curve25519-dalek from 4.0.0 to 4.1.3 (#8)
dependabot[bot] Oct 22, 2024
cd505dd
build(deps): bump nix from 0.25.0 to 0.29.0 (#7)
dependabot[bot] Oct 22, 2024
8e13f58
chore: fix clippy warnings (#14)
thomaseizinger Oct 22, 2024
bade0d0
chore: lower log-levels for timeouts to `debug` (#15)
thomaseizinger Oct 24, 2024
2db0e75
ci: fix compile errors around conditional code (#17)
thomaseizinger Oct 24, 2024
feea2a9
ci: remove `all-systems-go` job (#18)
thomaseizinger Oct 24, 2024
489684b
fix: remove panics from packet processing path (#26)
thomaseizinger Nov 12, 2024
e98ae0c
build(deps): bump tracing-appender from 0.2.2 to 0.2.3 (#24)
dependabot[bot] Nov 12, 2024
71b86c4
build(deps): bump parking_lot from 0.12.1 to 0.12.3 (#20)
dependabot[bot] Nov 12, 2024
a866e6d
build(deps): bump socket2 from 0.4.7 to 0.5.7 (#21)
dependabot[bot] Nov 12, 2024
b07142b
chore: add warning logs when destination buffer is too small (#27)
thomaseizinger Nov 12, 2024
b52bd54
build(deps): bump etherparse from 0.13.0 to 0.16.0 (#29)
dependabot[bot] Nov 18, 2024
9c5b7c9
build(deps): bump libc from 0.2.161 to 0.2.164 (#30)
dependabot[bot] Nov 18, 2024
aa1512a
build(deps): bump criterion from 0.3.6 to 0.5.1 (#28)
dependabot[bot] Nov 18, 2024
7cae12d
build(deps): bump base64 from 0.13.0 to 0.22.1 (#23)
dependabot[bot] Nov 19, 2024
0a430f6
build(deps): bump x25519-dalek from 2.0.0 to 2.0.1 (#34)
dependabot[bot] Nov 26, 2024
6a6c087
build(deps): bump ring from 0.17.5 to 0.17.8 (#32)
dependabot[bot] Nov 26, 2024
e0f74ae
chore: bump `boringtun` to Edition 2021 and fix clippy warnings (#40)
thomaseizinger Dec 2, 2024
9773808
build(deps): bump socket2 from 0.5.7 to 0.5.8 (#37)
dependabot[bot] Dec 2, 2024
9dad5bf
build(deps): bump tracing-subscriber from 0.3.18 to 0.3.19 (#36)
dependabot[bot] Dec 2, 2024
668ac2c
build(deps): bump libc from 0.2.164 to 0.2.167 (#39)
dependabot[bot] Dec 2, 2024
b6a758d
build(deps): bump tracing from 0.1.40 to 0.1.41 (#38)
dependabot[bot] Dec 2, 2024
490a43c
build(deps): bump libc from 0.2.167 to 0.2.168 (#42)
dependabot[bot] Dec 16, 2024
6df61ec
build(deps): bump libc from 0.2.168 to 0.2.169 (#43)
dependabot[bot] Dec 23, 2024
7f98ab8
Deprecate `update_timers` in favor of `update_timers_at`
thomaseizinger Oct 22, 2024
3ae570f
Add `Instant` parameter to `Timers::clear`
thomaseizinger Oct 22, 2024
c13efc9
Add `Instant` parameter to `Timers::new`
thomaseizinger Oct 22, 2024
e1cfb05
Add `Instant` parameter to `current_cookie`
thomaseizinger Oct 22, 2024
0ee96ce
Add `Instant` parameter to `Timerstamper::new`
thomaseizinger Oct 22, 2024
f4e1e9a
Add `Instant` parameter to `Handshake::new`
thomaseizinger Oct 22, 2024
2f14c1a
Add `Instant` parameter to `Timerstamper::stamp`
thomaseizinger Oct 22, 2024
e7498da
Add `Instant` parameter to `receive_handshake_response`
thomaseizinger Oct 22, 2024
71350a7
Add `Instant` parameter to `format_handshake_initiation`
thomaseizinger Oct 22, 2024
f0dda99
Add `Instant` parameter to `handle_handshake_response`
thomaseizinger Oct 22, 2024
4e7a329
Add `Instant` parameter to `handle_verified_packet`
thomaseizinger Oct 22, 2024
92b712b
Deprecate `new` in favor of `new_at`
thomaseizinger Oct 22, 2024
1750008
Deprecate `reset_count` in favor of `reset_count_at`
thomaseizinger Oct 22, 2024
0952b46
Deprecate `verify_packet` in favor of `verify_packet_at`
thomaseizinger Oct 22, 2024
49b4c28
Deprecate `time_since_last_handshake` in favor of `time_since_last_ha…
thomaseizinger Oct 22, 2024
85b84c3
Deprecate `Tunn:new` in favor of `Tunn::new_at`
thomaseizinger Oct 22, 2024
251e9fb
Deprecate `Tunn::set_static_private` in favor of `Tunn::set_static_pr…
thomaseizinger Oct 22, 2024
4a4a518
Deprecate `Tunn::decapsulate` in favor of `Tunn::decapsulate_at`
thomaseizinger Oct 22, 2024
aad2c94
Deprecate `format_handshake_initiation` in favor of `format_handshake…
thomaseizinger Oct 22, 2024
c230b50
Deprecate `Tunn::encapsulate` in favor of `Tunn::encapsulate_at`
thomaseizinger Oct 22, 2024
30976da
Deprecate `Tunn::stats` in favor of `Tunn::stats_at
thomaseizinger Oct 22, 2024
3dcc65c
Refactor tests to not depend on sleepinstant
thomaseizinger Oct 22, 2024
9ff747e
Remove `mock-instant` dependency
thomaseizinger Oct 22, 2024
4987ed2
Add note about impurity of `SystemTime`
thomaseizinger Oct 22, 2024
8db8dc7
Re-add mock-instant crate to workaround cargo-semver-checks false-pos…
thomaseizinger Jan 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ci: fix compile errors around conditional code (#17)
thomaseizinger committed Nov 12, 2024
commit 2db0e7548ccf71a1314ef5e9afcf83f2d02f7505
6 changes: 4 additions & 2 deletions boringtun/src/device/kqueue.rs
Original file line number Diff line number Diff line change
@@ -215,7 +215,7 @@ impl<H: Send + Sync> EventPoll<H> {
};

let (trigger, index) = match ev.kind {
EventKind::FD | EventKind::Signal => (ev.event.ident as RawFd, ev.event.ident as usize),
EventKind::FD | EventKind::Signal => (ev.event.ident as RawFd, ev.event.ident),
EventKind::Timer | EventKind::Notifier => (-(events.len() as RawFd) - 1, events.len()), // Custom events get negative identifiers, hopefully we will never have more than 2^31 events of each type
};

@@ -291,7 +291,9 @@ impl<H: Send + Sync> EventPoll<H> {
}

impl<H> EventPoll<H> {
// This function is only safe to call when the event loop is not running
/// # Safety
///
/// This function is only safe to call when the event loop is not running
pub unsafe fn clear_event_by_fd(&self, index: RawFd) {
let (mut events, index) = if index >= 0 {
(self.events.lock(), index as usize)
4 changes: 4 additions & 0 deletions boringtun/src/device/peer.rs
Original file line number Diff line number Diff line change
@@ -101,6 +101,10 @@ impl Peer {
}
}

#[cfg_attr(
not(any(target_os = "android", target_os = "fuchsia", target_os = "linux")),
allow(unused_variables)
)]
pub fn connect_endpoint(
&self,
port: u16,
2 changes: 1 addition & 1 deletion boringtun/src/device/tun_darwin.rs
Original file line number Diff line number Diff line change
@@ -87,7 +87,7 @@ pub fn parse_utun_name(name: &str) -> Result<u32, Error> {

impl TunSocket {
fn write(&self, src: &[u8], af: u8) -> usize {
let mut hdr = [0u8, 0u8, 0u8, af as u8];
let mut hdr = [0u8, 0u8, 0u8, af];
let mut iov = [
iovec {
iov_base: hdr.as_mut_ptr() as _,
1 change: 1 addition & 0 deletions boringtun/src/lib.rs
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@ pub mod noise;
#[cfg(not(feature = "mock-instant"))]
pub(crate) mod sleepyinstant;

#[cfg(any(feature = "ffi-bindings", feature = "device"))]
pub(crate) mod serialization;

/// Re-export of the x25519 types