You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-29 16:43:09 +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,
|
device_id: deviceId,
|
||||||
keys: client._deviceKeys,
|
keys: client._deviceKeys,
|
||||||
user_id: userId,
|
user_id: userId,
|
||||||
signatures: {},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var sig = client._olmDevice.sign(anotherjson.stringify(deviceKeys));
|
||||||
|
deviceKeys.signatures = {};
|
||||||
deviceKeys.signatures[userId] = {};
|
deviceKeys.signatures[userId] = {};
|
||||||
deviceKeys.signatures[userId]["ed25519:" + deviceId] =
|
deviceKeys.signatures[userId]["ed25519:" + deviceId] = sig;
|
||||||
client._olmDevice.sign(anotherjson.stringify(deviceKeys));
|
|
||||||
|
|
||||||
return client.uploadKeysRequest({
|
return client.uploadKeysRequest({
|
||||||
device_keys: deviceKeys,
|
device_keys: deviceKeys,
|
||||||
|
|||||||
Reference in New Issue
Block a user