Page MenuHomePhorge

D14349.1768623725.diff
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

D14349.1768623725.diff

diff --git a/web/push-notif/notif-crypto-utils.js b/web/push-notif/notif-crypto-utils.js
--- a/web/push-notif/notif-crypto-utils.js
+++ b/web/push-notif/notif-crypto-utils.js
@@ -840,14 +840,15 @@
encryptedPayload: string,
type: OlmEncryptedMessageTypes,
): DecryptionResult<T> {
+ // Memory is freed below after pickling.
const session = new olm.Session();
-
session.unpickle(picklingKey, pickledSession);
const decryptedNotification: T = JSON.parse(
session.decrypt(type, encryptedPayload),
);
-
const newPendingSessionUpdate = session.pickle(picklingKey);
+ session.free();
+
const newUpdateCreationTimestamp = Date.now();
return {
@@ -963,11 +964,13 @@
new TextDecoder().decode(serializedOlmData),
);
+ // Memory is freed below after pickling.
const session = new olm.Session();
session.unpickle(picklingKey, pendingSessionUpdate);
const encryptedNotification = session.encrypt(payload);
-
const newPendingSessionUpdate = session.pickle(picklingKey);
+ session.free();
+
const updatedOlmData: NotificationsOlmDataType = {
mainSession,
pendingSessionUpdate: newPendingSessionUpdate,

File Metadata

Mime Type
text/plain
Expires
Sat, Jan 17, 4:22 AM (17 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5947132
Default Alt Text
D14349.1768623725.diff (1 KB)

Event Timeline