From c9cf7a3d88c49cd888be0251f88bfb8f96f29daa Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Thu, 9 Jun 2022 10:40:19 -0700 Subject: [PATCH] Fixed authenticode.js not signing on older NodeJS versions. --- authenticode.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/authenticode.js b/authenticode.js index 30482d17..8dc5de27 100644 --- a/authenticode.js +++ b/authenticode.js @@ -120,7 +120,7 @@ function createAuthenticodeHandler(path) { // Open the file descriptor obj.path = path; - try { obj.fd = fs.openSync(path); } catch (ex) { return false; } // Unable to open file + try { obj.fd = fs.openSync(path, 'r'); } catch (ex) { return false; } // Unable to open file obj.stats = fs.fstatSync(obj.fd); obj.filesize = obj.stats.size; if (obj.filesize < 64) { obj.close(); return false; } // File too short.