Package org.bouncycastle.asn1
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.TestCaseWhite-box tests forASN1TimeFormat, the strict structural validator for UTCTime / GeneralizedTime content. Lives inorg.bouncycastle.asn1to 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 Constructor Description ASN1TimeFormatTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidtestInvalidGeneralizedTimeFieldRanges()voidtestInvalidGeneralizedTimeStructure()voidtestInvalidUTCTimeFieldRanges()voidtestInvalidUTCTimeStructure()voidtestRejectsReportedCorpusContent()Exact content octets (tag/length stripped) of inputs from the fuzzing report that BC parses today; every one must now be rejected.voidtestValidGeneralizedTime()voidtestValidUTCTime()-
Methods 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
-
-
-
-
Method Detail
-
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.
-
-