mirror of
https://github.com/github/codeql-action
synced 2026-05-23 20:00:54 +03:00
Update checked-in dependencies
This commit is contained in:
+2
-1
@@ -29,7 +29,8 @@ var AdmZip = require("adm-zip");
|
||||
|
||||
// reading archives
|
||||
var zip = new AdmZip("./my_file.zip");
|
||||
var zipEntries = zip.getEntries(); // an array of ZipEntry records
|
||||
var password = "1234567890";
|
||||
var zipEntries = zip.getEntries(); // an array of ZipEntry records - add password parameter if entries are password protected
|
||||
|
||||
zipEntries.forEach(function (zipEntry) {
|
||||
console.log(zipEntry.toString()); // outputs zip entries information
|
||||
|
||||
+4
-3
@@ -471,7 +471,8 @@ module.exports = function (/**String*/ input, /** object */ options) {
|
||||
*
|
||||
* @return Array
|
||||
*/
|
||||
getEntries: function () {
|
||||
getEntries: function (/**String*/ password) {
|
||||
_zip.password=password;
|
||||
return _zip ? _zip.entries : [];
|
||||
},
|
||||
|
||||
@@ -548,7 +549,7 @@ module.exports = function (/**String*/ input, /** object */ options) {
|
||||
return true;
|
||||
}
|
||||
|
||||
var content = item.getData();
|
||||
var content = item.getData(_zip.password);
|
||||
if (!content) throw new Error(Utils.Errors.CANT_EXTRACT_FILE);
|
||||
|
||||
if (filetools.fs.existsSync(target) && !overwrite) {
|
||||
@@ -710,9 +711,9 @@ module.exports = function (/**String*/ input, /** object */ options) {
|
||||
callback(getError("Unable to set times", filePath));
|
||||
return;
|
||||
}
|
||||
fileEntries.delete(entry);
|
||||
// call the callback if it was last entry
|
||||
done();
|
||||
fileEntries.delete(entry);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
+3
-1
@@ -83,7 +83,9 @@ module.exports = function () {
|
||||
set time(val) {
|
||||
setTime(val);
|
||||
},
|
||||
|
||||
get timeHighByte() {
|
||||
return (_time >>> 8) & 0xff;
|
||||
},
|
||||
get crc() {
|
||||
return _crc;
|
||||
},
|
||||
|
||||
+6
-2
@@ -118,8 +118,12 @@ function decrypt(/*Buffer*/ data, /*Object*/ header, /*String, Buffer*/ pwd) {
|
||||
// 2. decrypt salt what is always 12 bytes and is a part of file content
|
||||
const salt = decrypter(data.slice(0, 12));
|
||||
|
||||
// 3. does password meet expectations
|
||||
if (salt[11] !== header.crc >>> 24) {
|
||||
// if bit 3 (0x08) of the general-purpose flags field is set, check salt[11] with the high byte of the header time
|
||||
// 2 byte data block (as per Info-Zip spec), otherwise check with the high byte of the header entry
|
||||
const verifyByte = ((header.flags & 0x8) === 0x8) ? header.timeHighByte : header.crc >>> 24;
|
||||
|
||||
//3. does password meet expectations
|
||||
if (salt[11] !== verifyByte) {
|
||||
throw "ADM-ZIP: Wrong Password";
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "adm-zip",
|
||||
"version": "0.5.10",
|
||||
"version": "0.5.12",
|
||||
"description": "Javascript implementation of zip for nodejs with support for electron original-fs. Allows user to create or extract zip files both in memory or to/from disk",
|
||||
"scripts": {
|
||||
"test": "mocha -R spec",
|
||||
|
||||
+2
-1
@@ -8,6 +8,7 @@ module.exports = function (/*Buffer|null*/ inBuffer, /** object */ options) {
|
||||
_comment = Buffer.alloc(0),
|
||||
mainHeader = new Headers.MainHeader(),
|
||||
loadedEntries = false;
|
||||
var password = null;
|
||||
|
||||
// assign options
|
||||
const opts = Object.assign(Object.create(null), options);
|
||||
@@ -259,7 +260,7 @@ module.exports = function (/*Buffer|null*/ inBuffer, /** object */ options) {
|
||||
// 1.2. postheader - data after data header
|
||||
const postHeader = Buffer.alloc(entryNameLen + entry.extra.length);
|
||||
entry.rawEntryName.copy(postHeader, 0);
|
||||
postHeader.copy(entry.extra, entryNameLen);
|
||||
entry.extra.copy(postHeader, entryNameLen);
|
||||
|
||||
// 2. offsets
|
||||
const dataLength = dataHeader.length + postHeader.length + compressedData.length;
|
||||
|
||||
Reference in New Issue
Block a user