Socket
Socket
Sign inDemoInstall

@signalapp/libsignal-client

Package Overview
Dependencies
2
Maintainers
5
Versions
59
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.30.1 to 0.30.2

16

dist/Address.d.ts

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

}
type ThisType<T extends {
prototype: unknown;
}> = T['prototype'];
export declare class ServiceId extends Object {
export declare abstract class ServiceId extends Object {
private readonly serviceIdFixedWidthBinary;
protected constructor(serviceIdFixedWidthBinary: Buffer);
protected static fromUuidBytesAndKind<T extends typeof ServiceId>(this: T, uuidBytes: ArrayLike<number>, kind: ServiceIdKind): ThisType<T>;
constructor(serviceIdFixedWidthBinary: Buffer);
protected static fromUuidBytesAndKind<T extends typeof ServiceId>(this: new (serviceIdFixedWidthBinary: Buffer) => InstanceType<T>, uuidBytes: ArrayLike<number>, kind: ServiceIdKind): InstanceType<T>;
getServiceIdBinary(): Buffer;

@@ -19,5 +16,6 @@ getServiceIdFixedWidthBinary(): Buffer;

toString(): string;
static parseFromServiceIdFixedWidthBinary<T extends typeof ServiceId>(this: T, serviceIdFixedWidthBinary: Buffer): ThisType<T>;
static parseFromServiceIdBinary(serviceIdBinary: Buffer): ServiceId;
static parseFromServiceIdString(serviceIdString: string): ServiceId;
private downcastTo;
static parseFromServiceIdFixedWidthBinary<T extends typeof ServiceId>(this: T, serviceIdFixedWidthBinary: Buffer): InstanceType<T>;
static parseFromServiceIdBinary<T extends typeof ServiceId>(this: T, serviceIdBinary: Buffer): InstanceType<T>;
static parseFromServiceIdString<T extends typeof ServiceId>(this: T, serviceIdString: string): InstanceType<T>;
getRawUuid(): string;

@@ -24,0 +22,0 @@ getRawUuidBytes(): Buffer;

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

class ServiceId extends Object {
// This has to be public for `InstanceType<T>`, which we use below.
constructor(serviceIdFixedWidthBinary) {

@@ -43,2 +44,9 @@ super();

}
downcastTo(subclass) {
// Omitting `as object` results in TypeScript mistakenly assuming the branch is always taken.
if (this instanceof subclass) {
return this;
}
throw new TypeError(`expected ${subclass.name}, got ${this.constructor.name}`);
}
static parseFromServiceIdFixedWidthBinary(serviceIdFixedWidthBinary) {

@@ -56,12 +64,11 @@ let result;

}
if (result instanceof this) {
return result;
}
throw new TypeError(`expected ${this.name}, got ${result.constructor.name}`);
return result.downcastTo(this);
}
static parseFromServiceIdBinary(serviceIdBinary) {
return ServiceId.parseFromServiceIdFixedWidthBinary(Native.ServiceId_ParseFromServiceIdBinary(serviceIdBinary));
const result = ServiceId.parseFromServiceIdFixedWidthBinary(Native.ServiceId_ParseFromServiceIdBinary(serviceIdBinary));
return result.downcastTo(this);
}
static parseFromServiceIdString(serviceIdString) {
return ServiceId.parseFromServiceIdFixedWidthBinary(Native.ServiceId_ParseFromServiceIdString(serviceIdString));
const result = this.parseFromServiceIdFixedWidthBinary(Native.ServiceId_ParseFromServiceIdString(serviceIdString));
return result.downcastTo(this);
}

@@ -84,3 +91,3 @@ getRawUuid() {

static fromUuidBytes(uuidBytes) {
return super.fromUuidBytesAndKind(uuidBytes, ServiceIdKind.Aci);
return this.fromUuidBytesAndKind(uuidBytes, ServiceIdKind.Aci);
}

@@ -94,3 +101,3 @@ }

static fromUuidBytes(uuidBytes) {
return super.fromUuidBytesAndKind(uuidBytes, ServiceIdKind.Pni);
return this.fromUuidBytesAndKind(uuidBytes, ServiceIdKind.Pni);
}

@@ -97,0 +104,0 @@ }

/// <reference types="node" />
export * from './Errors';
import { ProtocolAddress } from './Address';
import { Aci, ProtocolAddress } from './Address';
export * from './Address';

@@ -224,3 +224,3 @@ export * as usernames from './usernames';

static _fromNativeHandle(nativeHandle: Native.SenderCertificate): SenderCertificate;
static new(senderUuid: string, senderE164: string | null, senderDeviceId: number, senderKey: PublicKey, expiration: number, signerCert: ServerCertificate, signerKey: PrivateKey): SenderCertificate;
static new(senderUuid: string | Aci, senderE164: string | null, senderDeviceId: number, senderKey: PublicKey, expiration: number, signerCert: ServerCertificate, signerKey: PrivateKey): SenderCertificate;
static deserialize(buffer: Buffer): SenderCertificate;

@@ -233,2 +233,8 @@ serialize(): Buffer;

senderUuid(): string;
/**
* Returns an ACI if the sender is a valid UUID, `null` otherwise.
*
* In a future release SenderCertificate will *only* support ACIs.
*/
senderAci(): Aci | null;
senderDeviceId(): number;

@@ -333,2 +339,8 @@ serverCertificate(): ServerCertificate;

senderUuid(): string;
/**
* Returns an ACI if the sender is a valid UUID, `null` otherwise.
*
* In a future release SenderCertificate will *only* support ACIs.
*/
senderAci(): Aci | null;
deviceId(): number;

@@ -335,0 +347,0 @@ }

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

static new(senderUuid, senderE164, senderDeviceId, senderKey, expiration, signerCert, signerKey) {
if (typeof senderUuid !== 'string') {
senderUuid = senderUuid.getServiceIdString();
}
return new SenderCertificate(Native.SenderCertificate_New(senderUuid, senderE164, senderDeviceId, senderKey, expiration, signerCert, signerKey));

@@ -571,2 +574,15 @@ }

}
/**
* Returns an ACI if the sender is a valid UUID, `null` otherwise.
*
* In a future release SenderCertificate will *only* support ACIs.
*/
senderAci() {
try {
return Address_1.Aci.parseFromServiceIdString(this.senderUuid());
}
catch (_a) {
return null;
}
}
senderDeviceId() {

@@ -592,3 +608,3 @@ return Native.SenderCertificate_GetDeviceId(this);

return __awaiter(this, void 0, void 0, function* () {
const handle = yield Native.SenderKeyDistributionMessage_Create(sender, Buffer.from(uuid.parse(distributionId)), store, null);
const handle = yield Native.SenderKeyDistributionMessage_Create(sender, Buffer.from(uuid.parse(distributionId)), store);
return new SenderKeyDistributionMessage(handle);

@@ -622,3 +638,3 @@ });

return __awaiter(this, void 0, void 0, function* () {
yield Native.SenderKeyDistributionMessage_Process(sender, message, store, null);
yield Native.SenderKeyDistributionMessage_Process(sender, message, store);
});

@@ -818,3 +834,3 @@ }

return __awaiter(this, void 0, void 0, function* () {
return CiphertextMessage._fromNativeHandle(yield Native.GroupCipher_EncryptMessage(sender, Buffer.from(uuid.parse(distributionId)), message, store, null));
return CiphertextMessage._fromNativeHandle(yield Native.GroupCipher_EncryptMessage(sender, Buffer.from(uuid.parse(distributionId)), message, store));
});

@@ -825,3 +841,3 @@ }

return __awaiter(this, void 0, void 0, function* () {
return Native.GroupCipher_DecryptMessage(sender, message, store, null);
return Native.GroupCipher_DecryptMessage(sender, message, store);
});

@@ -846,2 +862,15 @@ }

}
/**
* Returns an ACI if the sender is a valid UUID, `null` otherwise.
*
* In a future release SenderCertificate will *only* support ACIs.
*/
senderAci() {
try {
return Address_1.Aci.parseFromServiceIdString(this.senderUuid());
}
catch (_a) {
return null;
}
}
deviceId() {

@@ -928,3 +957,3 @@ return Native.SealedSenderDecryptionResult_GetDeviceId(this);

function processPreKeyBundle(bundle, address, sessionStore, identityStore) {
return Native.SessionBuilder_ProcessPreKeyBundle(bundle, address, sessionStore, identityStore, null);
return Native.SessionBuilder_ProcessPreKeyBundle(bundle, address, sessionStore, identityStore);
}

@@ -934,3 +963,3 @@ exports.processPreKeyBundle = processPreKeyBundle;

return __awaiter(this, void 0, void 0, function* () {
return CiphertextMessage._fromNativeHandle(yield Native.SessionCipher_EncryptMessage(message, address, sessionStore, identityStore, null));
return CiphertextMessage._fromNativeHandle(yield Native.SessionCipher_EncryptMessage(message, address, sessionStore, identityStore));
});

@@ -940,7 +969,7 @@ }

function signalDecrypt(message, address, sessionStore, identityStore) {
return Native.SessionCipher_DecryptSignalMessage(message, address, sessionStore, identityStore, null);
return Native.SessionCipher_DecryptSignalMessage(message, address, sessionStore, identityStore);
}
exports.signalDecrypt = signalDecrypt;
function signalDecryptPreKey(message, address, sessionStore, identityStore, prekeyStore, signedPrekeyStore, kyberPrekeyStore) {
return Native.SessionCipher_DecryptPreKeySignalMessage(message, address, sessionStore, identityStore, prekeyStore, signedPrekeyStore, kyberPrekeyStore, null);
return Native.SessionCipher_DecryptPreKeySignalMessage(message, address, sessionStore, identityStore, prekeyStore, signedPrekeyStore, kyberPrekeyStore);
}

@@ -957,3 +986,3 @@ exports.signalDecryptPreKey = signalDecryptPreKey;

function sealedSenderEncrypt(content, address, identityStore) {
return Native.SealedSender_Encrypt(address, content, identityStore, null);
return Native.SealedSender_Encrypt(address, content, identityStore);
}

@@ -964,3 +993,3 @@ exports.sealedSenderEncrypt = sealedSenderEncrypt;

const recipientSessions = yield sessionStore.getExistingSessions(recipients);
return yield Native.SealedSender_MultiRecipientEncrypt(recipients, recipientSessions, content, identityStore, null);
return yield Native.SealedSender_MultiRecipientEncrypt(recipients, recipientSessions, content, identityStore);
});

@@ -983,3 +1012,3 @@ }

return __awaiter(this, void 0, void 0, function* () {
const usmc = yield Native.SealedSender_DecryptToUsmc(message, identityStore, null);
const usmc = yield Native.SealedSender_DecryptToUsmc(message, identityStore);
return UnidentifiedSenderMessageContent._fromNativeHandle(usmc);

@@ -986,0 +1015,0 @@ });

@@ -120,4 +120,4 @@ //

export function GenericServerSecretParams_GetPublicParams(paramsBytes: Buffer): Buffer;
export function GroupCipher_DecryptMessage(sender: Wrapper<ProtocolAddress>, message: Buffer, store: SenderKeyStore, ctx: null): Promise<Buffer>;
export function GroupCipher_EncryptMessage(sender: Wrapper<ProtocolAddress>, distributionId: Uuid, message: Buffer, store: SenderKeyStore, ctx: null): Promise<CiphertextMessage>;
export function GroupCipher_DecryptMessage(sender: Wrapper<ProtocolAddress>, message: Buffer, store: SenderKeyStore): Promise<Buffer>;
export function GroupCipher_EncryptMessage(sender: Wrapper<ProtocolAddress>, distributionId: Uuid, message: Buffer, store: SenderKeyStore): Promise<CiphertextMessage>;
export function GroupMasterKey_CheckValidContents(buffer: Buffer): void;

@@ -245,5 +245,5 @@ export function GroupPublicParams_CheckValidContents(buffer: Buffer): void;

export function SealedSender_DecryptMessage(message: Buffer, trustRoot: Wrapper<PublicKey>, timestamp: Timestamp, localE164: string | null, localUuid: string, localDeviceId: number, sessionStore: SessionStore, identityStore: IdentityKeyStore, prekeyStore: PreKeyStore, signedPrekeyStore: SignedPreKeyStore, kyberPrekeyStore: KyberPreKeyStore): Promise<SealedSenderDecryptionResult>;
export function SealedSender_DecryptToUsmc(ctext: Buffer, identityStore: IdentityKeyStore, ctx: null): Promise<UnidentifiedSenderMessageContent>;
export function SealedSender_Encrypt(destination: Wrapper<ProtocolAddress>, content: Wrapper<UnidentifiedSenderMessageContent>, identityKeyStore: IdentityKeyStore, ctx: null): Promise<Buffer>;
export function SealedSender_MultiRecipientEncrypt(recipients: Wrapper<ProtocolAddress>[], recipientSessions: Wrapper<SessionRecord>[], content: Wrapper<UnidentifiedSenderMessageContent>, identityKeyStore: IdentityKeyStore, ctx: null): Promise<Buffer>;
export function SealedSender_DecryptToUsmc(ctext: Buffer, identityStore: IdentityKeyStore): Promise<UnidentifiedSenderMessageContent>;
export function SealedSender_Encrypt(destination: Wrapper<ProtocolAddress>, content: Wrapper<UnidentifiedSenderMessageContent>, identityKeyStore: IdentityKeyStore): Promise<Buffer>;
export function SealedSender_MultiRecipientEncrypt(recipients: Wrapper<ProtocolAddress>[], recipientSessions: Wrapper<SessionRecord>[], content: Wrapper<UnidentifiedSenderMessageContent>, identityKeyStore: IdentityKeyStore): Promise<Buffer>;
export function SealedSender_MultiRecipientMessageForSingleRecipient(encodedMultiRecipientMessage: Buffer): Buffer;

@@ -262,3 +262,3 @@ export function SenderCertificate_Deserialize(data: Buffer): SenderCertificate;

export function SenderCertificate_Validate(cert: Wrapper<SenderCertificate>, key: Wrapper<PublicKey>, time: Timestamp): boolean;
export function SenderKeyDistributionMessage_Create(sender: Wrapper<ProtocolAddress>, distributionId: Uuid, store: SenderKeyStore, ctx: null): Promise<SenderKeyDistributionMessage>;
export function SenderKeyDistributionMessage_Create(sender: Wrapper<ProtocolAddress>, distributionId: Uuid, store: SenderKeyStore): Promise<SenderKeyDistributionMessage>;
export function SenderKeyDistributionMessage_Deserialize(data: Buffer): SenderKeyDistributionMessage;

@@ -270,3 +270,3 @@ export function SenderKeyDistributionMessage_GetChainId(obj: Wrapper<SenderKeyDistributionMessage>): number;

export function SenderKeyDistributionMessage_New(messageVersion: number, distributionId: Uuid, chainId: number, iteration: number, chainkey: Buffer, pk: Wrapper<PublicKey>): SenderKeyDistributionMessage;
export function SenderKeyDistributionMessage_Process(sender: Wrapper<ProtocolAddress>, senderKeyDistributionMessage: Wrapper<SenderKeyDistributionMessage>, store: SenderKeyStore, ctx: null): Promise<void>;
export function SenderKeyDistributionMessage_Process(sender: Wrapper<ProtocolAddress>, senderKeyDistributionMessage: Wrapper<SenderKeyDistributionMessage>, store: SenderKeyStore): Promise<void>;
export function SenderKeyDistributionMessage_Serialize(obj: Wrapper<SenderKeyDistributionMessage>): Buffer;

@@ -320,6 +320,6 @@ export function SenderKeyMessage_Deserialize(data: Buffer): SenderKeyMessage;

export function ServiceId_ServiceIdString(value: Buffer): string;
export function SessionBuilder_ProcessPreKeyBundle(bundle: Wrapper<PreKeyBundle>, protocolAddress: Wrapper<ProtocolAddress>, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore, ctx: null): Promise<void>;
export function SessionCipher_DecryptPreKeySignalMessage(message: Wrapper<PreKeySignalMessage>, protocolAddress: Wrapper<ProtocolAddress>, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore, prekeyStore: PreKeyStore, signedPrekeyStore: SignedPreKeyStore, kyberPrekeyStore: KyberPreKeyStore, ctx: null): Promise<Buffer>;
export function SessionCipher_DecryptSignalMessage(message: Wrapper<SignalMessage>, protocolAddress: Wrapper<ProtocolAddress>, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore, ctx: null): Promise<Buffer>;
export function SessionCipher_EncryptMessage(ptext: Buffer, protocolAddress: Wrapper<ProtocolAddress>, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore, ctx: null): Promise<CiphertextMessage>;
export function SessionBuilder_ProcessPreKeyBundle(bundle: Wrapper<PreKeyBundle>, protocolAddress: Wrapper<ProtocolAddress>, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore): Promise<void>;
export function SessionCipher_DecryptPreKeySignalMessage(message: Wrapper<PreKeySignalMessage>, protocolAddress: Wrapper<ProtocolAddress>, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore, prekeyStore: PreKeyStore, signedPrekeyStore: SignedPreKeyStore, kyberPrekeyStore: KyberPreKeyStore): Promise<Buffer>;
export function SessionCipher_DecryptSignalMessage(message: Wrapper<SignalMessage>, protocolAddress: Wrapper<ProtocolAddress>, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore): Promise<Buffer>;
export function SessionCipher_EncryptMessage(ptext: Buffer, protocolAddress: Wrapper<ProtocolAddress>, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore): Promise<CiphertextMessage>;
export function SessionRecord_ArchiveCurrentState(sessionRecord: Wrapper<SessionRecord>): void;

@@ -326,0 +326,0 @@ export function SessionRecord_CurrentRatchetKeyMatches(s: Wrapper<SessionRecord>, key: Wrapper<PublicKey>): boolean;

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

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

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc