mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 10:21:52 +00:00
fix: correct argument order in asn1_time_to_system_time
The diff() method computes `compare - self`, not `self - compare`. The reversed arguments caused all cert expiration times to resolve to before the unix epoch, making getSslCertificate callbacks fire immediately and infinitely on every registration.
This commit is contained in:
@@ -188,7 +188,7 @@ lazy_static::lazy_static! {
|
||||
}
|
||||
|
||||
fn asn1_time_to_system_time(time: &Asn1TimeRef) -> Result<SystemTime, Error> {
|
||||
let diff = time.diff(&**ASN1_UNIX_EPOCH)?;
|
||||
let diff = ASN1_UNIX_EPOCH.diff(time)?;
|
||||
let mut res = UNIX_EPOCH;
|
||||
if diff.days >= 0 {
|
||||
res += Duration::from_secs(diff.days as u64 * 86400);
|
||||
|
||||
Reference in New Issue
Block a user