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

Use requestSecret on the client to request secrets

Rather than accessing private method to get the secret storage
object (this was a bit confusing when I grepped for 'requestSecret'
and didn't find anything).
This commit is contained in:
David Baker
2020-03-26 16:01:35 +00:00
parent bdba61975b
commit 7f5ac072e6
2 changed files with 2 additions and 2 deletions

View File

@@ -69,6 +69,7 @@ describe("self-verifications", () => {
_crossSigningInfo,
_secretStorage,
},
requestSecret: _secretStorage.request.bind(_secretStorage),
getUserId: () => userId,
};

View File

@@ -204,7 +204,6 @@ export class VerificationBase extends EventEmitter {
return new Promise((resolve, reject) => {
const client = this._baseApis;
const original = client._crypto._crossSigningInfo;
const storage = client._crypto._secretStorage;
/* We already have all of the infrastructure we need to validate and
* cache cross-signing keys, so instead of replicating that, here we
@@ -216,7 +215,7 @@ export class VerificationBase extends EventEmitter {
console.debug("VerificationBase.done: requesting secret",
type, this.deviceId);
const { promise } =
storage.request(`m.cross_signing.${type}`, [this.deviceId]);
client.requestSecret(`m.cross_signing.${type}`, [this.deviceId]);
const result = await promise;
const decoded = decodeBase64(result);
return Uint8Array.from(decoded);