Skip to content
Draft
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
3 changes: 2 additions & 1 deletion aws-creds/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ keywords = ["AWS", "S3", "Wasabi", "Minio", "R2"]
license = "MIT"
documentation = "https://docs.rs/aws-creds/latest/awscreds/"
edition = "2021"
rust-version = "1.88.0"

[lib]
name = "awscreds"
Expand All @@ -22,7 +23,7 @@ attohttpc = { version = "0.30", default-features = false, features = [
"json",
], optional = true }
url = "2"
quick-xml = { version = "0.38", features = ["serialize"] }
quick-xml = { version = "0.39", features = ["serialize"] }
serde = { version = "1", features = ["derive"] }
time = { version = "^0.3.6", features = ["serde", "serde-well-known"] }
log = "0.4"
Expand Down
1 change: 1 addition & 0 deletions aws-region/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ keywords = ["Amazon", "AWS", "S3", "R2", "Minio"]
license = "MIT"
documentation = "https://docs.rs/aws-region/latest/awsregion/"
edition = "2021"
rust-version = "1.88.0"

[lib]
name = "awsregion"
Expand Down
13 changes: 7 additions & 6 deletions s3/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ keywords = ["S3", "Wasabi", "Minio", "GCP", "R2"]
license = "MIT"
documentation = "https://docs.rs/rust-s3/latest/s3/"
edition = "2024"
rust-version = "1.88.0"

[lib]
name = "s3"
Expand Down Expand Up @@ -53,21 +54,21 @@ bytes = { version = "1.2" }
cfg-if = "1"
futures-util = { version = "0.3", optional = true, default-features = false }
hex = "0.4"
hmac = "0.12"
hmac = "0.13"
http = "1"
log = "0.4"
maybe-async = { version = "0.2" }
md5 = "0.8"
minidom = { version = "0.16", optional = true }
minidom = { version = "0.18", optional = true }
percent-encoding = "2"
quick-xml = { version = "0.38", features = ["serialize"] }
reqwest = { version = "0.12", optional = true, features = [
quick-xml = { version = "0.39", features = ["serialize"] }
reqwest = { version = "0.13", optional = true, features = [
"stream",
], default-features = false }
serde = "1"
serde_derive = "1"
serde_json = "1"
sha2 = "0.10"
sha2 = "0.11"
surf = { version = "2", optional = true, default-features = false }
sysinfo = {version = "0.37.0", optional = true }
thiserror = { version = "2", default-features = false }
Expand Down Expand Up @@ -96,7 +97,7 @@ tags = ["minidom"]
http-credentials = ["aws-creds/http-credentials"]

tokio-native-tls = ["aws-creds/native-tls", "reqwest/native-tls", "with-tokio"]
tokio-rustls-tls = ["aws-creds/rustls-tls", "reqwest/rustls-tls", "with-tokio"]
tokio-rustls-tls = ["aws-creds/rustls-tls", "reqwest/rustls-no-provider", "with-tokio"]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify whether a rustls CryptoProvider is explicitly installed in the codebase.
rg -n -C2 'install_default|CryptoProvider|rustls::crypto|aws_lc_rs|ring::default_provider' --type rust

# Verify all reqwest rustls feature usages in manifests.
rg -n -C2 'reqwest/.*rustls' --type toml

Repository: durch/rust-s3

Length of output: 340


🌐 Web query:

For reqwest 0.13, what does the rustls-no-provider feature require at runtime, and does it require explicit CryptoProvider installation?

💡 Result:

The rustls-no-provider feature in reqwest 0.13 enables rustls TLS without automatically including or activating a specific crypto provider (like aws-lc-rs or ring), unlike the default rustls feature which includes rustls-aws-lc-rs[1][2][3]. It still depends on rustls-platform-verifier for platform root certificates[1][3]. At runtime, since no crypto provider is automatically installed by this feature, rustls requires a CryptoProvider to be available, either via a process-global default set by CryptoProvider::install_default() (called early in the application, e.g., using rustls::crypto::ring::default_provider().install_default() or similar)[4][5], or by explicitly passing one when building the ClientConfig (e.g., via ClientConfig::builder_with_provider())[4][6]. Without this, attempts to use TLS will panic with "no process-level CryptoProvider available -- call CryptoProvider::install_default before this point"[7][8]. Thus, yes, it requires explicit CryptoProvider installation (process-global or per-config) at runtime for correct operation[2][9][7][4].

Citations:


🏁 Script executed:

# Check if this is a library or binary crate
head -20 s3/Cargo.toml

# Search more broadly for any crypto provider initialization
find . -name "*.rs" -type f | xargs grep -l "CryptoProvider\|install_default" 2>/dev/null | head -20

# Check the aws-creds dependency definition
rg -A5 "^\[dependencies\]" s3/Cargo.toml | head -40

# Look for lib.rs or main initialization code
find s3/src -name "lib.rs" -o -name "main.rs" | xargs head -50

Repository: durch/rust-s3

Length of output: 2340


🏁 Script executed:

# Find examples using tokio-rustls-tls or showing usage patterns
find . -name "*.rs" -type f | xargs grep -l "tokio-rustls-tls\|tokio_rustls_tls" 2>/dev/null

# Check if aws-creds/rustls-tls feature pulls in a provider
rg -A10 "feature.*rustls-tls" aws-creds/ --type toml 2>/dev/null || echo "aws-creds dir not found, checking dependencies"

# Look for any examples directory and see what's there
find . -type d -name examples -o -type d -name example 2>/dev/null | head -5

# List example files
ls -la examples/ 2>/dev/null || echo "No examples directory"

Repository: durch/rust-s3

Length of output: 692


🏁 Script executed:

# Check the tokio example
cat examples/tokio-backend.rs

# Check if aws-creds is referenced with feature flags anywhere
rg "aws-creds" s3/Cargo.toml -A2 -B2

# Try to find aws-creds crate online documentation or check if it's in workspace
find . -name "Cargo.toml" | xargs grep -l "aws.creds\|awscreds" | head -10

Repository: durch/rust-s3

Length of output: 2506


🏁 Script executed:

# Check aws-creds Cargo.toml to see what rustls-tls feature includes
cat aws-creds/Cargo.toml | grep -A20 "rustls-tls"

Repository: durch/rust-s3

Length of output: 187


🏁 Script executed:

# Check if there's documentation about rustls-tls in README or lib.rs
grep -r "rustls-tls\|CryptoProvider" s3/src/lib.rs examples/ README.md 2>/dev/null || echo "No documentation found"

# Verify the exact reqwest and attohttpc versions and their feature behavior
rg "reqwest|attohttpc" s3/Cargo.toml -A1 | head -20

Repository: durch/rust-s3

Length of output: 988


The tokio-rustls-tls feature requires explicit CryptoProvider initialization.

Line 100 enables reqwest/rustls-no-provider, which requires library users to call CryptoProvider::install_default() (e.g., rustls::crypto::ring::default_provider().install_default()) before making any TLS connections. Without this, code using tokio-rustls-tls will panic at runtime with "no process-level CryptoProvider available." The example in examples/tokio-backend.rs does not demonstrate this requirement. Add an example or documentation showing how users should initialize the provider when using this feature.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@s3/Cargo.toml` at line 100, The crate enables the tokio-rustls-tls feature
with reqwest/rustls-no-provider which requires callers to initialize a
process-level CryptoProvider before any TLS connections; update
examples/tokio-backend.rs and relevant documentation to show calling
CryptoProvider::install_default() (for example via
rustls::crypto::ring::default_provider().install_default()) during startup so
code using the tokio-rustls-tls feature won't panic with "no process-level
CryptoProvider available."


async-std-native-tls = [
"aws-creds/native-tls",
Expand Down
1 change: 1 addition & 0 deletions s3/src/post_policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ use crate::{Bucket, LONG_DATETIME, signing};

use awscreds::Rfc3339OffsetDateTime;
use awscreds::error::CredentialsError;
use hmac::KeyInit;
use serde::ser;
use serde::ser::{Serialize, SerializeMap, SerializeSeq, SerializeTuple, Serializer};
use std::borrow::Cow;
Expand Down
2 changes: 1 addition & 1 deletion s3/src/request/request_trait.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use base64::Engine;
use base64::engine::general_purpose;
use hmac::Mac;
use hmac::{KeyInit, Mac};
use quick_xml::se::to_string;
use std::collections::HashMap;
#[cfg(any(feature = "with-tokio", feature = "with-async-std"))]
Expand Down
2 changes: 1 addition & 1 deletion s3/src/signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
use std::collections::HashMap;
use std::str;

use hmac::{Hmac, Mac};
use hmac::{Hmac, KeyInit, Mac};
use http::HeaderMap;
use percent_encoding::{AsciiSet, CONTROLS, utf8_percent_encode};
use sha2::{Digest, Sha256};
Expand Down