From 9aa6e7fa6d4bbda3d0b3dc3d4011cd0f2b00a37f Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Sun, 17 Nov 2024 22:38:05 +0200 Subject: [PATCH] chore: thats why you need Buffer.from there --- packages/voice/src/receive/VoiceReceiver.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/voice/src/receive/VoiceReceiver.ts b/packages/voice/src/receive/VoiceReceiver.ts index 9e14c4f1e3c5..63785a7612f7 100644 --- a/packages/voice/src/receive/VoiceReceiver.ts +++ b/packages/voice/src/receive/VoiceReceiver.ts @@ -120,15 +120,14 @@ export class VoiceReceiver { case 'aead_xchacha20_poly1305_rtpsize': { // Combined mode expects authtag in the encrypted message - return methods.crypto_aead_xchacha20poly1305_ietf_decrypt( - Buffer.concat([encrypted, authTag]), - header, - nonce, - secretKey, + return Buffer.from( + methods.crypto_aead_xchacha20poly1305_ietf_decrypt( + Buffer.concat([encrypted, authTag]), + header, + nonce, + secretKey, + ), ); - - // TODO: the secretbox method says it always returns a buffer, so why was this needed? - // return Buffer.from(decrypted); } default: {