1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00

Make backup restore work

This commit is contained in:
David Baker
2018-11-20 16:15:29 +00:00
parent 44d99277fe
commit cb51799246
2 changed files with 4 additions and 4 deletions

View File

@@ -1013,7 +1013,7 @@ MatrixClient.prototype.restoreKeyBackupWithPassword = async function(
) {
const backupInfo = await this.getKeyBackupVersion();
const privKey = keyForExistingBackup(backupInfo, password);
const privKey = await keyForExistingBackup(backupInfo, password);
return this._restoreKeyBackup(
privKey, targetRoomId, targetSessionId, version,
);
@@ -1041,7 +1041,7 @@ MatrixClient.prototype._restoreKeyBackup = function(
const decryption = new global.Olm.PkDecryption();
try {
decryption.init_with_private_key(privkey);
decryption.init_with_private_key(privKey);
} catch(e) {
decryption.free();
throw e;

View File

@@ -33,8 +33,8 @@ export async function keyForExistingBackup(backupData, password) {
}
return await deriveKey(
password, backupData.private_key_salt,
backupData.private_key_iterations,
password, backupData.auth_data.private_key_salt,
backupData.auth_data.private_key_iterations,
);
}