From aa1fa0ca818900556c8635fd81eeb9cc038d9a15 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Fri, 26 Jul 2024 11:39:49 +0500 Subject: [PATCH] crypto: throw error if chunk decryption fails --- packages/crypto/src/decryption.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/crypto/src/decryption.ts b/packages/crypto/src/decryption.ts index 15a10659e..b5198c874 100644 --- a/packages/crypto/src/decryption.ts +++ b/packages/crypto/src/decryption.ts @@ -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();