From f8e0dcf26437c03c384ace261b53f06cb5a2293d Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 24 Jan 2020 09:33:55 -0700 Subject: [PATCH 1/3] Add null check for cross-signing info in verification panel --- src/components/views/right_panel/VerificationPanel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/right_panel/VerificationPanel.js b/src/components/views/right_panel/VerificationPanel.js index a29546c8f7..70ef8486bd 100644 --- a/src/components/views/right_panel/VerificationPanel.js +++ b/src/components/views/right_panel/VerificationPanel.js @@ -49,12 +49,12 @@ export default class VerificationPanel extends React.PureComponent { Verify by emoji ; - if (request.requestEvent && request.requestEvent.getId()) { + const crossSigningInfo = MatrixClientPeg.get().getStoredCrossSigningForUser(request.otherUserId); + if (request.requestEvent && request.requestEvent.getId() && crossSigningInfo) { const qrCodeKeys = [ [MatrixClientPeg.get().getDeviceId(), MatrixClientPeg.get().getDeviceEd25519Key()], [MatrixClientPeg.get().getCrossSigningId(), MatrixClientPeg.get().getCrossSigningId()], ]; - const crossSigningInfo = MatrixClientPeg.get().getStoredCrossSigningForUser(request.otherUserId); const qrCode = Date: Fri, 24 Jan 2020 09:37:12 -0700 Subject: [PATCH 2/3] Also check for our own key ID --- src/components/views/right_panel/VerificationPanel.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/views/right_panel/VerificationPanel.js b/src/components/views/right_panel/VerificationPanel.js index 70ef8486bd..403cff818c 100644 --- a/src/components/views/right_panel/VerificationPanel.js +++ b/src/components/views/right_panel/VerificationPanel.js @@ -50,10 +50,11 @@ export default class VerificationPanel extends React.PureComponent { ; const crossSigningInfo = MatrixClientPeg.get().getStoredCrossSigningForUser(request.otherUserId); + const myKeyId = MatrixClientPeg.get().getCrossSigningId(); if (request.requestEvent && request.requestEvent.getId() && crossSigningInfo) { const qrCodeKeys = [ [MatrixClientPeg.get().getDeviceId(), MatrixClientPeg.get().getDeviceEd25519Key()], - [MatrixClientPeg.get().getCrossSigningId(), MatrixClientPeg.get().getCrossSigningId()], + [myKeyId, MatrixClientPeg.get().getCrossSigningId()], ]; const qrCode = Date: Fri, 24 Jan 2020 09:41:47 -0700 Subject: [PATCH 3/3] less duplication --- src/components/views/right_panel/VerificationPanel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/right_panel/VerificationPanel.js b/src/components/views/right_panel/VerificationPanel.js index 403cff818c..a75afd154a 100644 --- a/src/components/views/right_panel/VerificationPanel.js +++ b/src/components/views/right_panel/VerificationPanel.js @@ -54,7 +54,7 @@ export default class VerificationPanel extends React.PureComponent { if (request.requestEvent && request.requestEvent.getId() && crossSigningInfo) { const qrCodeKeys = [ [MatrixClientPeg.get().getDeviceId(), MatrixClientPeg.get().getDeviceEd25519Key()], - [myKeyId, MatrixClientPeg.get().getCrossSigningId()], + [myKeyId, myKeyId], ]; const qrCode =