@signalapp/signal-client
Advanced tools
Comparing version 0.9.7 to 0.9.8
@@ -24,7 +24,9 @@ /// <reference types="node" /> | ||
export declare class HKDF { | ||
private readonly version; | ||
private constructor(); | ||
/** | ||
* @deprecated Use the top-level 'hkdf' function for standard HKDF behavior | ||
*/ | ||
static new(version: number): HKDF; | ||
deriveSecrets(outputLength: number, keyMaterial: Buffer, label: Buffer, salt: Buffer | null): Buffer; | ||
} | ||
export declare function hkdf(outputLength: number, keyMaterial: Buffer, label: Buffer, salt: Buffer | null): Buffer; | ||
export declare class ScannableFingerprint { | ||
@@ -323,1 +325,10 @@ private readonly scannable; | ||
export declare function sealedSenderDecryptToUsmc(message: Buffer, identityStore: IdentityKeyStore): Promise<UnidentifiedSenderMessageContent>; | ||
export declare class HsmEnclaveClient { | ||
readonly _nativeHandle: Native.HsmEnclaveClient; | ||
private constructor(); | ||
static new(public_key: PublicKey, code_hashes: Buffer[]): HsmEnclaveClient; | ||
initialRequest(): Buffer; | ||
completeHandshake(buffer: Buffer): void; | ||
establishedSend(buffer: Buffer): Buffer; | ||
establishedRecv(buffer: Buffer): Buffer; | ||
} |
@@ -26,3 +26,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.sealedSenderDecryptToUsmc = exports.sealedSenderDecryptMessage = exports.sealedSenderMultiRecipientMessageForSingleRecipient = exports.sealedSenderMultiRecipientEncrypt = exports.sealedSenderEncrypt = exports.sealedSenderEncryptMessage = exports.signalDecryptPreKey = exports.signalDecrypt = exports.signalEncrypt = exports.processPreKeyBundle = exports.DecryptionErrorMessage = exports.PlaintextContent = exports.CiphertextMessage = exports.SealedSenderDecryptionResult = exports.groupDecrypt = exports.groupEncrypt = exports.SenderKeyStore = exports.SignedPreKeyStore = exports.PreKeyStore = exports.IdentityKeyStore = exports.SessionStore = exports.UnidentifiedSenderMessageContent = exports.SenderKeyMessage = exports.processSenderKeyDistributionMessage = exports.SenderKeyDistributionMessage = exports.SenderCertificate = exports.SenderKeyRecord = exports.ServerCertificate = exports.SessionRecord = exports.PreKeySignalMessage = exports.SignalMessage = exports.SignedPreKeyRecord = exports.PreKeyRecord = exports.PreKeyBundle = exports.IdentityKeyPair = exports.PrivateKey = exports.PublicKey = exports.Aes256GcmSiv = exports.Fingerprint = exports.DisplayableFingerprint = exports.ScannableFingerprint = exports.HKDF = exports.LogLevel = exports.initLogger = void 0; | ||
exports.HsmEnclaveClient = exports.sealedSenderDecryptToUsmc = exports.sealedSenderDecryptMessage = exports.sealedSenderMultiRecipientMessageForSingleRecipient = exports.sealedSenderMultiRecipientEncrypt = exports.sealedSenderEncrypt = exports.sealedSenderEncryptMessage = exports.signalDecryptPreKey = exports.signalDecrypt = exports.signalEncrypt = exports.processPreKeyBundle = exports.DecryptionErrorMessage = exports.PlaintextContent = exports.CiphertextMessage = exports.SealedSenderDecryptionResult = exports.groupDecrypt = exports.groupEncrypt = exports.SenderKeyStore = exports.SignedPreKeyStore = exports.PreKeyStore = exports.IdentityKeyStore = exports.SessionStore = exports.UnidentifiedSenderMessageContent = exports.SenderKeyMessage = exports.processSenderKeyDistributionMessage = exports.SenderKeyDistributionMessage = exports.SenderCertificate = exports.SenderKeyRecord = exports.ServerCertificate = exports.SessionRecord = exports.PreKeySignalMessage = exports.SignalMessage = exports.SignedPreKeyRecord = exports.PreKeyRecord = exports.PreKeyBundle = exports.IdentityKeyPair = exports.PrivateKey = exports.PublicKey = exports.Aes256GcmSiv = exports.Fingerprint = exports.DisplayableFingerprint = exports.ScannableFingerprint = exports.hkdf = exports.HKDF = exports.LogLevel = exports.initLogger = void 0; | ||
const uuid = require("uuid"); | ||
@@ -38,13 +38,20 @@ const Errors = require("./Errors"); | ||
class HKDF { | ||
constructor(version) { | ||
this.version = version; | ||
} | ||
/** | ||
* @deprecated Use the top-level 'hkdf' function for standard HKDF behavior | ||
*/ | ||
static new(version) { | ||
return new HKDF(version); | ||
if (version != 3) { | ||
throw new Error('HKDF versions other than 3 are no longer supported'); | ||
} | ||
return new HKDF(); | ||
} | ||
deriveSecrets(outputLength, keyMaterial, label, salt) { | ||
return NativeImpl.HKDF_DeriveSecrets(outputLength, this.version, keyMaterial, label, salt); | ||
return hkdf(outputLength, keyMaterial, label, salt); | ||
} | ||
} | ||
exports.HKDF = HKDF; | ||
function hkdf(outputLength, keyMaterial, label, salt) { | ||
return NativeImpl.HKDF_DeriveSecrets(outputLength, keyMaterial, label, salt); | ||
} | ||
exports.hkdf = hkdf; | ||
class ScannableFingerprint { | ||
@@ -823,2 +830,29 @@ constructor(scannable) { | ||
exports.sealedSenderDecryptToUsmc = sealedSenderDecryptToUsmc; | ||
class HsmEnclaveClient { | ||
constructor(nativeHandle) { | ||
this._nativeHandle = nativeHandle; | ||
} | ||
static new(public_key, code_hashes) { | ||
code_hashes.forEach(hash => { | ||
if (hash.length != 32) { | ||
throw new Error('code hash length must be 32'); | ||
} | ||
}); | ||
const concat_hashes = Buffer.concat(code_hashes); | ||
return new HsmEnclaveClient(NativeImpl.HsmEnclaveClient_New(public_key.getPublicKeyBytes(), concat_hashes)); | ||
} | ||
initialRequest() { | ||
return NativeImpl.HsmEnclaveClient_InitialRequest(this); | ||
} | ||
completeHandshake(buffer) { | ||
return NativeImpl.HsmEnclaveClient_CompleteHandshake(this, buffer); | ||
} | ||
establishedSend(buffer) { | ||
return NativeImpl.HsmEnclaveClient_EstablishedSend(this, buffer); | ||
} | ||
establishedRecv(buffer) { | ||
return NativeImpl.HsmEnclaveClient_EstablishedRecv(this, buffer); | ||
} | ||
} | ||
exports.HsmEnclaveClient = HsmEnclaveClient; | ||
//# sourceMappingURL=index.js.map |
@@ -52,3 +52,3 @@ // | ||
export function CiphertextMessage_Type(msg: Wrapper<CiphertextMessage>): number; | ||
export function DecryptionErrorMessage_Deserialize(buffer: Buffer): DecryptionErrorMessage; | ||
export function DecryptionErrorMessage_Deserialize(data: Buffer): DecryptionErrorMessage; | ||
export function DecryptionErrorMessage_ExtractFromSerializedContent(bytes: Buffer): DecryptionErrorMessage; | ||
@@ -65,5 +65,10 @@ export function DecryptionErrorMessage_ForOriginalMessage(originalBytes: Buffer, originalType: number, originalTimestamp: number, originalSenderDeviceId: number): DecryptionErrorMessage; | ||
export function GroupCipher_EncryptMessage(sender: Wrapper<ProtocolAddress>, distributionId: Uuid, message: Buffer, store: SenderKeyStore, ctx: null): Promise<CiphertextMessage>; | ||
export function HKDF_DeriveSecrets(outputLength: number, version: number, ikm: Buffer, label: Buffer | null, salt: Buffer | null): Buffer; | ||
export function HKDF_DeriveSecrets(outputLength: number, ikm: Buffer, label: Buffer | null, salt: Buffer | null): Buffer; | ||
export function HsmEnclaveClient_CompleteHandshake(cli: Wrapper<HsmEnclaveClient>, handshakeReceived: Buffer): void; | ||
export function HsmEnclaveClient_EstablishedRecv(cli: Wrapper<HsmEnclaveClient>, receivedCiphertext: Buffer): Buffer; | ||
export function HsmEnclaveClient_EstablishedSend(cli: Wrapper<HsmEnclaveClient>, plaintextToSend: Buffer): Buffer; | ||
export function HsmEnclaveClient_InitialRequest(obj: Wrapper<HsmEnclaveClient>): Buffer; | ||
export function HsmEnclaveClient_New(trustedPublicKey: Buffer, trustedCodeHashes: Buffer): HsmEnclaveClient; | ||
export function IdentityKeyPair_Serialize(publicKey: Wrapper<PublicKey>, privateKey: Wrapper<PrivateKey>): Buffer; | ||
export function PlaintextContent_Deserialize(buffer: Buffer): PlaintextContent; | ||
export function PlaintextContent_Deserialize(data: Buffer): PlaintextContent; | ||
export function PlaintextContent_FromDecryptionErrorMessage(m: Wrapper<DecryptionErrorMessage>): PlaintextContent; | ||
@@ -81,3 +86,3 @@ export function PlaintextContent_GetBody(obj: Wrapper<PlaintextContent>): Buffer; | ||
export function PreKeyBundle_New(registrationId: number, deviceId: number, prekeyId: number | null, prekey: Wrapper<PublicKey> | null, signedPrekeyId: number, signedPrekey: Wrapper<PublicKey>, signedPrekeySignature: Buffer, identityKey: Wrapper<PublicKey>): PreKeyBundle; | ||
export function PreKeyRecord_Deserialize(buffer: Buffer): PreKeyRecord; | ||
export function PreKeyRecord_Deserialize(data: Buffer): PreKeyRecord; | ||
export function PreKeyRecord_GetId(obj: Wrapper<PreKeyRecord>): number; | ||
@@ -88,3 +93,3 @@ export function PreKeyRecord_GetPrivateKey(obj: Wrapper<PreKeyRecord>): PrivateKey; | ||
export function PreKeyRecord_Serialize(obj: Wrapper<PreKeyRecord>): Buffer; | ||
export function PreKeySignalMessage_Deserialize(buffer: Buffer): PreKeySignalMessage; | ||
export function PreKeySignalMessage_Deserialize(data: Buffer): PreKeySignalMessage; | ||
export function PreKeySignalMessage_GetPreKeyId(obj: Wrapper<PreKeySignalMessage>): number | null; | ||
@@ -97,3 +102,3 @@ export function PreKeySignalMessage_GetRegistrationId(obj: Wrapper<PreKeySignalMessage>): number; | ||
export function PrivateKey_Agree(privateKey: Wrapper<PrivateKey>, publicKey: Wrapper<PublicKey>): Buffer; | ||
export function PrivateKey_Deserialize(buffer: Buffer): PrivateKey; | ||
export function PrivateKey_Deserialize(data: Buffer): PrivateKey; | ||
export function PrivateKey_Generate(): PrivateKey; | ||
@@ -107,3 +112,3 @@ export function PrivateKey_GetPublicKey(k: Wrapper<PrivateKey>): PublicKey; | ||
export function PublicKey_Compare(key1: Wrapper<PublicKey>, key2: Wrapper<PublicKey>): number; | ||
export function PublicKey_Deserialize(buffer: Buffer): PublicKey; | ||
export function PublicKey_Deserialize(data: Buffer): PublicKey; | ||
export function PublicKey_GetPublicKeyBytes(obj: Wrapper<PublicKey>): Buffer; | ||
@@ -122,3 +127,3 @@ export function PublicKey_Serialize(obj: Wrapper<PublicKey>): Buffer; | ||
export function SealedSender_MultiRecipientMessageForSingleRecipient(encodedMultiRecipientMessage: Buffer): Buffer; | ||
export function SenderCertificate_Deserialize(buffer: Buffer): SenderCertificate; | ||
export function SenderCertificate_Deserialize(data: Buffer): SenderCertificate; | ||
export function SenderCertificate_GetCertificate(obj: Wrapper<SenderCertificate>): Buffer; | ||
@@ -136,3 +141,3 @@ export function SenderCertificate_GetDeviceId(obj: Wrapper<SenderCertificate>): number; | ||
export function SenderKeyDistributionMessage_Create(sender: Wrapper<ProtocolAddress>, distributionId: Uuid, store: SenderKeyStore, ctx: null): Promise<SenderKeyDistributionMessage>; | ||
export function SenderKeyDistributionMessage_Deserialize(buffer: Buffer): SenderKeyDistributionMessage; | ||
export function SenderKeyDistributionMessage_Deserialize(data: Buffer): SenderKeyDistributionMessage; | ||
export function SenderKeyDistributionMessage_GetChainId(obj: Wrapper<SenderKeyDistributionMessage>): number; | ||
@@ -145,3 +150,3 @@ export function SenderKeyDistributionMessage_GetChainKey(obj: Wrapper<SenderKeyDistributionMessage>): Buffer; | ||
export function SenderKeyDistributionMessage_Serialize(obj: Wrapper<SenderKeyDistributionMessage>): Buffer; | ||
export function SenderKeyMessage_Deserialize(buffer: Buffer): SenderKeyMessage; | ||
export function SenderKeyMessage_Deserialize(data: Buffer): SenderKeyMessage; | ||
export function SenderKeyMessage_GetChainId(obj: Wrapper<SenderKeyMessage>): number; | ||
@@ -154,6 +159,6 @@ export function SenderKeyMessage_GetCipherText(obj: Wrapper<SenderKeyMessage>): Buffer; | ||
export function SenderKeyMessage_VerifySignature(skm: Wrapper<SenderKeyMessage>, pubkey: Wrapper<PublicKey>): boolean; | ||
export function SenderKeyRecord_Deserialize(buffer: Buffer): SenderKeyRecord; | ||
export function SenderKeyRecord_Deserialize(data: Buffer): SenderKeyRecord; | ||
export function SenderKeyRecord_New(): SenderKeyRecord; | ||
export function SenderKeyRecord_Serialize(obj: Wrapper<SenderKeyRecord>): Buffer; | ||
export function ServerCertificate_Deserialize(buffer: Buffer): ServerCertificate; | ||
export function ServerCertificate_Deserialize(data: Buffer): ServerCertificate; | ||
export function ServerCertificate_GetCertificate(obj: Wrapper<ServerCertificate>): Buffer; | ||
@@ -171,3 +176,3 @@ export function ServerCertificate_GetKey(obj: Wrapper<ServerCertificate>): PublicKey; | ||
export function SessionRecord_CurrentRatchetKeyMatches(s: Wrapper<SessionRecord>, key: Wrapper<PublicKey>): boolean; | ||
export function SessionRecord_Deserialize(buffer: Buffer): SessionRecord; | ||
export function SessionRecord_Deserialize(data: Buffer): SessionRecord; | ||
export function SessionRecord_GetLocalRegistrationId(obj: Wrapper<SessionRecord>): number; | ||
@@ -177,3 +182,3 @@ export function SessionRecord_GetRemoteRegistrationId(obj: Wrapper<SessionRecord>): number; | ||
export function SessionRecord_Serialize(obj: Wrapper<SessionRecord>): Buffer; | ||
export function SignalMessage_Deserialize(buffer: Buffer): SignalMessage; | ||
export function SignalMessage_Deserialize(data: Buffer): SignalMessage; | ||
export function SignalMessage_GetBody(obj: Wrapper<SignalMessage>): Buffer; | ||
@@ -185,3 +190,3 @@ export function SignalMessage_GetCounter(obj: Wrapper<SignalMessage>): number; | ||
export function SignalMessage_VerifyMac(msg: Wrapper<SignalMessage>, senderIdentityKey: Wrapper<PublicKey>, receiverIdentityKey: Wrapper<PublicKey>, macKey: Buffer): boolean; | ||
export function SignedPreKeyRecord_Deserialize(buffer: Buffer): SignedPreKeyRecord; | ||
export function SignedPreKeyRecord_Deserialize(data: Buffer): SignedPreKeyRecord; | ||
export function SignedPreKeyRecord_GetId(obj: Wrapper<SignedPreKeyRecord>): number; | ||
@@ -194,6 +199,6 @@ export function SignedPreKeyRecord_GetPrivateKey(obj: Wrapper<SignedPreKeyRecord>): PrivateKey; | ||
export function SignedPreKeyRecord_Serialize(obj: Wrapper<SignedPreKeyRecord>): Buffer; | ||
export function UnidentifiedSenderMessageContent_Deserialize(buffer: Buffer): UnidentifiedSenderMessageContent; | ||
export function UnidentifiedSenderMessageContent_Deserialize(data: Buffer): UnidentifiedSenderMessageContent; | ||
export function UnidentifiedSenderMessageContent_GetContentHint(m: Wrapper<UnidentifiedSenderMessageContent>): number; | ||
export function UnidentifiedSenderMessageContent_GetContents(obj: Wrapper<UnidentifiedSenderMessageContent>): Buffer; | ||
export function UnidentifiedSenderMessageContent_GetGroupId(m: Wrapper<UnidentifiedSenderMessageContent>): Buffer; | ||
export function UnidentifiedSenderMessageContent_GetGroupId(obj: Wrapper<UnidentifiedSenderMessageContent>): Buffer; | ||
export function UnidentifiedSenderMessageContent_GetMsgType(m: Wrapper<UnidentifiedSenderMessageContent>): number; | ||
@@ -208,2 +213,3 @@ export function UnidentifiedSenderMessageContent_GetSenderCert(m: Wrapper<UnidentifiedSenderMessageContent>): SenderCertificate; | ||
interface Fingerprint { readonly __type: unique symbol; } | ||
interface HsmEnclaveClient { readonly __type: unique symbol; } | ||
interface PlaintextContent { readonly __type: unique symbol; } | ||
@@ -210,0 +216,0 @@ interface PreKeyBundle { readonly __type: unique symbol; } |
{ | ||
"name": "@signalapp/signal-client", | ||
"version": "0.9.7", | ||
"version": "0.9.8", | ||
"license": "AGPL-3.0-only", | ||
@@ -5,0 +5,0 @@ "main": "node/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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8786229
1520