Skip to content

Commit

Permalink
Fix dependabot issues (#64)
Browse files Browse the repository at this point in the history
get things running again
  • Loading branch information
jmwample authored Sep 18, 2024
1 parent 9ee2d0e commit dbd9460
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ jobs:
- run: cargo update -Z minimal-versions
# Now check that `cargo build` works with respect to the oldest possible
# deps and the stated MSRV. 1.70 should work for all
- uses: dtolnay/rust-toolchain@1.70.0
- uses: dtolnay/rust-toolchain@1.75.0
- run: cargo test --workspace --all-targets --all-features
# Also make sure the AVX2 build works
- run: cargo build --target x86_64-unknown-linux-gnu
# The PTRS crate has fewer dependencies and a lower msrv
- uses: dtolnay/rust-toolchain@1.63
- uses: dtolnay/rust-toolchain@1.70
- run: cargo test -p ptrs --all-targets --all-features
- run: cargo build -p ptrs --target x86_64-unknown-linux-gnu

Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ docker:

release:
cargo build --release

msrv:
cargo +1.70 test -p ptrs --all-targets --all-features
cargo +1.75 test --workspace --all-targets --all-features

16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,28 @@ lyrebird binary, and Pluggable Transports in Rust (PTRS) library.

| Crate | Description | Crates.io | Docs | MSRV |
-------------------------------------------|----------------|-----------|------|------|
| [`ptrs`](./crates/ptrs) | A library supporting implementation and integration of Pluggable Transport protocols. | [![](https://img.shields.io/crates/v/ptrs.svg)](https://crates.io/crates/ptrs) | [![](https://img.shields.io/docsrs/ptrs)](https://docs.rs/ptrs) | 1.63 |
| [`lyrebird`](./crates/lyrebird) | Implementation of the `Lyrebird` Tor bridge and a forward proxy compatible with `ptrs`. | [![](https://img.shields.io/crates/v/lyrebird.svg)](https://crates.io/crates/lyrebird) | [![](https://docs.rs/lyrebird/badge.svg)](https://docs.rs/lyrebird) | 1.70 |
| [`obfs4`](./crates/obfs4) | An implementation of obfs4 pluggable transport library in pure rust. | [![](https://img.shields.io/crates/v/obfs4.svg)](https://crates.io/crates/obfs4) | [![](https://docs.rs/obfs4/badge.svg)](https://docs.rs/obfs4) | 1.70 |
| [`ptrs`](./crates/ptrs) | A library supporting implementation and integration of Pluggable Transport protocols. | [![](https://img.shields.io/crates/v/ptrs.svg)](https://crates.io/crates/ptrs) | [![](https://img.shields.io/docsrs/ptrs)](https://docs.rs/ptrs) | 1.70 |
| [`lyrebird`](./crates/lyrebird) | Implementation of the `Lyrebird` Tor bridge and a forward proxy compatible with `ptrs`. | [![](https://img.shields.io/crates/v/lyrebird.svg)](https://crates.io/crates/lyrebird) | [![](https://docs.rs/lyrebird/badge.svg)](https://docs.rs/lyrebird) | 1.75 |
| [`obfs4`](./crates/obfs4) | An implementation of obfs4 pluggable transport library in pure rust. | [![](https://img.shields.io/crates/v/obfs4.svg)](https://crates.io/crates/obfs4) | [![](https://docs.rs/obfs4/badge.svg)](https://docs.rs/obfs4) | 1.75 |

## MSRV

The Minimum Supported Rust Versions (MSRV) for the various crates are listed above.
These are ensured by test and build steps in the CI pipeline.
These are ensured by test and build steps in the CI pipeline.

MSRV can be changed in the future, but it will be done with a minor version bump.
We will not increase MSRV on PATCH releases, though downstream dependencies might.
Once these crates reach a semi-stable state any changes to MSRV will be accompanied
with a minor version bump. We will not increase MSRV on PATCH releases, though downstream
dependencies might.

We won't increase MSRV just because we can: we'll only do so when we have a
Along these lines, we won't increase MSRV just because we can: we'll only do so when we have a
reason. (We don't guarantee that you'll agree with our reasoning; only that
it will exist.)

## Related

Things to keep an eye on:

- [X] [`kemeleon`](https://github.com/jmwample/kemeleon) crate implementing the [Kemeleon ML-KEM Key obfuscation algorithm(s)](https://eprint.iacr.org/2024/1086.pdf).
- [ ] PR implementating elligator2 for the `dalek` ed25519 library. [PR Here](https://github.com/dalek-cryptography/curve25519-dalek/pull/612)

## Open Source License
Expand Down
11 changes: 6 additions & 5 deletions crates/obfs4/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ tokio-util = { version = "0.7.10", features = ["codec", "io"]}
bytes = "1.5.0"

## ntor_arti
tor-cell = "0.20.0"
tor-llcrypto = "0.20.0"
tor-error = "0.20.0"
tor-bytes = "0.20.0"
tor-cell = "0.22.0"
tor-llcrypto = "0.22.0"
tor-error = "0.22.0"
tor-bytes = "0.22.0"
cipher = "0.4.4"
zeroize = "1.7.0"
thiserror = "1.0.56"
Expand All @@ -71,6 +71,7 @@ anyhow = { version="1.0.20", optional=true}
async-trait = { version="0.1.9", optional=true}
num-bigint = { version="0.4.2", optional=true}
simple_asn1 = { version="0.6.1", optional=true}
filetime = {version="0.2.25", optional=true}

## Maybe useful in future iterations
# tor-socksproto = { version = "0.10.0" }
Expand All @@ -80,7 +81,7 @@ simple_asn1 = { version="0.6.1", optional=true}
[dev-dependencies]
tracing-subscriber = "0.3.18"
hex-literal = "0.4.1"
tor-basic-utils = "0.20.0"
tor-basic-utils = "0.22.0"

# benches
# criterion = "0.5"
Expand Down
2 changes: 2 additions & 0 deletions crates/obfs4/src/common/probdist.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Weighted probability distribution
//!
//! The probdist module implements a weighted probability distribution suitable for
//! protocol parameterization. To allow for easy reproduction of a given
//! distribution, the drbg package is used as the random number source.
Expand Down
2 changes: 1 addition & 1 deletion crates/obfs4/src/common/replay_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ mod test {
f.filter.len()
);
assert!(
!f.test_and_set(now, &format!("message-1{i}")),
!f.test_and_set(now, format!("message-1{i}")),
"unique message failed insert (returned true)"
);
}
Expand Down
4 changes: 3 additions & 1 deletion crates/obfs4/src/common/skip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ use tokio::io::{AsyncRead, AsyncWrite, AsyncWriteExt};
// use std::task::{Context, Poll};
use std::time::Duration;

/// copies all data from the reader to a sink. If the reader closes before
/// Copies all data from the reader to a sink.
///
/// If the reader closes before
/// the timeout due to na error or an EoF that result will be returned.
/// Otherwise if the timeout is reached, the stream will be shutdown
/// and the result of that shutdown will be returned.
Expand Down
6 changes: 3 additions & 3 deletions crates/obfs4/src/common/x25519_elligator2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ use rand_core::{CryptoRng, RngCore};

pub const REPRESENTATIVE_LENGTH: usize = 32;

/// A collection of functions for generating x25519 keys wrapping `x25519_dalek`. ['EphemeralSecret']
/// keys are guaranteed to have a valid elligator2 representative. In general ['StaticSecret'] should
/// not be converted to PublicRepresentative, use an EphemeralSecret instead.
/// A collection of functions for generating x25519 keys wrapping `x25519_dalek`.
// ['EphemeralSecret'] keys are guaranteed to have a valid elligator2 representative. In general
// ['StaticSecret'] should not be converted to PublicRepresentative, use an EphemeralSecret instead.
pub struct Keys;

trait RetryLimit {
Expand Down
2 changes: 1 addition & 1 deletion crates/ptrs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ futures = "0.3.30"
itertools = "0.13.0"
subtle = "2.5.0"
thiserror = "1"
tokio = { version = "1.34", features = ["full"] }
tokio = { version = "1.40", features = ["full"] }
tracing = "0.1.40"
url = "2.5.0"

Expand Down
11 changes: 7 additions & 4 deletions crates/ptrs/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ pub fn is_client() -> Result<bool, Error> {
}
}

/// Return the directory name in the TOR_PT_STATE_LOCATION environment variable,
/// creating it if it doesn't exist. Returns non-nil error if
/// `TOR_PT_STATE_LOCATION` is not set or if there is an error creating the
/// directory.
/// Get the state directory from env, create if it doesnt exist.
///
/// Return the directory name in the TOR_PT_STATE_LOCATION environment variable, creating it
/// if it doesn't exist. Returns non-nil error if `TOR_PT_STATE_LOCATION` is not set or if
/// there is an error creating the directory.
pub fn make_state_dir() -> Result<String, Error> {
let path = env::var(constants::STATE_LOCATION)
.map_err(|_| to_io_other("missing required TOR_PT_STATE_LOCATION env var"))?;
Expand Down Expand Up @@ -244,6 +245,8 @@ pub(crate) fn validate_proxy_url(spec: &Url) -> Result<(), Error> {
// Server //
// ================================================================ //

/// Tor OR Server Information
///
/// Check the server pluggable transports environment, emitting an error message
/// and returning a non-nil error if any error is encountered. Resolves the
/// various requested bind addresses, the server ORPort and extended ORPort, and
Expand Down

0 comments on commit dbd9460

Please sign in to comment.