Skip to content

Commit

Permalink
x509-certificate: add tests for invalid fractional seconds
Browse files Browse the repository at this point in the history
Might as well fill in test cases before we implement fractional seconds.
  • Loading branch information
indygreg committed Jan 30, 2022
1 parent fac5991 commit 3b57010
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions x509-certificate/src/asn1time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,18 @@ mod test {
assert!(
GeneralizedTime::parse(b"20220130123015", GeneralizedTimeAllowedTimezone::Any).is_err()
);
assert!(
GeneralizedTime::parse(b"20220130123015.", GeneralizedTimeAllowedTimezone::Any)
.is_err()
);
assert!(
GeneralizedTime::parse(b"20220130123015.a", GeneralizedTimeAllowedTimezone::Any)
.is_err()
);
assert!(
GeneralizedTime::parse(b"20220130123015.0a", GeneralizedTimeAllowedTimezone::Any)
.is_err()
);
assert!(
GeneralizedTime::parse(b"20220130123015a", GeneralizedTimeAllowedTimezone::Any)
.is_err()
Expand Down

0 comments on commit 3b57010

Please sign in to comment.