Skip to content

Commit

Permalink
Update dependencies (#315)
Browse files Browse the repository at this point in the history
* Update rsa dependency to 0.5

* Update pbkdf dependency to 0.9

* Update x509-parser dependency to 0.11

* Update crypto-bigint subdepdendency to 0.2.6
  • Loading branch information
jeamland authored Sep 10, 2021
1 parent 3905104 commit 54ce90d
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 54 deletions.
76 changes: 35 additions & 41 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ nom = "6"
num-bigint-dig = { version = "0.7", features = ["rand"] }
num-traits = "0.2"
num-integer = "0.1"
pbkdf2 = { version = "0.8", default-features = false }
pbkdf2 = { version = "0.9", default-features = false }
p256 = "0.9"
p384 = "0.8"
pcsc = "2"
rand_core = { version = "0.6", features = ["std"] }
rsa = "0.4"
rsa = "0.5"
secrecy = "0.8"
sha-1 = "0.9"
sha2 = "0.9"
subtle = "2"
subtle-encoding = "0.5"
uuid = { version = "0.8", features = ["v4"] }
x509 = "0.2"
x509-parser = "0.9"
x509-parser = "0.11"
zeroize = "1"

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ log = "0.4"
sha2 = "0.9"
subtle-encoding = "0.5"
termcolor = "1"
x509-parser = "0.9"
x509-parser = "0.11"
yubikey = { version = "0.4", path = ".." }
14 changes: 7 additions & 7 deletions src/certificate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ use log::error;
use num_bigint_dig::BigUint;
use p256::NistP256;
use p384::NistP384;
use rsa::{PublicKeyParts, RSAPublicKey};
use rsa::{PublicKeyParts, RsaPublicKey};
use sha2::{Digest, Sha256};
use std::convert::TryFrom;
use std::fmt;
Expand Down Expand Up @@ -172,7 +172,7 @@ pub enum PublicKeyInfo {
algorithm: AlgorithmId,

/// Public key
pubkey: RSAPublicKey,
pubkey: RsaPublicKey,
},

/// EC P-256 keys
Expand Down Expand Up @@ -594,7 +594,7 @@ mod read_pki {
*,
};
use nom::{combinator, IResult};
use rsa::{BigUint, RSAPublicKey};
use rsa::{BigUint, RsaPublicKey};

use super::{OID_NIST_P256, OID_NIST_P384};
use crate::{piv::AlgorithmId, Error, Result};
Expand All @@ -606,7 +606,7 @@ mod read_pki {
/// publicExponent INTEGER -- e
/// }
/// ```
pub(super) fn rsa_pubkey(encoded: &[u8]) -> Result<RSAPublicKey> {
pub(super) fn rsa_pubkey(encoded: &[u8]) -> Result<RsaPublicKey> {
fn parse_rsa_pubkey(i: &[u8]) -> IResult<&[u8], DerObject<'_>, BerError> {
parse_der_sequence_defined!(i, parse_der_integer >> parse_der_integer)
}
Expand Down Expand Up @@ -634,7 +634,7 @@ mod read_pki {
_ => return Err(Error::InvalidObject),
};

RSAPublicKey::new(n, e).map_err(|_| Error::InvalidObject)
RsaPublicKey::new(n, e).map_err(|_| Error::InvalidObject)
}

/// From [RFC 5480](https://tools.ietf.org/html/rfc5480#section-2.1.1):
Expand All @@ -658,7 +658,7 @@ mod read_pki {

mod write_pki {
use cookie_factory::{SerializeFn, WriteContext};
use rsa::{BigUint, PublicKeyParts, RSAPublicKey};
use rsa::{BigUint, PublicKeyParts, RsaPublicKey};
use std::io::Write;
use x509::der::write::{der_integer, der_sequence};

Expand All @@ -675,7 +675,7 @@ mod write_pki {
/// }
/// ```
pub(super) fn rsa_pubkey<'a, W: Write + 'a>(
pubkey: &'a RSAPublicKey,
pubkey: &'a RsaPublicKey,
) -> impl SerializeFn<W> + 'a {
der_sequence((
der_integer_biguint(pubkey.n()),
Expand Down
4 changes: 2 additions & 2 deletions src/piv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ use crate::{
};
use elliptic_curve::sec1::EncodedPoint as EcPublicKey;
use log::{debug, error, warn};
use rsa::{BigUint, RSAPublicKey};
use rsa::{BigUint, RsaPublicKey};
use std::{convert::TryFrom, str::FromStr};

#[cfg(feature = "untested")]
Expand Down Expand Up @@ -624,7 +624,7 @@ pub fn generate(

Ok(PublicKeyInfo::Rsa {
algorithm,
pubkey: RSAPublicKey::new(
pubkey: RsaPublicKey::new(
BigUint::from_bytes_be(&modulus),
BigUint::from_bytes_be(&exp),
)
Expand Down

0 comments on commit 54ce90d

Please sign in to comment.