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,
libloki,
StringView,
dcodeIO,
lokiMessageAPI,
i18n,
*/
@ -429,42 +428,24 @@ OutgoingMessage.prototype = {
);
}
let type;
let content;
if (window.lokiFeatureFlags.useSealedSender) {
const secretSessionCipher = new window.Signal.Metadata.SecretSessionCipher(
textsecure.storage.protocol
);
// ciphers[address.getDeviceId()] = secretSessionCipher;
const secretSessionCipher = new window.Signal.Metadata.SecretSessionCipher(
textsecure.storage.protocol
);
// ciphers[address.getDeviceId()] = secretSessionCipher;
const senderCert = new textsecure.protobuf.SenderCertificate();
const senderCert = new textsecure.protobuf.SenderCertificate();
senderCert.sender = ourKey;
senderCert.senderDevice = deviceId;
senderCert.sender = ourKey;
senderCert.senderDevice = deviceId;
const ciphertext = await secretSessionCipher.encrypt(
address,
senderCert,
plaintext,
sessionCipher
);
type = textsecure.protobuf.Envelope.Type.UNIDENTIFIED_SENDER;
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;
}
const ciphertext = await secretSessionCipher.encrypt(
address,
senderCert,
plaintext,
sessionCipher
);
const type = textsecure.protobuf.Envelope.Type.UNIDENTIFIED_SENDER;
const content = window.Signal.Crypto.arrayBufferToBase64(ciphertext);
return {
type, // FallBackSessionCipher sets this to FRIEND_REQUEST

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

Loading…
Cancel
Save