Skip to content

Bouncy Castle 1.80 解析出了错误的CRL Number值 #2056

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

Open
onepeople158 opened this issue Apr 14, 2025 · 1 comment
Open

Bouncy Castle 1.80 解析出了错误的CRL Number值 #2056

onepeople158 opened this issue Apr 14, 2025 · 1 comment
Labels
support request Community assistance requested

Comments

@onepeople158
Copy link

Hello Developer,
I have a CRL file with the CRL Number value as a string, which is "G63287510". However, when I use Bouncy Castle 1.80 to parse this CRL file, the result parsed by Bouncy Castle 1.80 is "#473633323837353130" without any errors. So, is this a bug?

Test Case:

crl_string_num.zip

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_string_num.der");
            
            X509CRLHolder crlHolder = new X509CRLHolder(inputStream);
            
            ASN1ObjectIdentifier oid = new ASN1ObjectIdentifier("2.5.29.20"); 
            
            Extension extension = crlHolder.getExtension(oid);

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

        } 
}
@peterdettman
Copy link
Collaborator

Same incomplete parsing issue as #2055. Validation won't happen until you try to resolve the tagged object as an INTEGER.

@winfriedgerlach winfriedgerlach added the support request Community assistance requested label Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support request Community assistance requested
Projects
None yet
Development

No branches or pull requests

3 participants