Skip to content

Commit

Permalink
manifest-utils: remove deprecated NaiveDateTime::from_timestamp_millis
Browse files Browse the repository at this point in the history
  • Loading branch information
kamirr committed Aug 8, 2024
1 parent 3266d65 commit 821ec3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/manifest-utils/src/keystore/x509_keystore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ fn asn1_time_to_date_time(time: &Asn1TimeRef) -> anyhow::Result<DateTime<Utc>> {
// Openssl lib allows to access time only through ASN1_TIME_print.
// Diff starting from epoch is a workaround to get `not_after` value.
let time_diff = Asn1Time::from_unix(0)?.diff(time)?;
let not_after = NaiveDateTime::from_timestamp_millis(0).unwrap()
let not_after = DateTime::from_timestamp_millis(0).unwrap()
+ Duration::days(time_diff.days as i64)
+ Duration::seconds(time_diff.secs as i64);
Ok(Utc.from_utc_datetime(&not_after))
Ok(not_after)
}

pub(super) struct AddX509Response {
Expand Down

0 comments on commit 821ec3b

Please sign in to comment.