Skip to content

Commit

Permalink
merge refactor to crates
Browse files Browse the repository at this point in the history
  • Loading branch information
jmwample committed Mar 6, 2024
2 parents 50b9cbf + 443455c commit 093dfb4
Show file tree
Hide file tree
Showing 67 changed files with 506 additions and 89 deletions.
8 changes: 4 additions & 4 deletions .github/disabled/rust.yml → .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
- run: rustup target add ${{ matrix.target }}
- run: ${{ matrix.deps }}
- run: cargo test --target ${{ matrix.target }} --no-default-features
- run: cargo test --target ${{ matrix.target }}
- run: cargo test --target ${{ matrix.target }} --all-features
- run: cargo test --target ${{ matrix.target }} --workspace --all-targets --no-default-features
- run: cargo test --target ${{ matrix.target }} --workspace --all-targets
- run: cargo test --target ${{ matrix.target }} --workspace --all-targets --all-features
# - name: Test
# run: cargo test --verbose --workspace --all-features
# env:
Expand All @@ -94,7 +94,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
- run: cargo test
- run: cargo test --workspace --all-targets

build:
name: Build
Expand Down
87 changes: 6 additions & 81 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,85 +1,10 @@
[package]
name = "obfs"
version = "0.1.0"
edition = "2021"
[workspace]

[lib]
name = "obfs"
crate-type = ["cdylib", "rlib"]

[[bin]]
name = "fwd_proxy"
test = false
bench = false
members = [
"crates/obfs4",
"crates/ptrs"
]

[[bin]]
name = "lyrebird"
test = false
bench = false
resolver = "2"

[dependencies]
getrandom = "0.2.11"
rand = { version="0.8.5", features=["getrandom"]}
rand_core = "0.6.4"

digest = { version = "0.10.7", features=["mac"]}
siphasher = "1.0.0"
sha2 = "0.10.8"
hmac = { version="0.12.1", features=["reset"]}
hkdf = "0.12.3"

crypto_secretbox = { version="0.1.1", features=["salsa20"]}
subtle = "2.5.0"
x25519-dalek = { version = "2", features = ["static_secrets", "getrandom", "reusable_secrets", "elligator2"], git = "https://github.com/jmwample/curve25519-dalek.git", branch = "elligator2-ntor"}
group = "0.13.0"

lazy_static = "0.1.4"

hex = "0.4.3"
tracing = "0.1.40"
colored = "2.0.4"

pin-project = "1.1.3"
futures = "0.3.29"
tokio = { version = "1.33", features = ["io-util", "rt-multi-thread", "net", "rt", "macros", "sync", "signal", "time", "fs"] }
tokio-util = { version = "0.7.10", features = ["codec", "io"]}
bytes = "1.5.0"

# forward proxy binary only
anyhow = "1.0"
tracing-subscriber = "0.3.18"
clap = { version = "4.4.7", features = ["derive"]}
async-compat = "0.2.3"
safelog = { version = "0.3.5" }
tor-rtcompat = { version = "0.10.0", features = ["tokio", "rustls"]}
tor-socksproto = { version = "0.10.0" }
arti-client = { package = "arti-client", version = "0.14.0", default-features = false }
# tor-config = { version = "0.9.6" }
# tor-hsrproxy = { version = "0.2.0", optional = true }
# tor-hsservice = { version = "0.4.0", optional = true }
# tor-rpcbase = { version = "0.1.2", optional = true }
tor-ptmgr = { version = "0.10.0", features = ["full"] }

# ntor_arti
tor-cell = "0.16.0"
tor-llcrypto = "0.7.0"
tor-error = "0.6.1"
tor-bytes = "0.10.0"
tor-hscrypto = "0.6.0"
cipher = "0.4.4"
zeroize = "1.7.0"
thiserror = "1.0.56"

## lyrebird bin only
fast-socks5 = "0.9.1"
tokio-stream = "0.1.14"
tor-linkspec = { version="0.11.1" }
tor-chanmgr = { version="0.14.1", features = ["pt-client"] }

[dev-dependencies]
tracing-subscriber = "0.3.18"
hex-literal = "0.4.1"
tor-basic-utils = "0.8.0"

# o5 pqc test
pqc_kyber = {version="0.7.1", features=["kyber1024", "std"]}
76 changes: 76 additions & 0 deletions crates/lyrebird/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
[package]
name = "obfs"
version = "0.1.0"
edition = "2021"

[lib]
name = "obfs"
crate-type = ["cdylib", "rlib"]

[[bin]]
name = "fwd_proxy"
test = false
bench = false

[dependencies]
getrandom = "0.2.11"
rand = { version="0.8.5", fratures=["getrandom"]}
rand_core = "0.6.4"

digest = { version = "0.10.7", features=["mac"]}
siphasher = "1.0.0"
sha2 = "0.10.8"
hmac = { version="0.12.1", features=["reset"]}
hkdf = "0.12.3"

crypto_secretbox = { version="0.1.1", features=["salsa20"]}
subtle = "2.5.0"
x25519-dalek = { version = "2", features = ["static_secrets", "getrandom", "reusable_secrets", "elligator2"], git = "https://github.com/jmwample/curve25519-dalek.git", branch = "elligator2-ntor"}
group = "0.13.0"

lazy_static = "0.1.4"

hex = "0.4.3"
tracing = "0.1.40"
colored = "2.0.4"

pin-project = "1.1.3"
futures = "0.3.29"
tokio = { version = "1.33", features = ["io-util", "rt-multi-thread", "net", "rt", "macros", "sync", "signal", "time", "fs"] }
tokio-util = { version = "0.7.10", features = ["codec", "io"]}
bytes = "1.5.0"

# forward proxy binary only
anyhow = "1.0"
tracing-subscriber = "0.3.18"
clap = { version = "4.4.7", features = ["derive"]}
async-compat = "0.2.3"
safelog = { version = "0.3.5" }
tor-rtcompat = { version = "0.10.0", features = ["tokio", "rustls"]}
tor-socksproto = { version = "0.10.0" }
arti-client = { package = "arti-client", version = "0.14.0", default-features = false }
# tor-config = { version = "0.9.6" }
# tor-hsrproxy = { version = "0.2.0", optional = true }
# tor-hsservice = { version = "0.4.0", optional = true }
# tor-rpcbase = { version = "0.1.2", optional = true }

# ntor_arti
tor-cell = "0.16.0"
tor-llcrypto = "0.7.0"
tor-error = "0.6.1"
tor-bytes = "0.10.0"
tor-hscrypto = "0.6.0"
cipher = "0.4.4"
zeroize = "1.7.0"
thiserror = "1.0.56"

# [build-dependencies]
# cc = { version = "1.0.83", features = ["parallel"] }

[dev-dependencies]
tracing-subscriber = "0.3.18"
hex-literal = "0.4.1"
tor-basic-utils = "0.8.0"

# o5 pqc test
pqc_kyber = {version="0.7.1", features=["kyber1024", "std"]}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
84 changes: 84 additions & 0 deletions crates/obfs4/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
[package]
name = "obfs"
version = "0.1.0"
edition = "2021"

[lib]
name = "obfs"
crate-type = ["cdylib", "rlib"]

[[bin]]
name = "lyrebird"
test = false
bench = false

[[bin]]
name = "fwd_proxy"
test = false
bench = false

[dependencies]
getrandom = "0.2.11"
rand = { version="0.8.5", features=["getrandom"]}
rand_core = "0.6.4"

digest = { version = "0.10.7", features=["mac"]}
siphasher = "1.0.0"
sha2 = "0.10.8"
hmac = { version="0.12.1", features=["reset"]}
hkdf = "0.12.3"

crypto_secretbox = { version="0.1.1", features=["salsa20"]}
subtle = "2.5.0"
x25519-dalek = { version = "2", features = ["static_secrets", "getrandom", "reusable_secrets", "elligator2"], git = "https://github.com/jmwample/curve25519-dalek.git", branch = "elligator2-ntor"}
group = "0.13.0"

lazy_static = "0.1.4"

hex = "0.4.3"
tracing = "0.1.40"
colored = "2.0.4"

pin-project = "1.1.3"
futures = "0.3.29"
tokio = { version = "1.33", features = ["io-util", "rt-multi-thread", "net", "rt", "macros", "sync", "signal", "time", "fs"] }
tokio-util = { version = "0.7.10", features = ["codec", "io"]}
bytes = "1.5.0"

# forward proxy binary only
anyhow = "1.0"
tracing-subscriber = "0.3.18"
clap = { version = "4.4.7", features = ["derive"]}
async-compat = "0.2.3"
safelog = { version = "0.3.5" }
tor-rtcompat = { version = "0.10.0", features = ["tokio", "rustls"]}
tor-socksproto = { version = "0.10.0" }
arti-client = { package = "arti-client", version = "0.14.0", default-features = false }
# tor-config = { version = "0.9.6" }
# tor-hsrproxy = { version = "0.2.0", optional = true }
# tor-hsservice = { version = "0.4.0", optional = true }
# tor-rpcbase = { version = "0.1.2", optional = true }

# ntor_arti
tor-cell = "0.16.0"
tor-llcrypto = "0.7.0"
tor-error = "0.6.1"
tor-bytes = "0.10.0"
tor-hscrypto = "0.6.0"
cipher = "0.4.4"
zeroize = "1.7.0"
thiserror = "1.0.56"

## lyrebird bin only
fast-socks5 = "0.9.1"
tokio-stream = "0.1.14"
tor-linkspec = { version="0.11.1" }
tor-chanmgr = { version="0.14.1", features = ["pt-client"] }

[dev-dependencies]
tracing-subscriber = "0.3.18"
hex-literal = "0.4.1"
tor-basic-utils = "0.8.0"

# o5 pqc test
pqc_kyber = {version="0.7.1", features=["kyber1024", "std"]}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 1 addition & 4 deletions src/lib.rs → crates/obfs4/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
#![doc = include_str!("../doc/crate.md")]
#![doc = include_str!("../../../doc/crate.md")]
#![feature(trait_alias)]
#![feature(slice_flatten)]
// #![feature(stdarch_x86_avx512)]

// #![allow(dead_code)]
// #![allow(warnings)]

// pub mod ident;
pub mod o5;
// pub mod o7;
pub mod obfs4;

pub mod common;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use std::borrow::Borrow;
use bytes::BytesMut;
use digest::Mac;
use hmac::Hmac;
use rand::{RngCore, CryptoRng};
use subtle::ConstantTimeEq;
use tor_bytes::{EncodeResult, SecretBuf, Writer};
use tor_error::into_internal;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions crates/ptrs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "ptrs_dev"
version = "0.1.0"
edition = "2021"

[dependencies]
futures = "0.3.30"
tokio = { version = "1", features = ["full"] }

[dev-dependencies]
tracing = "0.1.40"
tracing-subscriber = "0.3.18"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 093dfb4

Please sign in to comment.