diff --git a/src/client.js b/src/client.js index 3503530b7..1ba3c4604 100644 --- a/src/client.js +++ b/src/client.js @@ -1505,8 +1505,14 @@ MatrixClient.prototype.createKeyBackupVersion = async function(info) { // favour of just signing with the cross-singing master key. await this._crypto._signObject(data.auth_data); - if (this._crypto._crossSigningInfo.getId()) { + if ( + this._cryptoCallbacks.getCrossSigningKey && + this._crypto._crossSigningInfo.getId() + ) { // now also sign the auth data with the cross-signing master key + // we check for the callback explicitly here because we still want to be able + // to create an un-cross-signed key backup if there is a cross-signing key but + // no callback supplied. await this._crypto._crossSigningInfo.signObject(data.auth_data, "master"); } diff --git a/src/crypto/index.js b/src/crypto/index.js index c4e37c16f..c91d6f9c2 100644 --- a/src/crypto/index.js +++ b/src/crypto/index.js @@ -218,7 +218,7 @@ export default function Crypto(baseApis, sessionStore, userId, deviceId, ); // Assuming no app-supplied callback, default to getting from SSSS. - if (!cryptoCallbacks.getCrossSigningKey) { + if (!cryptoCallbacks.getCrossSigningKey && cryptoCallbacks.getSecretStorageKey) { cryptoCallbacks.getCrossSigningKey = async (type) => { return CrossSigningInfo.getFromSecretStorage(type, this._secretStorage); };