Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible fix for the time parsing related issue (#1969) #1970

Merged
merged 2 commits into from
Mar 22, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/XrdCrypto/XrdCryptosslAux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -744,12 +744,13 @@ time_t XrdCryptosslASN1toUTC(const ASN1_TIME *tsn1)
ltm.tm_yday = 0; // day in the year
ltm.tm_isdst = 0; // we will correct with an offset without dst
//
// Renormalize some values: year should be modulo 1900
if (ltm.tm_year < 50)
ltm.tm_year += 100;
// In case GeneralizedTime is used
if (ltm.tm_year > 2000)
ltm.tm_year -= 1900;
// Renormalize some values (year should be modulo 1900), honouring all cases
if (ltm.tm_year < 50) {
ltm.tm_year += 2000;
} else if (ltm.tm_year < 100) {
ltm.tm_year += 1900;
}
ltm.tm_year -= 1900;
//
// month should in [0, 11]
(ltm.tm_mon)--;
Expand Down