mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 19:47:46 +00:00
LibCrypto: Store ASN1 certificate timestamps as UnixDateTime
We are currently using Core::DateTime, which is meant to represent local time. However, we are doing no conversion between the parsed time in UTC and local time, so we end up comparing time stamps from different time zones. Instead, store the parsed times as UnixDateTime, which is UTC. Then we can always compare the parsed times against the current UTC time. This also lets us store parsed milliseconds.
This commit is contained in:
parent
da118f2adf
commit
928287b782
7 changed files with 64 additions and 65 deletions
|
@ -6,8 +6,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Time.h>
|
||||
#include <AK/Types.h>
|
||||
#include <LibCore/DateTime.h>
|
||||
#include <LibCrypto/BigInt/UnsignedBigInteger.h>
|
||||
|
||||
namespace Crypto::ASN1 {
|
||||
|
@ -75,7 +75,7 @@ ByteString kind_name(Kind);
|
|||
ByteString class_name(Class);
|
||||
ByteString type_name(Type);
|
||||
|
||||
Optional<Core::DateTime> parse_utc_time(StringView);
|
||||
Optional<Core::DateTime> parse_generalized_time(StringView);
|
||||
Optional<UnixDateTime> parse_utc_time(StringView);
|
||||
Optional<UnixDateTime> parse_generalized_time(StringView);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue