Class ASN1TimeFormatTest

java.lang.Object
junit.framework.Assert
junit.framework.TestCase
org.bouncycastle.asn1.ASN1TimeFormatTest
All Implemented Interfaces:
junit.framework.Test

public class ASN1TimeFormatTest extends junit.framework.TestCase
White-box tests for ASN1TimeFormat, the strict structural validator for UTCTime / GeneralizedTime content. Lives in org.bouncycastle.asn1 to reach the package-private helper.

The "currently accepted but bogus" cases use the exact content bytes from the fuzzing report (github ASN.1 TIME parsing): values BC parses today and either turns into a nonsensical Date or fails on getDate(). The validator must reject all of them while still accepting the legal lenient forms BC is expected to read.

  • Constructor Details

    • ASN1TimeFormatTest

      public ASN1TimeFormatTest()
  • Method Details

    • testValidUTCTime

      public void testValidUTCTime()
    • testInvalidUTCTimeFieldRanges

      public void testInvalidUTCTimeFieldRanges()
    • testInvalidUTCTimeStructure

      public void testInvalidUTCTimeStructure()
    • testValidGeneralizedTime

      public void testValidGeneralizedTime()
    • testInvalidGeneralizedTimeFieldRanges

      public void testInvalidGeneralizedTimeFieldRanges()
    • testInvalidGeneralizedTimeStructure

      public void testInvalidGeneralizedTimeStructure()
    • testRejectsReportedCorpusContent

      public void testRejectsReportedCorpusContent()
      Exact content octets (tag/length stripped) of inputs from the fuzzing report that BC parses today; every one must now be rejected.