smimesign
smimesign copied to clipboard
Fix certstore windows cmsg type error when building using go v1.18
When trying to use certstore
in a project that makes use of go v1.18+, the following error occurs :
github.com\github\[email protected]\certstore\certstore_windows.go:640:29: cannot convert cmsg (variable of type *_Ctype_char) to type _Ctype_HANDLE
From this golang issue, it appears that go 1.18 has added some safety checks which reject unsafe conversions, resulting in such errors.
A simple fix is to cast the cms
variable into an unsafe.Pointer
before casting it to a C.HLOCAL
.
This change was tested on Windows by building smimesign
locally and running the test suite.
Closes #107
Signed-off-by: El Mostafa IDRASSI [email protected]
Thanks for this PR!
It looks fairly straightforward — we'll have to verify and debug this a bit, but looks like an appropriate fix.
Thanks for this PR!
It looks fairly straightforward — we'll have to verify and debug this a bit, but looks like an appropriate fix.
This pull requests also fixes an issue we have, that our signed commits cannot be verified with git verify-commit <commitid>
.
A misleading error message is shown: failed to verify signature: x509: certificate signed by unknown authority
Is there are a roadmap or release date when a new release with this fix will be available?
I can confirm this is an issue on go version go1.20.8 linux/amd64