aboutsummaryrefslogtreecommitdiff
path: root/src/api/signature.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-02-23 18:46:25 +0100
committerAlex Auvolat <alex@adnab.me>2021-02-23 18:46:25 +0100
commit40763fd749f36fe612f20f79ff7cac51252cc128 (patch)
treec43e3a8190a3323a93a7253c8095e33add817a7f /src/api/signature.rs
parent6e6f7e8555ad488a8b4d67ba640ddad933aa2654 (diff)
downloadgarage-40763fd749f36fe612f20f79ff7cac51252cc128.tar.gz
garage-40763fd749f36fe612f20f79ff7cac51252cc128.zip
Cargo fmt
Diffstat (limited to 'src/api/signature.rs')
-rw-r--r--src/api/signature.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/api/signature.rs b/src/api/signature.rs
index b6350634..d7fbd3f7 100644
--- a/src/api/signature.rs
+++ b/src/api/signature.rs
@@ -295,9 +295,12 @@ fn canonical_query_string(uri: &hyper::Uri) -> String {
}
pub fn verify_signed_content(content_sha256: Option<Hash>, body: &[u8]) -> Result<(), Error> {
- let expected_sha256 = content_sha256.ok_or_bad_request("Request content hash not signed, aborting.")?;
+ let expected_sha256 =
+ content_sha256.ok_or_bad_request("Request content hash not signed, aborting.")?;
if expected_sha256 != sha256sum(body) {
- return Err(Error::BadRequest(format!("Request content hash does not match signed hash")));
+ return Err(Error::BadRequest(format!(
+ "Request content hash does not match signed hash"
+ )));
}
Ok(())
}