crypto: throw error if chunk decryption fails

This commit is contained in:
Abdullah Atta
2024-07-26 11:39:49 +05:00
committed by Abdullah Atta
parent 398432efde
commit aa1fa0ca81

View File

@@ -98,6 +98,7 @@ export default class Decryption {
chunk,
null
);
if (!message) throw new Error("Could not decrypt chunk.");
controller.enqueue(message);
if (tag === crypto_secretstream_xchacha20poly1305_TAG_FINAL)
controller.terminate();