Socket
Socket
Sign inDemoInstall

@signalapp/libsignal-client

Package Overview
Dependencies
3
Maintainers
6
Versions
55
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.38.0 to 0.39.1

46

dist/Errors.d.ts

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

InvalidSenderKeySession = 7,
CannotBeEmpty = 8,
NicknameCannotBeEmpty = 8,
CannotStartWithDigit = 9,

@@ -19,9 +19,15 @@ MissingSeparator = 10,

NicknameTooLong = 13,
IoError = 14,
InvalidMediaInput = 15,
UnsupportedMediaInput = 16,
InputDataTooLong = 17,
InvalidEntropyDataLength = 18,
InvalidUsernameLinkEncryptedData = 19,
RateLimitedError = 20
DiscriminatorCannotBeEmpty = 14,
DiscriminatorCannotBeZero = 15,
DiscriminatorCannotBeSingleDigit = 16,
DiscriminatorCannotHaveLeadingZeros = 17,
BadDiscriminatorCharacter = 18,
DiscriminatorTooLarge = 19,
IoError = 20,
InvalidMediaInput = 21,
UnsupportedMediaInput = 22,
InputDataTooLong = 23,
InvalidEntropyDataLength = 24,
InvalidUsernameLinkEncryptedData = 25,
RateLimitedError = 26
}

@@ -63,4 +69,4 @@ export declare class LibSignalErrorBase extends Error {

};
export type CannotBeEmptyError = LibSignalErrorCommon & {
code: ErrorCode.CannotBeEmpty;
export type NicknameCannotBeEmptyError = LibSignalErrorCommon & {
code: ErrorCode.NicknameCannotBeEmpty;
};

@@ -82,2 +88,20 @@ export type CannotStartWithDigitError = LibSignalErrorCommon & {

};
export type DiscriminatorCannotBeEmptyError = LibSignalErrorCommon & {
code: ErrorCode.DiscriminatorCannotBeEmpty;
};
export type DiscriminatorCannotBeZeroError = LibSignalErrorCommon & {
code: ErrorCode.DiscriminatorCannotBeZero;
};
export type DiscriminatorCannotBeSingleDigitError = LibSignalErrorCommon & {
code: ErrorCode.DiscriminatorCannotBeSingleDigit;
};
export type DiscriminatorCannotHaveLeadingZerosError = LibSignalErrorCommon & {
code: ErrorCode.DiscriminatorCannotHaveLeadingZeros;
};
export type BadDiscriminatorCharacterError = LibSignalErrorCommon & {
code: ErrorCode.BadDiscriminatorCharacter;
};
export type DiscriminatorTooLargeError = LibSignalErrorCommon & {
code: ErrorCode.DiscriminatorTooLarge;
};
export type InputDataTooLong = LibSignalErrorCommon & {

@@ -105,2 +129,2 @@ code: ErrorCode.InputDataTooLong;

};
export type LibSignalError = GenericError | DuplicatedMessageError | SealedSenderSelfSendError | UntrustedIdentityError | InvalidRegistrationIdError | VerificationFailedError | InvalidSessionError | InvalidSenderKeySessionError | CannotBeEmptyError | CannotStartWithDigitError | MissingSeparatorError | BadNicknameCharacterError | NicknameTooShortError | NicknameTooLongError | InputDataTooLong | InvalidEntropyDataLength | InvalidUsernameLinkEncryptedData | IoError | InvalidMediaInputError | UnsupportedMediaInputError;
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;

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

ErrorCode[ErrorCode["InvalidSenderKeySession"] = 7] = "InvalidSenderKeySession";
ErrorCode[ErrorCode["CannotBeEmpty"] = 8] = "CannotBeEmpty";
ErrorCode[ErrorCode["NicknameCannotBeEmpty"] = 8] = "NicknameCannotBeEmpty";
ErrorCode[ErrorCode["CannotStartWithDigit"] = 9] = "CannotStartWithDigit";

@@ -26,9 +26,15 @@ ErrorCode[ErrorCode["MissingSeparator"] = 10] = "MissingSeparator";

ErrorCode[ErrorCode["NicknameTooLong"] = 13] = "NicknameTooLong";
ErrorCode[ErrorCode["IoError"] = 14] = "IoError";
ErrorCode[ErrorCode["InvalidMediaInput"] = 15] = "InvalidMediaInput";
ErrorCode[ErrorCode["UnsupportedMediaInput"] = 16] = "UnsupportedMediaInput";
ErrorCode[ErrorCode["InputDataTooLong"] = 17] = "InputDataTooLong";
ErrorCode[ErrorCode["InvalidEntropyDataLength"] = 18] = "InvalidEntropyDataLength";
ErrorCode[ErrorCode["InvalidUsernameLinkEncryptedData"] = 19] = "InvalidUsernameLinkEncryptedData";
ErrorCode[ErrorCode["RateLimitedError"] = 20] = "RateLimitedError";
ErrorCode[ErrorCode["DiscriminatorCannotBeEmpty"] = 14] = "DiscriminatorCannotBeEmpty";
ErrorCode[ErrorCode["DiscriminatorCannotBeZero"] = 15] = "DiscriminatorCannotBeZero";
ErrorCode[ErrorCode["DiscriminatorCannotBeSingleDigit"] = 16] = "DiscriminatorCannotBeSingleDigit";
ErrorCode[ErrorCode["DiscriminatorCannotHaveLeadingZeros"] = 17] = "DiscriminatorCannotHaveLeadingZeros";
ErrorCode[ErrorCode["BadDiscriminatorCharacter"] = 18] = "BadDiscriminatorCharacter";
ErrorCode[ErrorCode["DiscriminatorTooLarge"] = 19] = "DiscriminatorTooLarge";
ErrorCode[ErrorCode["IoError"] = 20] = "IoError";
ErrorCode[ErrorCode["InvalidMediaInput"] = 21] = "InvalidMediaInput";
ErrorCode[ErrorCode["UnsupportedMediaInput"] = 22] = "UnsupportedMediaInput";
ErrorCode[ErrorCode["InputDataTooLong"] = 23] = "InputDataTooLong";
ErrorCode[ErrorCode["InvalidEntropyDataLength"] = 24] = "InvalidEntropyDataLength";
ErrorCode[ErrorCode["InvalidUsernameLinkEncryptedData"] = 25] = "InvalidUsernameLinkEncryptedData";
ErrorCode[ErrorCode["RateLimitedError"] = 26] = "RateLimitedError";
})(ErrorCode = exports.ErrorCode || (exports.ErrorCode = {}));

@@ -35,0 +41,0 @@ class LibSignalErrorBase extends Error {

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

export declare function generateCandidates(nickname: string, minNicknameLength: number, maxNicknameLength: number): string[];
export declare function fromParts(nickname: string, discriminator: string, minNicknameLength: number, maxNicknameLength: number): {
username: string;
hash: Buffer;
};
export declare function hash(username: string): Buffer;

@@ -9,0 +13,0 @@ export declare function generateProof(username: string): Buffer;

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.verifyProof = exports.createUsernameLink = exports.decryptUsernameLink = exports.generateProofWithRandom = exports.generateProof = exports.hash = exports.generateCandidates = void 0;
exports.verifyProof = exports.createUsernameLink = exports.decryptUsernameLink = exports.generateProofWithRandom = exports.generateProof = exports.hash = exports.fromParts = exports.generateCandidates = void 0;
/* eslint @typescript-eslint/no-shadow: ["error", { "allow": ["hash"] }] */

@@ -17,2 +17,9 @@ const crypto_1 = require("crypto");

exports.generateCandidates = generateCandidates;
function fromParts(nickname, discriminator, minNicknameLength, maxNicknameLength) {
const hash = Native.Username_HashFromParts(nickname, discriminator, minNicknameLength, maxNicknameLength);
// If we generated the hash correctly, we can format the nickname and discriminator manually.
const username = `${nickname}.${discriminator}`;
return { username, hash };
}
exports.fromParts = fromParts;
function hash(username) {

@@ -19,0 +26,0 @@ return Native.Username_Hash(username);

@@ -426,2 +426,3 @@ //

export function Username_Hash(username: string): Buffer;
export function Username_HashFromParts(nickname: string, discriminator: string, minLen: number, maxLen: number): Buffer;
export function Username_Proof(username: string, randomness: Buffer): Buffer;

@@ -428,0 +429,0 @@ export function Username_Verify(proof: Buffer, hash: Buffer): void;

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

@@ -56,2 +56,3 @@ "main": "dist/index.js",

"prettier": "^2.7.1",
"prebuildify": "^5.0.1",
"rimraf": "^3.0.1",

@@ -58,0 +59,0 @@ "source-map-support": "^0.5.19",

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