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 handling of escape characters #2022

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

Bouncy Castle 1.80 handling of escape characters #2022

onepeople158 opened this issue Mar 12, 2025 · 0 comments

Comments

@onepeople158
Copy link

onepeople158 commented Mar 12, 2025

Hello Developer:
I have a CRL file, and the "O" field in its issuer section contains an escape character. The value of the "O" field is 'VeriSign\'. When I use Bouncy Castle 1.80 to parse this CRL file, Bouncy Castle 1.80 interprets the "O" field as 'VeriSign\\'. However, when I open the CRL file as a .crl file, the "O" field in the issuer section shows as 'VeriSign\'.
Therefore, I suspect that the handling of the escape character '\\' by Bouncy Castle 1.80 may not be entirely reasonable.

Code:

import java.io.InputStream;
import java.io.FileInputStream;
import org.bouncycastle.asn1.x509.CertificateList;
import org.bouncycastle.cert.X509CRLHolder;

public class CRLParserExample3 {
    public static void main(String[] args) throws Exception{
            InputStream inputStream = new FileInputStream("crl_file_.der");
            X509CRLHolder crlHolder = new X509CRLHolder(inputStream);
            
            System.out.println("Issuer: " + crlHolder.getIssuer());

        } 
}

Actual results:
The issuer field is parsed as Issuer: OU=Class 3 Public Primary Certification Authority,CN=test,O=VeriSign\\,L=test,ST=test,C=US.

Test case:
crl_file_.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