Skip to content

Commit 05a29ff

Browse files
aws-config: replaced ring with sha1 crate (#4547)
Fixes awslabs/aws-sdk-rust#1317 removing the dependency on `ring` --------- Co-authored-by: Landon James <lnj@amazon.com>
1 parent 7991280 commit 05a29ff

File tree

4 files changed

+30
-20
lines changed

4 files changed

+30
-20
lines changed

.changelog/sha1-lib.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
applies_to:
3+
- aws-sdk-rust
4+
authors:
5+
- markuskobler
6+
references:
7+
- aws-sdk-rust#1317
8+
breaking: false
9+
new_feature: false
10+
bug_fix: false
11+
---
12+
13+
Change sha1 calculation in aws-config from ring to sha1 crate.

aws/rust-runtime/Cargo.lock

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

aws/rust-runtime/aws-config/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "aws-config"
3-
version = "1.8.14"
3+
version = "1.8.15"
44
authors = [
55
"AWS Rust SDK Team <aws-sdk-rust@amazon.com>",
66
"Russell Cohen <rcoh@amazon.com>",
@@ -24,7 +24,7 @@ rt-tokio = ["aws-smithy-async/rt-tokio", "aws-smithy-runtime/rt-tokio", "tokio/r
2424
client-hyper = ["aws-smithy-runtime/default-https-client"]
2525
rustls = ["client-hyper"]
2626
default-https-client = ["aws-smithy-runtime/default-https-client"]
27-
sso = ["dep:aws-sdk-sso", "dep:aws-sdk-ssooidc", "dep:ring", "dep:hex", "dep:zeroize", "aws-smithy-runtime-api/http-auth"]
27+
sso = ["dep:aws-sdk-sso", "dep:aws-sdk-ssooidc", "dep:sha1", "dep:hex", "dep:zeroize", "aws-smithy-runtime-api/http-auth"]
2828
credentials-login = [
2929
"dep:aws-sdk-signin",
3030
"dep:sha2",
@@ -66,7 +66,7 @@ fastrand = "2.3.0"
6666

6767
# implementation detail of SSO credential caching
6868
aws-sdk-sso = { path = "../../sdk/build/aws-sdk/sdk/sso", default-features = false, optional = true }
69-
ring = { version = "0.17.5", optional = true }
69+
sha1 = { version = "0.10", optional = true }
7070
hex = { version = "0.4.3", optional = true }
7171
zeroize = { version = "1", optional = true }
7272

aws/rust-runtime/aws-config/src/sso/cache.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use aws_smithy_json::serialize::JsonObjectWriter;
1111
use aws_smithy_types::date_time::{DateTimeFormatError, Format};
1212
use aws_smithy_types::DateTime;
1313
use aws_types::os_shim_internal::{Env, Fs};
14-
use ring::digest;
14+
use sha1::{Digest, Sha1};
1515
use std::borrow::Cow;
1616
use std::error::Error as StdError;
1717
use std::fmt;
@@ -140,10 +140,7 @@ fn cached_token_path(identifier: &str, home: &str) -> PathBuf {
140140
let mut out = PathBuf::with_capacity(home.len() + "/.aws/sso/cache".len() + ".json".len() + 40);
141141
out.push(home);
142142
out.push(".aws/sso/cache");
143-
out.push(hex::encode(digest::digest(
144-
&digest::SHA1_FOR_LEGACY_USE_ONLY,
145-
identifier.as_bytes(),
146-
)));
143+
out.push(hex::encode(Sha1::digest(identifier.as_bytes())));
147144
out.set_extension("json");
148145
out
149146
}

0 commit comments

Comments
 (0)