mirror of
https://github.com/MercuryWorkshop/epoxy-tls.git
synced 2025-05-12 05:50:01 -04:00
sha512 -> sha256
This commit is contained in:
parent
1a8773f801
commit
fe250c32c3
3 changed files with 14 additions and 14 deletions
|
@ -1,7 +1,7 @@
|
|||
use std::{path::PathBuf, sync::Arc};
|
||||
|
||||
use ed25519_dalek::{pkcs8::DecodePublicKey, VerifyingKey};
|
||||
use sha2::{Digest, Sha512};
|
||||
use sha2::{Digest, Sha256};
|
||||
use wisp_mux::extensions::cert::VerifyKey;
|
||||
|
||||
pub async fn get_certificates_from_paths(paths: Vec<PathBuf>) -> anyhow::Result<Vec<VerifyKey>> {
|
||||
|
@ -11,9 +11,9 @@ pub async fn get_certificates_from_paths(paths: Vec<PathBuf>) -> anyhow::Result<
|
|||
let verifier = VerifyingKey::from_public_key_pem(&data)?;
|
||||
let binary_key = verifier.to_bytes();
|
||||
|
||||
let mut hasher = Sha512::new();
|
||||
let mut hasher = Sha256::new();
|
||||
hasher.update(binary_key);
|
||||
let hash: [u8; 64] = hasher.finalize().into();
|
||||
let hash: [u8; 32] = hasher.finalize().into();
|
||||
out.push(VerifyKey::new_ed25519(Arc::new(verifier), hash));
|
||||
}
|
||||
Ok(out)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue