mtrojnar / osslsigncode

OpenSSL based Authenticode signing for PE/MSI/Java CAB files
Other
801 stars 131 forks source link

Year 2038 Problem #183

Closed cjholoday closed 2 years ago

cjholoday commented 2 years ago

Since time_t is used throughout the code to represent timestamps, fatal errors will eventually happen due to the Year 2038 problem with unix timestamps. Essentially, an overflow in time_t will cause errors.

This issue is also relevant for those wanting to "pretend they're in the future" for the purposes of testing expired certificates / testing in preparation for the 2038 problem.

mtrojnar commented 2 years ago

AFAIK most operating systems use 64-bit time_t nowadays. Are you concerned about any particular platform?

mtrojnar commented 2 years ago

I found one bug we need to fix in osslsigncode: https://github.com/mtrojnar/osslsigncode/blob/b8cb44fa47440e7bc294a323af41550c8f08f27d/osslsigncode.c#L5775 We convert the string parameter to unsigned long, which is a 32-bit data type on Windows. We need to convert it to a 64-bit unsigned integer instead.