v0.25.0
This commit is contained in:
1 parent
2e4aa4df4d
commit
87e571c170
106 files changed
+17952
-6185
No files matched your search
+5
-10
@@ -600,11 +600,7 @@ fn x509_time(tag: u8, raw: &[u8]) -> Option<(String, i64)> {
|
||||
cursor += 2;
|
||||
let second = x509_decimal(&raw[cursor..cursor + 2])?;
|
||||
cursor += 2;
|
||||
if day == 0
|
||||
|| day > x509_days_in_month(year, month)?
|
||||
|| hour > 23
|
||||
|| minute > 59
|
||||
|| second > 60
|
||||
if day == 0 || day > x509_days_in_month(year, month)? || hour > 23 || minute > 59 || second > 60
|
||||
{
|
||||
return None;
|
||||
}
|
||||
@@ -622,8 +618,8 @@ fn x509_time(tag: u8, raw: &[u8]) -> Option<(String, i64)> {
|
||||
if zone_hour > 23 || zone_minute > 59 {
|
||||
return None;
|
||||
}
|
||||
let seconds = i64::from(zone_hour * 3600 + zone_minute * 60)
|
||||
* if sign == b'+' { 1 } else { -1 };
|
||||
let seconds =
|
||||
i64::from(zone_hour * 3600 + zone_minute * 60) * if sign == b'+' { 1 } else { -1 };
|
||||
(
|
||||
seconds,
|
||||
format!(
|
||||
@@ -640,9 +636,8 @@ fn x509_time(tag: u8, raw: &[u8]) -> Option<(String, i64)> {
|
||||
.checked_mul(86_400)?
|
||||
.checked_add(i64::from(hour * 3600 + minute * 60 + second.min(59)))?
|
||||
.checked_sub(offset_seconds)?;
|
||||
let display = format!(
|
||||
"{year:04}-{month:02}-{day:02}T{hour:02}:{minute:02}:{second:02}{suffix}"
|
||||
);
|
||||
let display =
|
||||
format!("{year:04}-{month:02}-{day:02}T{hour:02}:{minute:02}:{second:02}{suffix}");
|
||||
Some((display, unix))
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user