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

Bouncy Castle 1.80 accepted an incorrect CRL Number value #2031

Open
onepeople158 opened this issue Mar 18, 2025 · 0 comments
Open

Bouncy Castle 1.80 accepted an incorrect CRL Number value #2031

onepeople158 opened this issue Mar 18, 2025 · 0 comments

Comments

@onepeople158
Copy link

onepeople158 commented Mar 18, 2025

Hello Developer, I have a CRL file with a CRL number value of -36. According to RFC5280, the CRL number should be a non-negative integer, but Bouncy Castle 1.80 successfully printed this CRL without any errors.May I ask if this is a bug?

Code:

import java.io.InputStream;
import java.io.FileInputStream;
import org.bouncycastle.asn1.x509.CertificateList;
import org.bouncycastle.cert.X509CRLHolder;
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.bouncycastle.asn1.x509.Extension;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1OctetString;
import org.bouncycastle.asn1.DEROctetString;
import org.bouncycastle.asn1.ASN1OctetStringParser;

public class CRLParserExample_serial_num {
    public static void main(String[] args) throws Exception{
            
            InputStream inputStream = new FileInputStream("crl_file_test_.der");
            
            X509CRLHolder crlHolder = new X509CRLHolder(inputStream);
            
            ASN1ObjectIdentifier oid = new ASN1ObjectIdentifier("2.5.29.20"); 
            
            Extension extension = crlHolder.getExtension(oid);

            System.out.println(extension.getParsedValue());

        } 
}

Test Cases:

crl_file_test_.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant