Socket
Socket
Sign inDemoInstall

@signalapp/libsignal-client

Package Overview
Dependencies
3
Maintainers
6
Versions
50
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.40.1 to 0.41.0

3

dist/Address.d.ts
/// <reference types="node" />
import * as Native from '../Native';
declare enum ServiceIdKind {
export declare enum ServiceIdKind {
Aci = 0,

@@ -49,2 +49,1 @@ Pni = 1

}
export {};

@@ -7,3 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.ProtocolAddress = exports.Pni = exports.Aci = exports.ServiceId = void 0;
exports.ProtocolAddress = exports.Pni = exports.Aci = exports.ServiceId = exports.ServiceIdKind = void 0;
const Native = require("../Native");

@@ -15,3 +15,3 @@ const uuid = require("uuid");

ServiceIdKind[ServiceIdKind["Pni"] = 1] = "Pni";
})(ServiceIdKind || (ServiceIdKind = {}));
})(ServiceIdKind = exports.ServiceIdKind || (exports.ServiceIdKind = {}));
const SERVICE_ID_FIXED_WIDTH_BINARY_LEN = 17;

@@ -18,0 +18,0 @@ class ServiceId extends Object {

@@ -30,3 +30,6 @@ import { ProtocolAddress } from './Address';

InvalidUsernameLinkEncryptedData = 25,
RateLimitedError = 26
RateLimitedError = 26,
SvrDataMissing = 27,
SvrRequestFailed = 28,
SvrRestoreFailed = 29
}

@@ -126,2 +129,11 @@ export declare class LibSignalErrorBase extends Error {

};
export type LibSignalError = GenericError | DuplicatedMessageError | SealedSenderSelfSendError | UntrustedIdentityError | InvalidRegistrationIdError | VerificationFailedError | InvalidSessionError | InvalidSenderKeySessionError | NicknameCannotBeEmptyError | CannotStartWithDigitError | MissingSeparatorError | BadNicknameCharacterError | NicknameTooShortError | NicknameTooLongError | DiscriminatorCannotBeEmptyError | DiscriminatorCannotBeZeroError | DiscriminatorCannotBeSingleDigitError | DiscriminatorCannotHaveLeadingZerosError | BadDiscriminatorCharacterError | DiscriminatorTooLargeError | InputDataTooLong | InvalidEntropyDataLength | InvalidUsernameLinkEncryptedData | IoError | InvalidMediaInputError | UnsupportedMediaInputError;
export type SvrDataMissingError = LibSignalErrorBase & {
code: ErrorCode.SvrDataMissing;
};
export type SvrRequestFailedError = LibSignalErrorCommon & {
code: ErrorCode.SvrRequestFailed;
};
export type SvrRestoreFailedError = LibSignalErrorCommon & {
code: ErrorCode.SvrRestoreFailed;
};
export type LibSignalError = GenericError | DuplicatedMessageError | SealedSenderSelfSendError | UntrustedIdentityError | InvalidRegistrationIdError | VerificationFailedError | InvalidSessionError | InvalidSenderKeySessionError | NicknameCannotBeEmptyError | CannotStartWithDigitError | MissingSeparatorError | BadNicknameCharacterError | NicknameTooShortError | NicknameTooLongError | DiscriminatorCannotBeEmptyError | DiscriminatorCannotBeZeroError | DiscriminatorCannotBeSingleDigitError | DiscriminatorCannotHaveLeadingZerosError | BadDiscriminatorCharacterError | DiscriminatorTooLargeError | InputDataTooLong | InvalidEntropyDataLength | InvalidUsernameLinkEncryptedData | IoError | InvalidMediaInputError | SvrDataMissingError | SvrRestoreFailedError | SvrRequestFailedError | UnsupportedMediaInputError;

@@ -38,2 +38,5 @@ "use strict";

ErrorCode[ErrorCode["RateLimitedError"] = 26] = "RateLimitedError";
ErrorCode[ErrorCode["SvrDataMissing"] = 27] = "SvrDataMissing";
ErrorCode[ErrorCode["SvrRequestFailed"] = 28] = "SvrRequestFailed";
ErrorCode[ErrorCode["SvrRestoreFailed"] = 29] = "SvrRestoreFailed";
})(ErrorCode = exports.ErrorCode || (exports.ErrorCode = {}));

@@ -40,0 +43,0 @@ class LibSignalErrorBase extends Error {

@@ -352,3 +352,3 @@ /// <reference types="node" />

}
interface CiphertextMessageConvertible {
export interface CiphertextMessageConvertible {
asCiphertextMessage(): CiphertextMessage;

@@ -391,3 +391,3 @@ }

export declare function sealedSenderEncrypt(content: UnidentifiedSenderMessageContent, address: ProtocolAddress, identityStore: IdentityKeyStore): Promise<Buffer>;
type SealedSenderMultiRecipientEncryptOptions = {
export type SealedSenderMultiRecipientEncryptOptions = {
content: UnidentifiedSenderMessageContent;

@@ -394,0 +394,0 @@ recipients: ProtocolAddress[];

@@ -44,2 +44,6 @@ /// <reference types="node" />

}
export declare enum Purpose {
DeviceTransfer = 0,
RemoteBackup = 1
}
/**

@@ -49,2 +53,3 @@ * Validate a backup file

* @param backupKey The key to use to decrypt the backup contents.
* @param purpose Whether the backup is intended for device-to-device transfer or remote storage.
* @param inputFactory A function that returns new input streams that read the backup contents.

@@ -55,2 +60,2 @@ * @param length The exact length of the input stream.

*/
export declare function validate(backupKey: MessageBackupKey, inputFactory: InputStreamFactory, length: bigint): Promise<ValidationOutcome>;
export declare function validate(backupKey: MessageBackupKey, purpose: Purpose, inputFactory: InputStreamFactory, length: bigint): Promise<ValidationOutcome>;

@@ -7,3 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.validate = exports.MessageBackupKey = exports.ValidationOutcome = void 0;
exports.validate = exports.Purpose = exports.MessageBackupKey = exports.ValidationOutcome = void 0;
/**

@@ -15,3 +15,2 @@ * Message backup validation routines.

const Native = require("../Native");
const BigIntUtil_1 = require("./zkgroup/internal/BigIntUtil");
/**

@@ -50,2 +49,8 @@ * Result of validating a message backup bundle.

exports.MessageBackupKey = MessageBackupKey;
// This must match the Rust version of the enum.
var Purpose;
(function (Purpose) {
Purpose[Purpose["DeviceTransfer"] = 0] = "DeviceTransfer";
Purpose[Purpose["RemoteBackup"] = 1] = "RemoteBackup";
})(Purpose = exports.Purpose || (exports.Purpose = {}));
/**

@@ -55,2 +60,3 @@ * Validate a backup file

* @param backupKey The key to use to decrypt the backup contents.
* @param purpose Whether the backup is intended for device-to-device transfer or remote storage.
* @param inputFactory A function that returns new input streams that read the backup contents.

@@ -61,8 +67,8 @@ * @param length The exact length of the input stream.

*/
async function validate(backupKey, inputFactory, length) {
async function validate(backupKey, purpose, inputFactory, length) {
const firstStream = inputFactory();
const secondStream = inputFactory();
return new ValidationOutcome(await Native.MessageBackupValidator_Validate(backupKey, firstStream, secondStream, (0, BigIntUtil_1.bufferFromBigUInt64BE)(length)));
return new ValidationOutcome(await Native.MessageBackupValidator_Validate(backupKey, firstStream, secondStream, length, purpose));
}
exports.validate = validate;
//# sourceMappingURL=MessageBackup.js.map

@@ -37,3 +37,3 @@ /// <reference types="node" />

* Get the sanitized metadata, if any.
* @returns The sanitized metadata, or {@code null} if it didn't need to be sanitized.
* @returns The sanitized metadata, or `null` if it didn't need to be sanitized.
*/

@@ -56,8 +56,8 @@ getMetadata(): Buffer | null;

* @param input An MP4 format input stream.
* @param length The exact length of the input stream.
* @param len The exact length of the input stream.
* @returns The sanitized metadata.
* @throws IoError If an IO error on the input occurs.
* @throws InvalidMediaInputError If the input could not be parsed because it was invalid.
* @throws UnsupportedMediaInputError If the input could not be parsed because it's unsupported in some way.
* @throws {IoError} If an IO error on the input occurs.
* @throws {InvalidMediaInputError} If the input could not be parsed because it was invalid.
* @throws {UnsupportedMediaInputError} If the input could not be parsed because it's unsupported in some way.
*/
export declare function sanitize(input: InputStream, len: bigint): Promise<SanitizedMetadata>;

@@ -36,3 +36,2 @@ "use strict";

const Native = require("../Native");
const BigIntUtil_1 = require("./zkgroup/internal/BigIntUtil");
class SanitizedMetadata {

@@ -47,3 +46,3 @@ constructor(handle) {

* Get the sanitized metadata, if any.
* @returns The sanitized metadata, or {@code null} if it didn't need to be sanitized.
* @returns The sanitized metadata, or `null` if it didn't need to be sanitized.
*/

@@ -62,4 +61,3 @@ getMetadata() {

getDataOffset() {
const buffer = Native.SanitizedMetadata_GetDataOffset(this);
return buffer.readBigUInt64BE();
return Native.SanitizedMetadata_GetDataOffset(this);
}

@@ -71,4 +69,3 @@ /**

getDataLen() {
const buffer = Native.SanitizedMetadata_GetDataLen(this);
return buffer.readBigUInt64BE();
return Native.SanitizedMetadata_GetDataLen(this);
}

@@ -81,10 +78,10 @@ }

* @param input An MP4 format input stream.
* @param length The exact length of the input stream.
* @param len The exact length of the input stream.
* @returns The sanitized metadata.
* @throws IoError If an IO error on the input occurs.
* @throws InvalidMediaInputError If the input could not be parsed because it was invalid.
* @throws UnsupportedMediaInputError If the input could not be parsed because it's unsupported in some way.
* @throws {IoError} If an IO error on the input occurs.
* @throws {InvalidMediaInputError} If the input could not be parsed because it was invalid.
* @throws {UnsupportedMediaInputError} If the input could not be parsed because it's unsupported in some way.
*/
async function sanitize(input, len) {
const sanitizedMetadataNativeHandle = await Native.Mp4Sanitizer_Sanitize(input, (0, BigIntUtil_1.bufferFromBigUInt64BE)(len));
const sanitizedMetadataNativeHandle = await Native.Mp4Sanitizer_Sanitize(input, len);
return SanitizedMetadata._fromNativeHandle(sanitizedMetadataNativeHandle);

@@ -91,0 +88,0 @@ }

@@ -0,2 +1,4 @@

/// <reference types="node" />
import type { ReadonlyDeep } from 'type-fest';
import * as Native from '../Native';
export declare enum Environment {

@@ -6,3 +8,3 @@ Staging = 0,

}
export type CDSAuthType = {
export type ServiceAuth = {
username: string;

@@ -29,7 +31,120 @@ password: string;

}
export type ChatRequest = Readonly<{
verb: string;
path: string;
headers: ReadonlyArray<[string, string]>;
body?: Uint8Array;
timeoutMillis?: number;
}>;
export declare class Net {
private readonly _asyncContext;
private readonly _chatService;
private readonly _connectionManager;
/**
* Instance of the {@link Svr3Client} to access SVR3.
*/
svr3: Svr3Client;
constructor(env: Environment);
cdsiLookup({ username, password }: Readonly<CDSAuthType>, { e164s, acisAndAccessKeys, timeout, returnAcisWithoutUaks, }: ReadonlyDeep<CDSRequestOptionsType>): Promise<CDSResponseType<string, string>>;
disconnectChatService(): Promise<void>;
unauthenticatedFetchAndDebug(chatRequest: ChatRequest): Promise<Native.ResponseAndDebugInfo>;
unauthenticatedFetch(chatRequest: ChatRequest): Promise<Native.Response>;
static buildHttpRequest(chatRequest: ChatRequest): {
_nativeHandle: Native.HttpRequest;
};
cdsiLookup({ username, password }: Readonly<ServiceAuth>, { e164s, acisAndAccessKeys, timeout, returnAcisWithoutUaks, }: ReadonlyDeep<CDSRequestOptionsType>): Promise<CDSResponseType<string, string>>;
}
/**
* This interface provides functionality for communicating with SVR3
*
* Its instance can be obtained from an {@link Net#svr3} property
* of the {@link Net} class.
*
* Example usage:
*
* @example
* ```ts
* import { Environment, Net } from '../net';
* // Obtain an instance
* const SVR3 = new Net(Environment.Staging).svr3;
* // Instantiate ServiceAuth with the username and password obtained from the Chat Server.
* const auth = { username: USERNAME, password: ENCLAVE_PASSWORD };
* // Store a value in SVR3. Here 10 is the number of permitted restore attempts.
* const shareSet = await SVR3.backup(SECRET_TO_BE_STORED, PASSWORD, 10, auth, TIMEOUT);
* const restoredSecret = await SVR3.restore( PASSWORD, shareSet, auth, TIMEOUT);
* ```
*/
export interface Svr3Client {
/**
* Backup a secret to SVR3.
*
* Error messages are expected to be log-safe and not contain any sensitive
* data.
*
* @param what - The secret to be stored. Must be 32 bytes long.
* @param password - User-provided password that will be used to derive the
* encryption key for the secret.
* @param maxTries - Number of times the secret will be allowed to be guessed.
* Each call to {@link Svr3Client#restore} that has reached the server will
* decrement the counter. Must be positive.
* @param auth - An instance of {@link ServiceAuth} containing the username
* and password obtained from the Chat Server. The password is an OTP which is
* generally good for about 15 minutes, therefore it can be reused for the
* subsequent calls to either backup or restore that are not too far apart in
* time.
* @param opTimeoutMs - The maximum wall time libsignal is allowed to spend
* communicating with SVR3 service.
* @returns A `Promise` which--when awaited--will return a byte array with a
* serialized masked share set. It is supposed to be an opaque blob for the
* clients and therefore no assumptions should be made about its contents.
* This byte array should be stored by the clients and used to restore the
* secret along with the password. Please note that masked share set does not
* have to be treated as secret.
*
* The returned `Promise` can also fail due to the network issues (including the
* timeout), problems establishing the Noise connection to the enclaves, or
* invalid arguments' values. {@link IoError} errors can, in general, be
* retried, although there is already a retry-with-backoff mechanism inside
* libsignal used to connect to the SVR3 servers. Other exceptions are caused
* by the bad input or data missing on the server. They are therefore
* non-actionable and are guaranteed to be thrown again when retried.
*/
backup(what: Buffer, password: string, maxTries: number, auth: Readonly<ServiceAuth>, opTimeoutMs: number): Promise<Buffer>;
/**
* Restore a secret from SVR3.
*
* Error messages are expected to be log-safe and not contain any sensitive
* data.
*
* @param password - User-provided password that will be used to derive the
* decryption key for the secret.
* @param shareSet - a serialized masked share set returned by a call to
* {@link Svr3Client#backup}.
* @param auth - An instance of {@link ServiceAuth} containing the username
* and password obtained from the Chat Server. The password is an OTP which is
* generally good for about 15 minutes, therefore it can be reused for the
* subsequent calls to either backup or restore that are not too far apart in
* time.
* @param opTimeoutMs - The maximum wall time libsignal is allowed to spend
* communicating with SVR3 service.
* @returns A `Promise` which--when awaited--will return a byte array with the
* restored secret.
*
* The returned `Promise` can also fail due to the network issues (including the
* timeout), problems establishing the Noise connection to the enclaves, or
* invalid arguments' values. {@link IoError} errors can, in general, be
* retried, although there is already a retry-with-backoff mechanism inside
* libsignal used to connect to the SVR3 servers. Other exceptions are caused
* by the bad input or data missing on the server. They are therefore
* non-actionable and are guaranteed to be thrown again when retried.
*
* - {@link SvrDataMissingError} is returned when the maximum restore attempts
* number has been exceeded or if the value has never been backed up.
* - {@link SvrRestoreFailedError} is returned when the combination of the
* password and masked share set does not result in successful restoration
* of the secret.
* - {@link SvrRequestFailedError} is returned when the de-serialization of a
* masked share set fails, or when the server requests fail for reasons
* other than "maximum attempts exceeded".
*/
restore(password: string, shareSet: Buffer, auth: Readonly<ServiceAuth>, opTimeoutMs: number): Promise<Buffer>;
}

@@ -10,2 +10,3 @@ "use strict";

const Address_1 = require("./Address");
const DEFAULT_CHAT_REQUEST_TIMEOUT_MILLIS = 5000;
// This must match the libsignal-bridge Rust enum of the same name.

@@ -19,5 +20,32 @@ var Environment;

constructor(env) {
this._asyncContext = Native.TokioAsyncContext_new();
this._connectionManager = Native.ConnectionManager_new(env);
this._asyncContext = { _nativeHandle: Native.TokioAsyncContext_new() };
this._connectionManager = {
_nativeHandle: Native.ConnectionManager_new(env),
};
this._chatService = {
_nativeHandle: Native.ChatService_new(this._connectionManager, '', ''),
};
this.svr3 = new Svr3ClientImpl(this._asyncContext, this._connectionManager);
}
async disconnectChatService() {
await Native.ChatService_disconnect(this._asyncContext, this._chatService);
}
async unauthenticatedFetchAndDebug(chatRequest) {
return await Native.ChatService_unauth_send_and_debug(this._asyncContext, this._chatService, Net.buildHttpRequest(chatRequest), chatRequest.timeoutMillis ?? DEFAULT_CHAT_REQUEST_TIMEOUT_MILLIS);
}
async unauthenticatedFetch(chatRequest) {
return await Native.ChatService_unauth_send(this._asyncContext, this._chatService, Net.buildHttpRequest(chatRequest), chatRequest.timeoutMillis ?? DEFAULT_CHAT_REQUEST_TIMEOUT_MILLIS);
}
static buildHttpRequest(chatRequest) {
const { verb, path, body, headers } = chatRequest;
const bodyBuffer = body !== undefined ? Buffer.from(body) : null;
const httpRequest = {
_nativeHandle: Native.HttpRequest_new(verb, path, bodyBuffer),
};
headers.forEach((header) => {
const [name, value] = header;
Native.HttpRequest_add_header(httpRequest, name, value);
});
return httpRequest;
}
async cdsiLookup({ username, password }, { e164s, acisAndAccessKeys, timeout, returnAcisWithoutUaks, }) {

@@ -32,7 +60,21 @@ const request = { _nativeHandle: Native.LookupRequest_new() };

Native.LookupRequest_setReturnAcisWithoutUaks(request, returnAcisWithoutUaks);
const lookup = await Native.CdsiLookup_new({ _nativeHandle: this._asyncContext }, { _nativeHandle: this._connectionManager }, username, password, request, timeout);
return await Native.CdsiLookup_complete({ _nativeHandle: this._asyncContext }, { _nativeHandle: lookup });
const lookup = await Native.CdsiLookup_new(this._asyncContext, this._connectionManager, username, password, request, timeout);
return await Native.CdsiLookup_complete(this._asyncContext, {
_nativeHandle: lookup,
});
}
}
exports.Net = Net;
class Svr3ClientImpl {
constructor(_asyncContext, _connectionManager) {
this._asyncContext = _asyncContext;
this._connectionManager = _connectionManager;
}
async backup(what, password, maxTries, auth, opTimeoutMs) {
return Native.Svr3Backup(this._asyncContext, this._connectionManager, what, password, maxTries, auth.username, auth.password, opTimeoutMs);
}
async restore(password, shareSet, auth, opTimeoutMs) {
return Native.Svr3Restore(this._asyncContext, this._connectionManager, password, shareSet, auth.username, auth.password, opTimeoutMs);
}
}
//# sourceMappingURL=net.js.map

@@ -6,7 +6,6 @@ /// <reference types="node" />

* @param input A WebP format input stream.
* @param length The exact length of the input stream.
* @throws IoError If an IO error on the input occurs.
* @throws InvalidMediaInputError If the input could not be parsed because it was invalid.
* @throws UnsupportedMediaInputError If the input could not be parsed because it's unsupported in some way.
* @throws {IoError} If an IO error on the input occurs.
* @throws {InvalidMediaInputError} If the input could not be parsed because it was invalid.
* @throws {UnsupportedMediaInputError} If the input could not be parsed because it's unsupported in some way.
*/
export declare function sanitize(input: Buffer): void;

@@ -21,6 +21,5 @@ "use strict";

* @param input A WebP format input stream.
* @param length The exact length of the input stream.
* @throws IoError If an IO error on the input occurs.
* @throws InvalidMediaInputError If the input could not be parsed because it was invalid.
* @throws UnsupportedMediaInputError If the input could not be parsed because it's unsupported in some way.
* @throws {IoError} If an IO error on the input occurs.
* @throws {InvalidMediaInputError} If the input could not be parsed because it was invalid.
* @throws {UnsupportedMediaInputError} If the input could not be parsed because it's unsupported in some way.
*/

@@ -27,0 +26,0 @@ function sanitize(input) {

@@ -12,3 +12,2 @@ "use strict";

const BackupAuthCredentialResponse_1 = require("./BackupAuthCredentialResponse");
const BigIntUtil_1 = require("../internal/BigIntUtil");
class BackupAuthCredentialRequest extends ByteArray_1.default {

@@ -23,3 +22,3 @@ constructor(contents) {

issueCredentialWithRandom(timestamp, receiptLevel, params, random) {
return new BackupAuthCredentialResponse_1.default(Native.BackupAuthCredentialRequest_IssueDeterministic(this.contents, timestamp, (0, BigIntUtil_1.bufferFromBigUInt64BE)(receiptLevel), params.contents, random));
return new BackupAuthCredentialResponse_1.default(Native.BackupAuthCredentialRequest_IssueDeterministic(this.contents, timestamp, receiptLevel, params.contents, random));
}

@@ -26,0 +25,0 @@ }

@@ -12,3 +12,2 @@ "use strict";

const BackupAuthCredential_1 = require("./BackupAuthCredential");
const BigIntUtil_1 = require("../internal/BigIntUtil");
class BackupAuthCredentialRequestContext extends ByteArray_1.default {

@@ -25,3 +24,3 @@ constructor(contents) {

receive(response, params, expectedReceiptLevel) {
return new BackupAuthCredential_1.default(Native.BackupAuthCredentialRequestContext_ReceiveResponse(this.contents, response.contents, params.contents, (0, BigIntUtil_1.bufferFromBigUInt64BE)(expectedReceiptLevel)));
return new BackupAuthCredential_1.default(Native.BackupAuthCredentialRequestContext_ReceiveResponse(this.contents, response.contents, params.contents, expectedReceiptLevel));
}

@@ -28,0 +27,0 @@ }

@@ -17,3 +17,3 @@ "use strict";

getReceiptLevel() {
return Native.ReceiptCredential_GetReceiptLevel(this.contents).readBigUInt64BE();
return Native.ReceiptCredential_GetReceiptLevel(this.contents);
}

@@ -20,0 +20,0 @@ }

@@ -18,3 +18,3 @@ "use strict";

getReceiptLevel() {
return Native.ReceiptCredentialPresentation_GetReceiptLevel(this.contents).readBigUInt64BE();
return Native.ReceiptCredentialPresentation_GetReceiptLevel(this.contents);
}

@@ -21,0 +21,0 @@ getReceiptSerialBytes() {

@@ -10,3 +10,2 @@ "use strict";

const Constants_1 = require("../internal/Constants");
const BigIntUtil_1 = require("../internal/BigIntUtil");
const ReceiptCredentialResponse_1 = require("./ReceiptCredentialResponse");

@@ -22,3 +21,3 @@ class ServerZkReceiptOperations {

issueReceiptCredentialWithRandom(random, receiptCredentialRequest, receiptExpirationTime, receiptLevel) {
return new ReceiptCredentialResponse_1.default(Native.ServerSecretParams_IssueReceiptCredentialDeterministic(this.serverSecretParams.getContents(), random, receiptCredentialRequest.getContents(), receiptExpirationTime, (0, BigIntUtil_1.bufferFromBigUInt64BE)(receiptLevel)));
return new ReceiptCredentialResponse_1.default(Native.ServerSecretParams_IssueReceiptCredentialDeterministic(this.serverSecretParams.getContents(), random, receiptCredentialRequest.getContents(), receiptExpirationTime, receiptLevel));
}

@@ -25,0 +24,0 @@ verifyReceiptCredentialPresentation(receiptCredentialPresentation) {

@@ -24,2 +24,20 @@ //

interface Response {
status: number;
message: string | undefined;
headers: ReadonlyArray<[string, string]>;
body: Buffer | undefined;
}
interface DebugInfo {
connectionReused: boolean;
reconnectCount: number;
ipType: number;
}
interface ResponseAndDebugInfo {
response: Response;
debugInfo: DebugInfo;
}
interface SealedSenderMultiRecipientMessageRecipient {

@@ -130,5 +148,5 @@ deviceIds: number[];

export function BackupAuthCredentialRequestContext_New(backupKey: Buffer, uuid: Uuid): Buffer;
export function BackupAuthCredentialRequestContext_ReceiveResponse(contextBytes: Buffer, responseBytes: Buffer, paramsBytes: Buffer, expectedReceiptLevel: Buffer): Buffer;
export function BackupAuthCredentialRequestContext_ReceiveResponse(contextBytes: Buffer, responseBytes: Buffer, paramsBytes: Buffer, expectedReceiptLevel: bigint): Buffer;
export function BackupAuthCredentialRequest_CheckValidContents(requestBytes: Buffer): void;
export function BackupAuthCredentialRequest_IssueDeterministic(requestBytes: Buffer, redemptionTime: Timestamp, receiptLevel: Buffer, paramsBytes: Buffer, randomness: Buffer): Buffer;
export function BackupAuthCredentialRequest_IssueDeterministic(requestBytes: Buffer, redemptionTime: Timestamp, receiptLevel: bigint, paramsBytes: Buffer, randomness: Buffer): Buffer;
export function BackupAuthCredentialResponse_CheckValidContents(responseBytes: Buffer): void;

@@ -155,2 +173,6 @@ export function BackupAuthCredential_CheckValidContents(paramsBytes: Buffer): void;

export function CdsiLookup_token(lookup: Wrapper<CdsiLookup>): Buffer;
export function ChatService_disconnect(asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<Chat>): Promise<void>;
export function ChatService_new(connectionManager: Wrapper<ConnectionManager>, username: string, password: string): Chat;
export function ChatService_unauth_send(asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<Chat>, httpRequest: Wrapper<HttpRequest>, timeoutMillis: number): Promise<Response>;
export function ChatService_unauth_send_and_debug(asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<Chat>, httpRequest: Wrapper<HttpRequest>, timeoutMillis: number): Promise<ResponseAndDebugInfo>;
export function CiphertextMessage_FromPlaintextContent(m: Wrapper<PlaintextContent>): CiphertextMessage;

@@ -171,2 +193,4 @@ export function CiphertextMessage_Serialize(obj: Wrapper<CiphertextMessage>): Buffer;

export function CreateCallLinkCredential_PresentDeterministic(credentialBytes: Buffer, roomId: Buffer, userId: Buffer, serverParamsBytes: Buffer, callLinkParamsBytes: Buffer, randomness: Buffer): Buffer;
export function CreateOTP(username: string, secret: Buffer): string;
export function CreateOTPFromBase64(username: string, secret: string): string;
export function DecryptionErrorMessage_Deserialize(data: Buffer): DecryptionErrorMessage;

@@ -220,2 +244,4 @@ export function DecryptionErrorMessage_ExtractFromSerializedContent(bytes: Buffer): DecryptionErrorMessage;

export function HsmEnclaveClient_New(trustedPublicKey: Buffer, trustedCodeHashes: Buffer): HsmEnclaveClient;
export function HttpRequest_add_header(request: Wrapper<HttpRequest>, name: string, value: string): void;
export function HttpRequest_new(method: string, path: string, bodyAsSlice: Buffer | null): HttpRequest;
export function IdentityKeyPair_Deserialize(buffer: Buffer): {publicKey:PublicKey,privateKey:PrivateKey};

@@ -253,5 +279,5 @@ export function IdentityKeyPair_Serialize(publicKey: Wrapper<PublicKey>, privateKey: Wrapper<PrivateKey>): Buffer;

export function MessageBackupKey_New(masterKey: Buffer, aci: Buffer): MessageBackupKey;
export function MessageBackupValidator_Validate(key: Wrapper<MessageBackupKey>, firstStream: InputStream, secondStream: InputStream, len: Buffer): Promise<MessageBackupValidationOutcome>;
export function MessageBackupValidator_Validate(key: Wrapper<MessageBackupKey>, firstStream: InputStream, secondStream: InputStream, len: bigint, purpose: number): Promise<MessageBackupValidationOutcome>;
export function MinidumpToJSONString(buffer: Buffer): string;
export function Mp4Sanitizer_Sanitize(input: InputStream, len: Buffer): Promise<SanitizedMetadata>;
export function Mp4Sanitizer_Sanitize(input: InputStream, len: bigint): Promise<SanitizedMetadata>;
export function PlaintextContent_Deserialize(data: Buffer): PlaintextContent;

@@ -315,3 +341,3 @@ export function PlaintextContent_FromDecryptionErrorMessage(m: Wrapper<DecryptionErrorMessage>): PlaintextContent;

export function ReceiptCredentialPresentation_GetReceiptExpirationTime(presentation: Serialized<ReceiptCredentialPresentation>): Timestamp;
export function ReceiptCredentialPresentation_GetReceiptLevel(presentation: Serialized<ReceiptCredentialPresentation>): Buffer;
export function ReceiptCredentialPresentation_GetReceiptLevel(presentation: Serialized<ReceiptCredentialPresentation>): bigint;
export function ReceiptCredentialPresentation_GetReceiptSerial(presentation: Serialized<ReceiptCredentialPresentation>): Buffer;

@@ -324,5 +350,5 @@ export function ReceiptCredentialRequestContext_CheckValidContents(buffer: Buffer): void;

export function ReceiptCredential_GetReceiptExpirationTime(receiptCredential: Serialized<ReceiptCredential>): Timestamp;
export function ReceiptCredential_GetReceiptLevel(receiptCredential: Serialized<ReceiptCredential>): Buffer;
export function SanitizedMetadata_GetDataLen(sanitized: Wrapper<SanitizedMetadata>): Buffer;
export function SanitizedMetadata_GetDataOffset(sanitized: Wrapper<SanitizedMetadata>): Buffer;
export function ReceiptCredential_GetReceiptLevel(receiptCredential: Serialized<ReceiptCredential>): bigint;
export function SanitizedMetadata_GetDataLen(sanitized: Wrapper<SanitizedMetadata>): bigint;
export function SanitizedMetadata_GetDataOffset(sanitized: Wrapper<SanitizedMetadata>): bigint;
export function SanitizedMetadata_GetMetadata(sanitized: Wrapper<SanitizedMetadata>): Buffer;

@@ -398,3 +424,3 @@ export function ScannableFingerprint_Compare(fprint1: Buffer, fprint2: Buffer): boolean;

export function ServerSecretParams_IssueExpiringProfileKeyCredentialDeterministic(serverSecretParams: Serialized<ServerSecretParams>, randomness: Buffer, request: Serialized<ProfileKeyCredentialRequest>, userId: Buffer, commitment: Serialized<ProfileKeyCommitment>, expirationInSeconds: Timestamp): Serialized<ExpiringProfileKeyCredentialResponse>;
export function ServerSecretParams_IssueReceiptCredentialDeterministic(serverSecretParams: Serialized<ServerSecretParams>, randomness: Buffer, request: Serialized<ReceiptCredentialRequest>, receiptExpirationTime: Timestamp, receiptLevel: Buffer): Serialized<ReceiptCredentialResponse>;
export function ServerSecretParams_IssueReceiptCredentialDeterministic(serverSecretParams: Serialized<ServerSecretParams>, randomness: Buffer, request: Serialized<ReceiptCredentialRequest>, receiptExpirationTime: Timestamp, receiptLevel: bigint): Serialized<ReceiptCredentialResponse>;
export function ServerSecretParams_SignDeterministic(params: Serialized<ServerSecretParams>, randomness: Buffer, message: Buffer): Buffer;

@@ -440,4 +466,13 @@ export function ServerSecretParams_VerifyAuthCredentialPresentation(serverSecretParams: Serialized<ServerSecretParams>, groupPublicParams: Serialized<GroupPublicParams>, presentationBytes: Buffer, currentTimeInSeconds: Timestamp): void;

export function SignedPreKeyRecord_Serialize(obj: Wrapper<SignedPreKeyRecord>): Buffer;
export function Svr3Backup(asyncRuntime: Wrapper<TokioAsyncContext>, connectionManager: Wrapper<ConnectionManager>, secret: Buffer, password: string, maxTries: number, username: string, enclavePassword: string, opTimeoutMs: number): Promise<Buffer>;
export function Svr3Restore(asyncRuntime: Wrapper<TokioAsyncContext>, connectionManager: Wrapper<ConnectionManager>, password: string, shareSet: Buffer, username: string, enclavePassword: string, opTimeoutMs: number): Promise<Buffer>;
export function TESTING_CdsiLookupErrorConvert(): void;
export function TESTING_CdsiLookupResponseConvert(asyncRuntime: Wrapper<TokioAsyncContext>): Promise<LookupResponse>;
export function TESTING_ChatRequestGetBody(request: Wrapper<HttpRequest>): Buffer | null;
export function TESTING_ChatRequestGetHeaderValue(request: Wrapper<HttpRequest>, headerName: string): string;
export function TESTING_ChatRequestGetMethod(request: Wrapper<HttpRequest>): string;
export function TESTING_ChatRequestGetPath(request: Wrapper<HttpRequest>): string;
export function TESTING_ChatServiceDebugInfoConvert(): DebugInfo;
export function TESTING_ChatServiceErrorConvert(): void;
export function TESTING_ChatServiceResponseConvert(bodyPresent: boolean): Response;
export function TESTING_ErrorOnBorrowAsync(_input: null): Promise<void>;

@@ -497,2 +532,3 @@ export function TESTING_ErrorOnBorrowIo(asyncRuntime: Wrapper<NonSuspendingBackgroundThreadRuntime>, _input: null): Promise<void>;

interface CdsiLookup { readonly __type: unique symbol; }
interface Chat { readonly __type: unique symbol; }
interface CiphertextMessage { readonly __type: unique symbol; }

@@ -508,2 +544,3 @@ interface ConnectionManager { readonly __type: unique symbol; }

interface HsmEnclaveClient { readonly __type: unique symbol; }
interface HttpRequest { readonly __type: unique symbol; }
interface IncrementalMac { readonly __type: unique symbol; }

@@ -510,0 +547,0 @@ interface KyberKeyPair { readonly __type: unique symbol; }

{
"name": "@signalapp/libsignal-client",
"version": "0.40.1",
"version": "0.41.0",
"license": "AGPL-3.0-only",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc