x509-cert: v1 CRLs fail to decode (`TBSCertList.version` is OPTIONAL)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust
- Domain
- backend-api-design
Research direction
Start with TbsCertList in the x509-cert CRL module and compare its version field with the defaulted version in TbsCertificate; the issue says the prior fix in #2445 still applies. Add a round-trip test for a v1 CRL with the optional version absent, using the supplied DER reproducer. Done means the CRL decodes successfully and the test confirms its v1 representation.
Written by the indexing model from the issue text.
Description
RFC 5280 §5.1 makes TBSCertList.version OPTIONAL (absent means v1), and the doc
comment on TbsCertList quotes that, but the field is a required Version. So every
v1 CRL fails:
use der::Decode;
use x509_cert::crl::CertificateList;
// v1 CRL: TBSCertList { sha256WithRSAEncryption, CN=test, thisUpdate 260101000000Z }
let crl = hex_literal::hex!(
"3044" "302f" "300d06092a864886f70d01010b0500"
"300f310d300b06035504030c0474657374" "170d3236303130313030303030305a"
"300d06092a864886f70d01010b0500" "03020000");
CertificateList::<x509_cert::certificate::Rfc5280>::from_der(&crl).unwrap();
// Err: unexpected ASN.1 DER tag: expected INTEGER, got SEQUENCE
I hit this on real CRLs (two Certipost qualified-CA CRLs and several in the EU DSS
test data); OpenSSL reads them as "Version 1".
#2445 had the fix (#[asn1(default = "Default::default")], as TbsCertificate
already does for its version, with a round-trip test) but was closed without review.
Its diff still applies to master 715d277d and makes the CRL above decode. Could it be
reopened?
Versions: x509-cert 0.3.0 and master 715d277d.
Found and analyzed with AI assistance; the reproducers and results above were run on the versions stated.
- Dominant language
- Rust
- Stars
- 347
- Forks
- 200
- Avg merge
- 15h 53m
- Merged PRs (30d)
- 34
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from RustCrypto/formats
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
RustCrypto/formats#2543 ·
Maintainers usually reply within 1 day
-
cms: CHOICE types in `SET OF` are ordered as `SEQUENCE OF INTEGER`, not by their bytesPossibly taken @brother-z claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
RustCrypto/formats#2538 · 1 comment ·
Maintainers usually reply within 1 day
-
pem-rfc7468: a lone CR before -----BEGIN is refused as Error::Preamble, so a CR-terminated multi-certificate PEM fails load_pem_chain (RFC 7468 eol = CRLF / CR / LF)Possibly taken @choksi2212 claimed this 25 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
RustCrypto/formats#2486 · 1 comment ·
Maintainers usually reply within 1 day
-
IssuingDistributionPoint has the wrong AssociatedOid (id-pe-subjectInfoAccess)Possibly taken @eyusd claimed this 103 days ago. Open
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
RustCrypto/formats#2389 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
RustCrypto/formats#2366 ·
Maintainers usually reply within 1 day
All issues in RustCrypto/formats
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
open-telemetry/weaver#1917 ·
Maintainers usually reply within 2 days
-
bug host P3 web
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
jphacks/kz_2613#589 · 1 comment ·
Maintainers usually reply within 1 day
-
documentation pkg:sdk project
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
priority middle
Difficulty 1/5 Under an hour Newbie friendliness 72/100
KATO-Hiro/AtCoderClans#13029 ·
Maintainers usually reply within 1 day
-
bug ui
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
userFRM/egui-charts#3363 ·
Maintainers usually reply within 1 day