1
0
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:
Richard van der Hoff
2016-08-04 11:25:38 +01:00
parent 24957a1445
commit 6dc7e624d3

View File

@@ -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,