1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-05 17:02:07 +03:00

Fix callback check

We need to check for getCrossSisgningKey but that was added
unconditionally elsewhere - only add it if we actually have a
getSecretStorageKey callback to use.
This commit is contained in:
David Baker
2020-01-03 14:36:04 +00:00
parent fbb355c5c9
commit 5487cf2070
2 changed files with 2 additions and 2 deletions

View File

@@ -1506,7 +1506,7 @@ MatrixClient.prototype.createKeyBackupVersion = async function(info) {
await this._crypto._signObject(data.auth_data); await this._crypto._signObject(data.auth_data);
if ( if (
this._cryptoCallbacks.getSecretStorageKey && this._cryptoCallbacks.getCrossSigningKey &&
this._crypto._crossSigningInfo.getId() this._crypto._crossSigningInfo.getId()
) { ) {
// now also sign the auth data with the cross-signing master key // now also sign the auth data with the cross-signing master key

View File

@@ -218,7 +218,7 @@ export default function Crypto(baseApis, sessionStore, userId, deviceId,
); );
// Assuming no app-supplied callback, default to getting from SSSS. // Assuming no app-supplied callback, default to getting from SSSS.
if (!cryptoCallbacks.getCrossSigningKey) { if (!cryptoCallbacks.getCrossSigningKey && cryptoCallbacks.getSecretStorageKey) {
cryptoCallbacks.getCrossSigningKey = async (type) => { cryptoCallbacks.getCrossSigningKey = async (type) => {
return CrossSigningInfo.getFromSecretStorage(type, this._secretStorage); return CrossSigningInfo.getFromSecretStorage(type, this._secretStorage);
}; };