From 0c714ba4a1fcf11f1c32bfae4e76d6e0438bb553 Mon Sep 17 00:00:00 2001 From: Hubert Chathi Date: Wed, 5 Jun 2019 15:24:03 -0400 Subject: [PATCH] some cleanups --- spec/test-utils.js | 1 - spec/unit/crypto/cross-signing.spec.js | 2 -- spec/unit/crypto/secrets.spec.js | 3 --- src/crypto/index.js | 2 +- 4 files changed, 1 insertion(+), 7 deletions(-) diff --git a/spec/test-utils.js b/spec/test-utils.js index fcb9eb0fb..57835536b 100644 --- a/spec/test-utils.js +++ b/spec/test-utils.js @@ -1,7 +1,6 @@ "use strict"; import expect from 'expect'; import Promise from 'bluebird'; -const logger = require("../lib/logger"); // load olm before the sdk if possible import './olm-loader'; diff --git a/spec/unit/crypto/cross-signing.spec.js b/spec/unit/crypto/cross-signing.spec.js index 3b78fd06a..0f7e75c4e 100644 --- a/spec/unit/crypto/cross-signing.spec.js +++ b/spec/unit/crypto/cross-signing.spec.js @@ -67,8 +67,6 @@ describe("Cross Signing", function() { }, }, }, - verified: 0, - unsigned: {}, }); // Alice verifies Bob's key alice.on("cross-signing:getKey", function(e) { diff --git a/spec/unit/crypto/secrets.spec.js b/spec/unit/crypto/secrets.spec.js index 8f33befdf..c357c33aa 100644 --- a/spec/unit/crypto/secrets.spec.js +++ b/spec/unit/crypto/secrets.spec.js @@ -17,7 +17,6 @@ limitations under the License. import '../../olm-loader'; import expect from 'expect'; -import anotherjson from 'another-json'; import { MatrixEvent } from '../../../lib/models/event'; import olmlib from '../../../lib/crypto/olmlib'; @@ -25,8 +24,6 @@ import olmlib from '../../../lib/crypto/olmlib'; import TestClient from '../../TestClient'; import { makeTestClients } from './verification/util'; -import {HttpResponse, setHttpResponses} from '../../test-utils'; - async function makeTestClient(userInfo, options) { const client = (new TestClient( userInfo.userId, userInfo.deviceId, undefined, undefined, options, diff --git a/src/crypto/index.js b/src/crypto/index.js index 1164892ea..3be1be3c0 100644 --- a/src/crypto/index.js +++ b/src/crypto/index.js @@ -1047,7 +1047,7 @@ Crypto.prototype.setDeviceVerification = async function( userId, deviceId, verified, blocked, known, ) { const xsk = this._deviceList.getStoredCrossSigningForUser(userId); - if (xsk.getId() === deviceId) { + if (xsk && xsk.getId() === deviceId) { if (verified) { const device = await this._crossSigningInfo.signUser(xsk); // FIXME: mark xsk as dirty in device list