feat: update cates version

This commit is contained in:
2022-10-03 23:55:59 +08:00
parent 623f8fb585
commit 7902ec5655
3 changed files with 342 additions and 306 deletions

632
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -9,7 +9,7 @@ authenticator = "0.3"
clap = "2.33"
rust_util = { version = "0.6", features = ["use_clap"] }
digest = "0.10"
sha1 = "0.6"
sha1 = "0.10"
sha2 = "0.10"
rand = "0.8"
base64 = "0.13"
@@ -20,13 +20,13 @@ u2f = "0.2"
openpgp-card = "0.2"
openpgp-card-pcsc = "0.2"
openpgp-card-sequoia = "0.0.8"
sequoia-openpgp = "1.3.0"
sequoia-openpgp = "1.3"
chrono = "0.4"
simpledateformat = "0.1"
ring = "0.16"
openssl = "0.10"
pem = "1.0"
yubikey = "0.5"
pem = "1.1"
yubikey = "0.6"
yubico_manager = "0.9"
x509 = "0.2"
x509-parser = "0.13"

View File

@@ -1,12 +1,6 @@
use sha1::Sha1;
use sha2::{Digest, Sha256, Sha384, Sha512};
// pub fn sha1(input: &str) -> Vec<u8> {
// let mut challenge = Sha1::default();
// challenge.update(input.as_bytes());
// challenge.digest().bytes().to_vec()
// }
pub fn sha256(input: &str) -> Vec<u8> {
sha256_bytes(input.as_bytes())
}
@@ -14,7 +8,7 @@ pub fn sha256(input: &str) -> Vec<u8> {
pub fn sha1_bytes(input: &[u8]) -> Vec<u8> {
let mut digest = Sha1::default();
digest.update(input);
digest.digest().bytes().to_vec()
digest.finalize().to_vec()
}
pub fn sha256_bytes(input: &[u8]) -> Vec<u8> {