Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3386206
D12203.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D12203.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D12203: [web] update `olm` API to allow creating session without OTKs
Attached
Detach File
Event Timeline
Log In to Comment