remove useSealedSender feature as this is default now

pull/1084/head
Audric Ackermann 5 years ago
parent edbe79486c
commit 875c128d2a
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -5,7 +5,6 @@
ConversationController, ConversationController,
libloki, libloki,
StringView, StringView,
dcodeIO,
lokiMessageAPI, lokiMessageAPI,
i18n, i18n,
*/ */
@ -429,42 +428,24 @@ OutgoingMessage.prototype = {
); );
} }
let type; const secretSessionCipher = new window.Signal.Metadata.SecretSessionCipher(
let content; textsecure.storage.protocol
if (window.lokiFeatureFlags.useSealedSender) { );
const secretSessionCipher = new window.Signal.Metadata.SecretSessionCipher( // ciphers[address.getDeviceId()] = secretSessionCipher;
textsecure.storage.protocol
);
// ciphers[address.getDeviceId()] = secretSessionCipher;
const senderCert = new textsecure.protobuf.SenderCertificate(); const senderCert = new textsecure.protobuf.SenderCertificate();
senderCert.sender = ourKey; senderCert.sender = ourKey;
senderCert.senderDevice = deviceId; senderCert.senderDevice = deviceId;
const ciphertext = await secretSessionCipher.encrypt( const ciphertext = await secretSessionCipher.encrypt(
address, address,
senderCert, senderCert,
plaintext, plaintext,
sessionCipher sessionCipher
); );
type = textsecure.protobuf.Envelope.Type.UNIDENTIFIED_SENDER; const type = textsecure.protobuf.Envelope.Type.UNIDENTIFIED_SENDER;
content = window.Signal.Crypto.arrayBufferToBase64(ciphertext); const content = window.Signal.Crypto.arrayBufferToBase64(ciphertext);
} else {
// TODO: probably remove this branch once
// mobile clients implement sealed sender
// ciphers[address.getDeviceId()] = sessionCipher;
const ciphertext = await sessionCipher.encrypt(plaintext);
if (!enableFallBackEncryption) {
// eslint-disable-next-line no-param-reassign
ciphertext.body = new Uint8Array(
dcodeIO.ByteBuffer.wrap(ciphertext.body, 'binary').toArrayBuffer()
);
}
// eslint-disable-next-line prefer-destructuring
type = ciphertext.type;
content = ciphertext.body;
}
return { return {
type, // FallBackSessionCipher sets this to FRIEND_REQUEST type, // FallBackSessionCipher sets this to FRIEND_REQUEST

@ -413,7 +413,6 @@ window.lokiFeatureFlags = {
multiDeviceUnpairing: true, multiDeviceUnpairing: true,
privateGroupChats: true, privateGroupChats: true,
useSnodeProxy: !process.env.USE_STUBBED_NETWORK, useSnodeProxy: !process.env.USE_STUBBED_NETWORK,
useSealedSender: true,
useOnionRequests: true, useOnionRequests: true,
onionRequestHops: 1, onionRequestHops: 1,
}; };
@ -448,6 +447,5 @@ if (config.environment.includes('test-integration')) {
multiDeviceUnpairing: true, multiDeviceUnpairing: true,
privateGroupChats: true, privateGroupChats: true,
useSnodeProxy: !process.env.USE_STUBBED_NETWORK, useSnodeProxy: !process.env.USE_STUBBED_NETWORK,
useSealedSender: true,
}; };
} }

Loading…
Cancel
Save