Handle additional errors in attachment_channel

This commit is contained in:
Fedor Indutny 2024-07-15 16:26:27 -07:00 committed by GitHub
parent 07195f4096
commit 11a4b32270
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 18 additions and 10 deletions

2
.nvmrc
View File

@ -1 +1 @@
20.14.0
20.15.0

View File

@ -352,6 +352,10 @@ export async function handleAttachmentRequest(req: Request): Promise<Response> {
plaintext
);
} catch (error) {
console.error(
'handleAttachmentRequest: decryption error',
Errors.toLogFormat(error)
);
plaintext.emit('error', error);
}
}
@ -459,6 +463,10 @@ function handleRangeRequest({
try {
await pipeline(plaintext, transform);
} catch (error) {
console.error(
'handleAttachmentRequest: range transform error',
Errors.toLogFormat(error)
);
transform.emit('error', error);
}
})()

11
package-lock.json generated
View File

@ -208,7 +208,7 @@
"csv-parse": "5.5.2",
"danger": "11.3.1",
"debug": "4.3.3",
"electron": "31.1.0",
"electron": "31.2.0",
"electron-builder": "24.13.3",
"electron-mocha": "12.2.0",
"endanger": "7.0.4",
@ -261,7 +261,7 @@
"webpack-dev-server": "4.11.1"
},
"engines": {
"node": "20.14.0"
"node": "20.15.0"
},
"optionalDependencies": {
"fs-xattr": "0.3.0"
@ -17899,12 +17899,11 @@
}
},
"node_modules/electron": {
"version": "31.1.0",
"resolved": "https://registry.npmjs.org/electron/-/electron-31.1.0.tgz",
"integrity": "sha512-TBOwqLxSxnx6+pH6GMri7R3JPH2AkuGJHfWZS0p1HsmN+Qr1T9b0IRJnnehSd/3NZAmAre4ft9Ljec7zjyKFJA==",
"version": "31.2.0",
"resolved": "https://registry.npmjs.org/electron/-/electron-31.2.0.tgz",
"integrity": "sha512-5w+kjOsGiTXytPSErBPNp/3znnuEMKc42RD41MqRoQkiYaR8x/Le2+qWk1cL60UwE/67oeKnOHnnol8xEuldGg==",
"dev": true,
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
"@electron/get": "^2.0.0",
"@types/node": "^20.9.0",

View File

@ -290,7 +290,7 @@
"csv-parse": "5.5.2",
"danger": "11.3.1",
"debug": "4.3.3",
"electron": "31.1.0",
"electron": "31.2.0",
"electron-builder": "24.13.3",
"electron-mocha": "12.2.0",
"endanger": "7.0.4",
@ -366,7 +366,7 @@
}
},
"engines": {
"node": "20.14.0"
"node": "20.15.0"
},
"build": {
"appId": "org.whispersystems.signal-desktop",

View File

@ -6,6 +6,7 @@ import Long from 'long';
import { HKDF } from '@signalapp/libsignal-client';
import * as Bytes from './Bytes';
import { Crypto } from './context/Crypto';
import { calculateAgreement, generateKeyPair } from './Curve';
import { HashType, CipherType, UUID_BYTE_SIZE } from './types/Crypto';
import { ProfileDecryptError } from './types/errors';
@ -734,7 +735,7 @@ export function decryptProfileName(
// SignalContext APIs
//
const { crypto } = globalThis.window?.SignalContext ?? {};
const crypto = globalThis.window?.SignalContext.crypto || new Crypto();
export function sign(key: Uint8Array, data: Uint8Array): Uint8Array {
return crypto.sign(key, data);