Update ring, base64

This commit is contained in:
asonix 2023-11-25 19:52:55 -06:00
parent 47d07e7f1f
commit 47d28c6f47
4 changed files with 11 additions and 7 deletions

View file

@ -1,7 +1,7 @@
[package]
name = "http-signature-normalization-reqwest"
description = "An HTTP Signatures library that leaves the signing to you"
version = "0.10.0"
version = "0.11.0"
authors = ["asonix <asonix@asonix.dog>"]
license = "AGPL-3.0"
readme = "README.md"
@ -25,12 +25,12 @@ required-features = ["default-spawner", "ring"]
[dependencies]
async-trait = "0.1.71"
base64 = { version = "0.13", optional = true }
base64 = { version = "0.21", optional = true }
http-signature-normalization = { version = "0.7.0", path = ".." }
httpdate = "1.0.2"
reqwest = { version = "0.11", default-features = false, features = ["json"] }
reqwest-middleware = { version = "0.2.0", optional = true }
ring = { version = "0.16.20", optional = true }
ring = { version = "0.17.5", optional = true }
sha2 = { version = "0.10", optional = true }
sha3 = { version = "0.10", optional = true }
thiserror = "1.0"
@ -39,7 +39,7 @@ tokio = { version = "1", default-features = false, features = [
], optional = true }
[dev-dependencies]
pretty_env_logger = "0.4"
pretty_env_logger = "0.5"
tokio = { version = "1", default-features = false, features = [
"rt-multi-thread",
"macros",

View file

@ -81,9 +81,11 @@ impl Default for Sha512 {
}
fn create(mut context: ring::digest::Context, input: &[u8]) -> String {
use base64::prelude::*;
context.update(input);
let digest = context.finish();
base64::encode(digest.as_ref())
BASE64_STANDARD.encode(digest.as_ref())
}
impl DigestCreate for Sha256 {

View file

@ -1,3 +1,4 @@
use base64::prelude::*;
use sha2::{Sha224, Sha256, Sha384, Sha512};
use super::DigestCreate;
@ -7,7 +8,7 @@ fn create<D: sha2::Digest + sha2::digest::FixedOutputReset>(
input: &[u8],
) -> String {
sha2::Digest::update(digest, input);
base64::encode(&digest.finalize_reset())
BASE64_STANDARD.encode(&digest.finalize_reset())
}
impl DigestCreate for Sha224 {

View file

@ -1,3 +1,4 @@
use base64::prelude::*;
use sha3::{
Keccak224, Keccak256, Keccak256Full, Keccak384, Keccak512, Sha3_224, Sha3_256, Sha3_384,
Sha3_512,
@ -10,7 +11,7 @@ fn create<D: sha3::Digest + sha3::digest::FixedOutputReset>(
input: &[u8],
) -> String {
sha3::Digest::update(digest, input);
base64::encode(&digest.finalize_reset())
BASE64_STANDARD.encode(&digest.finalize_reset())
}
impl DigestCreate for Sha3_224 {