mirror of
https://git.asonix.dog/asonix/http-signature-normalization.git
synced 2024-11-25 02:41:00 +00:00
Fix sha3 feature
This commit is contained in:
parent
ce881b18e1
commit
139ff58466
1 changed files with 2 additions and 2 deletions
|
@ -6,12 +6,12 @@ use sha3::{
|
||||||
|
|
||||||
use super::{DigestCreate, DigestPart, DigestVerify};
|
use super::{DigestCreate, DigestPart, DigestVerify};
|
||||||
|
|
||||||
fn create(digest: &mut impl sha2::Digest, input: &[u8]) -> String {
|
fn create(digest: &mut impl sha3::Digest, input: &[u8]) -> String {
|
||||||
digest.update(input);
|
digest.update(input);
|
||||||
base64::encode(&digest.finalize_reset())
|
base64::encode(&digest.finalize_reset())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn verify(digest: &mut impl sha2::Digest, name: &str, parts: &[DigestPart]) -> bool {
|
fn verify(digest: &mut impl sha3::Digest, name: &str, parts: &[DigestPart]) -> bool {
|
||||||
if let Some(part) = parts
|
if let Some(part) = parts
|
||||||
.iter()
|
.iter()
|
||||||
.find(|p| p.algorithm.to_lowercase() == name.to_lowercase())
|
.find(|p| p.algorithm.to_lowercase() == name.to_lowercase())
|
||||||
|
|
Loading…
Reference in a new issue