Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
access cross-signing callbacks via method
Browse files Browse the repository at this point in the history
  • Loading branch information
foldleft committed Mar 5, 2020
1 parent 4396d85 commit 26177a1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/CrossSigningManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,13 @@ const onSecretRequested = async function({
console.log(`CrossSigningManager: Ignoring request from untrusted device ${deviceId}`);
return;
}
const crossSigning = client._crypto._crossSigningInfo;
if (!crossSigning._cacheCallbacks.getCrossSigningKeyCache) return;
const callbacks = client.getCrossSigningCacheCallbacks();
if (!callbacks.getCrossSigningKeyCache) return;
if (name === "m.key.self_signing") {
const key = await crossSigning._cacheCallbacks.getCrossSigningKeyCache("self_signing");
const key = await callbacks.getCrossSigningKeyCache("self_signing");
return key && encodeBase64(key);
} else if (name === "m.key.user_signing") {
const key = await crossSigning._cacheCallbacks.getCrossSigningKeyCache("user_signing");
const key = await callbacks.getCrossSigningKeyCache("user_signing");
return key && encodeBase64(key);
}
console.warn("onSecretRequested didn't recognise the secret named ", name);
Expand Down

0 comments on commit 26177a1

Please sign in to comment.