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

Fix/rustsec 2025 0009 0.17 #193

Merged
merged 2 commits into from
Mar 12, 2025
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@

### Thanks

## 0.17.1

### Added/Changed/Fixed

Global:
- Upgrade `ring` to version >= 0.17.12 (#190 - RUSTSEC-2025-0009)

## 0.17.0

### Added/Changed/Fixed
Expand Down
17 changes: 5 additions & 12 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
@@ -1,6 +1,6 @@
[package]
name = "x509-parser"
version = "0.17.0"
version = "0.17.1"
description = "Parser for the X.509 v3 format (RFC 5280 certificates)"
license = "MIT OR Apache-2.0"
keywords = ["X509","Certificate","parser","nom"]
Expand Down Expand Up @@ -46,7 +46,7 @@ asn1-rs = { version = "0.7.0", features=["datetime"] }
data-encoding = "2.2.1"
lazy_static = "1.4"
nom = "7.0"
oid-registry = { version="0.8", features=["crypto", "x509", "x962"] }
oid-registry = { version="0.8.1", features=["crypto", "x509", "x962"] }
rusticata-macros = "4.0"
ring = { version="0.17.7", optional=true }
der-parser = { version = "10.0", features=["bigint"] }
Expand Down
2 changes: 1 addition & 1 deletion src/certificate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ impl<'a> TbsCertificate<'a> {
pub fn inhibit_anypolicy(
&self,
) -> Result<Option<BasicExtension<&InhibitAnyPolicy>>, X509Error> {
self.get_extension_unique(&OID_X509_EXT_INHIBITANT_ANY_POLICY)?
self.get_extension_unique(&OID_X509_EXT_INHIBIT_ANY_POLICY)?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused what happened here, I fixed this instance, and the one in src/extensions/mod.rs already in 27dd7d2 no? Did that work get undone?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh! I see now, this PR is targetting a x509-parser-0.17 feature branch 💡

In that case maybe next time it'd be better to cherry-pick the equivalent fixes from master where possible?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, sorry I should have added it in the description.
I just created the x509-parser-0.17 branch to backport fixes (like this one). We can of course also cherry-pick any change that is interesting for this branch.

This is also in anticipation of some future breaking changes when this crate will have to be updated to the next asn1-rs releases (which have a lot of pending breaking changes in its API, and will require adjusting x509-parser). Of course the goal is to make the update as easy as possible.

.map_or(Ok(None), |ext| match ext.parsed_extension {
ParsedExtension::InhibitAnyPolicy(ref value) => {
Ok(Some(BasicExtension::new(ext.critical, value)))
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ pub(crate) mod parser {
);
add!(
m,
OID_X509_EXT_INHIBITANT_ANY_POLICY,
OID_X509_EXT_INHIBIT_ANY_POLICY,
parse_inhibitanypolicy_ext
);
add!(
Expand Down
2 changes: 1 addition & 1 deletion src/visitor/certificate_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ impl TbsCertificate<'_> {
if let ParsedExtension::CRLDistributionPoints(crl) = &extension.parsed_extension {
visitor.visit_extension_crl_distribution_points(crl);
}
} else if extension.oid == OID_X509_EXT_INHIBITANT_ANY_POLICY {
} else if extension.oid == OID_X509_EXT_INHIBIT_ANY_POLICY {
if let ParsedExtension::InhibitAnyPolicy(policy) = &extension.parsed_extension {
visitor.visit_extension_inhibit_anypolicy(policy);
}
Expand Down