Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicit select SHA256 for code signing on windows #4823

Closed
wants to merge 4 commits into from

Conversation

daschuer
Copy link
Member

This fixes the following error message:

SignTool Error: No file digest algorithm specified. Please specify the digest algorithm with the /fd flag. Using /fd SHA256 is recommended and more secure than SHA1. Calling signtool with /fd sha1 is equivalent to the previous behavior. In order to select the hash algorithm used in the signing certificate's signature, use the /fd certHash option. 

This restores the original behavior as a band aid. I have no clue what it means to switch to the recommended /fd SHA256

@github-actions github-actions bot added the build label Jun 22, 2022
@Swiftb0y
Copy link
Member

IMO its just a change in hash strength. Changing it to the more secure sha256 should make no difference IMO. Do we hardcode the hashes somewhere else?

@daschuer
Copy link
Member Author

daschuer commented Jun 23, 2022

We can just give it a try. I will add a commit on top of this for SHA256 merge it and ask a windows user if anything it wrong. In case yes, quickly revert. Unfortunately we need to do this in main because of the secrets.

@Swiftb0y
Copy link
Member

Does it really have to be on main? Can't we just quickly create a different branch based on main in the mixxx repo?

@Swiftb0y
Copy link
Member

CMakeLists.txt Outdated
@@ -1326,9 +1326,9 @@ if(WIN32)
set(WINDOWS_CODESIGN_CERTIFICATE_PATH "$ENV{WINDOWS_CODESIGN_CERTIFICATE_PATH}" CACHE STRING "Path to signtool certificate")
set(WINDOWS_CODESIGN_CERTIFICATE_PASSWORD "$ENV{WINDOWS_CODESIGN_CERTIFICATE_PASSWORD}" CACHE STRING "Password of signtool certificate")
if("${WINDOWS_CODESIGN_CERTIFICATE_PATH}" STREQUAL "" AND "${WINDOWS_CODESIGN_CERTIFICATE_PASSWORD}" STREQUAL "")
set(WINDOWS_CODESIGN_ARGS /a /t http://timestamp.verisign.com/scripts/timstamp.dll CACHE STRING "parameters for signtool (list)")
set(WINDOWS_CODESIGN_ARGS /fd SHA256 /a /t http://timestamp.verisign.com/scripts/timstamp.dll CACHE STRING "parameters for signtool (list)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we also need to specify the timestamp digest algorithm.
See the note at the top of the page: https://docs.microsoft.com/en-us/windows/win32/seccrypto/signtool

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm actually not sure about that anymore. We don't actually timestamp the build right now. I don't know what the purpose of that would be.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, we aren't timestamping the build right now anyways.

@daschuer daschuer changed the title Explicit select sha1 for code signing on windows Explicit select SHA256 for code signing on windows Jun 23, 2022
@Swiftb0y
Copy link
Member

You also need to set the timestamp digest algorithm
d600361
https://github.com/mixxxdj/mixxx/runs/7031560221

The build succeeded but it doesn't actually do any timestamping because we didn't specify /t.If we do specify the timestamp server, the build fails because the timestamp url is invalid?!?

@daschuer
Copy link
Member Author

Closed in favor of #4824

@daschuer daschuer closed this Jun 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants