[*] Fix project build regressions caused by refactoring in 522def0a
This commit is contained in:
parent
522def0a85
commit
636a7ef625
@ -173,13 +173,13 @@ namespace Aurora::Crypto::X509
|
|||||||
{
|
{
|
||||||
auto issueNorm = AuTime::ToCivilTime(request.iIssuedDateMs, AuTime::ETimezoneShift::eUTC);
|
auto issueNorm = AuTime::ToCivilTime(request.iIssuedDateMs, AuTime::ETimezoneShift::eUTC);
|
||||||
auto issue = fmt::format("{:04}{:02}{:02}{:02}{:02}{:02}",
|
auto issue = fmt::format("{:04}{:02}{:02}{:02}{:02}{:02}",
|
||||||
issueNorm.tm_year + 1900, issueNorm.tm_mon + 1, issueNorm.tm_mday,
|
issueNorm.year, issueNorm.mon + 1, issueNorm.mday + 1,
|
||||||
issueNorm.tm_hour, issueNorm.tm_min, issueNorm.tm_sec);
|
issueNorm.hour, issueNorm.min, issueNorm.sec);
|
||||||
|
|
||||||
auto expireNorm = AuTime::ToCivilTime(request.iExpirationDateMs, AuTime::ETimezoneShift::eUTC);
|
auto expireNorm = AuTime::ToCivilTime(request.iExpirationDateMs, AuTime::ETimezoneShift::eUTC);
|
||||||
auto expire = fmt::format("{:04}{:02}{:02}{:02}{:02}{:02}",
|
auto expire = fmt::format("{:04}{:02}{:02}{:02}{:02}{:02}",
|
||||||
expireNorm.tm_year + 1900, expireNorm.tm_mon + 1, expireNorm.tm_mday,
|
expireNorm.year, expireNorm.mon + 1, expireNorm.mday + 1,
|
||||||
expireNorm.tm_hour, expireNorm.tm_min, expireNorm.tm_sec);
|
expireNorm.hour, expireNorm.min, expireNorm.sec);
|
||||||
if (mbedtls_x509write_crt_set_validity(&crt, issue.c_str(), expire.c_str()) != 0)
|
if (mbedtls_x509write_crt_set_validity(&crt, issue.c_str(), expire.c_str()) != 0)
|
||||||
{
|
{
|
||||||
SysPushErrorCrypto("Couldn't update certificate validity");
|
SysPushErrorCrypto("Couldn't update certificate validity");
|
||||||
|
@ -345,12 +345,12 @@ namespace Aurora::Crypto::X509
|
|||||||
static AuInt64 ConvertTime(const mbedtls_x509_time &time)
|
static AuInt64 ConvertTime(const mbedtls_x509_time &time)
|
||||||
{
|
{
|
||||||
AuTime::tm tm = {};
|
AuTime::tm tm = {};
|
||||||
tm.tm_year = time.year - 1900;
|
tm.year = time.year;
|
||||||
tm.tm_mon = time.mon - 1;
|
tm.mon = time.mon - 1;
|
||||||
tm.tm_mday = time.day;
|
tm.mday = time.day - 1;
|
||||||
tm.tm_sec = time.sec;
|
tm.sec = time.sec;
|
||||||
tm.tm_min = time.min;
|
tm.min = time.min;
|
||||||
tm.tm_hour = time.hour;
|
tm.hour = time.hour;
|
||||||
return AuTime::FromCivilTime(tm, AuTime::ETimezoneShift::eUTC);
|
return AuTime::FromCivilTime(tm, AuTime::ETimezoneShift::eUTC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,16 +169,16 @@ namespace Aurora::Locale
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
bool simple = time.tm_mday == 0 && time.tm_mon == 0 && time.tm_year == 0;
|
bool simple = time.mday == 0 && time.mon == 0 && time.year == 0;
|
||||||
if (simple)
|
if (simple)
|
||||||
{
|
{
|
||||||
return fmt::format("{:02}-{:02}-{:02}", time.tm_hour, time.tm_min, time.tm_sec);
|
return fmt::format("{:02}-{:02}-{:02}", time.hour, time.min, time.sec);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Hard-code ISO-8601 locale because, the Americans locale doesn't make any sense whatsoever, and east asia has the right idea
|
// Hard-code ISO-8601 locale because, the Americans locale doesn't make any sense whatsoever, and east asia has the right idea
|
||||||
// EU users and burgers seethe... we normalize one sane standard to disambiguate this shit across locale boundaries
|
// EU users and burgers seethe... we normalize one sane standard to disambiguate this shit across locale boundaries
|
||||||
return fmt::format("{:04}-{:02}-{:02} {:02}-{:02}-{:02}", time.tm_year + 1900, time.tm_mon + 1, time.tm_mday, time.tm_hour, time.tm_min, time.tm_sec);
|
return fmt::format("{:04}-{:02}-{:02} {:02}-{:02}-{:02}", time.year, time.mon + 1, time.mday + 1, time.hour, time.min, time.sec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
@ -195,8 +195,8 @@ namespace Aurora::Locale
|
|||||||
AuString tz {};
|
AuString tz {};
|
||||||
auto tnorm = AuTime::NormalizeCivilTimezone(time, shift);
|
auto tnorm = AuTime::NormalizeCivilTimezone(time, shift);
|
||||||
return fmt::format("{:04}-{:02}-{:02}T{:02}-{:02}-{:02}Z",
|
return fmt::format("{:04}-{:02}-{:02}T{:02}-{:02}-{:02}Z",
|
||||||
tnorm.tm_year + 1900, tnorm.tm_mon + 1, tnorm.tm_mday,
|
tnorm.year, tnorm.mon + 1, tnorm.mday + 1,
|
||||||
tnorm.tm_hour, tnorm.tm_min, tnorm.tm_sec);
|
tnorm.hour, tnorm.min, tnorm.sec);
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
@ -212,8 +212,8 @@ namespace Aurora::Locale
|
|||||||
AuString tz {};
|
AuString tz {};
|
||||||
auto tnorm = AuTime::NormalizeCivilTimezone(time, shift);
|
auto tnorm = AuTime::NormalizeCivilTimezone(time, shift);
|
||||||
return fmt::format("{:04}-{:02}-{:02}T{:02}:{:02}:{:02}Z",
|
return fmt::format("{:04}-{:02}-{:02}T{:02}:{:02}:{:02}Z",
|
||||||
tnorm.tm_year + 1900, tnorm.tm_mon + 1, tnorm.tm_mday,
|
tnorm.year, tnorm.mon + 1, tnorm.mday + 1,
|
||||||
tnorm.tm_hour, tnorm.tm_min, tnorm.tm_sec);
|
tnorm.hour, tnorm.min, tnorm.sec);
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
|
@ -183,8 +183,8 @@ namespace Aurora::Logging::Sinks
|
|||||||
auto tm = Time::ToCivilTime(Time::CurrentClockMS());
|
auto tm = Time::ToCivilTime(Time::CurrentClockMS());
|
||||||
path = fmt::format("{}/{:04}-{:02}-{:02}T{:02}-{:02}-{:02}Z.{}",
|
path = fmt::format("{}/{:04}-{:02}-{:02}T{:02}-{:02}-{:02}Z.{}",
|
||||||
baseDirectory,
|
baseDirectory,
|
||||||
tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
|
tm.year, tm.mon + 1, tm.mday + 1,
|
||||||
tm.tm_hour, tm.tm_min, tm.tm_sec,
|
tm.hour, tm.min, tm.sec,
|
||||||
bBinary ? "log" : "txt");
|
bBinary ? "log" : "txt");
|
||||||
|
|
||||||
CleanupOldLogs(meta, baseDirectory);
|
CleanupOldLogs(meta, baseDirectory);
|
||||||
|
Loading…
Reference in New Issue
Block a user