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

Adding hash via signWithParams result in error due to duplicating args #46

Open
ShGKme opened this issue Nov 20, 2024 · 0 comments
Open

Comments

@ShGKme
Copy link

ShGKme commented Nov 20, 2024

No matter what options you have, signWithSignTool always adds hashing/timestampServer params.

// Timestamp
if (hash === HASHES.sha256) {
args.push('/tr', timestampServer);
args.push('/td', hash);
} else {
args.push('/t', timestampServer);
}

Then if you signWithParams with the same params (e.g. /td sha256), signing results in error because duplicating params in signtool is not allowed.

I think this would be good if developers can provide any params in signWithSignTool. Especially because README makes a feeling it is possible:

windows-sign/README.md

Lines 231 to 237 in 2605684

To sign with `@electron/windows-sign` using those instructions, you would take the parameters and add them to `signWithParams`:
```js
await sign({
signWithParams: "/csp \"DigiCert Signing Manager KSP\" /kc <keypair_alias> /f <certificate_file> /tr http://timestamp.digicert.com /td SHA256 /fd SHA256"
})
```

Probably related: Squirrel/Squirrel.Windows#1742


Proposal

After parsing signWithParams, replace duplicating params.

If this is fine, I'm ready to make a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant