Fixed authenticode.js not signing on older NodeJS versions.
Ylian Saint-Hilaire committed
Jun 9, 2022 at 10:40 UTC
c9cf7a3d88c49cd888be0251f88bfb8f96f29daa
1 file changed
+1
-1
authenticode.js
+1
-1
@@ -120,7 +120,7 @@ function createAuthenticodeHandler(path) {
120
121
// Open the file descriptor
122
obj.path = path;
123
- try { obj.fd = fs.openSync(path); } catch (ex) { return false; } // Unable to open file
123
+ try { obj.fd = fs.openSync(path, 'r'); } catch (ex) { return false; } // Unable to open file
124
obj.stats = fs.fstatSync(obj.fd);
125
obj.filesize = obj.stats.size;
126
if (obj.filesize < 64) { obj.close(); return false; } // File too short.