Skip to content

Problem with small certificate serial numbers #5

@augenblickliebhaber

Description

@augenblickliebhaber

Certificates of my own PKI have small serial numbers (less than 256). Because of this there is a problem in line 409:

$ocsp_req->{'tbsRequest'}->{'requestList'}->[0]->{'reqCert'}->{'serialNumber'}->as_hex;

I think the ASN1 parser does not convert small serial numbers into an object but into an integer value that has no method.
So I get this error for a certificate with serial number 49 (decimal):

Thread 2 terminated abnormally: Can't locate object method "as_hex" via package "49" (perhaps you forgot to load "49"?) at /usr/local/sbin/ocsp_proxy line 409.

Perhaps it is better not to convert the serial numbers to hexadecimal values for the cache key, and use

'_' . $ocsp_req->{'tbsRequest'}->{'requestList'}->[0]->{'reqCert'}->{'serialNumber'};

instead in line 409, so it will work for small and for large serial numbers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions