Release v1.4.36 with tolerant DLC padding
- Local DLC decryption no longer throws on invalid PKCS7 padding - Instead tries to parse the decrypted data as-is (Node.js base64 decoder is lenient with trailing garbage bytes) - This fixes large DLCs that previously failed locally and then hit dcrypt.it's 413 size limit on both endpoints - Empty decryption result returns [] instead of throwing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
48c89713ba
commit
a0c58aad2c
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "real-debrid-downloader",
|
"name": "real-debrid-downloader",
|
||||||
"version": "1.4.35",
|
"version": "1.4.36",
|
||||||
"description": "Real-Debrid Downloader Desktop (Electron + React + TypeScript)",
|
"description": "Real-Debrid Downloader Desktop (Electron + React + TypeScript)",
|
||||||
"main": "build/main/main/main.js",
|
"main": "build/main/main/main.js",
|
||||||
"author": "Sucukdeluxe",
|
"author": "Sucukdeluxe",
|
||||||
|
|||||||
@ -145,18 +145,21 @@ async function decryptDlcLocal(filePath: string): Promise<ParsedPackageInput[]>
|
|||||||
let decrypted = Buffer.concat([decipher.update(encrypted), decipher.final()]);
|
let decrypted = Buffer.concat([decipher.update(encrypted), decipher.final()]);
|
||||||
|
|
||||||
if (decrypted.length === 0) {
|
if (decrypted.length === 0) {
|
||||||
throw new Error("DLC-Entschlüsselung lieferte keine Daten");
|
return [];
|
||||||
}
|
}
|
||||||
const pad = decrypted[decrypted.length - 1];
|
const pad = decrypted[decrypted.length - 1];
|
||||||
if (pad <= 0 || pad > 16 || pad > decrypted.length) {
|
if (pad > 0 && pad <= 16 && pad <= decrypted.length) {
|
||||||
throw new Error("Ungültiges DLC-Padding");
|
let validPad = true;
|
||||||
}
|
|
||||||
for (let index = 1; index <= pad; index += 1) {
|
for (let index = 1; index <= pad; index += 1) {
|
||||||
if (decrypted[decrypted.length - index] !== pad) {
|
if (decrypted[decrypted.length - index] !== pad) {
|
||||||
throw new Error("Ungültiges DLC-Padding");
|
validPad = false;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (validPad) {
|
||||||
decrypted = decrypted.subarray(0, decrypted.length - pad);
|
decrypted = decrypted.subarray(0, decrypted.length - pad);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const xmlData = Buffer.from(decrypted.toString("utf8"), "base64").toString("utf8");
|
const xmlData = Buffer.from(decrypted.toString("utf8"), "base64").toString("utf8");
|
||||||
return parsePackagesFromDlcXml(xmlData);
|
return parsePackagesFromDlcXml(xmlData);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user