ebourg / jsign

Java implementation of Microsoft Authenticode for signing Windows executables, installers & scripts
https://ebourg.github.io/jsign
Apache License 2.0
250 stars 107 forks source link

Attaching signatures doesn't leaves the signed file open #117

Closed markt-asf closed 2 years ago

markt-asf commented 2 years ago

When JSign is configured to attach existing signatures, the attach process doesn't close the signed file. This causes problems when using the Ant task on Windows when trying to use the newly signed file.

Adding

if (signable instanceof Closeable) {
    ((Closeable) signable).close();
}

at line 509 and line 543 of SignerHelper appeared to fix the issue but I suspect that fix is a hack that could be improved.

ebourg commented 2 years ago

Thank you Mark, I'll look into it.