Skip to content

Commit 1aae90c

Browse files
christian-schillingLMG
authored andcommitted
Remove dependency on rust-crypto
This library has been flagged as unmaintained and we only used it to compute a hash, which we can also easily do via libgit Change-Id: rm-rust-crypto
1 parent 1d6b85f commit 1aae90c

File tree

3 files changed

+4
-84
lines changed

3 files changed

+4
-84
lines changed

Cargo.lock

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

josh-proxy/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ lazy_static = "1.4.0"
3535
josh = {path = "../"}
3636
serde_json= "1.0.81"
3737
serde= "1.0.137"
38-
rust-crypto = "0.2.36"
3938
unindent = "0.1.9"
4039
juniper = { version = "0.15.7", features = ["expose-test-schema"] }
4140
url = "2.2.2"

josh-proxy/src/auth.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ pub fn strip_auth(
121121
let header: Option<hyper::header::HeaderValue> = req.headers_mut().remove("authorization");
122122

123123
if let Some(header) = header {
124-
use crypto::digest::Digest;
125-
let mut d = crypto::sha1::Sha1::new();
126-
d.input(header.as_bytes());
127124
let hp = Handle {
128-
hash: d.result_str(),
125+
hash: format!(
126+
"{:?}",
127+
git2::Oid::hash_object(git2::ObjectType::Blob, header.as_bytes())?
128+
),
129129
};
130130
let p = Header {
131131
header: Some(header),

0 commit comments

Comments
 (0)