Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump der-parser to v8; x509-parser to v0.14 #402

Merged
merged 1 commit into from
Aug 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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