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