-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -139,14 +139,14 @@ export async function checkDeviceIsCrossSigned(app: ElementAppPage): Promise<voi | |
* Check that the current device is connected to the expected key backup. | ||
* Also checks that the decryption key is known and cached locally. | ||
* | ||
* @param app - app page | ||
* @param app -` ElementAppPage` wrapper for the playwright `Page`. | ||
* @param expectedBackupVersion - the version of the backup we expect to be connected to. | ||
* @param checkBackupKeyInCache - whether to check that the backup key is cached locally. | ||
* @param checkBackupPrivateKeyInCache - whether to check that the backup decryption key is cached locally | ||
*/ | ||
export async function checkDeviceIsConnectedKeyBackup( | ||
app: ElementAppPage, | ||
expectedBackupVersion: string, | ||
checkBackupKeyInCache: boolean, | ||
checkBackupPrivateKeyInCache: boolean, | ||
): Promise<void> { | ||
// Sanity check the given backup version: if it's null, something went wrong earlier in the test. | ||
if (!expectedBackupVersion) { | ||
|
@@ -160,20 +160,18 @@ export async function checkDeviceIsConnectedKeyBackup( | |
if (!crypto) return; | ||
|
||
const backupInfo = await crypto.getKeyBackupInfo(); | ||
const backupKeyStored = Boolean(await client.isKeyBackupKeyStored()); | ||
const backupKeyFromCache = await crypto.getSessionBackupPrivateKey(); | ||
const backupKeyCached = Boolean(backupKeyFromCache); | ||
const backupKeyWellFormed = backupKeyFromCache instanceof Uint8Array; | ||
const backupKeyIn4S = Boolean(await client.isKeyBackupKeyStored()); | ||
const backupPrivateKeyFromCache = await crypto.getSessionBackupPrivateKey(); | ||
const activeBackupVersion = await crypto.getActiveSessionBackupVersion(); | ||
|
||
return { backupInfo, backupKeyStored, backupKeyCached, backupKeyWellFormed, activeBackupVersion }; | ||
return { backupInfo, backupPrivateKeyFromCache, backupKeyIn4S, activeBackupVersion }; | ||
}); | ||
|
||
if (!backupData) { | ||
throw new Error("Crypo module is not available"); | ||
throw new Error("Crypto module is not available"); | ||
} | ||
|
||
const { backupInfo, backupKeyStored, backupKeyCached, backupKeyWellFormed, activeBackupVersion } = backupData; | ||
const { backupInfo, backupKeyIn4S, backupPrivateKeyFromCache, activeBackupVersion } = backupData; | ||
|
||
// We have a key backup | ||
expect(backupInfo).toBeDefined(); | ||
|
@@ -182,13 +180,13 @@ export async function checkDeviceIsConnectedKeyBackup( | |
// The active backup version is as expected | ||
expect(activeBackupVersion).toBe(expectedBackupVersion); | ||
// The backup key is stored in 4S | ||
expect(backupKeyStored).toBe(true); | ||
expect(backupKeyIn4S).toBe(true); | ||
|
||
if (checkBackupKeyInCache) { | ||
if (checkBackupPrivateKeyInCache) { | ||
// The backup key is available locally | ||
expect(backupKeyCached).toBe(true); | ||
expect(Boolean(backupPrivateKeyFromCache)).toBe(true); | ||
// The backup key is well-formed | ||
expect(backupKeyWellFormed).toBe(true); | ||
expect(backupPrivateKeyFromCache instanceof Uint8Array).toBe(true); | ||
Check failure on line 189 in playwright/e2e/crypto/utils.ts GitHub Actions / Run Tests [Chrome] 4/6[Chrome] › settings/encryption-user-tab/recovery.spec.ts:33:9 › Recovery section in Encryption tab › should verify the device @screenshot
Check failure on line 189 in playwright/e2e/crypto/utils.ts GitHub Actions / Run Tests [Chrome] 4/6[Chrome] › settings/encryption-user-tab/recovery.spec.ts:33:9 › Recovery section in Encryption tab › should verify the device @screenshot
Check failure on line 189 in playwright/e2e/crypto/utils.ts GitHub Actions / Run Tests [Chrome] 4/6[Chrome] › settings/encryption-user-tab/recovery.spec.ts:33:9 › Recovery section in Encryption tab › should verify the device @screenshot
Check failure on line 189 in playwright/e2e/crypto/utils.ts GitHub Actions / Run Tests [Chrome] 4/6[Chrome] › settings/encryption-user-tab/recovery.spec.ts:87:9 › Recovery section in Encryption tab › should setup the recovery key @screenshot @no-webkit
Check failure on line 189 in playwright/e2e/crypto/utils.ts GitHub Actions / Run Tests [Chrome] 4/6[Chrome] › settings/encryption-user-tab/recovery.spec.ts:87:9 › Recovery section in Encryption tab › should setup the recovery key @screenshot @no-webkit
Check failure on line 189 in playwright/e2e/crypto/utils.ts GitHub Actions / Run Tests [Chrome] 4/6[Chrome] › settings/encryption-user-tab/recovery.spec.ts:87:9 › Recovery section in Encryption tab › should setup the recovery key @screenshot @no-webkit
Check failure on line 189 in playwright/e2e/crypto/utils.ts GitHub Actions / Run Tests [Chrome] 4/6[Chrome] › settings/encryption-user-tab/recovery.spec.ts:129:9 › Recovery section in Encryption tab › should enter the recovery key when the secrets are not cached @screenshot
Check failure on line 189 in playwright/e2e/crypto/utils.ts GitHub Actions / Run Tests [Chrome] 4/6[Chrome] › settings/encryption-user-tab/recovery.spec.ts:129:9 › Recovery section in Encryption tab › should enter the recovery key when the secrets are not cached @screenshot
Check failure on line 189 in playwright/e2e/crypto/utils.ts GitHub Actions / Run Tests [Chrome] 4/6[Chrome] › settings/encryption-user-tab/recovery.spec.ts:129:9 › Recovery section in Encryption tab › should enter the recovery key when the secrets are not cached @screenshot
Check failure on line 189 in playwright/e2e/crypto/utils.ts GitHub Actions / Run Tests [Chrome] 1/6[Chrome] › crypto/device-verification.spec.ts:75:9 › Device verification › Verify device with QR code during login @no-webkit
Check failure on line 189 in playwright/e2e/crypto/utils.ts GitHub Actions / Run Tests [Chrome] 1/6[Chrome] › crypto/device-verification.spec.ts:75:9 › Device verification › Verify device with QR code during login @no-webkit
Check failure on line 189 in playwright/e2e/crypto/utils.ts GitHub Actions / Run Tests [Chrome] 1/6[Chrome] › crypto/device-verification.spec.ts:75:9 › Device verification › Verify device with QR code during login @no-webkit
Check failure on line 189 in playwright/e2e/crypto/utils.ts GitHub Actions / Run Tests [Chrome] 1/6[Chrome] › crypto/device-verification.spec.ts:118:9 › Device verification › Verify device with Security Phrase during login @no-webkit
Check failure on line 189 in playwright/e2e/crypto/utils.ts GitHub Actions / Run Tests [Chrome] 1/6[Chrome] › crypto/device-verification.spec.ts:118:9 › Device verification › Verify device with Security Phrase during login @no-webkit
Check failure on line 189 in playwright/e2e/crypto/utils.ts GitHub Actions / Run Tests [Chrome] 1/6[Chrome] › crypto/device-verification.spec.ts:118:9 › Device verification › Verify device with Security Phrase during login @no-webkit
Check failure on line 189 in playwright/e2e/crypto/utils.ts GitHub Actions / Run Tests [Chrome] 1/6[Chrome] › crypto/device-verification.spec.ts:139:9 › Device verification › Verify device with Security Key during login @no-webkit
Check failure on line 189 in playwright/e2e/crypto/utils.ts GitHub Actions / Run Tests [Chrome] 1/6[Chrome] › crypto/device-verification.spec.ts:139:9 › Device verification › Verify device with Security Key during login @no-webkit
Check failure on line 189 in playwright/e2e/crypto/utils.ts GitHub Actions / Run Tests [Chrome] 1/6[Chrome] › crypto/device-verification.spec.ts:139:9 › Device verification › Verify device with Security Key during login @no-webkit
|
||
} | ||
} | ||
|
||
|