mirror of
https://github.com/oxen-io/session-desktop.git
synced 2023-12-14 02:12:57 +01:00
Merge branch 'master' into clearnet
This commit is contained in:
commit
27323a12f4
|
@ -2,7 +2,7 @@
|
|||
"name": "session-desktop",
|
||||
"productName": "Session",
|
||||
"description": "Private messaging from your desktop",
|
||||
"version": "1.5.3",
|
||||
"version": "1.5.4",
|
||||
"license": "GPL-3.0",
|
||||
"author": {
|
||||
"name": "Loki Project",
|
||||
|
|
|
@ -62,6 +62,7 @@ window.lokiFeatureFlags = {
|
|||
useFileOnionRequestsV2: true, // more compact encoding of files in response
|
||||
onionRequestHops: 3,
|
||||
useRequestEncryptionKeyPair: false,
|
||||
padOutgoingAttachments: false,
|
||||
};
|
||||
|
||||
if (
|
||||
|
|
|
@ -238,6 +238,13 @@ const processOnionResponse = async (
|
|||
|
||||
// FIXME: 401/500 handling?
|
||||
|
||||
// detect SNode is deregisted?
|
||||
if (response.status === 502) {
|
||||
log.warn(`(${reqIdx}) [path] Got 502: snode not found`);
|
||||
|
||||
return RequestError.BAD_PATH;
|
||||
}
|
||||
|
||||
// detect SNode is not ready (not in swarm; not done syncing)
|
||||
if (response.status === 503) {
|
||||
log.warn(`(${reqIdx}) [path] Got 503: snode not ready`);
|
||||
|
|
|
@ -94,9 +94,10 @@ export class AttachmentUtils {
|
|||
pointer.key = new Uint8Array(crypto.randomBytes(64));
|
||||
const iv = new Uint8Array(crypto.randomBytes(16));
|
||||
|
||||
const dataToEncrypt = !shouldPad
|
||||
? attachment.data
|
||||
: AttachmentUtils.addAttachmentPadding(attachment.data);
|
||||
const dataToEncrypt =
|
||||
!shouldPad || !window.lokiFeatureFlags.padOutgoingAttachments
|
||||
? attachment.data
|
||||
: AttachmentUtils.addAttachmentPadding(attachment.data);
|
||||
const data = await window.textsecure.crypto.encryptAttachment(
|
||||
dataToEncrypt,
|
||||
pointer.key.buffer,
|
||||
|
|
1
ts/window.d.ts
vendored
1
ts/window.d.ts
vendored
|
@ -61,6 +61,7 @@ declare global {
|
|||
useFileOnionRequestsV2: boolean;
|
||||
onionRequestHops: number;
|
||||
useRequestEncryptionKeyPair: boolean;
|
||||
padOutgoingAttachments: boolean;
|
||||
};
|
||||
lokiFileServerAPI: LokiFileServerInstance;
|
||||
lokiMessageAPI: LokiMessageInterface;
|
||||
|
|
Loading…
Reference in a new issue