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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ resolver = "2"

[workspace.package]
edition = "2021"
version = "0.0.17"
version = "0.0.18"
authors = ["Jun Kurihara"]
homepage = "https://github.com/junkurihara/httpsig-rs"
repository = "https://github.com/junkurihara/httpsig-rs"
Expand Down
8 changes: 4 additions & 4 deletions httpsig-hyper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ rust-version.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
httpsig = { path = "../httpsig", version = "0.0.17" }
httpsig = { path = "../httpsig", version = "0.0.18" }

thiserror = { version = "2.0.11" }
tracing = { version = "0.1.41" }
futures = { version = "0.3.31", default-features = false, features = [
"std",
"async-await",
] }
indexmap = { version = "2.7.0" }
indexmap = { version = "2.7.1" }

# content digest with rfc8941 structured field values
sha2 = { version = "0.10.8", default-features = false }
sfv = { version = "0.9.4" }
sfv = { version = "0.10.4" }

# encoding
base64 = { version = "0.22.1" }
Expand All @@ -34,7 +34,7 @@ base64 = { version = "0.22.1" }
http = { version = "1.2.0" }
http-body = { version = "1.0.1" }
http-body-util = { version = "0.1.2" }
bytes = { version = "1.9.0" }
bytes = { version = "1.10.0" }


[dev-dependencies]
Expand Down
15 changes: 9 additions & 6 deletions httpsig/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ rust-version.workspace = true
[dependencies]
thiserror = { version = "2.0.11" }
tracing = { version = "0.1.41" }
rustc-hash = { version = "2.1.0" }
indexmap = { version = "2.7.0" }
rustc-hash = { version = "2.1.1" }
indexmap = { version = "2.7.1" }
fxhash = { version = "0.2.1" }
rand = { version = "0.8.5" }
rand = { version = "0.9.0" }

# crypto
pkcs8 = { version = "0.10.2", default-features = false, features = ["pem"] }
Expand All @@ -34,16 +34,19 @@ p256 = { version = "0.13.2", default-features = false, features = [
"arithmetic",
"ecdsa",
] }
p384 = { version = "0.13.0", default-features = false, features = [
p384 = { version = "0.13.1", default-features = false, features = [
"arithmetic",
"ecdsa",
] }
hmac = { version = "0.12.1" }
sha2 = { version = "0.10.8", default-features = false }
bytes = { version = "1.9.0" }
bytes = { version = "1.10.0" }

# encoding
base64 = { version = "0.22.1" }

# for rfc8941 structured field values
sfv = { version = "0.9.4" }
sfv = { version = "0.10.4" }

[dev-dependencies]
rand-085 = { package = "rand", version = "0.8.5" } # testing only
3 changes: 2 additions & 1 deletion httpsig/src/crypto/asymmetric.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,8 @@ MCowBQYDK2VwAyEA1ixMQcxO46PLlgQfYS46ivFd+n0CcDHSKUnuhm3i1O0=
let pk = PublicKey::from_bytes(AlgorithmName::Ed25519, ed25519_pk).unwrap();
assert!(matches!(pk, PublicKey::Ed25519(_)));

let es256_sk = p256::ecdsa::SigningKey::random(&mut rand::thread_rng());
let mut rng = rand_085::thread_rng();
let es256_sk = p256::ecdsa::SigningKey::random(&mut rng);
let es256_pk = es256_sk.verifying_key();
let sk = SecretKey::from_bytes(AlgorithmName::EcdsaP256Sha256, es256_sk.to_bytes().as_ref()).unwrap();
assert!(matches!(sk, SecretKey::EcdsaP256Sha256(_)));
Expand Down
4 changes: 2 additions & 2 deletions httpsig/src/signature_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ impl HttpSignatureParams {

/// Set random nonce
pub fn set_random_nonce(&mut self) -> &mut Self {
let mut rng = rand::thread_rng();
let nonce = rng.gen::<[u8; 32]>();
let mut rng = rand::rng();
let nonce = rng.random::<[u8; 32]>();
self.nonce = Some(general_purpose::STANDARD.encode(nonce));
self
}
Expand Down