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

feat: support skipping SHA1 signing #19

Merged
merged 4 commits into from
Nov 5, 2024

Conversation

mceachen
Copy link
Contributor

Howdy! Thanks for this package!

Codesigning for my project is quite slow due to the number of .DLLs I need to include. It seems that SHA1 signatures are ignored ever since WIndows 7, and SHA256 is recommended by Microsoft.

Have you considered allowing consumers skip SHA1 signatures?

This patch allows an optional hash to be specified in the options array. It halves my signing time (which takes upwards of 10 minutes otherwise).

Feel free to tweak to taste. I tried to maintain consistency with existing code.

(BTW, if you switched your descriptive comments in your interfaces to jsdoc (use /** message */ instead of // message) your consumers get to see those comments inline).

@mceachen mceachen requested a review from a team as a code owner April 14, 2024 22:36
README.md Outdated Show resolved Hide resolved
@mceachen mceachen changed the title Allow for only signing with sha256 feat: support skipping SHA1 signing Apr 16, 2024
@mceachen
Copy link
Contributor Author

Do you want me to add this param to the CLI tool, too?

src/types.ts Outdated Show resolved Hide resolved
Copy link
Member

@felixrieseberg felixrieseberg left a comment

Choose a reason for hiding this comment

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

Thank you, super supportive of the change! I don't think we need a CLI option, the option itself is good enough for me.

I'd only prefer to keep the type the same but otherwise this can go out!

@mceachen
Copy link
Contributor Author

mceachen commented Apr 16, 2024

keep the type the same

So you'd rather use hash: string rather than hashes: string[]?

@mceachen
Copy link
Contributor Author

Friendly bump: what needs to be changed here to get the PR merged?

@mceachen
Copy link
Contributor Author

mceachen commented Jun 4, 2024

@MarshallOfSound anything I can do here to get this merged?

@ToshB
Copy link

ToshB commented Aug 15, 2024

I am eagerly awaiting merging of this pull request. After updating electron-forge I'm unable to sign my MSIs, which apparently doesn't support multiple signatures. This change will let me work around my problem.

@zkrige
Copy link

zkrige commented Oct 1, 2024

Please can someone accept and merge this PR - im stuck unable to sign MSI's because of this

@AndreyApalkov
Copy link

Please can someone accept and merge this PR

@BlackHole1
Copy link
Member

BlackHole1 commented Oct 30, 2024

keep the type the same

So you'd rather use hash: string rather than hashes: string[]?

Hey @mceachen. Thank you for your PR!

I think what @felixrieseberg is trying to express is: just remove Omit<>.

In the windows-sign code, hash and hashes represent different meanings.

  • hash: Used to inform the getSigntoolArgs function what parameters should be passed to sign, see:
    // Timestamp
    if (hash === HASHES.sha256) {
    args.push('/tr', timestampServer);
    args.push('/td', hash);
    } else {
    args.push('/t', timestampServer);
  • hashes: Allows developers to choose which hashes they want to use.

Therefore, there is no either-or question, as one is aimed at developers and the other is focused on internal code logic; both are indispensable :)

@mceachen
Copy link
Contributor Author

just remove Omit<>.

Done! I also merged with upstream main and resolved conflicts. @felixrieseberg @MarshallOfSound if there's anything else I need to do to get this merged, please holler.

Copy link
Member

@BlackHole1 BlackHole1 left a comment

Choose a reason for hiding this comment

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

LGTM. PTAL @felixrieseberg

Copy link
Member

@felixrieseberg felixrieseberg left a comment

Choose a reason for hiding this comment

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

LGTM, merging!

@felixrieseberg felixrieseberg merged commit 4fbd62e into electron:main Nov 5, 2024
2 checks passed
@mceachen mceachen deleted the add-hash branch November 5, 2024 17:31
Copy link

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@nikwen
Copy link

nikwen commented Nov 28, 2024

This PR just saved me a ton of work. Thank you, @mceachen!

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.

8 participants