Move back to libsignal-client v0.18.1
This commit is contained in:
parent
d25e3c37ed
commit
08b2aeb237
6 changed files with 39 additions and 26 deletions
|
@ -80,7 +80,7 @@
|
||||||
"@indutny/frameless-titlebar": "2.3.5",
|
"@indutny/frameless-titlebar": "2.3.5",
|
||||||
"@popperjs/core": "2.9.2",
|
"@popperjs/core": "2.9.2",
|
||||||
"@react-spring/web": "9.4.5",
|
"@react-spring/web": "9.4.5",
|
||||||
"@signalapp/libsignal-client": "0.19.1",
|
"@signalapp/libsignal-client": "0.18.1",
|
||||||
"@sindresorhus/is": "0.8.0",
|
"@sindresorhus/is": "0.8.0",
|
||||||
"@types/fabric": "4.5.3",
|
"@types/fabric": "4.5.3",
|
||||||
"abort-controller": "3.0.0",
|
"abort-controller": "3.0.0",
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { z } from 'zod';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Direction,
|
Direction,
|
||||||
IdentityKeyPair,
|
// IdentityKeyPair,
|
||||||
PreKeyRecord,
|
PreKeyRecord,
|
||||||
PrivateKey,
|
PrivateKey,
|
||||||
PublicKey,
|
PublicKey,
|
||||||
|
@ -32,7 +32,7 @@ import type {
|
||||||
IdentityKeyIdType,
|
IdentityKeyIdType,
|
||||||
KeyPairType,
|
KeyPairType,
|
||||||
OuterSignedPrekeyType,
|
OuterSignedPrekeyType,
|
||||||
PniKeyMaterialType,
|
// PniKeyMaterialType,
|
||||||
PreKeyIdType,
|
PreKeyIdType,
|
||||||
PreKeyType,
|
PreKeyType,
|
||||||
SenderKeyIdType,
|
SenderKeyIdType,
|
||||||
|
@ -1978,35 +1978,34 @@ export class SignalProtocolStore extends EventsMixin {
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateOurPniKeyMaterial(
|
async updateOurPniKeyMaterial(pni: UUID): /* {
|
||||||
pni: UUID,
|
identityKeyPair: identityBytes,
|
||||||
{
|
signedPreKey: signedPreKeyBytes,
|
||||||
identityKeyPair: identityBytes,
|
registrationId,
|
||||||
signedPreKey: signedPreKeyBytes,
|
}: PniKeyMaterialType
|
||||||
registrationId,
|
*/
|
||||||
}: PniKeyMaterialType
|
Promise<void> {
|
||||||
): Promise<void> {
|
throw new Error(
|
||||||
log.info(`SignalProtocolStore.updateOurPniKeyMaterial(${pni})`);
|
`TODO: SignalProtocolStore.updateOurPniKeyMaterial(${pni}) is not implemented!`
|
||||||
|
);
|
||||||
|
|
||||||
|
/*
|
||||||
|
log.info(`SignalProtocolStore.updateOurPniKeyMaterial(${pni})`);
|
||||||
const identityKeyPair = IdentityKeyPair.deserialize(
|
const identityKeyPair = IdentityKeyPair.deserialize(
|
||||||
Buffer.from(identityBytes)
|
Buffer.from(identityBytes)
|
||||||
);
|
);
|
||||||
const signedPreKey = SignedPreKeyRecord.deserialize(
|
const signedPreKey = SignedPreKeyRecord.deserialize(
|
||||||
Buffer.from(signedPreKeyBytes)
|
Buffer.from(signedPreKeyBytes)
|
||||||
);
|
);
|
||||||
|
|
||||||
const { storage } = window;
|
const { storage } = window;
|
||||||
|
|
||||||
const pniPublicKey = identityKeyPair.publicKey.serialize();
|
const pniPublicKey = identityKeyPair.publicKey.serialize();
|
||||||
const pniPrivateKey = identityKeyPair.privateKey.serialize();
|
const pniPrivateKey = identityKeyPair.privateKey.serialize();
|
||||||
|
|
||||||
// Update caches
|
// Update caches
|
||||||
this.ourIdentityKeys.set(pni.toString(), {
|
this.ourIdentityKeys.set(pni.toString(), {
|
||||||
pubKey: pniPublicKey,
|
pubKey: pniPublicKey,
|
||||||
privKey: pniPrivateKey,
|
privKey: pniPrivateKey,
|
||||||
});
|
});
|
||||||
this.ourRegistrationIds.set(pni.toString(), registrationId);
|
this.ourRegistrationIds.set(pni.toString(), registrationId);
|
||||||
|
|
||||||
// Update database
|
// Update database
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
storage.put('identityKeyMap', {
|
storage.put('identityKeyMap', {
|
||||||
|
@ -2031,6 +2030,7 @@ export class SignalProtocolStore extends EventsMixin {
|
||||||
signedPreKey.timestamp()
|
signedPreKey.timestamp()
|
||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
async removeAllData(): Promise<void> {
|
async removeAllData(): Promise<void> {
|
||||||
|
|
|
@ -7,12 +7,12 @@ import chai, { assert } from 'chai';
|
||||||
import chaiAsPromised from 'chai-as-promised';
|
import chaiAsPromised from 'chai-as-promised';
|
||||||
import {
|
import {
|
||||||
Direction,
|
Direction,
|
||||||
IdentityKeyPair,
|
// IdentityKeyPair,
|
||||||
PrivateKey,
|
// PrivateKey,
|
||||||
PublicKey,
|
// PublicKey,
|
||||||
SenderKeyRecord,
|
SenderKeyRecord,
|
||||||
SessionRecord,
|
SessionRecord,
|
||||||
SignedPreKeyRecord,
|
// SignedPreKeyRecord,
|
||||||
} from '@signalapp/libsignal-client';
|
} from '@signalapp/libsignal-client';
|
||||||
|
|
||||||
import { signal } from '../protobuf/compiled';
|
import { signal } from '../protobuf/compiled';
|
||||||
|
@ -20,12 +20,12 @@ import { sessionStructureToBytes } from '../util/sessionTranslation';
|
||||||
import * as durations from '../util/durations';
|
import * as durations from '../util/durations';
|
||||||
import { Zone } from '../util/Zone';
|
import { Zone } from '../util/Zone';
|
||||||
|
|
||||||
import * as Bytes from '../Bytes';
|
// import * as Bytes from '../Bytes';
|
||||||
import { getRandomBytes, constantTimeEqual } from '../Crypto';
|
import { getRandomBytes, constantTimeEqual } from '../Crypto';
|
||||||
import {
|
import {
|
||||||
clampPrivateKey,
|
clampPrivateKey,
|
||||||
setPublicKeyTypeByte,
|
setPublicKeyTypeByte,
|
||||||
generateSignedPreKey,
|
// generateSignedPreKey,
|
||||||
} from '../Curve';
|
} from '../Curve';
|
||||||
import type { SignalProtocolStore } from '../SignalProtocolStore';
|
import type { SignalProtocolStore } from '../SignalProtocolStore';
|
||||||
import { GLOBAL_ZONE } from '../SignalProtocolStore';
|
import { GLOBAL_ZONE } from '../SignalProtocolStore';
|
||||||
|
@ -1774,6 +1774,7 @@ describe('SignalProtocolStore', () => {
|
||||||
assert.strictEqual(items.length, 0);
|
assert.strictEqual(items.length, 0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
/*
|
||||||
describe('removeOurOldPni/updateOurPniKeyMaterial', () => {
|
describe('removeOurOldPni/updateOurPniKeyMaterial', () => {
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await store.storePreKey(ourUuid, 2, testKey);
|
await store.storePreKey(ourUuid, 2, testKey);
|
||||||
|
@ -1850,4 +1851,5 @@ describe('SignalProtocolStore', () => {
|
||||||
// Note: signature is ignored.
|
// Note: signature is ignored.
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
});
|
});
|
||||||
|
|
|
@ -862,8 +862,8 @@ export default class AccountManager extends EventTarget {
|
||||||
|
|
||||||
if (keyMaterial) {
|
if (keyMaterial) {
|
||||||
await storage.protocol.updateOurPniKeyMaterial(
|
await storage.protocol.updateOurPniKeyMaterial(
|
||||||
new UUID(pni),
|
new UUID(pni)
|
||||||
keyMaterial
|
// keyMaterial
|
||||||
);
|
);
|
||||||
|
|
||||||
// Intentionally not awaiting since this is processed on encrypted queue
|
// Intentionally not awaiting since this is processed on encrypted queue
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright 2022 Signal Messenger, LLC
|
// Copyright 2022 Signal Messenger, LLC
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import { Cds2Client } from '@signalapp/libsignal-client';
|
import type { Cds2Client } from '@signalapp/libsignal-client';
|
||||||
|
|
||||||
import { strictAssert } from '../../util/assert';
|
import { strictAssert } from '../../util/assert';
|
||||||
import { SignalService as Proto } from '../../protobuf';
|
import { SignalService as Proto } from '../../protobuf';
|
||||||
|
@ -23,6 +23,8 @@ export class CDSISocket extends CDSSocketBase<CDSISocketOptionsType> {
|
||||||
);
|
);
|
||||||
this.state = CDSSocketState.Handshake;
|
this.state = CDSSocketState.Handshake;
|
||||||
|
|
||||||
|
throw new Error('TODO: CDSISocket: Cds2Client is not available!');
|
||||||
|
/*
|
||||||
{
|
{
|
||||||
const { done, value: attestationMessage } =
|
const { done, value: attestationMessage } =
|
||||||
await this.socketIterator.next();
|
await this.socketIterator.next();
|
||||||
|
@ -40,6 +42,7 @@ export class CDSISocket extends CDSSocketBase<CDSISocketOptionsType> {
|
||||||
earliestValidTimestamp
|
earliestValidTimestamp
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
this.socket.sendBytes(this.cdsClient.initialRequest());
|
this.socket.sendBytes(this.cdsClient.initialRequest());
|
||||||
|
|
||||||
|
|
10
yarn.lock
10
yarn.lock
|
@ -1745,7 +1745,15 @@
|
||||||
"@react-spring/shared" "~9.4.5"
|
"@react-spring/shared" "~9.4.5"
|
||||||
"@react-spring/types" "~9.4.5"
|
"@react-spring/types" "~9.4.5"
|
||||||
|
|
||||||
"@signalapp/libsignal-client@0.19.1", "@signalapp/libsignal-client@^0.19.1":
|
"@signalapp/libsignal-client@0.18.1":
|
||||||
|
version "0.18.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/@signalapp/libsignal-client/-/libsignal-client-0.18.1.tgz#6b499cdcc952f1981c6367f68484cf3275be3b31"
|
||||||
|
integrity sha512-43NcTYpahImlWHBDaNFmn7QaeXZHkFkTtb4m+ZWgzU0mkS1M8V+orGen2XuDvNiu+9HQmW4Lg7FV1deXhWtIRA==
|
||||||
|
dependencies:
|
||||||
|
node-gyp-build "^4.2.3"
|
||||||
|
uuid "^8.3.0"
|
||||||
|
|
||||||
|
"@signalapp/libsignal-client@^0.19.1":
|
||||||
version "0.19.1"
|
version "0.19.1"
|
||||||
resolved "https://registry.yarnpkg.com/@signalapp/libsignal-client/-/libsignal-client-0.19.1.tgz#ccc12f0f034fe522940ba176a4518b4a05162b6d"
|
resolved "https://registry.yarnpkg.com/@signalapp/libsignal-client/-/libsignal-client-0.19.1.tgz#ccc12f0f034fe522940ba176a4518b4a05162b6d"
|
||||||
integrity sha512-x6qMjLxoq39oXnoUI8vA1Pd+fitEuYdA828LwBZIY0gxdBVv4D2DNB2kmyiGH2KtqHucnsRSz216gBOWbI2Q/g==
|
integrity sha512-x6qMjLxoq39oXnoUI8vA1Pd+fitEuYdA828LwBZIY0gxdBVv4D2DNB2kmyiGH2KtqHucnsRSz216gBOWbI2Q/g==
|
||||||
|
|
Loading…
Reference in a new issue