Page MenuHomePhabricator

D12203.diff
No OneTemporary

D12203.diff

diff --git a/web/shared-worker/worker/worker-crypto.js b/web/shared-worker/worker/worker-crypto.js
--- a/web/shared-worker/worker/worker-crypto.js
+++ b/web/shared-worker/worker/worker-crypto.js
@@ -607,14 +607,24 @@
const existingSession = contentSessions[contentIdentityKeys.ed25519];
const session = new olm.Session();
- session.create_outbound(
- contentAccount,
- contentIdentityKeys.curve25519,
- contentIdentityKeys.ed25519,
- contentInitializationInfo.prekey,
- contentInitializationInfo.prekeySignature,
- contentInitializationInfo.oneTimeKey,
- );
+ if (contentInitializationInfo.oneTimeKey) {
+ session.create_outbound(
+ contentAccount,
+ contentIdentityKeys.curve25519,
+ contentIdentityKeys.ed25519,
+ contentInitializationInfo.prekey,
+ contentInitializationInfo.prekeySignature,
+ contentInitializationInfo.oneTimeKey,
+ );
+ } else {
+ session.create_outbound_without_otk(
+ contentAccount,
+ contentIdentityKeys.curve25519,
+ contentIdentityKeys.ed25519,
+ contentInitializationInfo.prekey,
+ contentInitializationInfo.prekeySignature,
+ );
+ }
const initialEncryptedData = session.encrypt(
JSON.stringify(initialEncryptedMessageContent),
);
@@ -655,14 +665,24 @@
const notificationsPrekey = notificationsInitializationInfo.prekey;
const session = new olm.Session();
- session.create_outbound(
- notificationAccount,
- notificationsIdentityKeys.curve25519,
- notificationsIdentityKeys.ed25519,
- notificationsPrekey,
- notificationsInitializationInfo.prekeySignature,
- notificationsInitializationInfo.oneTimeKey,
- );
+ if (notificationsInitializationInfo.oneTimeKey) {
+ session.create_outbound(
+ notificationAccount,
+ notificationsIdentityKeys.curve25519,
+ notificationsIdentityKeys.ed25519,
+ notificationsPrekey,
+ notificationsInitializationInfo.prekeySignature,
+ notificationsInitializationInfo.oneTimeKey,
+ );
+ } else {
+ session.create_outbound_without_otk(
+ notificationAccount,
+ notificationsIdentityKeys.curve25519,
+ notificationsIdentityKeys.ed25519,
+ notificationsPrekey,
+ notificationsInitializationInfo.prekeySignature,
+ );
+ }
const { body: initialNotificationsEncryptedMessage } = session.encrypt(
JSON.stringify(initialEncryptedMessageContent),
);

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 30, 3:45 AM (22 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2599410
Default Alt Text
D12203.diff (2 KB)

Event Timeline