diff options
author | Alex Auvolat <alex@adnab.me> | 2021-02-21 15:24:30 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2021-02-21 15:24:30 +0100 |
commit | b1b640ae8bd8d2ed7c128cb3f90e3e56226a5560 (patch) | |
tree | 55a703af2b8816b5c2e1aeb635db3538daa96a75 /src/api/signature.rs | |
parent | e59322041a0f894db0dfbd32805303b64048c810 (diff) | |
download | garage-b1b640ae8bd8d2ed7c128cb3f90e3e56226a5560.tar.gz garage-b1b640ae8bd8d2ed7c128cb3f90e3e56226a5560.zip |
rename hash() to sha256sum(), we might want to change it at some places
Diffstat (limited to 'src/api/signature.rs')
-rw-r--r-- | src/api/signature.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/api/signature.rs b/src/api/signature.rs index a9876462..b6350634 100644 --- a/src/api/signature.rs +++ b/src/api/signature.rs @@ -6,7 +6,7 @@ use hyper::{Body, Method, Request}; use sha2::{Digest, Sha256}; use garage_table::*; -use garage_util::data::{hash, Hash}; +use garage_util::data::{sha256sum, Hash}; use garage_model::garage::Garage; use garage_model::key_table::*; @@ -296,7 +296,7 @@ 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.")?; - if expected_sha256 != hash(body) { + if expected_sha256 != sha256sum(body) { return Err(Error::BadRequest(format!("Request content hash does not match signed hash"))); } Ok(()) |