Skip to content

Commit

Permalink
Bump der-parser to v8; x509-parser to v0.14 (#402)
Browse files Browse the repository at this point in the history
  • Loading branch information
tony-iqlusion authored Aug 10, 2022
1 parent 014b7ee commit 3463d10
Show file tree
Hide file tree
Showing 3 changed files with 155 additions and 12 deletions.
156 changes: 149 additions & 7 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ members = [".", "cli"]
[dependencies]
chrono = "0.4"
cookie-factory = "0.3"
der-parser = "6"
der-parser = "8"
des = "0.8"
elliptic-curve = "0.12"
hmac = "0.12"
Expand All @@ -44,7 +44,7 @@ subtle = "2"
subtle-encoding = "0.5"
uuid = { version = "1.0", features = ["v4"] }
x509 = "0.2"
x509-parser = "0.12"
x509-parser = "0.14"
zeroize = "1"

[dev-dependencies]
Expand Down
7 changes: 4 additions & 3 deletions src/certificate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ impl PublicKeyInfo {
fn parse(subject_pki: &SubjectPublicKeyInfo<'_>) -> Result<Self> {
match subject_pki.algorithm.algorithm.to_string().as_str() {
OID_RSA_ENCRYPTION => {
let pubkey = read_pki::rsa_pubkey(subject_pki.subject_public_key.data)?;
let pubkey = read_pki::rsa_pubkey(&subject_pki.subject_public_key.data)?;

Ok(PublicKeyInfo::Rsa {
algorithm: match pubkey.n().bits() {
Expand Down Expand Up @@ -587,6 +587,7 @@ pub(crate) fn write_certificate(

mod read_pki {
use der_parser::{
asn1_rs::Any,
ber::BerObjectContent,
der::{parse_der_integer, parse_der_sequence_defined_g, DerObject},
error::BerError,
Expand Down Expand Up @@ -640,8 +641,8 @@ mod read_pki {
/// -- specifiedCurve SpecifiedECDomain
/// }
/// ```
pub(super) fn ec_parameters(parameters: &DerObject<'_>) -> Result<AlgorithmId> {
let curve_oid = parameters.as_oid_val().map_err(|_| Error::InvalidObject)?;
pub(super) fn ec_parameters(parameters: &Any<'_>) -> Result<AlgorithmId> {
let curve_oid = parameters.as_oid().map_err(|_| Error::InvalidObject)?;

match curve_oid.to_string().as_str() {
OID_NIST_P256 => Ok(AlgorithmId::EccP256),
Expand Down

0 comments on commit 3463d10

Please sign in to comment.