Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@signalapp/mock-server

Package Overview
Dependencies
Maintainers
5
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@signalapp/mock-server - npm Package Compare versions

Comparing version 2.18.0 to 2.19.0

protos/README.md

4

package.json
{
"name": "@signalapp/mock-server",
"version": "2.18.0",
"version": "2.19.0",
"description": "Mock Signal Server for writing tests",

@@ -43,3 +43,3 @@ "main": "src/index.js",

"dependencies": {
"@signalapp/libsignal-client": "^0.22.0",
"@signalapp/libsignal-client": "^0.24.0",
"debug": "^4.3.2",

@@ -46,0 +46,0 @@ "long": "^4.0.0",

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

updatedPni?: UUID;
distributionId?: UUID;
group?: Group;
}>;
export type EncryptTextOptions = EncryptOptions & Readonly<{
group?: Group;
withProfileKey?: boolean;

@@ -200,2 +201,3 @@ withPniSignature?: boolean;

sendRaw(target: Device, content: Proto.IContent, options?: EncryptOptions): Promise<void>;
sendSenderKey(target: Device, options?: EncryptOptions): Promise<UUID>;
receive(source: Device, encrypted: Buffer): Promise<void>;

@@ -202,0 +204,0 @@ waitForMessage(): Promise<MessageQueueEntry>;

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

}
async sendSenderKey(target, options) {
const distributionId = crypto_1.default.randomUUID();
const senderKeys = this.senderKeys.get(types_1.UUIDKind.ACI);
(0, assert_1.default)(senderKeys, 'Should have a sender key store');
const skdm = await libsignal_client_1.SenderKeyDistributionMessage.create(target.address, distributionId, senderKeys);
this.sendRaw(target, {
senderKeyDistributionMessage: skdm.serialize(),
}, options);
return distributionId;
}
async receive(source, encrypted) {

@@ -896,3 +906,3 @@ const envelope = compiled_1.signalservice.Envelope.decode(encrypted);

}
async encrypt(target, message, { timestamp = Date.now(), sealed = false, uuidKind = types_1.UUIDKind.ACI, updatedPni, } = {}) {
async encrypt(target, message, { timestamp = Date.now(), sealed = false, uuidKind = types_1.UUIDKind.ACI, updatedPni, distributionId, group, } = {}) {
assert_1.default.ok(this.isInitialized, 'Not initialized');

@@ -911,3 +921,15 @@ // "Pad"

(0, assert_1.default)(uuidKind === types_1.UUIDKind.ACI, 'Can\'t send sealed sender to PNI');
content = await SignalClient.sealedSenderEncryptMessage(paddedMessage, target.getAddressByKind(uuidKind), this.senderCertificate, this.sessions, identity);
if (distributionId) {
(0, assert_1.default)(group, 'Should have a Group along with distributionId');
const senderKey = this.senderKeys.get(types_1.UUIDKind.ACI);
(0, assert_1.default)(senderKey, 'Should have an ACI sender keys');
const ciphertext = await SignalClient.groupEncrypt(this.device.address, distributionId, senderKey, paddedMessage);
const usmc = SignalClient.UnidentifiedSenderMessageContent.new(ciphertext, this.senderCertificate, SignalClient.ContentHint.Implicit, group.publicParams.getGroupIdentifier().serialize());
const multiRecipient = await SignalClient.sealedSenderMultiRecipientEncrypt(usmc, [target.getAddressByKind(uuidKind)], identity, this.sessions);
content =
SignalClient.sealedSenderMultiRecipientMessageForSingleRecipient(multiRecipient);
}
else {
content = await SignalClient.sealedSenderEncryptMessage(paddedMessage, target.getAddressByKind(uuidKind), this.senderCertificate, this.sessions, identity);
}
envelopeType = compiled_1.signalservice.Envelope.Type.UNIDENTIFIED_SENDER;

@@ -914,0 +936,0 @@ }

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc