The LimpetIssueCertificate function was setting the certificate expiration date by adding 10 years, not correctly accounting for leap year. In other words, if this function was called on 2020-02-29, it would attempt to create a certificate with the expiration date of 2030-02-29, which doesn't exist because 2030 is not a leap year. (CryptSignAndEncodeCertificate will fail when passed such a date.)
This code corrects Feb 29th back to Feb 28th when the resulting year is not a leap year.
The
LimpetIssueCertificate
function was setting the certificate expiration date by adding 10 years, not correctly accounting for leap year. In other words, if this function was called on2020-02-29
, it would attempt to create a certificate with the expiration date of2030-02-29
, which doesn't exist because 2030 is not a leap year. (CryptSignAndEncodeCertificate
will fail when passed such a date.)This code corrects Feb 29th back to Feb 28th when the resulting year is not a leap year.