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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidvoidvoidExact content octets (tag/length stripped) of inputs from the fuzzing report that BC parses today; every one must now be rejected.voidvoidMethods inherited from class junit.framework.TestCase
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
-
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.
-