You've already forked matrix-js-sdk
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:
@@ -1506,7 +1506,7 @@ MatrixClient.prototype.createKeyBackupVersion = async function(info) {
|
||||
await this._crypto._signObject(data.auth_data);
|
||||
|
||||
if (
|
||||
this._cryptoCallbacks.getSecretStorageKey &&
|
||||
this._cryptoCallbacks.getCrossSigningKey &&
|
||||
this._crypto._crossSigningInfo.getId()
|
||||
) {
|
||||
// now also sign the auth data with the cross-signing master key
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user