Skip to content

x509-cert/der regression #978

Closed
Closed
@lumag

Description

@lumag

I found a regression after upgrading to x509-cert 0.2.1 / der 0.7.1. The attached certificate
test.txt can be parsed prefectly with x509-cert 0.1 / der 0.6.1, but fails after upgrade with the following error:

Error: Error { kind: Overlength, position: Some(Length(62)) }

I could not spot any obvious issue and the position seems lame (parsing TbsCertificate starting from byte 4 returns an error at position 29.

Reproducer (convert cert to DER for it to work):

use x509_cert::certificate::Certificate;
use x509_cert::der::Decode;

fn main() {
    let name = std::env::args().skip(1).next().unwrap();
    let bytes = std::fs::read(name).unwrap();
    let parsed_cert = &Certificate::from_der(&bytes).unwrap();
    println!("{parsed_cert:?}");
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions