@ledgerhq/ledger-key-ring-protocol 0.6.8-nightly.3 → 0.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
1
 
2
- > @ledgerhq/ledger-key-ring-protocol@0.6.8-nightly.2 build /home/runner/work/ledger-live/ledger-live/libs/ledger-key-ring-protocol
2
+ > @ledgerhq/ledger-key-ring-protocol@0.6.8 build /home/runner/work/ledger-live/ledger-live/libs/ledger-key-ring-protocol
3
3
  > tsc && tsc -m esnext --moduleResolution bundler --outDir lib-es
4
4
 
package/CHANGELOG.md CHANGED
@@ -1,46 +1,24 @@
1
1
  # @ledgerhq/live-wallet
2
2
 
3
- ## 0.6.8-nightly.3
3
+ ## 0.6.8
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - Updated dependencies [[`cbc0648`](https://github.com/LedgerHQ/ledger-live/commit/cbc064885d8e0459e40d327a2e5389204b3ec705)]:
8
- - @ledgerhq/live-env@2.19.0-nightly.2
9
- - @ledgerhq/hw-ledger-key-ring-protocol@0.5.2-nightly.3
10
- - @ledgerhq/live-network@2.0.20-nightly.3
11
- - @ledgerhq/speculos-transport@0.2.13-nightly.3
12
-
13
- ## 0.6.8-nightly.2
14
-
15
- ### Patch Changes
16
-
17
- - Updated dependencies [[`cadf2e1`](https://github.com/LedgerHQ/ledger-live/commit/cadf2e1dfb09248d3f77d96f94ae774425dbca75)]:
18
- - @ledgerhq/live-env@2.19.0-nightly.1
19
- - @ledgerhq/hw-ledger-key-ring-protocol@0.5.2-nightly.2
20
- - @ledgerhq/live-network@2.0.20-nightly.2
21
- - @ledgerhq/speculos-transport@0.2.13-nightly.2
22
-
23
- ## 0.6.8-nightly.1
24
-
25
- ### Patch Changes
26
-
27
- - Updated dependencies [[`759064d`](https://github.com/LedgerHQ/ledger-live/commit/759064d4815c636af2d73ba548a85b4f53e7b491)]:
28
- - @ledgerhq/errors@6.27.0-nightly.0
29
- - @ledgerhq/hw-transport@6.31.13-nightly.0
30
- - @ledgerhq/live-network@2.0.20-nightly.1
31
- - @ledgerhq/speculos-transport@0.2.13-nightly.1
32
- - @ledgerhq/hw-ledger-key-ring-protocol@0.5.2-nightly.1
33
- - @ledgerhq/hw-transport-mocker@6.29.13-nightly.0
7
+ - Updated dependencies [[`f1f3845`](https://github.com/LedgerHQ/ledger-live/commit/f1f3845942e4cbce9c585dc65f6170ddbc319f19)]:
8
+ - @ledgerhq/live-env@2.19.0
9
+ - @ledgerhq/hw-ledger-key-ring-protocol@0.5.2
10
+ - @ledgerhq/live-network@2.0.20
11
+ - @ledgerhq/speculos-transport@0.2.13
34
12
 
35
- ## 0.6.8-nightly.0
13
+ ## 0.6.8-next.0
36
14
 
37
15
  ### Patch Changes
38
16
 
39
17
  - Updated dependencies [[`f1f3845`](https://github.com/LedgerHQ/ledger-live/commit/f1f3845942e4cbce9c585dc65f6170ddbc319f19)]:
40
- - @ledgerhq/live-env@2.19.0-nightly.0
41
- - @ledgerhq/hw-ledger-key-ring-protocol@0.5.2-nightly.0
42
- - @ledgerhq/live-network@2.0.20-nightly.0
43
- - @ledgerhq/speculos-transport@0.2.13-nightly.0
18
+ - @ledgerhq/live-env@2.19.0-next.0
19
+ - @ledgerhq/hw-ledger-key-ring-protocol@0.5.2-next.0
20
+ - @ledgerhq/live-network@2.0.20-next.0
21
+ - @ledgerhq/speculos-transport@0.2.13-next.0
44
22
 
45
23
  ## 0.6.7
46
24
 
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=cipher.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cipher.test.d.ts","sourceRoot":"","sources":["../../src/qrcode/cipher.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const hw_ledger_key_ring_protocol_1 = require("@ledgerhq/hw-ledger-key-ring-protocol");
4
+ const cipher_1 = require("./cipher");
5
+ const errors_1 = require("../errors");
6
+ describe("makeCipher", () => {
7
+ it("should encrypt and decrypt correctly", () => {
8
+ const ephemeralKey = hw_ledger_key_ring_protocol_1.crypto.randomKeypair();
9
+ const candidate = hw_ledger_key_ring_protocol_1.crypto.randomKeypair();
10
+ const sessionEncryptionKey = hw_ledger_key_ring_protocol_1.crypto.ecdh(ephemeralKey, candidate.publicKey);
11
+ const cipher = (0, cipher_1.makeCipher)(sessionEncryptionKey);
12
+ const plaintext = { message: "Hello, World!" };
13
+ const encrypted = cipher.encrypt(plaintext);
14
+ expect(typeof encrypted).toBe("string");
15
+ const decrypted = cipher.decrypt(encrypted);
16
+ expect(decrypted).toEqual(plaintext);
17
+ });
18
+ it("should throw InvalidEncryptionKeyError if key changes", () => {
19
+ const ephemeralKey = hw_ledger_key_ring_protocol_1.crypto.randomKeypair();
20
+ const candidate = hw_ledger_key_ring_protocol_1.crypto.randomKeypair();
21
+ const sessionEncryptionKey = hw_ledger_key_ring_protocol_1.crypto.ecdh(ephemeralKey, candidate.publicKey);
22
+ const cipher = (0, cipher_1.makeCipher)(sessionEncryptionKey);
23
+ const plaintext = { message: "Hello, World!" };
24
+ const encrypted = cipher.encrypt(plaintext);
25
+ const ephemeralKey2 = hw_ledger_key_ring_protocol_1.crypto.randomKeypair();
26
+ const otherSessionEncryptionKey = hw_ledger_key_ring_protocol_1.crypto.ecdh(ephemeralKey2, candidate.publicKey);
27
+ const cipher2 = (0, cipher_1.makeCipher)(otherSessionEncryptionKey);
28
+ expect(() => cipher2.decrypt(encrypted)).toThrow(errors_1.InvalidEncryptionKeyError);
29
+ });
30
+ });
31
+ //# sourceMappingURL=cipher.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cipher.test.js","sourceRoot":"","sources":["../../src/qrcode/cipher.test.ts"],"names":[],"mappings":";;AAAA,uFAA+D;AAC/D,qCAAsC;AACtC,sCAAsD;AAEtD,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,EAAE,CAA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CAAC,SAAS,CAAC,CAAC;QAClF,MAAM,OAAO,GAAG,IAAA,mBAAU,EAAC,yBAAyB,CAAC,CAAC;QACtD,MAAM,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,kCAAyB,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../src/qrcode/index.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,151 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const _1 = require(".");
7
+ const ws_1 = __importDefault(require("ws"));
8
+ const sdk_1 = require("../sdk");
9
+ const hw_ledger_key_ring_protocol_1 = require("@ledgerhq/hw-ledger-key-ring-protocol");
10
+ const errors_1 = require("../errors");
11
+ // Test data constants
12
+ const MOCK_TRUSTCHAIN = {
13
+ rootId: "test-root-id",
14
+ walletSyncEncryptionKey: "test-wallet-sync-encryption-key",
15
+ applicationPath: "m/0'/16'/0'",
16
+ };
17
+ const LEGACY_IMPORT_QR_CODE = "ZAADAAIAAAAEd2JXMpuoYdzvkNzFTlmQLPcGf2LSjDOgqaB3nQoZqlimcCX6HNkescWKyT1DCGuwO7IesD7oYg+fdZPkiIfFL3V9swfZRePkaNN09IjXsWLsim9hK/qi/RC1/ofX3hYNKUxUAgYVVG82WKXIk47siWfUlRZsCYSAARQ6ASpUgidPjMHaOMK6w53wTZplwo7Zjv1HrIyKwr3Ci8OmrFye5g==";
18
+ const CRYPTO_ADDRESSES = {
19
+ ethereum: "0x6fC39c0C6D379d8D168e9EFD90C4B55Fc1Bb1fF2",
20
+ solana: "5eMHnPQa4vHP6oFbydZx6RjzGvZR2qZtCQ7E8yrFw93n",
21
+ ripple: "rU6K7V3Po4snVhBBaU29sesqs2qTQJWDw1",
22
+ cardano: "addr1q9dduxx8zhp4vq4rkfsl8gk0wnwhkyd4shzdc3u9jxuw8c3af2cqpjnhx8yqz3sjdf8ttf5htp2v07ah3ts2mtfzw46qqj7kzw",
23
+ bitcoin: "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
24
+ cosmos: "cosmos1h9w6z0sgp2k4z6qzwk0jhp5a5rz87vt4l25fsl",
25
+ };
26
+ describe("Trustchain QR Code", () => {
27
+ let server;
28
+ let wsA = null;
29
+ let wsB = null;
30
+ beforeAll(() => {
31
+ server = new ws_1.default.Server({ port: 1234 });
32
+ server.on("connection", ws => {
33
+ if (!wsA) {
34
+ wsA = ws;
35
+ }
36
+ else if (!wsB) {
37
+ wsB = ws;
38
+ }
39
+ ws.on("message", message => {
40
+ if (ws === wsA && wsB) {
41
+ wsB.send(message);
42
+ }
43
+ else if (ws === wsB && wsA) {
44
+ wsA.send(message);
45
+ }
46
+ });
47
+ });
48
+ });
49
+ afterAll(async () => {
50
+ if (wsA) {
51
+ wsA.terminate();
52
+ wsA = null;
53
+ }
54
+ if (wsB) {
55
+ wsB.terminate();
56
+ wsB = null;
57
+ }
58
+ if (server) {
59
+ await new Promise(resolve => {
60
+ server.close(() => resolve());
61
+ });
62
+ }
63
+ });
64
+ /**
65
+ * Helper function to create common test setup
66
+ */
67
+ const createTestSetup = async () => {
68
+ const memberCredentials = (0, sdk_1.convertKeyPairToLiveCredentials)(await hw_ledger_key_ring_protocol_1.crypto.randomKeypair());
69
+ const addMember = jest.fn(() => Promise.resolve(MOCK_TRUSTCHAIN));
70
+ const onRequestQRCodeInput = jest.fn();
71
+ return {
72
+ memberCredentials,
73
+ addMember,
74
+ onRequestQRCodeInput,
75
+ memberName: "foo",
76
+ };
77
+ };
78
+ test("digits matching scenario", async () => {
79
+ const { memberCredentials, addMember, memberName } = await createTestSetup();
80
+ const onDisplayDigits = jest.fn();
81
+ let scannedUrlResolve;
82
+ const scannedUrlPromise = new Promise(resolve => {
83
+ scannedUrlResolve = resolve;
84
+ });
85
+ const onDisplayQRCode = (url) => {
86
+ scannedUrlResolve(url);
87
+ };
88
+ const onRequestQRCodeInput = jest.fn((config, callback) => callback(onDisplayDigits.mock.calls[0][0]));
89
+ const hostP = (0, _1.createQRCodeHostInstance)({
90
+ trustchainApiBaseUrl: "ws://localhost:1234",
91
+ onDisplayQRCode,
92
+ onDisplayDigits,
93
+ addMember,
94
+ memberCredentials,
95
+ memberName,
96
+ initialTrustchainId: MOCK_TRUSTCHAIN.rootId,
97
+ });
98
+ const scannedUrl = await scannedUrlPromise;
99
+ const candidateP = (0, _1.createQRCodeCandidateInstance)({
100
+ memberCredentials,
101
+ memberName,
102
+ initialTrustchainId: undefined,
103
+ addMember,
104
+ scannedUrl,
105
+ onRequestQRCodeInput,
106
+ });
107
+ const [_, res] = await Promise.all([hostP, candidateP]);
108
+ expect(onDisplayDigits).toHaveBeenCalledWith(expect.any(String));
109
+ expect(addMember).toHaveBeenCalled();
110
+ expect(onRequestQRCodeInput).toHaveBeenCalledWith({ digits: 3, connected: false }, expect.any(Function));
111
+ expect(res).toEqual(MOCK_TRUSTCHAIN);
112
+ });
113
+ test("invalid qr code scanned", async () => {
114
+ const { memberCredentials, addMember, onRequestQRCodeInput, memberName } = await createTestSetup();
115
+ const scannedUrl = "https://example.com";
116
+ const candidateP = (0, _1.createQRCodeCandidateInstance)({
117
+ memberCredentials,
118
+ memberName,
119
+ initialTrustchainId: undefined,
120
+ addMember,
121
+ scannedUrl,
122
+ onRequestQRCodeInput,
123
+ });
124
+ await expect(candidateP).rejects.toThrow(new errors_1.ScannedInvalidQrCode());
125
+ });
126
+ test("old accounts export qr code scanned", async () => {
127
+ const { memberCredentials, addMember, onRequestQRCodeInput, memberName } = await createTestSetup();
128
+ const candidateP = (0, _1.createQRCodeCandidateInstance)({
129
+ memberCredentials,
130
+ memberName,
131
+ initialTrustchainId: undefined,
132
+ addMember,
133
+ scannedUrl: LEGACY_IMPORT_QR_CODE,
134
+ onRequestQRCodeInput,
135
+ });
136
+ await expect(candidateP).rejects.toThrow(new errors_1.ScannedOldImportQrCode());
137
+ });
138
+ it.each(Object.entries(CRYPTO_ADDRESSES))("should reject cryptocurrency address (%s) as invalid QR code", async (_, address) => {
139
+ const { memberCredentials, addMember, onRequestQRCodeInput, memberName } = await createTestSetup();
140
+ const candidateP = (0, _1.createQRCodeCandidateInstance)({
141
+ memberCredentials,
142
+ memberName,
143
+ initialTrustchainId: undefined,
144
+ addMember,
145
+ scannedUrl: address,
146
+ onRequestQRCodeInput,
147
+ });
148
+ await expect(candidateP).rejects.toThrow(new errors_1.ScannedInvalidQrCode());
149
+ });
150
+ });
151
+ //# sourceMappingURL=index.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../src/qrcode/index.test.ts"],"names":[],"mappings":";;;;;AAAA,wBAA4E;AAC5E,4CAA2B;AAC3B,gCAAyD;AACzD,uFAA+D;AAC/D,sCAAyE;AAEzE,sBAAsB;AACtB,MAAM,eAAe,GAAG;IACtB,MAAM,EAAE,cAAc;IACtB,uBAAuB,EAAE,iCAAiC;IAC1D,eAAe,EAAE,aAAa;CACtB,CAAC;AAEX,MAAM,qBAAqB,GACzB,sOAAsO,CAAC;AAEzO,MAAM,gBAAgB,GAAG;IACvB,QAAQ,EAAE,4CAA4C;IACtD,MAAM,EAAE,8CAA8C;IACtD,MAAM,EAAE,oCAAoC;IAC5C,OAAO,EACL,yGAAyG;IAC3G,OAAO,EAAE,4CAA4C;IACrD,MAAM,EAAE,+CAA+C;CAC/C,CAAC;AAEX,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,IAAI,MAAwB,CAAC;IAC7B,IAAI,GAAG,GAAqB,IAAI,CAAC;IACjC,IAAI,GAAG,GAAqB,IAAI,CAAC;IA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oBAAoB,EAAE,UAAU,EAAE,GACtE,MAAM,eAAe,EAAE,CAAC;QAE1B,MAAM,UAAU,GAAG,IAAA,gCAA6B,EAAC;YAC/C,iBAAiB;YACjB,UAAU;YACV,mBAAmB,EAAE,SAAS;YAC9B,SAAS;YACT,UAAU,EAAE,qBAAqB;YACjC,oBAAoB;SACrB,CAAC,CAAC;QAEH,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,+BAAsB,EAAE,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CACvC,8DAA8D,EAC9D,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE;QACnB,MAAM,EAAE,iBAAiB,EAAE,SAAS,EAAE,oBAAoB,EAAE,UAAU,EAAE,GACtE,MAAM,eAAe,EAAE,CAAC;QAE1B,MAAM,UAAU,GAAG,IAAA,gCAA6B,EAAC;YAC/C,iBAAiB;YACjB,UAAU;YACV,mBAAmB,EAAE,SAAS;YAC9B,SAAS;YACT,UAAU,EAAE,OAAO;YACnB,oBAAoB;SACrB,CAAC,CAAC;QAEH,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,6BAAoB,EAAE,CAAC,CAAC;IACvE,CAAC,CACF,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=cipher.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cipher.test.d.ts","sourceRoot":"","sources":["../../src/qrcode/cipher.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,29 @@
1
+ import { crypto } from "@ledgerhq/hw-ledger-key-ring-protocol";
2
+ import { makeCipher } from "./cipher";
3
+ import { InvalidEncryptionKeyError } from "../errors";
4
+ describe("makeCipher", () => {
5
+ it("should encrypt and decrypt correctly", () => {
6
+ const ephemeralKey = crypto.randomKeypair();
7
+ const candidate = crypto.randomKeypair();
8
+ const sessionEncryptionKey = crypto.ecdh(ephemeralKey, candidate.publicKey);
9
+ const cipher = makeCipher(sessionEncryptionKey);
10
+ const plaintext = { message: "Hello, World!" };
11
+ const encrypted = cipher.encrypt(plaintext);
12
+ expect(typeof encrypted).toBe("string");
13
+ const decrypted = cipher.decrypt(encrypted);
14
+ expect(decrypted).toEqual(plaintext);
15
+ });
16
+ it("should throw InvalidEncryptionKeyError if key changes", () => {
17
+ const ephemeralKey = crypto.randomKeypair();
18
+ const candidate = crypto.randomKeypair();
19
+ const sessionEncryptionKey = crypto.ecdh(ephemeralKey, candidate.publicKey);
20
+ const cipher = makeCipher(sessionEncryptionKey);
21
+ const plaintext = { message: "Hello, World!" };
22
+ const encrypted = cipher.encrypt(plaintext);
23
+ const ephemeralKey2 = crypto.randomKeypair();
24
+ const otherSessionEncryptionKey = crypto.ecdh(ephemeralKey2, candidate.publicKey);
25
+ const cipher2 = makeCipher(otherSessionEncryptionKey);
26
+ expect(() => cipher2.decrypt(encrypted)).toThrow(InvalidEncryptionKeyError);
27
+ });
28
+ });
29
+ //# sourceMappingURL=cipher.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cipher.test.js","sourceRoot":"","sources":["../../src/qrcode/cipher.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAEtD,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC9C,MAAM,YAAY,GAAG,MAAM,CAAC,aAAa,EAAE,CAAC;QAC5C,MAAM,SAAS,GAAG,MAAM,CAAC,aAAa,EAAE,CAAC;QACzC,MAAM,oBAAoB,GAAG,MAAM,C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IAC9E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../src/qrcode/index.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,146 @@
1
+ import { createQRCodeHostInstance, createQRCodeCandidateInstance } from ".";
2
+ import WebSocket from "ws";
3
+ import { convertKeyPairToLiveCredentials } from "../sdk";
4
+ import { crypto } from "@ledgerhq/hw-ledger-key-ring-protocol";
5
+ import { ScannedInvalidQrCode, ScannedOldImportQrCode } from "../errors";
6
+ // Test data constants
7
+ const MOCK_TRUSTCHAIN = {
8
+ rootId: "test-root-id",
9
+ walletSyncEncryptionKey: "test-wallet-sync-encryption-key",
10
+ applicationPath: "m/0'/16'/0'",
11
+ };
12
+ const LEGACY_IMPORT_QR_CODE = "ZAADAAIAAAAEd2JXMpuoYdzvkNzFTlmQLPcGf2LSjDOgqaB3nQoZqlimcCX6HNkescWKyT1DCGuwO7IesD7oYg+fdZPkiIfFL3V9swfZRePkaNN09IjXsWLsim9hK/qi/RC1/ofX3hYNKUxUAgYVVG82WKXIk47siWfUlRZsCYSAARQ6ASpUgidPjMHaOMK6w53wTZplwo7Zjv1HrIyKwr3Ci8OmrFye5g==";
13
+ const CRYPTO_ADDRESSES = {
14
+ ethereum: "0x6fC39c0C6D379d8D168e9EFD90C4B55Fc1Bb1fF2",
15
+ solana: "5eMHnPQa4vHP6oFbydZx6RjzGvZR2qZtCQ7E8yrFw93n",
16
+ ripple: "rU6K7V3Po4snVhBBaU29sesqs2qTQJWDw1",
17
+ cardano: "addr1q9dduxx8zhp4vq4rkfsl8gk0wnwhkyd4shzdc3u9jxuw8c3af2cqpjnhx8yqz3sjdf8ttf5htp2v07ah3ts2mtfzw46qqj7kzw",
18
+ bitcoin: "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
19
+ cosmos: "cosmos1h9w6z0sgp2k4z6qzwk0jhp5a5rz87vt4l25fsl",
20
+ };
21
+ describe("Trustchain QR Code", () => {
22
+ let server;
23
+ let wsA = null;
24
+ let wsB = null;
25
+ beforeAll(() => {
26
+ server = new WebSocket.Server({ port: 1234 });
27
+ server.on("connection", ws => {
28
+ if (!wsA) {
29
+ wsA = ws;
30
+ }
31
+ else if (!wsB) {
32
+ wsB = ws;
33
+ }
34
+ ws.on("message", message => {
35
+ if (ws === wsA && wsB) {
36
+ wsB.send(message);
37
+ }
38
+ else if (ws === wsB && wsA) {
39
+ wsA.send(message);
40
+ }
41
+ });
42
+ });
43
+ });
44
+ afterAll(async () => {
45
+ if (wsA) {
46
+ wsA.terminate();
47
+ wsA = null;
48
+ }
49
+ if (wsB) {
50
+ wsB.terminate();
51
+ wsB = null;
52
+ }
53
+ if (server) {
54
+ await new Promise(resolve => {
55
+ server.close(() => resolve());
56
+ });
57
+ }
58
+ });
59
+ /**
60
+ * Helper function to create common test setup
61
+ */
62
+ const createTestSetup = async () => {
63
+ const memberCredentials = convertKeyPairToLiveCredentials(await crypto.randomKeypair());
64
+ const addMember = jest.fn(() => Promise.resolve(MOCK_TRUSTCHAIN));
65
+ const onRequestQRCodeInput = jest.fn();
66
+ return {
67
+ memberCredentials,
68
+ addMember,
69
+ onRequestQRCodeInput,
70
+ memberName: "foo",
71
+ };
72
+ };
73
+ test("digits matching scenario", async () => {
74
+ const { memberCredentials, addMember, memberName } = await createTestSetup();
75
+ const onDisplayDigits = jest.fn();
76
+ let scannedUrlResolve;
77
+ const scannedUrlPromise = new Promise(resolve => {
78
+ scannedUrlResolve = resolve;
79
+ });
80
+ const onDisplayQRCode = (url) => {
81
+ scannedUrlResolve(url);
82
+ };
83
+ const onRequestQRCodeInput = jest.fn((config, callback) => callback(onDisplayDigits.mock.calls[0][0]));
84
+ const hostP = createQRCodeHostInstance({
85
+ trustchainApiBaseUrl: "ws://localhost:1234",
86
+ onDisplayQRCode,
87
+ onDisplayDigits,
88
+ addMember,
89
+ memberCredentials,
90
+ memberName,
91
+ initialTrustchainId: MOCK_TRUSTCHAIN.rootId,
92
+ });
93
+ const scannedUrl = await scannedUrlPromise;
94
+ const candidateP = createQRCodeCandidateInstance({
95
+ memberCredentials,
96
+ memberName,
97
+ initialTrustchainId: undefined,
98
+ addMember,
99
+ scannedUrl,
100
+ onRequestQRCodeInput,
101
+ });
102
+ const [_, res] = await Promise.all([hostP, candidateP]);
103
+ expect(onDisplayDigits).toHaveBeenCalledWith(expect.any(String));
104
+ expect(addMember).toHaveBeenCalled();
105
+ expect(onRequestQRCodeInput).toHaveBeenCalledWith({ digits: 3, connected: false }, expect.any(Function));
106
+ expect(res).toEqual(MOCK_TRUSTCHAIN);
107
+ });
108
+ test("invalid qr code scanned", async () => {
109
+ const { memberCredentials, addMember, onRequestQRCodeInput, memberName } = await createTestSetup();
110
+ const scannedUrl = "https://example.com";
111
+ const candidateP = createQRCodeCandidateInstance({
112
+ memberCredentials,
113
+ memberName,
114
+ initialTrustchainId: undefined,
115
+ addMember,
116
+ scannedUrl,
117
+ onRequestQRCodeInput,
118
+ });
119
+ await expect(candidateP).rejects.toThrow(new ScannedInvalidQrCode());
120
+ });
121
+ test("old accounts export qr code scanned", async () => {
122
+ const { memberCredentials, addMember, onRequestQRCodeInput, memberName } = await createTestSetup();
123
+ const candidateP = createQRCodeCandidateInstance({
124
+ memberCredentials,
125
+ memberName,
126
+ initialTrustchainId: undefined,
127
+ addMember,
128
+ scannedUrl: LEGACY_IMPORT_QR_CODE,
129
+ onRequestQRCodeInput,
130
+ });
131
+ await expect(candidateP).rejects.toThrow(new ScannedOldImportQrCode());
132
+ });
133
+ it.each(Object.entries(CRYPTO_ADDRESSES))("should reject cryptocurrency address (%s) as invalid QR code", async (_, address) => {
134
+ const { memberCredentials, addMember, onRequestQRCodeInput, memberName } = await createTestSetup();
135
+ const candidateP = createQRCodeCandidateInstance({
136
+ memberCredentials,
137
+ memberName,
138
+ initialTrustchainId: undefined,
139
+ addMember,
140
+ scannedUrl: address,
141
+ onRequestQRCodeInput,
142
+ });
143
+ await expect(candidateP).rejects.toThrow(new ScannedInvalidQrCode());
144
+ });
145
+ });
146
+ //# sourceMappingURL=index.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../src/qrcode/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,6BAA6B,EAAE,MAAM,GAAG,CAAC;AAC5E,OAAO,SAAS,MAAM,IAAI,CAAC;AAC3B,OAAO,EAAE,+BAA+B,EAAE,MAAM,QAAQ,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAEzE,sBAAsB;AACtB,MAAM,eAAe,GAAG;IACtB,MAAM,EAAE,cAAc;IACtB,uBAAuB,EAAE,iCAAiC;IAC1D,eAAe,EAAE,aAAa;CACtB,CAAC;AAEX,MAAM,qBAAqB,GACzB,sOAAsO,CAAC;AAEzO,MAAM,gBAAgB,GAAG;IACvB,QAAQ,EAAE,4CAA4C;IACtD,MAAM,EAAE,8CAA8C;IACtD,MAAM,EAAE,oCAAoC;IAC5C,OAAO,EACL,yGAAyG;IAC3G,OAAO,EAAE,4CAA4C;IACrD,MAAM,EAAE,+CAA+C;CAC/C,CAAC;AAEX,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,IAAI,MAAwB,CAAC;IAC7B,IAAI,GAAG,GAAqB,IAAI,CAAC;IACjC,IAAI,GAAG,GAAqB,IAAI,CAAC;IAEjC,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,GAAG,IAAI,SAAS,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAC9C,MAAM,CAAC,EAAE,CAAC,YAAY,EAAE,EAAE,CAAC,EAAE;YAC3B,IAAI,CA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QAEH,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,sBAAsB,EAAE,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CACvC,8DAA8D,EAC9D,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE;QACnB,MAAM,EAAE,iBAAiB,EAAE,SAAS,EAAE,oBAAoB,EAAE,UAAU,EAAE,GACtE,MAAM,eAAe,EAAE,CAAC;QAE1B,MAAM,UAAU,GAAG,6BAA6B,CAAC;YAC/C,iBAAiB;YACjB,UAAU;YACV,mBAAmB,EAAE,SAAS;YAC9B,SAAS;YACT,UAAU,EAAE,OAAO;YACnB,oBAAoB;SACrB,CAAC,CAAC;QAEH,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,oBAAoB,EAAE,CAAC,CAAC;IACvE,CAAC,CACF,CAAC;AACJ,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/ledger-key-ring-protocol",
3
- "version": "0.6.8-nightly.3",
3
+ "version": "0.6.8",
4
4
  "description": "Ledger Key Ring Protocol layer",
5
5
  "keywords": [
6
6
  "Ledger"
@@ -57,15 +57,15 @@
57
57
  "isomorphic-ws": "5",
58
58
  "rxjs": "^7.8.1",
59
59
  "ws": "8",
60
- "@ledgerhq/errors": "6.27.0-nightly.0",
61
- "@ledgerhq/hw-transport": "6.31.13-nightly.0",
62
- "@ledgerhq/hw-ledger-key-ring-protocol": "0.5.2-nightly.3",
63
- "@ledgerhq/live-env": "2.19.0-nightly.2",
64
- "@ledgerhq/live-network": "2.0.20-nightly.3",
60
+ "@ledgerhq/errors": "6.26.0",
61
+ "@ledgerhq/hw-transport": "6.31.12",
62
+ "@ledgerhq/hw-transport-mocker": "6.29.12",
63
+ "@ledgerhq/hw-ledger-key-ring-protocol": "0.5.2",
64
+ "@ledgerhq/live-env": "2.19.0",
65
+ "@ledgerhq/live-network": "2.0.20",
65
66
  "@ledgerhq/logs": "6.13.0",
66
- "@ledgerhq/speculos-transport": "0.2.13-nightly.3",
67
- "@ledgerhq/types-devices": "^6.27.0",
68
- "@ledgerhq/hw-transport-mocker": "6.29.13-nightly.0"
67
+ "@ledgerhq/speculos-transport": "0.2.13",
68
+ "@ledgerhq/types-devices": "^6.27.0"
69
69
  },
70
70
  "devDependencies": {
71
71
  "@types/jest": "^29.5.10",
package/tsconfig.json CHANGED
@@ -9,5 +9,6 @@
9
9
  "lib": ["es2020", "dom"],
10
10
  "outDir": "lib"
11
11
  },
12
- "include": ["src/**/*"]
12
+ "include": ["src/**/*"],
13
+ "exclude": ["src/__tests__/**/*"]
13
14
  }