More protobufjs use

This commit is contained in:
Fedor Indutny 2021-07-02 12:21:24 -07:00 committed by GitHub
parent 1fa0e6c8c1
commit 299fe2af36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 646 additions and 447 deletions

View file

@ -4,7 +4,6 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable no-bitwise */
/* eslint-disable more/no-then */
import { ByteBufferClass } from '../window.d';
import {
decryptAes256CbcPkcsPadding,
encryptAes256CbcPkcsPadding,
@ -145,11 +144,9 @@ async function verifyDigest(
const Crypto = {
// Decrypts message into a raw string
async decryptWebsocketMessage(
message: ByteBufferClass,
decodedMessage: ArrayBuffer,
signalingKey: ArrayBuffer
): Promise<ArrayBuffer> {
const decodedMessage = message.toArrayBuffer();
if (signalingKey.byteLength !== 52) {
throw new Error('Got invalid length signalingKey');
}