1
0
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:
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, 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,