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

Request master cross-signing private key during verification

This change adds a request for the master cross-signing private key, in case the
other device is willing to share it.

Part of https://github.com/vector-im/element-web/issues/13896
This commit is contained in:
J. Ryan Stinnett
2020-08-06 14:04:56 +01:00
parent 3166a4880d
commit 098cd1b8d4
2 changed files with 5 additions and 3 deletions

View File

@@ -54,6 +54,7 @@ describe("self-verifications", () => {
cacheCallbacks, cacheCallbacks,
); );
_crossSigningInfo.keys = { _crossSigningInfo.keys = {
master: { keys: { X: testKeyPub } },
self_signing: { keys: { X: testKeyPub } }, self_signing: { keys: { X: testKeyPub } },
user_signing: { keys: { X: testKeyPub } }, user_signing: { keys: { X: testKeyPub } },
}; };
@@ -96,9 +97,9 @@ describe("self-verifications", () => {
const result = await verification.done(); const result = await verification.done();
/* We should request, and store, two cross signing key and the key backup key */ /* We should request, and store, 3 cross signing keys and the key backup key */
expect(cacheCallbacks.storeCrossSigningKeyCache.mock.calls.length).toBe(2); expect(cacheCallbacks.storeCrossSigningKeyCache.mock.calls.length).toBe(3);
expect(_secretStorage.request.mock.calls.length).toBe(3); expect(_secretStorage.request.mock.calls.length).toBe(4);
expect(cacheCallbacks.storeCrossSigningKeyCache.mock.calls[0][1]) expect(cacheCallbacks.storeCrossSigningKeyCache.mock.calls[0][1])
.toEqual(testKey); .toEqual(testKey);

View File

@@ -761,6 +761,7 @@ export async function requestKeysDuringVerification(baseApis, userId, deviceId)
// We call getCrossSigningKey() for its side-effects // We call getCrossSigningKey() for its side-effects
return Promise.race([ return Promise.race([
Promise.all([ Promise.all([
crossSigning.getCrossSigningKey("master"),
crossSigning.getCrossSigningKey("self_signing"), crossSigning.getCrossSigningKey("self_signing"),
crossSigning.getCrossSigningKey("user_signing"), crossSigning.getCrossSigningKey("user_signing"),
backupKeyPromise, backupKeyPromise,