Skip to content

Commit

Permalink
fix the certification signing
Browse files Browse the repository at this point in the history
  • Loading branch information
pipobscure committed Jan 10, 2024
1 parent e12780f commit cea9a5d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/common/sea.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,18 @@ function injectAndCodeSign(targetExecutable, resource) {
}
if (signtoolFound) {
let certificatesFound = false;
let stderr;
let stderr, child;
try {
({ stderr } = spawnSyncAndExitWithoutError('signtool', [ 'sign', '/fd', 'SHA256', targetExecutable ], {}));
({ child, stderr } = spawnSyncAndExitWithoutError('signtool', [ 'sign', '/fd', 'SHA256', targetExecutable ], { status: undefined }));
if (child.status !== 0) throw new Error(`- process terminated with status ${child.status}, expected 0`);
certificatesFound = true;
} catch (err) {
if (!/SignTool Error: No certificates were found that met all the given criteria/.test(stderr)) {
throw err;
}
}
if (certificatesFound) {
spawnSyncAndExitWithoutError('signtool', 'verify', '/pa', 'SHA256', targetExecutable, {});
spawnSyncAndExitWithoutError('signtool', [ 'verify', '/pa', 'SHA256', targetExecutable ], {});
}
}
}
Expand Down

0 comments on commit cea9a5d

Please sign in to comment.