Skip to content

Commit 87352d5

Browse files
committed
Update sha2 crate to 0.9.0
As part of the update to 0.9.0, the RustCrypto suite of crates has changed some function names in their public api: RustCrypto/traits#43 RustCrypto/hashes#157 This commit updates to the 0.9.x version of the sha2 crate from that suite and changes function calls as appropriate. Signed-off-by: Scott Macfarlane <smacfarlane@chef.io>
1 parent 3d31c57 commit 87352d5

5 files changed

Lines changed: 122 additions & 19 deletions

File tree

Cargo.lock

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

components/builder-api/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ reqwest = "*"
3636
serde = "*"
3737
serde_derive = "*"
3838
serde_json = "*"
39-
sha2 = "= 0.8.2"
39+
sha2 = "*"
4040
toml = { version = "*", default-features = false }
4141
futures = "*"
4242
rand = "*"

components/builder-api/src/server/services/memcache.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,6 @@ fn member_role_ns_key(origin: &str, account_id: u64) -> String {
311311

312312
fn hash_key(key: &str) -> String {
313313
let mut hasher = Sha512::new();
314-
hasher.input(key);
315-
format!("{:02x}", hasher.result())
314+
hasher.update(key);
315+
format!("{:02x}", hasher.finalize())
316316
}

components/builder-jobsrv/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ rand = "*"
3939
r2d2 = "*"
4040
serde = "*"
4141
serde_derive = "*"
42-
sha2 = "= 0.8.2"
42+
sha2 = "*"
4343
toml = { version = "*", default-features = false }
4444

4545
[dependencies.actix-web]

components/builder-jobsrv/src/server/log_archiver/local.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ impl LocalArchiver {
5454
/// as not to run afoul of directory limits.
5555
pub fn archive_path(&self, job_id: u64) -> PathBuf {
5656
let mut hasher = Sha256::default();
57-
hasher.input(job_id.to_string().as_bytes());
58-
let checksum = hasher.result();
57+
hasher.update(job_id.to_string().as_bytes());
58+
let checksum = hasher.finalize();
5959

6060
let mut new_path = self.0.clone();
6161
for byte in checksum.iter().take(4) {

0 commit comments

Comments
 (0)