Skip to content

Commit

Permalink
Update for @signalapp/libsignal-client rename
Browse files Browse the repository at this point in the history
  • Loading branch information
jrose-signal committed Mar 24, 2022
1 parent d18ed40 commit 5a107e1
Show file tree
Hide file tree
Showing 28 changed files with 56 additions and 64 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"@evanhahn/lottie-web-light": "5.8.1",
"@popperjs/core": "2.9.2",
"@react-spring/web": "9.4.1",
"@signalapp/signal-client": "0.12.4",
"@signalapp/libsignal-client": "0.15.0",
"@sindresorhus/is": "0.8.0",
"@types/fabric": "4.5.3",
"abort-controller": "3.0.0",
Expand Down Expand Up @@ -189,7 +189,7 @@
"@chanzuckerberg/axe-storybook-testing": "3.0.2",
"@electron/fuses": "1.5.0",
"@mixer/parallel-prettier": "2.0.1",
"@signalapp/mock-server": "1.2.0",
"@signalapp/mock-server": "1.2.1",
"@storybook/addon-actions": "5.1.11",
"@storybook/addon-knobs": "5.1.11",
"@storybook/addons": "5.1.11",
Expand Down Expand Up @@ -330,7 +330,7 @@
}
],
"mergeASARs": true,
"singleArchFiles": "node_modules/{@signalapp/signal-client/prebuilds/**,ringrtc/build/**,sharp/**}",
"singleArchFiles": "node_modules/{@signalapp/libsignal-client/prebuilds/**,ringrtc/build/**,sharp/**}",
"target": [
{
"target": "zip",
Expand Down Expand Up @@ -477,7 +477,7 @@
"!node_modules/better-sqlite3/deps/*",
"!node_modules/better-sqlite3/src/*",
"node_modules/better-sqlite3/build/Release/better_sqlite3.node",
"node_modules/@signalapp/signal-client/prebuilds/${platform}-${arch}/*.node",
"node_modules/@signalapp/libsignal-client/prebuilds/${platform}-${arch}/*.node",
"node_modules/ringrtc/build/${platform}/*${arch}*.node",
"node_modules/mac-screen-capture-permissions/build/Release/*.node",
"!**/node_modules/react-dom/*/*.development.js",
Expand Down
4 changes: 2 additions & 2 deletions scripts/esbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ const bundleDefaults = {
bundle: true,
external: [
// Native libraries
'@signalapp/signal-client',
'@signalapp/signal-client/zkgroup',
'@signalapp/libsignal-client',
'@signalapp/libsignal-client/zkgroup',
'better-sqlite3',
'electron',
'fs-xattr',
Expand Down
5 changes: 4 additions & 1 deletion scripts/generate-acknowledgments.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ const {
optionalDependencies = {},
} = require('../package.json');

const SKIPPED_DEPENDENCIES = new Set(['ringrtc', '@signalapp/signal-client']);
const SKIPPED_DEPENDENCIES = new Set([
'ringrtc',
'@signalapp/libsignal-client',
]);

const rootDir = join(__dirname, '..');
const nodeModulesPath = join(rootDir, 'node_modules');
Expand Down
2 changes: 1 addition & 1 deletion ts/Crypto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Buffer } from 'buffer';
import pProps from 'p-props';
import { chunk } from 'lodash';
import Long from 'long';
import { HKDF } from '@signalapp/signal-client';
import { HKDF } from '@signalapp/libsignal-client';

import * as Bytes from './Bytes';
import { calculateAgreement, generateKeyPair } from './Curve';
Expand Down
2 changes: 1 addition & 1 deletion ts/Curve.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only

import * as client from '@signalapp/signal-client';
import * as client from '@signalapp/libsignal-client';

import * as Bytes from './Bytes';
import { constantTimeEqual } from './Crypto';
Expand Down
4 changes: 2 additions & 2 deletions ts/LibSignalStores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type {
SessionRecord,
SignedPreKeyRecord,
Uuid,
} from '@signalapp/signal-client';
} from '@signalapp/libsignal-client';
import {
IdentityKeyStore,
PreKeyStore,
Expand All @@ -22,7 +22,7 @@ import {
SenderKeyStore,
SessionStore,
SignedPreKeyStore,
} from '@signalapp/signal-client';
} from '@signalapp/libsignal-client';
import { freezePreKey, freezeSignedPreKey } from './SignalProtocolStore';
import { Address } from './types/Address';
import { QualifiedAddress } from './types/QualifiedAddress';
Expand Down
2 changes: 1 addition & 1 deletion ts/SignalProtocolStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
SenderKeyRecord,
SessionRecord,
SignedPreKeyRecord,
} from '@signalapp/signal-client';
} from '@signalapp/libsignal-client';

import * as Bytes from './Bytes';
import { constantTimeEqual } from './Crypto';
Expand Down
2 changes: 1 addition & 1 deletion ts/groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
values,
} from 'lodash';
import Long from 'long';
import type { ClientZkGroupCipher } from '@signalapp/signal-client/zkgroup';
import type { ClientZkGroupCipher } from '@signalapp/libsignal-client/zkgroup';
import { v4 as getGuid } from 'uuid';
import LRU from 'lru-cache';
import PQueue from 'p-queue';
Expand Down
4 changes: 2 additions & 2 deletions ts/logging/set_up_renderer_logging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { createStream } from 'rotating-file-stream';
import {
initLogger,
LogLevel as SignalClientLogLevel,
} from '@signalapp/signal-client';
} from '@signalapp/libsignal-client';

import {
LogLevel,
Expand Down Expand Up @@ -137,7 +137,7 @@ initLogger(
} else if (file) {
fileString = ` ${file}`;
}
const logString = `@signalapp/signal-client ${message} ${target}${fileString}`;
const logString = `@signalapp/libsignal-client ${message} ${target}${fileString}`;

if (level === SignalClientLogLevel.Trace) {
log.trace(logString);
Expand Down
2 changes: 1 addition & 1 deletion ts/services/groupCredentialFetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: AGPL-3.0-only

import { last, sortBy } from 'lodash';
import { AuthCredentialResponse } from '@signalapp/signal-client/zkgroup';
import { AuthCredentialResponse } from '@signalapp/libsignal-client/zkgroup';

import { getClientZkAuthOperations } from '../util/zkgroup';

Expand Down
2 changes: 1 addition & 1 deletion ts/test-electron/Crypto_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ describe('Crypto', () => {
const result = deriveSecrets(input, salt, info);
assert.lengthOf(result, 3);
result.forEach(part => {
// This is a smoke test; HKDF is tested as part of @signalapp/signal-client.
// This is a smoke test; HKDF is tested as part of @signalapp/libsignal-client.
assert.instanceOf(part, Uint8Array);
assert.strictEqual(part.byteLength, 32);
});
Expand Down
2 changes: 1 addition & 1 deletion ts/test-electron/SignalProtocolStore_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
Direction,
SenderKeyRecord,
SessionRecord,
} from '@signalapp/signal-client';
} from '@signalapp/libsignal-client';

import { signal } from '../protobuf/compiled';
import { sessionStructureToBytes } from '../util/sessionTranslation';
Expand Down
2 changes: 1 addition & 1 deletion ts/textsecure.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2020-2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only

import { UnidentifiedSenderMessageContent } from '@signalapp/signal-client';
import { UnidentifiedSenderMessageContent } from '@signalapp/libsignal-client';

import MessageSender from './textsecure/SendMessage';
import SyncRequest from './textsecure/SyncRequest';
Expand Down
2 changes: 1 addition & 1 deletion ts/textsecure/CDSSocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { EventEmitter } from 'events';
import { noop } from 'lodash';
import { Readable } from 'stream';
import type { HsmEnclaveClient } from '@signalapp/signal-client';
import type { HsmEnclaveClient } from '@signalapp/libsignal-client';
import type { connection as WebSocket } from 'websocket';
import Long from 'long';

Expand Down
9 changes: 3 additions & 6 deletions ts/textsecure/CDSSocketManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
// SPDX-License-Identifier: AGPL-3.0-only

import ProxyAgent from 'proxy-agent';
import { HsmEnclaveClient, PublicKey } from '@signalapp/signal-client';
import { HsmEnclaveClient } from '@signalapp/libsignal-client';
import type { connection as WebSocket } from 'websocket';

import * as Bytes from '../Bytes';
import { prefixPublicKey } from '../Curve';
import type { AbortableProcess } from '../util/AbortableProcess';
import * as durations from '../util/durations';
import { getBasicAuth } from '../util/getBasicAuth';
Expand All @@ -32,7 +31,7 @@ export type CDSSocketManagerOptionsType = Readonly<{
export type CDSResponseType = CDSSocketDictionaryType;

export class CDSSocketManager {
private readonly publicKey: PublicKey;
private readonly publicKey: Buffer;

private readonly codeHashes: Array<Buffer>;

Expand All @@ -41,9 +40,7 @@ export class CDSSocketManager {
private retryAfter?: number;

constructor(private readonly options: CDSSocketManagerOptionsType) {
this.publicKey = PublicKey.deserialize(
Buffer.from(prefixPublicKey(Bytes.fromHex(options.publicKey)))
);
this.publicKey = Buffer.from(Bytes.fromHex(options.publicKey));
this.codeHashes = options.codeHashes.map(hash =>
Buffer.from(Bytes.fromHex(hash))
);
Expand Down
4 changes: 2 additions & 2 deletions ts/textsecure/MessageReceiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {
SealedSenderDecryptionResult,
SenderCertificate,
UnidentifiedSenderMessageContent,
} from '@signalapp/signal-client';
} from '@signalapp/libsignal-client';
import {
CiphertextMessageType,
DecryptionErrorMessage,
Expand All @@ -28,7 +28,7 @@ import {
signalDecrypt,
signalDecryptPreKey,
SignalMessage,
} from '@signalapp/signal-client';
} from '@signalapp/libsignal-client';

import {
IdentityKeys,
Expand Down
4 changes: 2 additions & 2 deletions ts/textsecure/OutgoingMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import { z } from 'zod';
import type {
CiphertextMessage,
PlaintextContent,
} from '@signalapp/signal-client';
} from '@signalapp/libsignal-client';
import {
CiphertextMessageType,
ProtocolAddress,
sealedSenderEncrypt,
SenderCertificate,
signalEncrypt,
UnidentifiedSenderMessageContent,
} from '@signalapp/signal-client';
} from '@signalapp/libsignal-client';

import type { WebAPIType, MessageType } from './WebAPI';
import type { SendMetadataType, SendOptionsType } from './SendMessage';
Expand Down
4 changes: 2 additions & 2 deletions ts/textsecure/SendMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import { z } from 'zod';
import type { Dictionary } from 'lodash';
import Long from 'long';
import PQueue from 'p-queue';
import type { PlaintextContent } from '@signalapp/signal-client';
import type { PlaintextContent } from '@signalapp/libsignal-client';
import {
ProtocolAddress,
SenderKeyDistributionMessage,
} from '@signalapp/signal-client';
} from '@signalapp/libsignal-client';

import { GLOBAL_ZONE } from '../SignalProtocolStore';
import { assert } from '../util/assert';
Expand Down
2 changes: 1 addition & 1 deletion ts/textsecure/getKeysForIdentifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
processPreKeyBundle,
ProtocolAddress,
PublicKey,
} from '@signalapp/signal-client';
} from '@signalapp/libsignal-client';

import {
UnregisteredUserError,
Expand Down
2 changes: 1 addition & 1 deletion ts/textsecure/messageReceiverEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: AGPL-3.0-only
/* eslint-disable max-classes-per-file */

import type { PublicKey } from '@signalapp/signal-client';
import type { PublicKey } from '@signalapp/libsignal-client';

import type { SignalService as Proto } from '../protobuf';
import type {
Expand Down
2 changes: 1 addition & 1 deletion ts/updater/curve.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2019-2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only

import { PrivateKey, PublicKey } from '@signalapp/signal-client';
import { PrivateKey, PublicKey } from '@signalapp/libsignal-client';

export function keyPair(): Record<string, Buffer> {
const privKey = PrivateKey.generate();
Expand Down
2 changes: 1 addition & 1 deletion ts/util/getProfile.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2020-2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only

import type { ProfileKeyCredentialRequestContext } from '@signalapp/signal-client/zkgroup';
import type { ProfileKeyCredentialRequestContext } from '@signalapp/libsignal-client/zkgroup';
import { SEALED_SENDER } from '../types/SealedSender';
import * as Errors from '../types/errors';
import type {
Expand Down
2 changes: 1 addition & 1 deletion ts/util/handleRetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import {
DecryptionErrorMessage,
PlaintextContent,
} from '@signalapp/signal-client';
} from '@signalapp/libsignal-client';
import { isNumber } from 'lodash';

import * as Bytes from '../Bytes';
Expand Down
2 changes: 1 addition & 1 deletion ts/util/lint/linter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const excludedFilesRegexp = RegExp(
'^.github/.+',

// Modules we trust
'^node_modules/@signalapp/signal-client/.+',
'^node_modules/@signalapp/libsignal-client/.+',
'^node_modules/core-js-pure/.+',
'^node_modules/core-js/.+',
'^node_modules/fbjs/.+',
Expand Down
2 changes: 1 addition & 1 deletion ts/util/safetyNumber.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only

import { PublicKey, Fingerprint } from '@signalapp/signal-client';
import { PublicKey, Fingerprint } from '@signalapp/libsignal-client';
import type { ConversationType } from '../state/ducks/conversations';
import { UUID } from '../types/UUID';

Expand Down
2 changes: 1 addition & 1 deletion ts/util/sendToGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
sealedSenderMultiRecipientEncrypt,
SenderCertificate,
UnidentifiedSenderMessageContent,
} from '@signalapp/signal-client';
} from '@signalapp/libsignal-client';
import * as Bytes from '../Bytes';
import { senderCertificateService } from '../services/senderCertificate';
import type { SendLogCallbackType } from '../textsecure/OutgoingMessage';
Expand Down
6 changes: 3 additions & 3 deletions ts/util/zkgroup.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2020-2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only

import type { ProfileKeyCredentialRequestContext } from '@signalapp/signal-client/zkgroup';
import type { ProfileKeyCredentialRequestContext } from '@signalapp/libsignal-client/zkgroup';
import {
AuthCredential,
ClientZkAuthOperations,
Expand All @@ -17,11 +17,11 @@ import {
ServerPublicParams,
UuidCiphertext,
NotarySignature,
} from '@signalapp/signal-client/zkgroup';
} from '@signalapp/libsignal-client/zkgroup';
import { UUID } from '../types/UUID';
import type { UUIDStringType } from '../types/UUID';

export * from '@signalapp/signal-client/zkgroup';
export * from '@signalapp/libsignal-client/zkgroup';

// Scenarios

Expand Down

0 comments on commit 5a107e1

Please sign in to comment.