Merge branch 'master' into clearnet

This commit is contained in:
Audric Ackermann 2021-04-22 17:55:35 +10:00
commit 27323a12f4
No known key found for this signature in database
GPG key ID: 999F434D76324AD4
5 changed files with 14 additions and 4 deletions

View file

@ -2,7 +2,7 @@
"name": "session-desktop", "name": "session-desktop",
"productName": "Session", "productName": "Session",
"description": "Private messaging from your desktop", "description": "Private messaging from your desktop",
"version": "1.5.3", "version": "1.5.4",
"license": "GPL-3.0", "license": "GPL-3.0",
"author": { "author": {
"name": "Loki Project", "name": "Loki Project",

View file

@ -62,6 +62,7 @@ window.lokiFeatureFlags = {
useFileOnionRequestsV2: true, // more compact encoding of files in response useFileOnionRequestsV2: true, // more compact encoding of files in response
onionRequestHops: 3, onionRequestHops: 3,
useRequestEncryptionKeyPair: false, useRequestEncryptionKeyPair: false,
padOutgoingAttachments: false,
}; };
if ( if (

View file

@ -238,6 +238,13 @@ const processOnionResponse = async (
// FIXME: 401/500 handling? // 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) // detect SNode is not ready (not in swarm; not done syncing)
if (response.status === 503) { if (response.status === 503) {
log.warn(`(${reqIdx}) [path] Got 503: snode not ready`); log.warn(`(${reqIdx}) [path] Got 503: snode not ready`);

View file

@ -94,9 +94,10 @@ export class AttachmentUtils {
pointer.key = new Uint8Array(crypto.randomBytes(64)); pointer.key = new Uint8Array(crypto.randomBytes(64));
const iv = new Uint8Array(crypto.randomBytes(16)); const iv = new Uint8Array(crypto.randomBytes(16));
const dataToEncrypt = !shouldPad const dataToEncrypt =
? attachment.data !shouldPad || !window.lokiFeatureFlags.padOutgoingAttachments
: AttachmentUtils.addAttachmentPadding(attachment.data); ? attachment.data
: AttachmentUtils.addAttachmentPadding(attachment.data);
const data = await window.textsecure.crypto.encryptAttachment( const data = await window.textsecure.crypto.encryptAttachment(
dataToEncrypt, dataToEncrypt,
pointer.key.buffer, pointer.key.buffer,

1
ts/window.d.ts vendored
View file

@ -61,6 +61,7 @@ declare global {
useFileOnionRequestsV2: boolean; useFileOnionRequestsV2: boolean;
onionRequestHops: number; onionRequestHops: number;
useRequestEncryptionKeyPair: boolean; useRequestEncryptionKeyPair: boolean;
padOutgoingAttachments: boolean;
}; };
lokiFileServerAPI: LokiFileServerInstance; lokiFileServerAPI: LokiFileServerInstance;
lokiMessageAPI: LokiMessageInterface; lokiMessageAPI: LokiMessageInterface;