You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-08-15 07:22:16 +03:00
Add 'keys' to *all* olm messages
(including ones which just carry megolm keys)
This commit is contained in:
@@ -119,17 +119,6 @@ OlmEncryption.prototype.encryptMessage = function(room, eventType, content) {
|
||||
room_id: room.roomId,
|
||||
type: eventType,
|
||||
content: content,
|
||||
// Include the ED25519 key so that the recipient knows what
|
||||
// device this message came from.
|
||||
// We don't need to include the curve25519 key since the
|
||||
// recipient will already know this from the olm headers.
|
||||
// When combined with the device keys retrieved from the
|
||||
// homeserver signed by the ed25519 key this proves that
|
||||
// the curve25519 key and the ed25519 key are owned by
|
||||
// the same device.
|
||||
keys: {
|
||||
"ed25519": self._olmDevice.deviceEd25519Key
|
||||
},
|
||||
}
|
||||
);
|
||||
});
|
||||
|
@@ -51,6 +51,18 @@ module.exports.encryptMessageForDevices = function(
|
||||
var payloadJson = {
|
||||
fingerprint: participantHash,
|
||||
sender_device: ourDeviceId,
|
||||
|
||||
// Include the Ed25519 key so that the recipient knows what
|
||||
// device this message came from.
|
||||
// We don't need to include the curve25519 key since the
|
||||
// recipient will already know this from the olm headers.
|
||||
// When combined with the device keys retrieved from the
|
||||
// homeserver signed by the ed25519 key this proves that
|
||||
// the curve25519 key and the ed25519 key are owned by
|
||||
// the same device.
|
||||
keys: {
|
||||
"ed25519": olmDevice.deviceEd25519Key,
|
||||
},
|
||||
};
|
||||
utils.extend(payloadJson, payloadFields);
|
||||
|
||||
|
Reference in New Issue
Block a user