Update dependencies - ring is public

This commit is contained in:
asonix 2023-11-25 19:43:33 -06:00
parent 369a1e8a96
commit bf8e0e5f69
4 changed files with 17 additions and 11 deletions

View file

@ -1,7 +1,7 @@
[package]
name = "http-signature-normalization-actix"
description = "An HTTP Signatures library that leaves the signing to you"
version = "0.10.4"
version = "0.11.0"
authors = ["asonix <asonix@asonix.dog>"]
license = "AGPL-3.0"
readme = "README.md"
@ -32,13 +32,13 @@ actix-http = { version = "3.0.2", default-features = false }
actix-rt = "2.6.0"
actix-web = { version = "4.0.0", default-features = false, optional = true }
awc = { version = "3.0.0", default-features = false, optional = true }
base64 = { version = "0.13", optional = true }
base64 = { version = "0.21", optional = true }
futures-core = "0.3.28"
http-signature-normalization = { version = "0.7.0", path = ".." }
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 }
streem = "0.1.1"
streem = "0.2.0"
thiserror = "1.0"
tokio = { version = "1", default-features = false, features = ["sync"] }
tracing = "0.1"
@ -47,7 +47,7 @@ tracing-futures = "0.2"
[dev-dependencies]
actix-rt = "2.6.0"
tracing-actix-web = { version = "0.6.0" }
tracing-actix-web = { version = "0.7.0" }
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }
[package.metadata.docs.rs]

View file

@ -96,11 +96,12 @@ impl DigestName for Sha512 {
mod client {
use super::*;
use crate::digest::DigestCreate;
use base64::prelude::*;
fn create(mut context: ring::digest::Context, input: &[u8]) -> String {
context.update(input);
let digest = context.finish();
base64::encode(digest.as_ref())
BASE64_STANDARD.encode(digest.as_ref())
}
impl DigestCreate for Sha256 {
@ -126,6 +127,7 @@ mod client {
mod server {
use super::*;
use crate::digest::{DigestPart, DigestVerify};
use base64::prelude::*;
use tracing::{debug, warn};
fn verify(context: ring::digest::Context, name: &str, parts: &[DigestPart]) -> bool {
@ -135,7 +137,7 @@ mod server {
{
debug!("Verifying digest type, {}", name);
let digest = context.finish();
let encoded = base64::encode(digest.as_ref());
let encoded = BASE64_STANDARD.encode(digest.as_ref());
return part.digest == encoded;
}

View file

@ -21,13 +21,14 @@ impl DigestName for Sha512 {
mod client {
use super::*;
use crate::digest::DigestCreate;
use base64::prelude::*;
fn create<D: sha2::Digest + sha2::digest::FixedOutputReset>(
digest: &mut D,
input: &[u8],
) -> String {
sha2::Digest::update(digest, input);
base64::encode(&digest.finalize_reset())
BASE64_STANDARD.encode(&digest.finalize_reset())
}
impl DigestCreate for Sha224 {
@ -59,6 +60,7 @@ mod client {
mod server {
use super::*;
use crate::digest::{DigestPart, DigestVerify};
use base64::prelude::*;
use tracing::{debug, warn};
fn verify<D: sha2::Digest + sha2::digest::FixedOutputReset>(
@ -71,7 +73,7 @@ mod server {
.find(|p| p.algorithm.to_lowercase() == name.to_lowercase())
{
debug!("Verifying digest type, {}", name);
let encoded = base64::encode(&digest.finalize_reset());
let encoded = BASE64_STANDARD.encode(&digest.finalize_reset());
return part.digest == encoded;
}

View file

@ -44,13 +44,14 @@ impl DigestName for Sha3_512 {
mod client {
use super::*;
use crate::digest::DigestCreate;
use base64::prelude::*;
fn create<D: sha3::Digest + sha3::digest::FixedOutputReset>(
digest: &mut D,
input: &[u8],
) -> String {
digest.update(input);
base64::encode(&digest.finalize_reset())
BASE64_STANDARD.encode(&digest.finalize_reset())
}
impl DigestCreate for Sha3_224 {
@ -112,6 +113,7 @@ mod client {
mod server {
use super::*;
use crate::digest::{DigestPart, DigestVerify};
use base64::prelude::*;
use tracing::{debug, warn};
fn verify<D: sha3::Digest + sha3::digest::FixedOutputReset>(
@ -124,7 +126,7 @@ mod server {
.find(|p| p.algorithm.to_lowercase() == name.to_lowercase())
{
debug!("Verifying digest type, {}", name);
let encoded = base64::encode(&digest.finalize_reset());
let encoded = BASE64_STANDARD.encode(&digest.finalize_reset());
return part.digest == encoded;
}