diff --git a/Userland/Libraries/LibCrypto/ASN1/ASN1.cpp b/Userland/Libraries/LibCrypto/ASN1/ASN1.cpp index 7fc07b1ca9..a87e5b4f54 100644 --- a/Userland/Libraries/LibCrypto/ASN1/ASN1.cpp +++ b/Userland/Libraries/LibCrypto/ASN1/ASN1.cpp @@ -110,7 +110,9 @@ Optional parse_utc_time(StringView time) return {}; } - auto full_year = (Core::DateTime::now().year() / 100) * 100 + year_in_century.value(); + // RFC5280 section 4.1.2.5.1. + auto full_year = year_in_century.value(); + full_year += (full_year < 50) ? 2000 : 1900; auto full_seconds = seconds.value_or(0); // FIXME: Handle offsets!