Skip to content

Bouncy Castle 1.80 accepts the incorrect GeneralizedTime value. #2040

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 Mar 27, 2025 · 0 comments
Open

Bouncy Castle 1.80 accepts the incorrect GeneralizedTime value. #2040

onepeople158 opened this issue Mar 27, 2025 · 0 comments

Comments

@onepeople158
Copy link

onepeople158 commented Mar 27, 2025

The RFC standard for X.509 CRLs restricts the thisUpdate field to only two formats, namely UTCTime (YYMMDDHHMMSSZ) and GeneralizedTime (YYYYMMDDHHMMSSZ) in ASN.1 representation, which are 13 and 15 characters wide, respectively. However,Bouncy Castle 1.80 accepts the thisUpdate field type as GeneralizedTime with a length of 13 ("240123000000Z") in the CRL.

Code:

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

public class CRLParserExample_thisUpdate{
    public static void main(String[] args) throws Exception {
        
        InputStream inputStream = new FileInputStream("crl_file_13gn.der");

        X509CRLHolder crlHolder = new X509CRLHolder(inputStream);
        
        System.out.println(crlHolder.getThisUpdate());
    } 
}

Test Case:

crl_file_13gn.zip

@onepeople158 onepeople158 changed the title Bouncy Castle 1.80 accepts the incorrect generalTime value. Bouncy Castle 1.80 accepts the incorrect GeneralizedTime value. Mar 27, 2025
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