mtrojnar / osslsigncode

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

Fix asn1_get_time_t timezone offset #231

Closed jcristau closed 1 year ago

jcristau commented 1 year ago

mktime takes an input in local time, but what we have is UTC. timegm does the right thing but is a nonstandard GNU and BSD extension. I'm not sure if this is acceptable?

I hit an issue where my local time zone is CET (UTC+1), the timestamp server returns something like 230208140333Z, and osslsigncode says "Signing time: Feb 8 13:03:33 2023 GMT", an hour off. It also seems to cause verification problems if e.g. the CA or signing cert is newly created because set_store_time is called with a time_t that can be in the future.

mtrojnar commented 1 year ago

Thank you. Good point. You'd need to find a solution that also builds on/for Windows if you want to get this PR merged. This may help: https://stackoverflow.com/a/29411795

jcristau commented 1 year ago

Sounds good, thanks for the pointer!

mtrojnar commented 1 year ago

Thank you for the fix.