Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33266756
D14349.1768623725.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D14349.1768623725.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D14349: [web][push-notif] free memory in `encryptNotificationWithOlmSession` and `decryptWithSession`
Attached
Detach File
Event Timeline
Log In to Comment