Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 7 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ license-file = "LICENSE"
homepage = "https://github.com/OctaneWeb/Octane"
readme = "README.md"
edition = "2018"
rust-version = "1.85"

[dependencies]
lazy_static = "1.4.0"
tokio-rustls = { version = "0.20", optional = true }
tokio-rustls = { version = "0.26.6", default-features = false, features = ["ring", "tls12"], optional = true }
openssl = { version = "0.10.30", optional = true }
tokio-openssl = { version = "0.5", optional = true }
tokio = { version = "0.3", features = ["net", "io-util", "stream", "rt-multi-thread", "macros", "fs"] }
socket2 = "0.3.19"
tokio-openssl = { version = "0.6.5", optional = true }
tokio = { version = "1.54.1", features = ["net", "io-util", "rt", "fs", "sync", "time"] }
socket2 = "0.6.5"
serde = { version = "1.0.123", optional = true }
serde_json = { version = "1.0.59", optional = true }

Expand Down Expand Up @@ -42,10 +42,11 @@ openSSL = ["openssl", "tokio-openssl"]
fuzzing = []

[dev-dependencies]
tokio = { version = "0.3", features = ["net", "io-util", "rt-multi-thread", "macros"] }
tokio = { version = "1.54.1", features = ["macros", "rt-multi-thread"] }
curl = "0.4.33"

[workspace]
resolver = "2"
members = [
"octane_macros",
"octane_http"
Expand Down
6 changes: 5 additions & 1 deletion octane_http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "octane_http"
version = "0.1.0"
authors = ["Daksh14 <[email protected]>"]
edition = "2018"
rust-version = "1.85"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand All @@ -11,5 +12,8 @@ path = "../octane_macros"
version = "0.1.2"

[dependencies]
tokio = { version = "0.3", features = ["net", "io-util", "stream", "rt-multi-thread"] }
tokio = "1.54.1"

[dev-dependencies]
tokio = { version = "1.54.1", features = ["rt"] }

3 changes: 2 additions & 1 deletion octane_http/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ name = "octane_http-fuzz"
version = "0.0.0"
publish = false
edition = "2018"
rust-version = "1.85"

[package.metadata]
cargo-fuzz = true

[dependencies]
libfuzzer-sys = "0.4"
tokio = { version = "0.3", features = ["io-util", "rt"] }
tokio = { version = "1.54.1", features = ["rt"] }

[dependencies.octane_http]
path = ".."
Expand Down
21 changes: 12 additions & 9 deletions octane_http/fuzz/fuzz_targets/http1x_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,18 @@ fuzz_target!(|data: &[u8]| {

// The returned request borrows `buffered`, so copy its fields out
// before inspecting the buffer again.
let owned = Http1xReader::new(&mut io, &mut buffered).await.ok().map(|req| {
(
req.request_method.to_vec(),
req.request_url.to_vec(),
req.request_version.to_vec(),
req.headers.to_vec(),
req.body_remainder.to_vec(),
)
});
let owned = Http1xReader::new(&mut io, &mut buffered)
.await
.ok()
.map(|req| {
(
req.request_method.to_vec(),
req.request_url.to_vec(),
req.request_version.to_vec(),
req.headers.to_vec(),
req.body_remainder.to_vec(),
)
});

// The reader only ever buffers bytes the connection produced, in order.
assert!(wire.starts_with(&buffered));
Expand Down
5 changes: 4 additions & 1 deletion octane_http/fuzz/fuzz_targets/http2_frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ fuzz_target!(|data: &[u8]| {
let mut full = Vec::with_capacity(PREFACE.len() + wire.len());
full.extend_from_slice(PREFACE);
full.extend_from_slice(wire);
let mut io = ChunkedIo { input: &full, chunk };
let mut io = ChunkedIo {
input: &full,
chunk,
};

if Http2FrameReader::read_preface(&mut io).await.is_err() {
return;
Expand Down
5 changes: 4 additions & 1 deletion octane_http/fuzz/fuzz_targets/http2_hpack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ fuzz_target!(|data: &[u8]| {
// Huffman: decoding arbitrary bytes may fail but must not panic, and
// anything we encode must decode back to itself.
let _ = huffman::decode(rest);
assert_eq!(huffman::decode(&huffman::encode(rest)).as_deref(), Some(rest));
assert_eq!(
huffman::decode(&huffman::encode(rest)).as_deref(),
Some(rest)
);

// Encoder round-trip: a header field encoded by the server must survive a
// trip through its own decoder byte-for-byte.
Expand Down
Loading
Loading