v0.25.5
This commit is contained in:
1 parent
1dea7f55c8
commit
c819f0a335
151 files changed
+7610
-4264
No files matched your search
@@ -203,11 +203,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;
|
||||
}
|
||||
@@ -225,8 +221,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!(
|
||||
@@ -243,9 +239,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