From 7f5ac072e6061c00c284065a9492cde4ec2c1bf5 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 26 Mar 2020 16:01:35 +0000 Subject: [PATCH] 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). --- spec/unit/crypto/verification/secret_request.spec.js | 1 + src/crypto/verification/Base.js | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/unit/crypto/verification/secret_request.spec.js b/spec/unit/crypto/verification/secret_request.spec.js index ca347f31f..d0beff951 100644 --- a/spec/unit/crypto/verification/secret_request.spec.js +++ b/spec/unit/crypto/verification/secret_request.spec.js @@ -69,6 +69,7 @@ describe("self-verifications", () => { _crossSigningInfo, _secretStorage, }, + requestSecret: _secretStorage.request.bind(_secretStorage), getUserId: () => userId, }; diff --git a/src/crypto/verification/Base.js b/src/crypto/verification/Base.js index a48c86082..0bcea4ea5 100644 --- a/src/crypto/verification/Base.js +++ b/src/crypto/verification/Base.js @@ -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);