public class ASN1TimeFormatTest
extends junit.framework.TestCase
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 and Description |
|---|
ASN1TimeFormatTest() |
| Modifier and Type | Method and Description |
|---|---|
void |
testDayAgainstMonthLength()
A day the month does not have is not a date: the lenient Calendar behind getDate() rolls it
into the next month, so the value read back is not the one the encoding names, and some other
encoding already denotes it.
|
void |
testDayAgainstMonthLengthCanBeSwitchedOff() |
void |
testInvalidGeneralizedTimeFieldRanges() |
void |
testInvalidGeneralizedTimeStructure() |
void |
testInvalidUTCTimeFieldRanges() |
void |
testInvalidUTCTimeStructure() |
void |
testRejectsReportedCorpusContent() |
void |
testValidGeneralizedTime() |
void |
testValidUTCTime() |
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, toStringpublic void testValidUTCTime()
public void testInvalidUTCTimeFieldRanges()
public void testInvalidUTCTimeStructure()
public void testValidGeneralizedTime()
public void testInvalidGeneralizedTimeFieldRanges()
public void testInvalidGeneralizedTimeStructure()
public void testDayAgainstMonthLength()
public void testDayAgainstMonthLengthCanBeSwitchedOff()
public void testRejectsReportedCorpusContent()