@signalapp/libsignal-client 0.81.1 → 0.82.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Native.d.ts +34 -31
- package/Native.js +4 -1
- package/dist/AccountKeys.d.ts +3 -3
- package/dist/AccountKeys.js +8 -14
- package/dist/Address.d.ts +1 -1
- package/dist/Address.js +8 -15
- package/dist/EcKeys.d.ts +1 -1
- package/dist/EcKeys.js +4 -10
- package/dist/Errors.d.ts +2 -2
- package/dist/Errors.js +5 -9
- package/dist/MessageBackup.d.ts +4 -4
- package/dist/MessageBackup.js +10 -18
- package/dist/Minidump.js +2 -6
- package/dist/Mp4Sanitizer.d.ts +2 -2
- package/dist/Mp4Sanitizer.js +3 -8
- package/dist/SealedSenderMultiRecipientMessage.d.ts +1 -1
- package/dist/SealedSenderMultiRecipientMessage.js +2 -5
- package/dist/WebpSanitizer.js +2 -6
- package/dist/acknowledgments.md +87 -89
- package/dist/incremental_mac.d.ts +1 -1
- package/dist/incremental_mac.js +11 -19
- package/dist/index.d.ts +18 -18
- package/dist/index.js +93 -158
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +3 -8
- package/dist/io.d.ts +1 -1
- package/dist/io.js +1 -5
- package/dist/net/CDSI.d.ts +2 -2
- package/dist/net/CDSI.js +8 -12
- package/dist/net/Chat.d.ts +11 -12
- package/dist/net/Chat.js +15 -22
- package/dist/net/KeyTransparency.d.ts +10 -10
- package/dist/net/KeyTransparency.js +4 -8
- package/dist/net/Registration.d.ts +5 -5
- package/dist/net/Registration.js +16 -22
- package/dist/net/SvrB.d.ts +3 -3
- package/dist/net/SvrB.js +5 -9
- package/dist/net/chat/UnauthUsernamesService.d.ts +4 -4
- package/dist/net/chat/UnauthUsernamesService.js +5 -7
- package/dist/net.d.ts +11 -11
- package/dist/net.js +27 -46
- package/dist/usernames.js +12 -23
- package/dist/zkgroup/GenericServerPublicParams.d.ts +1 -1
- package/dist/zkgroup/GenericServerPublicParams.js +3 -6
- package/dist/zkgroup/GenericServerSecretParams.d.ts +2 -2
- package/dist/zkgroup/GenericServerSecretParams.js +8 -11
- package/dist/zkgroup/NotarySignature.d.ts +1 -1
- package/dist/zkgroup/NotarySignature.js +3 -5
- package/dist/zkgroup/ServerPublicParams.d.ts +2 -2
- package/dist/zkgroup/ServerPublicParams.js +2 -5
- package/dist/zkgroup/ServerSecretParams.d.ts +3 -3
- package/dist/zkgroup/ServerSecretParams.js +10 -13
- package/dist/zkgroup/auth/AuthCredentialPresentation.d.ts +2 -2
- package/dist/zkgroup/auth/AuthCredentialPresentation.js +6 -9
- package/dist/zkgroup/auth/AuthCredentialWithPni.d.ts +1 -1
- package/dist/zkgroup/auth/AuthCredentialWithPni.js +3 -6
- package/dist/zkgroup/auth/AuthCredentialWithPniResponse.d.ts +1 -1
- package/dist/zkgroup/auth/AuthCredentialWithPniResponse.js +3 -6
- package/dist/zkgroup/auth/ClientZkAuthOperations.d.ts +6 -6
- package/dist/zkgroup/auth/ClientZkAuthOperations.js +9 -12
- package/dist/zkgroup/auth/ServerZkAuthOperations.d.ts +5 -5
- package/dist/zkgroup/auth/ServerZkAuthOperations.js +7 -10
- package/dist/zkgroup/backups/BackupAuthCredential.d.ts +5 -5
- package/dist/zkgroup/backups/BackupAuthCredential.js +12 -15
- package/dist/zkgroup/backups/BackupAuthCredentialPresentation.d.ts +4 -4
- package/dist/zkgroup/backups/BackupAuthCredentialPresentation.js +7 -10
- package/dist/zkgroup/backups/BackupAuthCredentialRequest.d.ts +5 -5
- package/dist/zkgroup/backups/BackupAuthCredentialRequest.js +8 -11
- package/dist/zkgroup/backups/BackupAuthCredentialRequestContext.d.ts +6 -6
- package/dist/zkgroup/backups/BackupAuthCredentialRequestContext.js +8 -11
- package/dist/zkgroup/backups/BackupAuthCredentialResponse.d.ts +1 -1
- package/dist/zkgroup/backups/BackupAuthCredentialResponse.js +3 -6
- package/dist/zkgroup/backups/BackupCredentialType.js +1 -3
- package/dist/zkgroup/backups/BackupLevel.js +1 -3
- package/dist/zkgroup/calllinks/CallLinkAuthCredential.d.ts +5 -5
- package/dist/zkgroup/calllinks/CallLinkAuthCredential.js +8 -11
- package/dist/zkgroup/calllinks/CallLinkAuthCredentialPresentation.d.ts +4 -4
- package/dist/zkgroup/calllinks/CallLinkAuthCredentialPresentation.js +5 -8
- package/dist/zkgroup/calllinks/CallLinkAuthCredentialResponse.d.ts +5 -5
- package/dist/zkgroup/calllinks/CallLinkAuthCredentialResponse.js +8 -11
- package/dist/zkgroup/calllinks/CallLinkPublicParams.d.ts +1 -1
- package/dist/zkgroup/calllinks/CallLinkPublicParams.js +3 -6
- package/dist/zkgroup/calllinks/CallLinkSecretParams.d.ts +4 -4
- package/dist/zkgroup/calllinks/CallLinkSecretParams.js +9 -12
- package/dist/zkgroup/calllinks/CreateCallLinkCredential.d.ts +5 -5
- package/dist/zkgroup/calllinks/CreateCallLinkCredential.js +8 -11
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialPresentation.d.ts +3 -3
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialPresentation.js +3 -6
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialRequest.d.ts +4 -4
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialRequest.js +8 -11
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialRequestContext.d.ts +6 -6
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialRequestContext.js +10 -13
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialResponse.d.ts +1 -1
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialResponse.js +3 -6
- package/dist/zkgroup/groups/ClientZkGroupCipher.d.ts +5 -5
- package/dist/zkgroup/groups/ClientZkGroupCipher.js +13 -16
- package/dist/zkgroup/groups/GroupIdentifier.d.ts +1 -1
- package/dist/zkgroup/groups/GroupIdentifier.js +3 -5
- package/dist/zkgroup/groups/GroupMasterKey.d.ts +1 -1
- package/dist/zkgroup/groups/GroupMasterKey.js +3 -5
- package/dist/zkgroup/groups/GroupPublicParams.d.ts +2 -2
- package/dist/zkgroup/groups/GroupPublicParams.js +5 -8
- package/dist/zkgroup/groups/GroupSecretParams.d.ts +3 -3
- package/dist/zkgroup/groups/GroupSecretParams.js +10 -13
- package/dist/zkgroup/groups/ProfileKeyCiphertext.d.ts +1 -1
- package/dist/zkgroup/groups/ProfileKeyCiphertext.js +3 -6
- package/dist/zkgroup/groups/UuidCiphertext.d.ts +1 -1
- package/dist/zkgroup/groups/UuidCiphertext.js +3 -6
- package/dist/zkgroup/groupsend/GroupSendDerivedKeyPair.d.ts +2 -2
- package/dist/zkgroup/groupsend/GroupSendDerivedKeyPair.js +3 -6
- package/dist/zkgroup/groupsend/GroupSendEndorsement.d.ts +5 -5
- package/dist/zkgroup/groupsend/GroupSendEndorsement.js +10 -13
- package/dist/zkgroup/groupsend/GroupSendEndorsementsResponse.d.ts +7 -7
- package/dist/zkgroup/groupsend/GroupSendEndorsementsResponse.js +14 -17
- package/dist/zkgroup/groupsend/GroupSendFullToken.d.ts +3 -3
- package/dist/zkgroup/groupsend/GroupSendFullToken.js +5 -8
- package/dist/zkgroup/groupsend/GroupSendToken.d.ts +2 -2
- package/dist/zkgroup/groupsend/GroupSendToken.js +5 -8
- package/dist/zkgroup/index.d.ts +57 -57
- package/dist/zkgroup/index.js +57 -118
- package/dist/zkgroup/internal/ByteArray.js +6 -10
- package/dist/zkgroup/internal/Constants.js +4 -7
- package/dist/zkgroup/profiles/ClientZkProfileOperations.d.ts +8 -8
- package/dist/zkgroup/profiles/ClientZkProfileOperations.js +12 -15
- package/dist/zkgroup/profiles/ExpiringProfileKeyCredential.d.ts +1 -1
- package/dist/zkgroup/profiles/ExpiringProfileKeyCredential.js +3 -6
- package/dist/zkgroup/profiles/ExpiringProfileKeyCredentialResponse.d.ts +1 -1
- package/dist/zkgroup/profiles/ExpiringProfileKeyCredentialResponse.js +3 -6
- package/dist/zkgroup/profiles/ProfileKey.d.ts +4 -4
- package/dist/zkgroup/profiles/ProfileKey.js +8 -10
- package/dist/zkgroup/profiles/ProfileKeyCommitment.d.ts +1 -1
- package/dist/zkgroup/profiles/ProfileKeyCommitment.js +3 -6
- package/dist/zkgroup/profiles/ProfileKeyCredentialPresentation.d.ts +3 -3
- package/dist/zkgroup/profiles/ProfileKeyCredentialPresentation.js +7 -10
- package/dist/zkgroup/profiles/ProfileKeyCredentialRequest.d.ts +1 -1
- package/dist/zkgroup/profiles/ProfileKeyCredentialRequest.js +3 -6
- package/dist/zkgroup/profiles/ProfileKeyCredentialRequestContext.d.ts +2 -2
- package/dist/zkgroup/profiles/ProfileKeyCredentialRequestContext.js +5 -8
- package/dist/zkgroup/profiles/ProfileKeyVersion.d.ts +1 -1
- package/dist/zkgroup/profiles/ProfileKeyVersion.js +3 -5
- package/dist/zkgroup/profiles/ServerZkProfileOperations.d.ts +7 -7
- package/dist/zkgroup/profiles/ServerZkProfileOperations.js +7 -10
- package/dist/zkgroup/receipts/ClientZkReceiptOperations.d.ts +6 -6
- package/dist/zkgroup/receipts/ClientZkReceiptOperations.js +12 -15
- package/dist/zkgroup/receipts/ReceiptCredential.d.ts +1 -1
- package/dist/zkgroup/receipts/ReceiptCredential.js +3 -6
- package/dist/zkgroup/receipts/ReceiptCredentialPresentation.d.ts +2 -2
- package/dist/zkgroup/receipts/ReceiptCredentialPresentation.js +6 -8
- package/dist/zkgroup/receipts/ReceiptCredentialRequest.d.ts +1 -1
- package/dist/zkgroup/receipts/ReceiptCredentialRequest.js +3 -6
- package/dist/zkgroup/receipts/ReceiptCredentialRequestContext.d.ts +2 -2
- package/dist/zkgroup/receipts/ReceiptCredentialRequestContext.js +6 -8
- package/dist/zkgroup/receipts/ReceiptCredentialResponse.d.ts +1 -1
- package/dist/zkgroup/receipts/ReceiptCredentialResponse.js +3 -6
- package/dist/zkgroup/receipts/ReceiptSerial.d.ts +1 -1
- package/dist/zkgroup/receipts/ReceiptSerial.js +3 -5
- package/dist/zkgroup/receipts/ServerZkReceiptOperations.d.ts +4 -4
- package/dist/zkgroup/receipts/ServerZkReceiptOperations.js +7 -10
- package/package.json +19 -16
- package/prebuilds/darwin-arm64/@signalapp+libsignal-client.node +0 -0
- package/prebuilds/darwin-x64/@signalapp+libsignal-client.node +0 -0
- package/prebuilds/linux-arm64/@signalapp+libsignal-client.node +0 -0
- package/prebuilds/linux-x64/@signalapp+libsignal-client.node +0 -0
- package/prebuilds/win32-arm64/@signalapp+libsignal-client.node +0 -0
- package/prebuilds/win32-x64/@signalapp+libsignal-client.node +0 -0
- package/zkgroup.js +1 -1
package/Native.d.ts
CHANGED
|
@@ -64,80 +64,83 @@ enum IdentityChange {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
type IdentityKeyStore = {
|
|
67
|
-
_getIdentityKey()
|
|
68
|
-
_getLocalRegistrationId()
|
|
69
|
-
_saveIdentity
|
|
70
|
-
|
|
67
|
+
_getIdentityKey: () => Promise<PrivateKey>;
|
|
68
|
+
_getLocalRegistrationId: () => Promise<number>;
|
|
69
|
+
_saveIdentity: (
|
|
70
|
+
name: ProtocolAddress,
|
|
71
|
+
key: PublicKey
|
|
72
|
+
) => Promise<IdentityChange>;
|
|
73
|
+
_isTrustedIdentity: (
|
|
71
74
|
name: ProtocolAddress,
|
|
72
75
|
key: PublicKey,
|
|
73
76
|
sending: boolean
|
|
74
|
-
)
|
|
75
|
-
_getIdentity(name: ProtocolAddress)
|
|
77
|
+
) => Promise<boolean>;
|
|
78
|
+
_getIdentity: (name: ProtocolAddress) => Promise<PublicKey | null>;
|
|
76
79
|
};
|
|
77
80
|
|
|
78
81
|
type SessionStore = {
|
|
79
|
-
_saveSession(addr: ProtocolAddress, record: SessionRecord)
|
|
80
|
-
_getSession(addr: ProtocolAddress)
|
|
82
|
+
_saveSession: (addr: ProtocolAddress, record: SessionRecord) => Promise<void>;
|
|
83
|
+
_getSession: (addr: ProtocolAddress) => Promise<SessionRecord | null>;
|
|
81
84
|
};
|
|
82
85
|
|
|
83
86
|
type PreKeyStore = {
|
|
84
|
-
_savePreKey(preKeyId: number, record: PreKeyRecord)
|
|
85
|
-
_getPreKey(preKeyId: number)
|
|
86
|
-
_removePreKey(preKeyId: number)
|
|
87
|
+
_savePreKey: (preKeyId: number, record: PreKeyRecord) => Promise<void>;
|
|
88
|
+
_getPreKey: (preKeyId: number) => Promise<PreKeyRecord>;
|
|
89
|
+
_removePreKey: (preKeyId: number) => Promise<void>;
|
|
87
90
|
};
|
|
88
91
|
|
|
89
92
|
type SignedPreKeyStore = {
|
|
90
|
-
_saveSignedPreKey(
|
|
93
|
+
_saveSignedPreKey: (
|
|
91
94
|
signedPreKeyId: number,
|
|
92
95
|
record: SignedPreKeyRecord
|
|
93
|
-
)
|
|
94
|
-
_getSignedPreKey(signedPreKeyId: number)
|
|
96
|
+
) => Promise<void>;
|
|
97
|
+
_getSignedPreKey: (signedPreKeyId: number) => Promise<SignedPreKeyRecord>;
|
|
95
98
|
};
|
|
96
99
|
|
|
97
100
|
type KyberPreKeyStore = {
|
|
98
|
-
_saveKyberPreKey(
|
|
101
|
+
_saveKyberPreKey: (
|
|
99
102
|
kyberPreKeyId: number,
|
|
100
103
|
record: KyberPreKeyRecord
|
|
101
|
-
)
|
|
102
|
-
_getKyberPreKey(kyberPreKeyId: number)
|
|
103
|
-
_markKyberPreKeyUsed(
|
|
104
|
+
) => Promise<void>;
|
|
105
|
+
_getKyberPreKey: (kyberPreKeyId: number) => Promise<KyberPreKeyRecord>;
|
|
106
|
+
_markKyberPreKeyUsed: (
|
|
104
107
|
kyberPreKeyId: number,
|
|
105
108
|
signedPreKeyId: number,
|
|
106
109
|
baseKey: PublicKey
|
|
107
|
-
)
|
|
110
|
+
) => Promise<void>;
|
|
108
111
|
};
|
|
109
112
|
|
|
110
113
|
type SenderKeyStore = {
|
|
111
|
-
_saveSenderKey(
|
|
114
|
+
_saveSenderKey: (
|
|
112
115
|
sender: ProtocolAddress,
|
|
113
116
|
distributionId: Uuid,
|
|
114
117
|
record: SenderKeyRecord
|
|
115
|
-
)
|
|
116
|
-
_getSenderKey(
|
|
118
|
+
) => Promise<void>;
|
|
119
|
+
_getSenderKey: (
|
|
117
120
|
sender: ProtocolAddress,
|
|
118
121
|
distributionId: Uuid
|
|
119
|
-
)
|
|
122
|
+
) => Promise<SenderKeyRecord | null>;
|
|
120
123
|
};
|
|
121
124
|
|
|
122
125
|
type InputStream = {
|
|
123
|
-
_read(amount: number)
|
|
124
|
-
_skip(amount: number)
|
|
126
|
+
_read: (amount: number) => Promise<Uint8Array>;
|
|
127
|
+
_skip: (amount: number) => Promise<void>;
|
|
125
128
|
};
|
|
126
129
|
|
|
127
130
|
type SyncInputStream = Uint8Array;
|
|
128
131
|
|
|
129
132
|
type ChatListener = {
|
|
130
|
-
_incoming_message(
|
|
133
|
+
_incoming_message: (
|
|
131
134
|
envelope: Uint8Array,
|
|
132
135
|
timestamp: number,
|
|
133
136
|
ack: ServerMessageAck
|
|
134
|
-
)
|
|
135
|
-
_queue_empty()
|
|
136
|
-
_received_alerts(alerts: string[])
|
|
137
|
-
_connection_interrupted(
|
|
137
|
+
) => void;
|
|
138
|
+
_queue_empty: () => void;
|
|
139
|
+
_received_alerts: (alerts: string[]) => void;
|
|
140
|
+
_connection_interrupted: (
|
|
138
141
|
// A LibSignalError or null, but not naming the type to avoid circular import dependencies.
|
|
139
142
|
reason: Error | null
|
|
140
|
-
)
|
|
143
|
+
) => void;
|
|
141
144
|
};
|
|
142
145
|
|
|
143
146
|
type ChallengeOption = 'pushChallenge' | 'captcha';
|
package/Native.js
CHANGED
package/dist/AccountKeys.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import ByteArray from './zkgroup/internal/ByteArray';
|
|
2
|
-
import { Aci } from './Address';
|
|
3
|
-
import { PrivateKey } from './EcKeys';
|
|
1
|
+
import ByteArray from './zkgroup/internal/ByteArray.js';
|
|
2
|
+
import { Aci } from './Address.js';
|
|
3
|
+
import { PrivateKey } from './EcKeys.js';
|
|
4
4
|
/**
|
|
5
5
|
* The randomly-generated user-memorized entropy used to derive the backup key,
|
|
6
6
|
* with other possible future uses.
|
package/dist/AccountKeys.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2024 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.BackupForwardSecrecyToken = exports.BackupKey = exports.AccountEntropyPool = void 0;
|
|
8
5
|
/**
|
|
9
6
|
* Cryptographic hashing, randomness generation, etc. related to SVR/Backup Keys.
|
|
10
7
|
*
|
|
@@ -12,17 +9,17 @@ exports.BackupForwardSecrecyToken = exports.BackupKey = exports.AccountEntropyPo
|
|
|
12
9
|
*
|
|
13
10
|
* @module AccountKeys
|
|
14
11
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
import * as crypto from 'node:crypto';
|
|
13
|
+
import Native from '../Native.js';
|
|
14
|
+
import ByteArray from './zkgroup/internal/ByteArray.js';
|
|
15
|
+
import { PrivateKey } from './EcKeys.js';
|
|
19
16
|
/**
|
|
20
17
|
* The randomly-generated user-memorized entropy used to derive the backup key,
|
|
21
18
|
* with other possible future uses.
|
|
22
19
|
*
|
|
23
20
|
* Contains log_2(36^64) = ~330 bits of entropy.
|
|
24
21
|
*/
|
|
25
|
-
class AccountEntropyPool {
|
|
22
|
+
export class AccountEntropyPool {
|
|
26
23
|
/**
|
|
27
24
|
* Randomly generates an Account Entropy Pool and returns the canonical string
|
|
28
25
|
* representation of that pool.
|
|
@@ -61,7 +58,6 @@ class AccountEntropyPool {
|
|
|
61
58
|
return new BackupKey(Native.AccountEntropyPool_DeriveBackupKey(accountEntropyPool));
|
|
62
59
|
}
|
|
63
60
|
}
|
|
64
|
-
exports.AccountEntropyPool = AccountEntropyPool;
|
|
65
61
|
/**
|
|
66
62
|
* A key used for many aspects of backups.
|
|
67
63
|
*
|
|
@@ -69,7 +65,7 @@ exports.AccountEntropyPool = AccountEntropyPool;
|
|
|
69
65
|
* root backup key" or just "the backup key") that's derived from an {@link AccountEntropyPool}, and
|
|
70
66
|
* a "media" key (formally the "media root backup key") that's not derived from anything else.
|
|
71
67
|
*/
|
|
72
|
-
class BackupKey extends
|
|
68
|
+
export class BackupKey extends ByteArray {
|
|
73
69
|
constructor(contents) {
|
|
74
70
|
super(contents, BackupKey.checkLength(BackupKey.SIZE));
|
|
75
71
|
}
|
|
@@ -98,7 +94,7 @@ class BackupKey extends ByteArray_1.default {
|
|
|
98
94
|
* Used for both message and media backups.
|
|
99
95
|
*/
|
|
100
96
|
deriveEcKey(aci) {
|
|
101
|
-
return
|
|
97
|
+
return PrivateKey._fromNativeHandle(Native.BackupKey_DeriveEcKey(this.contents, aci.getServiceIdFixedWidthBinary()));
|
|
102
98
|
}
|
|
103
99
|
/**
|
|
104
100
|
* Derives the AES key used for encrypted fields in local backup metadata.
|
|
@@ -138,7 +134,6 @@ class BackupKey extends ByteArray_1.default {
|
|
|
138
134
|
return Native.BackupKey_DeriveThumbnailTransitEncryptionKey(this.contents, mediaId);
|
|
139
135
|
}
|
|
140
136
|
}
|
|
141
|
-
exports.BackupKey = BackupKey;
|
|
142
137
|
BackupKey.SIZE = 32;
|
|
143
138
|
/**
|
|
144
139
|
* A forward secrecy token used for deriving message backup keys.
|
|
@@ -146,11 +141,10 @@ BackupKey.SIZE = 32;
|
|
|
146
141
|
* This token is retrieved from the server when restoring a backup and is used together
|
|
147
142
|
* with the backup key to derive the actual encryption keys for message backups.
|
|
148
143
|
*/
|
|
149
|
-
class BackupForwardSecrecyToken extends
|
|
144
|
+
export class BackupForwardSecrecyToken extends ByteArray {
|
|
150
145
|
constructor(contents) {
|
|
151
146
|
super(contents, BackupForwardSecrecyToken.checkLength(BackupForwardSecrecyToken.SIZE));
|
|
152
147
|
}
|
|
153
148
|
}
|
|
154
|
-
exports.BackupForwardSecrecyToken = BackupForwardSecrecyToken;
|
|
155
149
|
BackupForwardSecrecyToken.SIZE = 32;
|
|
156
150
|
//# sourceMappingURL=AccountKeys.js.map
|
package/dist/Address.d.ts
CHANGED
package/dist/Address.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2021 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const uuid = require("uuid");
|
|
10
|
-
var ServiceIdKind;
|
|
5
|
+
import Native from '../Native.js';
|
|
6
|
+
import * as uuid from 'uuid';
|
|
7
|
+
export var ServiceIdKind;
|
|
11
8
|
(function (ServiceIdKind) {
|
|
12
9
|
ServiceIdKind[ServiceIdKind["Aci"] = 0] = "Aci";
|
|
13
10
|
ServiceIdKind[ServiceIdKind["Pni"] = 1] = "Pni";
|
|
14
|
-
})(ServiceIdKind || (
|
|
11
|
+
})(ServiceIdKind || (ServiceIdKind = {}));
|
|
15
12
|
const SERVICE_ID_FIXED_WIDTH_BINARY_LEN = 17;
|
|
16
13
|
/**
|
|
17
14
|
* Typed representation of a Signal service ID, which can be one of various types.
|
|
@@ -19,7 +16,7 @@ const SERVICE_ID_FIXED_WIDTH_BINARY_LEN = 17;
|
|
|
19
16
|
* Conceptually this is a UUID in a particular "namespace" representing a particular way to reach a
|
|
20
17
|
* user on the Signal service.
|
|
21
18
|
*/
|
|
22
|
-
class ServiceId extends Object {
|
|
19
|
+
export class ServiceId extends Object {
|
|
23
20
|
// This has to be public for `InstanceType<T>`, which we use below.
|
|
24
21
|
constructor(serviceIdFixedWidthBinary) {
|
|
25
22
|
super();
|
|
@@ -102,8 +99,7 @@ class ServiceId extends Object {
|
|
|
102
99
|
return result;
|
|
103
100
|
}
|
|
104
101
|
}
|
|
105
|
-
|
|
106
|
-
class Aci extends ServiceId {
|
|
102
|
+
export class Aci extends ServiceId {
|
|
107
103
|
static fromUuid(uuidString) {
|
|
108
104
|
return this.fromUuidBytes(uuid.parse(uuidString));
|
|
109
105
|
}
|
|
@@ -111,8 +107,7 @@ class Aci extends ServiceId {
|
|
|
111
107
|
return this.fromUuidBytesAndKind(uuidBytes, ServiceIdKind.Aci);
|
|
112
108
|
}
|
|
113
109
|
}
|
|
114
|
-
|
|
115
|
-
class Pni extends ServiceId {
|
|
110
|
+
export class Pni extends ServiceId {
|
|
116
111
|
static fromUuid(uuidString) {
|
|
117
112
|
return this.fromUuidBytes(uuid.parse(uuidString));
|
|
118
113
|
}
|
|
@@ -120,8 +115,7 @@ class Pni extends ServiceId {
|
|
|
120
115
|
return this.fromUuidBytesAndKind(uuidBytes, ServiceIdKind.Pni);
|
|
121
116
|
}
|
|
122
117
|
}
|
|
123
|
-
|
|
124
|
-
class ProtocolAddress {
|
|
118
|
+
export class ProtocolAddress {
|
|
125
119
|
constructor(handle) {
|
|
126
120
|
this._nativeHandle = handle;
|
|
127
121
|
}
|
|
@@ -161,5 +155,4 @@ class ProtocolAddress {
|
|
|
161
155
|
return `${this.name()}.${this.deviceId()}`;
|
|
162
156
|
}
|
|
163
157
|
}
|
|
164
|
-
exports.ProtocolAddress = ProtocolAddress;
|
|
165
158
|
//# sourceMappingURL=Address.js.map
|
package/dist/EcKeys.d.ts
CHANGED
package/dist/EcKeys.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2020-2022 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const Native = require("../Native");
|
|
9
|
-
class PublicKey {
|
|
5
|
+
import Native from '../Native.js';
|
|
6
|
+
export class PublicKey {
|
|
10
7
|
constructor(handle) {
|
|
11
8
|
this._nativeHandle = handle;
|
|
12
9
|
}
|
|
@@ -49,8 +46,7 @@ class PublicKey {
|
|
|
49
46
|
return Native.PublicKey_HpkeSeal(this, msg, infoBuffer, associatedData ?? new Uint8Array());
|
|
50
47
|
}
|
|
51
48
|
}
|
|
52
|
-
|
|
53
|
-
class PrivateKey {
|
|
49
|
+
export class PrivateKey {
|
|
54
50
|
constructor(handle) {
|
|
55
51
|
this._nativeHandle = handle;
|
|
56
52
|
}
|
|
@@ -87,8 +83,7 @@ class PrivateKey {
|
|
|
87
83
|
return Native.PrivateKey_HpkeOpen(this, ciphertext, infoBuffer, associatedData ?? new Uint8Array());
|
|
88
84
|
}
|
|
89
85
|
}
|
|
90
|
-
|
|
91
|
-
class IdentityKeyPair {
|
|
86
|
+
export class IdentityKeyPair {
|
|
92
87
|
constructor(publicKey, privateKey) {
|
|
93
88
|
this.publicKey = publicKey;
|
|
94
89
|
this.privateKey = privateKey;
|
|
@@ -108,5 +103,4 @@ class IdentityKeyPair {
|
|
|
108
103
|
return Native.IdentityKeyPair_SignAlternateIdentity(this.publicKey, this.privateKey, other);
|
|
109
104
|
}
|
|
110
105
|
}
|
|
111
|
-
exports.IdentityKeyPair = IdentityKeyPair;
|
|
112
106
|
//# sourceMappingURL=EcKeys.js.map
|
package/dist/Errors.d.ts
CHANGED
package/dist/Errors.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2021 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const Address_1 = require("./Address");
|
|
9
|
-
var ErrorCode;
|
|
5
|
+
import { ProtocolAddress } from './Address.js';
|
|
6
|
+
export var ErrorCode;
|
|
10
7
|
(function (ErrorCode) {
|
|
11
8
|
ErrorCode[ErrorCode["Generic"] = 0] = "Generic";
|
|
12
9
|
ErrorCode[ErrorCode["DuplicatedMessage"] = 1] = "DuplicatedMessage";
|
|
@@ -54,8 +51,8 @@ var ErrorCode;
|
|
|
54
51
|
ErrorCode[ErrorCode["KeyTransparencyError"] = 43] = "KeyTransparencyError";
|
|
55
52
|
ErrorCode[ErrorCode["KeyTransparencyVerificationFailed"] = 44] = "KeyTransparencyVerificationFailed";
|
|
56
53
|
ErrorCode[ErrorCode["IncrementalMacVerificationFailed"] = 45] = "IncrementalMacVerificationFailed";
|
|
57
|
-
})(ErrorCode || (
|
|
58
|
-
class LibSignalErrorBase extends Error {
|
|
54
|
+
})(ErrorCode || (ErrorCode = {}));
|
|
55
|
+
export class LibSignalErrorBase extends Error {
|
|
59
56
|
constructor(message, name, operation, extraProps) {
|
|
60
57
|
super(message);
|
|
61
58
|
// Include the dynamic check for `name in ErrorCode` in case there's a bug in the Rust code.
|
|
@@ -82,7 +79,7 @@ class LibSignalErrorBase extends Error {
|
|
|
82
79
|
case ErrorCode.UntrustedIdentity:
|
|
83
80
|
return this._addr;
|
|
84
81
|
case ErrorCode.InvalidRegistrationId:
|
|
85
|
-
return
|
|
82
|
+
return ProtocolAddress._fromNativeHandle(this._addr);
|
|
86
83
|
default:
|
|
87
84
|
throw new TypeError(`cannot get address from this error (${this})`);
|
|
88
85
|
}
|
|
@@ -103,5 +100,4 @@ class LibSignalErrorBase extends Error {
|
|
|
103
100
|
return false;
|
|
104
101
|
}
|
|
105
102
|
}
|
|
106
|
-
exports.LibSignalErrorBase = LibSignalErrorBase;
|
|
107
103
|
//# sourceMappingURL=Errors.js.map
|
package/dist/MessageBackup.d.ts
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module MessageBackup
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
7
|
-
import { BackupForwardSecrecyToken, BackupKey } from './AccountKeys';
|
|
8
|
-
import { Aci } from './Address';
|
|
9
|
-
import { InputStream } from './io';
|
|
6
|
+
import Native from '../Native.js';
|
|
7
|
+
import { BackupForwardSecrecyToken, BackupKey } from './AccountKeys.js';
|
|
8
|
+
import { Aci } from './Address.js';
|
|
9
|
+
import { InputStream } from './io.js';
|
|
10
10
|
export type InputStreamFactory = () => InputStream;
|
|
11
11
|
/**
|
|
12
12
|
* Result of validating a message backup bundle.
|
package/dist/MessageBackup.js
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2024 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.ComparableBackup = exports.OnlineBackupValidator = exports.validate = exports.Purpose = exports.MessageBackupKey = exports.ValidationOutcome = void 0;
|
|
8
5
|
/**
|
|
9
6
|
* Message backup validation routines.
|
|
10
7
|
*
|
|
11
8
|
* @module MessageBackup
|
|
12
9
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
import Native from '../Native.js';
|
|
11
|
+
import { BackupKey } from './AccountKeys.js';
|
|
15
12
|
/**
|
|
16
13
|
* Result of validating a message backup bundle.
|
|
17
14
|
*/
|
|
18
|
-
class ValidationOutcome {
|
|
15
|
+
export class ValidationOutcome {
|
|
19
16
|
/**
|
|
20
17
|
* `true` if the backup is valid, `false` otherwise.
|
|
21
18
|
*
|
|
@@ -30,13 +27,12 @@ class ValidationOutcome {
|
|
|
30
27
|
this.unknownFieldMessages = unknownFieldMessages;
|
|
31
28
|
}
|
|
32
29
|
}
|
|
33
|
-
exports.ValidationOutcome = ValidationOutcome;
|
|
34
30
|
/**
|
|
35
31
|
* Key used to encrypt and decrypt a message backup bundle.
|
|
36
32
|
*
|
|
37
33
|
* @see {@link BackupKey}
|
|
38
34
|
*/
|
|
39
|
-
class MessageBackupKey {
|
|
35
|
+
export class MessageBackupKey {
|
|
40
36
|
/**
|
|
41
37
|
* Create a backup bundle key from an account entropy pool and ACI.
|
|
42
38
|
*
|
|
@@ -54,7 +50,7 @@ class MessageBackupKey {
|
|
|
54
50
|
else {
|
|
55
51
|
const { backupId, forwardSecrecyToken } = input;
|
|
56
52
|
let { backupKey } = input;
|
|
57
|
-
if (backupKey instanceof
|
|
53
|
+
if (backupKey instanceof BackupKey) {
|
|
58
54
|
backupKey = backupKey.contents;
|
|
59
55
|
}
|
|
60
56
|
this._nativeHandle = Native.MessageBackupKey_FromBackupKeyAndBackupId(backupKey, backupId, forwardSecrecyToken?.contents ?? null);
|
|
@@ -69,13 +65,12 @@ class MessageBackupKey {
|
|
|
69
65
|
return Native.MessageBackupKey_GetAesKey(this);
|
|
70
66
|
}
|
|
71
67
|
}
|
|
72
|
-
exports.MessageBackupKey = MessageBackupKey;
|
|
73
68
|
// This must match the Rust version of the enum.
|
|
74
|
-
var Purpose;
|
|
69
|
+
export var Purpose;
|
|
75
70
|
(function (Purpose) {
|
|
76
71
|
Purpose[Purpose["DeviceTransfer"] = 0] = "DeviceTransfer";
|
|
77
72
|
Purpose[Purpose["RemoteBackup"] = 1] = "RemoteBackup";
|
|
78
|
-
})(Purpose || (
|
|
73
|
+
})(Purpose || (Purpose = {}));
|
|
79
74
|
/**
|
|
80
75
|
* Validate a backup file
|
|
81
76
|
*
|
|
@@ -88,7 +83,7 @@ var Purpose;
|
|
|
88
83
|
*
|
|
89
84
|
* @see OnlineBackupValidator
|
|
90
85
|
*/
|
|
91
|
-
async function validate(backupKey, purpose, inputFactory, length) {
|
|
86
|
+
export async function validate(backupKey, purpose, inputFactory, length) {
|
|
92
87
|
let firstStream;
|
|
93
88
|
let secondStream;
|
|
94
89
|
try {
|
|
@@ -101,7 +96,6 @@ async function validate(backupKey, purpose, inputFactory, length) {
|
|
|
101
96
|
await secondStream?.close();
|
|
102
97
|
}
|
|
103
98
|
}
|
|
104
|
-
exports.validate = validate;
|
|
105
99
|
/**
|
|
106
100
|
* An alternative to {@link validate()} that validates a backup frame-by-frame.
|
|
107
101
|
*
|
|
@@ -124,7 +118,7 @@ exports.validate = validate;
|
|
|
124
118
|
* validator.finalize() // don't forget this!
|
|
125
119
|
* ```
|
|
126
120
|
*/
|
|
127
|
-
class OnlineBackupValidator {
|
|
121
|
+
export class OnlineBackupValidator {
|
|
128
122
|
/**
|
|
129
123
|
* Initializes an OnlineBackupValidator from the given BackupInfo protobuf message.
|
|
130
124
|
*
|
|
@@ -156,7 +150,6 @@ class OnlineBackupValidator {
|
|
|
156
150
|
Native.OnlineBackupValidator_Finalize(this);
|
|
157
151
|
}
|
|
158
152
|
}
|
|
159
|
-
exports.OnlineBackupValidator = OnlineBackupValidator;
|
|
160
153
|
/**
|
|
161
154
|
* An in-memory representation of a backup file used to compare contents.
|
|
162
155
|
*
|
|
@@ -170,7 +163,7 @@ exports.OnlineBackupValidator = OnlineBackupValidator;
|
|
|
170
163
|
* The diff of the canonical strings (which may be rather large) will show the
|
|
171
164
|
* differences between the logical content of the input backup files.
|
|
172
165
|
*/
|
|
173
|
-
class ComparableBackup {
|
|
166
|
+
export class ComparableBackup {
|
|
174
167
|
constructor(handle) {
|
|
175
168
|
this._nativeHandle = handle;
|
|
176
169
|
}
|
|
@@ -209,5 +202,4 @@ class ComparableBackup {
|
|
|
209
202
|
return Native.ComparableBackup_GetUnknownFields(this);
|
|
210
203
|
}
|
|
211
204
|
}
|
|
212
|
-
exports.ComparableBackup = ComparableBackup;
|
|
213
205
|
//# sourceMappingURL=MessageBackup.js.map
|
package/dist/Minidump.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2024 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const Native = require("../Native");
|
|
9
|
-
function toJSONString(buffer) {
|
|
5
|
+
import Native from '../Native.js';
|
|
6
|
+
export function toJSONString(buffer) {
|
|
10
7
|
return Native.MinidumpToJSONString(buffer);
|
|
11
8
|
}
|
|
12
|
-
exports.toJSONString = toJSONString;
|
|
13
9
|
//# sourceMappingURL=Minidump.js.map
|
package/dist/Mp4Sanitizer.d.ts
CHANGED
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
*
|
|
26
26
|
* @module Mp4Sanitizer
|
|
27
27
|
*/
|
|
28
|
-
import
|
|
29
|
-
import { InputStream } from './io';
|
|
28
|
+
import Native from '../Native.js';
|
|
29
|
+
import { InputStream } from './io.js';
|
|
30
30
|
export declare class SanitizedMetadata {
|
|
31
31
|
readonly _nativeHandle: Native.SanitizedMetadata;
|
|
32
32
|
private constructor();
|
package/dist/Mp4Sanitizer.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2023 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.sanitize = exports.SanitizedMetadata = void 0;
|
|
8
5
|
/**
|
|
9
6
|
* An MP4 format “sanitizer”.
|
|
10
7
|
*
|
|
@@ -32,8 +29,8 @@ exports.sanitize = exports.SanitizedMetadata = void 0;
|
|
|
32
29
|
*
|
|
33
30
|
* @module Mp4Sanitizer
|
|
34
31
|
*/
|
|
35
|
-
|
|
36
|
-
class SanitizedMetadata {
|
|
32
|
+
import Native from '../Native.js';
|
|
33
|
+
export class SanitizedMetadata {
|
|
37
34
|
constructor(handle) {
|
|
38
35
|
this._nativeHandle = handle;
|
|
39
36
|
}
|
|
@@ -66,7 +63,6 @@ class SanitizedMetadata {
|
|
|
66
63
|
return Native.SanitizedMetadata_GetDataLen(this);
|
|
67
64
|
}
|
|
68
65
|
}
|
|
69
|
-
exports.SanitizedMetadata = SanitizedMetadata;
|
|
70
66
|
/**
|
|
71
67
|
* Sanitize an MP4 input.
|
|
72
68
|
*
|
|
@@ -77,9 +73,8 @@ exports.SanitizedMetadata = SanitizedMetadata;
|
|
|
77
73
|
* @throws {InvalidMediaInputError} If the input could not be parsed because it was invalid.
|
|
78
74
|
* @throws {UnsupportedMediaInputError} If the input could not be parsed because it's unsupported in some way.
|
|
79
75
|
*/
|
|
80
|
-
async function sanitize(input, len) {
|
|
76
|
+
export async function sanitize(input, len) {
|
|
81
77
|
const sanitizedMetadataNativeHandle = await Native.Mp4Sanitizer_Sanitize(input, len);
|
|
82
78
|
return SanitizedMetadata._fromNativeHandle(sanitizedMetadataNativeHandle);
|
|
83
79
|
}
|
|
84
|
-
exports.sanitize = sanitize;
|
|
85
80
|
//# sourceMappingURL=Mp4Sanitizer.js.map
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2024 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
const Native = require("../Native");
|
|
5
|
+
import Native from '../Native.js';
|
|
8
6
|
/**
|
|
9
7
|
* A parsed Sealed Sender v2 "SentMessage", ready to be fanned out to multiple recipients.
|
|
10
8
|
*
|
|
11
9
|
* The implementation assumes that every device for a particular recipient should use the same key
|
|
12
10
|
* material.
|
|
13
11
|
*/
|
|
14
|
-
class SealedSenderMultiRecipientMessage {
|
|
12
|
+
export default class SealedSenderMultiRecipientMessage {
|
|
15
13
|
constructor(buffer) {
|
|
16
14
|
const { recipientMap, excludedRecipients, offsetOfSharedData } = Native.SealedSenderMultiRecipientMessage_Parse(buffer);
|
|
17
15
|
this._buffer = buffer;
|
|
@@ -55,5 +53,4 @@ class SealedSenderMultiRecipientMessage {
|
|
|
55
53
|
]));
|
|
56
54
|
}
|
|
57
55
|
}
|
|
58
|
-
exports.default = SealedSenderMultiRecipientMessage;
|
|
59
56
|
//# sourceMappingURL=SealedSenderMultiRecipientMessage.js.map
|
package/dist/WebpSanitizer.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2023 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.sanitize = void 0;
|
|
8
5
|
/**
|
|
9
6
|
* A WebP format “sanitizer”.
|
|
10
7
|
*
|
|
@@ -13,7 +10,7 @@ exports.sanitize = void 0;
|
|
|
13
10
|
*
|
|
14
11
|
* @module WebpSanitizer
|
|
15
12
|
*/
|
|
16
|
-
|
|
13
|
+
import Native from '../Native.js';
|
|
17
14
|
/**
|
|
18
15
|
* Sanitize a WebP input.
|
|
19
16
|
*
|
|
@@ -22,8 +19,7 @@ const Native = require("../Native");
|
|
|
22
19
|
* @throws {InvalidMediaInputError} If the input could not be parsed because it was invalid.
|
|
23
20
|
* @throws {UnsupportedMediaInputError} If the input could not be parsed because it's unsupported in some way.
|
|
24
21
|
*/
|
|
25
|
-
function sanitize(input) {
|
|
22
|
+
export function sanitize(input) {
|
|
26
23
|
Native.WebpSanitizer_Sanitize(input);
|
|
27
24
|
}
|
|
28
|
-
exports.sanitize = sanitize;
|
|
29
25
|
//# sourceMappingURL=WebpSanitizer.js.map
|