Skip to content

Commit

Permalink
Bump rsa to v0.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tony-iqlusion committed Nov 14, 2022
1 parent 0071566 commit 2e6d29e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 91 deletions.
101 changes: 24 additions & 77 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ p256 = "0.11"
p384 = "0.11"
pcsc = "2"
rand_core = { version = "0.6", features = ["std"] }
rsa = "0.6"
rsa = "0.7"
secrecy = "0.8"
sha1 = "0.10"
sha2 = "0.10"
sha1 = { version = "0.10", features = ["oid"] }
sha2 = { version = "0.10", features = ["oid"] }
subtle = "2"
subtle-encoding = "0.5"
uuid = { version = "1.2", features = ["v4"] }
Expand All @@ -50,6 +50,7 @@ zeroize = "1"
[dev-dependencies]
env_logger = "0.9"
lazy_static = "1"
signature = { version = "1.6.4", features = ["hazmat-preview"] }

[features]
untested = []
Expand Down
15 changes: 4 additions & 11 deletions tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
use lazy_static::lazy_static;
use log::trace;
use rand_core::{OsRng, RngCore};
use rsa::{hash::Hash::SHA2_256, PaddingScheme, PublicKey};
use rsa::{pkcs1v15, PaddingScheme, PublicKey};
use sha2::{Digest, Sha256};
use signature::hazmat::PrehashVerifier;
use std::{env, str::FromStr, sync::Mutex};
use x509::RelativeDistinguishedName;
use yubikey::{
Expand Down Expand Up @@ -200,7 +201,7 @@ fn generate_self_signed_rsa_cert() {
//

let pubkey = match cert.subject_pki() {
PublicKeyInfo::Rsa { pubkey, .. } => pubkey,
PublicKeyInfo::Rsa { pubkey, .. } => pkcs1v15::VerifyingKey::from(pubkey.clone()),
_ => unreachable!(),
};

Expand All @@ -211,15 +212,7 @@ fn generate_self_signed_rsa_cert() {

let hash = Sha256::digest(msg);

assert!(pubkey
.verify(
PaddingScheme::PKCS1v15Sign {
hash: Some(SHA2_256)
},
&hash,
sig
)
.is_ok());
assert!(pubkey.verify_prehash(&hash, sig).is_ok());
}

#[test]
Expand Down

0 comments on commit 2e6d29e

Please sign in to comment.