You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-28 05:03:59 +03:00
Fix device key signing
Calculate the signature *before* we add the `signatures` key.
This commit is contained in:
@@ -349,12 +349,12 @@ function _uploadDeviceKeys(client) {
|
||||
device_id: deviceId,
|
||||
keys: client._deviceKeys,
|
||||
user_id: userId,
|
||||
signatures: {},
|
||||
};
|
||||
|
||||
var sig = client._olmDevice.sign(anotherjson.stringify(deviceKeys));
|
||||
deviceKeys.signatures = {};
|
||||
deviceKeys.signatures[userId] = {};
|
||||
deviceKeys.signatures[userId]["ed25519:" + deviceId] =
|
||||
client._olmDevice.sign(anotherjson.stringify(deviceKeys));
|
||||
deviceKeys.signatures[userId]["ed25519:" + deviceId] = sig;
|
||||
|
||||
return client.uploadKeysRequest({
|
||||
device_keys: deviceKeys,
|
||||
|
||||
Reference in New Issue
Block a user