From 3e934c80816aaab1fb7c67ccb53cad7b757f7aa6 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 11 May 2020 15:17:25 +0100 Subject: [PATCH] Send cross-signing debug booleans over rageshake Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/rageshake/submit-rageshake.ts | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/rageshake/submit-rageshake.ts b/src/rageshake/submit-rageshake.ts index 921f3fbf40..d01fa66655 100644 --- a/src/rageshake/submit-rageshake.ts +++ b/src/rageshake/submit-rageshake.ts @@ -109,7 +109,29 @@ export default async function sendBugReport(bugReportEndpoint: string, opts: IOp keys.push(`curve25519:${client.getDeviceCurve25519Key()}`); } body.append('device_keys', keys.join(', ')); - body.append('cross_signing_key', client.getCrossSigningId()); + + // add cross-signing status information + const crossSigning = client._crypto._crossSigningInfo; + const secretStorage = client._crypto._secretStorage; + + body.append("cross_signing_key", crossSigning.getId()); + body.append("cross_signing_pk_in_ssss", + String(!!(await crossSigning.isStoredInSecretStorage(secretStorage)))); + body.append("ssss_key_in_account", String(!!(await secretStorage.hasKey()))); + + const pkCache = client.getCrossSigningCacheCallbacks(); + body.append("self_signing_pk_cached", + String(!!(pkCache && await pkCache.getCrossSigningKeyCache("self_signing")))); + body.append("user_signing_pk_cached", + String(!!(pkCache && await pkCache.getCrossSigningKeyCache("user_signing")))); + + const sessionBackupKeyFromCache = await client._crypto.getSessionBackupPrivateKey(); + body.append("session_backup_key_cached", String(!!sessionBackupKeyFromCache)); + body.append("session_backup_key_well_formed", String(sessionBackupKeyFromCache instanceof Uint8Array)); + body.append("cross_signing_supported_by_hs", + String(await client.doesServerSupportUnstableFeature("org.matrix.e2e_cross_signing"))); + body.append("cross_signing_ready", String(await client.isCrossSigningReady())); + body.append("ssss_key_needs_upgrade", String(await client.secretStorageKeyNeedsUpgrade())); } if (opts.label) {