Skip to content

Commit

Permalink
build(s3s): upgrade sha1 & sha2
Browse files Browse the repository at this point in the history
  • Loading branch information
Nugine committed Oct 8, 2024
1 parent be9ebf5 commit 2b874f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions crates/s3s/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ bytestring = "1.3.1"
chrono = { version = "0.4.38", default-features = false }
crc32c = "0.6.8"
crc32fast = "1.4.2"
digest = "0.10.7"
digest = "0.11.0-pre.9"
futures = { version = "0.3.30", default-features = false, features = ["std"] }
hex-simd = "0.8.0"
hmac = "0.12.1"
hmac = "0.13.0-pre.4"
http-body = "1.0.1"
http-body-util = "0.1.2"
httparse = "1.9.4"
Expand All @@ -48,8 +48,8 @@ pin-project-lite = "0.2.14"
quick-xml = { version = "0.36.1", features = ["serialize"] }
serde = { version = "1.0.210", features = ["derive"] }
serde_urlencoded = "0.7.1"
sha1 = "0.10.6"
sha2 = "0.10.8"
sha1 = "0.11.0-pre.4"
sha2 = "0.11.0-pre.4"
smallvec = "1.13.2"
thiserror = "1.0.63"
time = { version = "0.3.36", features = ["formatting", "parsing", "macros"] }
Expand Down
4 changes: 2 additions & 2 deletions crates/s3s/src/utils/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub fn is_sha256_checksum(s: &str) -> bool {

/// `hmac_sha1(key, data)`
pub fn hmac_sha1(key: impl AsRef<[u8]>, data: impl AsRef<[u8]>) -> [u8; 20] {
use hmac::{Hmac, Mac};
use hmac::{Hmac, KeyInit, Mac};
use sha1::Sha1;

let mut m = <Hmac<Sha1>>::new_from_slice(key.as_ref()).unwrap();
Expand All @@ -22,7 +22,7 @@ pub fn hmac_sha1(key: impl AsRef<[u8]>, data: impl AsRef<[u8]>) -> [u8; 20] {

/// `hmac_sha256(key, data)`
pub fn hmac_sha256(key: impl AsRef<[u8]>, data: impl AsRef<[u8]>) -> [u8; 32] {
use hmac::{Hmac, Mac};
use hmac::{Hmac, KeyInit, Mac};
use sha2::Sha256;

let mut m = <Hmac<Sha256>>::new_from_slice(key.as_ref()).unwrap();
Expand Down

0 comments on commit 2b874f8

Please sign in to comment.