Skip to content

Commit

Permalink
Take into account comments to PR 1970
Browse files Browse the repository at this point in the history
  • Loading branch information
gganis committed Mar 21, 2023
1 parent c08e22c commit 88b458f
Showing 1 changed file with 7 additions and 6 deletions.
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

0 comments on commit 88b458f

Please sign in to comment.