@signalapp/libsignal-client 0.64.1 → 0.65.1
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 +13 -13
- package/dist/AccountKeys.d.ts +6 -0
- package/dist/AccountKeys.js +8 -0
- package/dist/acknowledgments.md +128 -47
- package/dist/net.d.ts +1 -136
- package/dist/net.js +6 -31
- package/dist/zkgroup/auth/AuthCredentialPresentation.d.ts +1 -1
- package/dist/zkgroup/auth/AuthCredentialPresentation.js +1 -5
- package/dist/zkgroup/auth/ServerZkAuthOperations.d.ts +0 -8
- package/dist/zkgroup/auth/ServerZkAuthOperations.js +0 -13
- package/package.json +1 -1
- 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/Native.d.ts
CHANGED
|
@@ -138,6 +138,8 @@ type MessageBackupValidationOutcome = {
|
|
|
138
138
|
unknownFieldMessages: Array<string>;
|
|
139
139
|
};
|
|
140
140
|
|
|
141
|
+
type AccountEntropyPool = string;
|
|
142
|
+
|
|
141
143
|
type CancellablePromise<T> = Promise<T> & {
|
|
142
144
|
_cancellationToken: bigint;
|
|
143
145
|
};
|
|
@@ -148,21 +150,22 @@ type Serialized<T> = Buffer;
|
|
|
148
150
|
export function registerErrors(errorsModule: Record<string, unknown>): void;
|
|
149
151
|
|
|
150
152
|
export const enum LogLevel { Error = 1, Warn, Info, Debug, Trace }
|
|
151
|
-
export function AccountEntropyPool_DeriveBackupKey(accountEntropy:
|
|
152
|
-
export function AccountEntropyPool_DeriveSvrKey(accountEntropy:
|
|
153
|
+
export function AccountEntropyPool_DeriveBackupKey(accountEntropy: AccountEntropyPool): Buffer;
|
|
154
|
+
export function AccountEntropyPool_DeriveSvrKey(accountEntropy: AccountEntropyPool): Buffer;
|
|
153
155
|
export function AccountEntropyPool_Generate(): string;
|
|
156
|
+
export function AccountEntropyPool_IsValid(accountEntropy: string): boolean;
|
|
154
157
|
export function Aes256GcmSiv_Decrypt(aesGcmSiv: Wrapper<Aes256GcmSiv>, ctext: Buffer, nonce: Buffer, associatedData: Buffer): Buffer;
|
|
155
158
|
export function Aes256GcmSiv_Encrypt(aesGcmSivObj: Wrapper<Aes256GcmSiv>, ptext: Buffer, nonce: Buffer, associatedData: Buffer): Buffer;
|
|
156
159
|
export function Aes256GcmSiv_New(key: Buffer): Aes256GcmSiv;
|
|
157
160
|
export function AuthCredentialPresentation_CheckValidContents(presentationBytes: Buffer): void;
|
|
158
|
-
export function AuthCredentialPresentation_GetPniCiphertext(presentationBytes: Buffer):
|
|
161
|
+
export function AuthCredentialPresentation_GetPniCiphertext(presentationBytes: Buffer): Serialized<UuidCiphertext>;
|
|
159
162
|
export function AuthCredentialPresentation_GetRedemptionTime(presentationBytes: Buffer): Timestamp;
|
|
160
163
|
export function AuthCredentialPresentation_GetUuidCiphertext(presentationBytes: Buffer): Serialized<UuidCiphertext>;
|
|
161
164
|
export function AuthCredentialWithPniResponse_CheckValidContents(bytes: Buffer): void;
|
|
162
165
|
export function AuthCredentialWithPni_CheckValidContents(bytes: Buffer): void;
|
|
163
166
|
export function AuthenticatedChatConnection_connect(asyncRuntime: Wrapper<TokioAsyncContext>, connectionManager: Wrapper<ConnectionManager>, username: string, password: string, receiveStories: boolean): CancellablePromise<AuthenticatedChatConnection>;
|
|
164
167
|
export function AuthenticatedChatConnection_disconnect(asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<AuthenticatedChatConnection>): CancellablePromise<void>;
|
|
165
|
-
export function AuthenticatedChatConnection_info(chat: Wrapper<AuthenticatedChatConnection>):
|
|
168
|
+
export function AuthenticatedChatConnection_info(chat: Wrapper<AuthenticatedChatConnection>): ChatConnectionInfo;
|
|
166
169
|
export function AuthenticatedChatConnection_init_listener(chat: Wrapper<AuthenticatedChatConnection>, listener: ChatListener): void;
|
|
167
170
|
export function AuthenticatedChatConnection_send(asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<AuthenticatedChatConnection>, httpRequest: Wrapper<HttpRequest>, timeoutMillis: number): CancellablePromise<ChatResponse>;
|
|
168
171
|
export function BackupAuthCredentialPresentation_CheckValidContents(presentationBytes: Buffer): void;
|
|
@@ -205,6 +208,9 @@ export function Cds2ClientState_New(mrenclave: Buffer, attestationMsg: Buffer, c
|
|
|
205
208
|
export function CdsiLookup_complete(asyncRuntime: Wrapper<TokioAsyncContext>, lookup: Wrapper<CdsiLookup>): CancellablePromise<LookupResponse>;
|
|
206
209
|
export function CdsiLookup_new(asyncRuntime: Wrapper<TokioAsyncContext>, connectionManager: Wrapper<ConnectionManager>, username: string, password: string, request: Wrapper<LookupRequest>): CancellablePromise<CdsiLookup>;
|
|
207
210
|
export function CdsiLookup_token(lookup: Wrapper<CdsiLookup>): Buffer;
|
|
211
|
+
export function ChatConnectionInfo_description(connectionInfo: Wrapper<ChatConnectionInfo>): string;
|
|
212
|
+
export function ChatConnectionInfo_ip_version(connectionInfo: Wrapper<ChatConnectionInfo>): number;
|
|
213
|
+
export function ChatConnectionInfo_local_port(connectionInfo: Wrapper<ChatConnectionInfo>): number;
|
|
208
214
|
export function ChatService_SetListenerAuth(runtime: Wrapper<TokioAsyncContext>, chat: Wrapper<AuthChat>, listener: ChatListener | null): void;
|
|
209
215
|
export function ChatService_SetListenerUnauth(runtime: Wrapper<TokioAsyncContext>, chat: Wrapper<UnauthChat>, listener: ChatListener | null): void;
|
|
210
216
|
export function ChatService_auth_send(asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<AuthChat>, httpRequest: Wrapper<HttpRequest>, timeoutMillis: number): CancellablePromise<ChatResponse>;
|
|
@@ -223,8 +229,6 @@ export function CiphertextMessage_Type(msg: Wrapper<CiphertextMessage>): number;
|
|
|
223
229
|
export function ComparableBackup_GetComparableString(backup: Wrapper<ComparableBackup>): string;
|
|
224
230
|
export function ComparableBackup_GetUnknownFields(backup: Wrapper<ComparableBackup>): string[];
|
|
225
231
|
export function ComparableBackup_ReadUnencrypted(stream: InputStream, len: bigint, purpose: number): Promise<ComparableBackup>;
|
|
226
|
-
export function ConnectionInfo_ip_version(connectionInfo: Wrapper<ConnectionInfo>): number;
|
|
227
|
-
export function ConnectionInfo_local_port(connectionInfo: Wrapper<ConnectionInfo>): number;
|
|
228
232
|
export function ConnectionManager_clear_proxy(connectionManager: Wrapper<ConnectionManager>): void;
|
|
229
233
|
export function ConnectionManager_new(environment: number, userAgent: string): ConnectionManager;
|
|
230
234
|
export function ConnectionManager_on_network_change(connectionManager: Wrapper<ConnectionManager>): void;
|
|
@@ -331,7 +335,7 @@ export function LookupRequest_addE164(request: Wrapper<LookupRequest>, e164: str
|
|
|
331
335
|
export function LookupRequest_addPreviousE164(request: Wrapper<LookupRequest>, e164: string): void;
|
|
332
336
|
export function LookupRequest_new(): LookupRequest;
|
|
333
337
|
export function LookupRequest_setToken(request: Wrapper<LookupRequest>, token: Buffer): void;
|
|
334
|
-
export function MessageBackupKey_FromAccountEntropyPool(accountEntropy:
|
|
338
|
+
export function MessageBackupKey_FromAccountEntropyPool(accountEntropy: AccountEntropyPool, aci: Buffer): MessageBackupKey;
|
|
335
339
|
export function MessageBackupKey_FromBackupKeyAndBackupId(backupKey: Buffer, backupId: Buffer): MessageBackupKey;
|
|
336
340
|
export function MessageBackupKey_FromMasterKey(masterKey: Buffer, aci: Buffer): MessageBackupKey;
|
|
337
341
|
export function MessageBackupKey_GetAesKey(key: Wrapper<MessageBackupKey>): Buffer;
|
|
@@ -476,7 +480,6 @@ export function ServerPublicParams_VerifySignature(serverPublicParams: Wrapper<S
|
|
|
476
480
|
export function ServerSecretParams_Deserialize(buffer: Buffer): ServerSecretParams;
|
|
477
481
|
export function ServerSecretParams_GenerateDeterministic(randomness: Buffer): ServerSecretParams;
|
|
478
482
|
export function ServerSecretParams_GetPublicParams(params: Wrapper<ServerSecretParams>): ServerPublicParams;
|
|
479
|
-
export function ServerSecretParams_IssueAuthCredentialWithPniAsServiceIdDeterministic(serverSecretParams: Wrapper<ServerSecretParams>, randomness: Buffer, aci: Buffer, pni: Buffer, redemptionTime: Timestamp): Buffer;
|
|
480
483
|
export function ServerSecretParams_IssueAuthCredentialWithPniZkcDeterministic(serverSecretParams: Wrapper<ServerSecretParams>, randomness: Buffer, aci: Buffer, pni: Buffer, redemptionTime: Timestamp): Buffer;
|
|
481
484
|
export function ServerSecretParams_IssueExpiringProfileKeyCredentialDeterministic(serverSecretParams: Wrapper<ServerSecretParams>, randomness: Buffer, request: Serialized<ProfileKeyCredentialRequest>, userId: Buffer, commitment: Serialized<ProfileKeyCommitment>, expirationInSeconds: Timestamp): Serialized<ExpiringProfileKeyCredentialResponse>;
|
|
482
485
|
export function ServerSecretParams_IssueReceiptCredentialDeterministic(serverSecretParams: Wrapper<ServerSecretParams>, randomness: Buffer, request: Serialized<ReceiptCredentialRequest>, receiptExpirationTime: Timestamp, receiptLevel: bigint): Serialized<ReceiptCredentialResponse>;
|
|
@@ -521,9 +524,6 @@ export function SignedPreKeyRecord_GetSignature(obj: Wrapper<SignedPreKeyRecord>
|
|
|
521
524
|
export function SignedPreKeyRecord_GetTimestamp(obj: Wrapper<SignedPreKeyRecord>): Timestamp;
|
|
522
525
|
export function SignedPreKeyRecord_New(id: number, timestamp: Timestamp, pubKey: Wrapper<PublicKey>, privKey: Wrapper<PrivateKey>, signature: Buffer): SignedPreKeyRecord;
|
|
523
526
|
export function SignedPreKeyRecord_Serialize(obj: Wrapper<SignedPreKeyRecord>): Buffer;
|
|
524
|
-
export function Svr3Backup(asyncRuntime: Wrapper<TokioAsyncContext>, connectionManager: Wrapper<ConnectionManager>, secret: Buffer, password: string, maxTries: number, username: string, enclavePassword: string): CancellablePromise<Buffer>;
|
|
525
|
-
export function Svr3Remove(asyncRuntime: Wrapper<TokioAsyncContext>, connectionManager: Wrapper<ConnectionManager>, username: string, enclavePassword: string): CancellablePromise<void>;
|
|
526
|
-
export function Svr3Restore(asyncRuntime: Wrapper<TokioAsyncContext>, connectionManager: Wrapper<ConnectionManager>, password: string, shareSet: Buffer, username: string, enclavePassword: string): CancellablePromise<Buffer>;
|
|
527
527
|
export function TESTING_CdsiLookupErrorConvert(errorDescription: string): void;
|
|
528
528
|
export function TESTING_CdsiLookupResponseConvert(asyncRuntime: Wrapper<TokioAsyncContext>): CancellablePromise<LookupResponse>;
|
|
529
529
|
export function TESTING_ChatRequestGetBody(request: Wrapper<HttpRequest>): Buffer;
|
|
@@ -572,7 +572,7 @@ export function TokioAsyncContext_cancel(context: Wrapper<TokioAsyncContext>, ra
|
|
|
572
572
|
export function TokioAsyncContext_new(): TokioAsyncContext;
|
|
573
573
|
export function UnauthenticatedChatConnection_connect(asyncRuntime: Wrapper<TokioAsyncContext>, connectionManager: Wrapper<ConnectionManager>): CancellablePromise<UnauthenticatedChatConnection>;
|
|
574
574
|
export function UnauthenticatedChatConnection_disconnect(asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<UnauthenticatedChatConnection>): CancellablePromise<void>;
|
|
575
|
-
export function UnauthenticatedChatConnection_info(chat: Wrapper<UnauthenticatedChatConnection>):
|
|
575
|
+
export function UnauthenticatedChatConnection_info(chat: Wrapper<UnauthenticatedChatConnection>): ChatConnectionInfo;
|
|
576
576
|
export function UnauthenticatedChatConnection_init_listener(chat: Wrapper<UnauthenticatedChatConnection>, listener: ChatListener): void;
|
|
577
577
|
export function UnauthenticatedChatConnection_send(asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<UnauthenticatedChatConnection>, httpRequest: Wrapper<HttpRequest>, timeoutMillis: number): CancellablePromise<ChatResponse>;
|
|
578
578
|
export function UnidentifiedSenderMessageContent_Deserialize(data: Buffer): UnidentifiedSenderMessageContent;
|
|
@@ -601,10 +601,10 @@ interface Aes256GcmSiv { readonly __type: unique symbol; }
|
|
|
601
601
|
interface AuthChat { readonly __type: unique symbol; }
|
|
602
602
|
interface AuthenticatedChatConnection { readonly __type: unique symbol; }
|
|
603
603
|
interface CdsiLookup { readonly __type: unique symbol; }
|
|
604
|
+
interface ChatConnectionInfo { readonly __type: unique symbol; }
|
|
604
605
|
interface CiphertextMessage { readonly __type: unique symbol; }
|
|
605
606
|
interface ComparableBackup { readonly __type: unique symbol; }
|
|
606
607
|
interface ComparableBackup { readonly __type: unique symbol; }
|
|
607
|
-
interface ConnectionInfo { readonly __type: unique symbol; }
|
|
608
608
|
interface ConnectionManager { readonly __type: unique symbol; }
|
|
609
609
|
interface DecryptionErrorMessage { readonly __type: unique symbol; }
|
|
610
610
|
interface ExpiringProfileKeyCredential { readonly __type: unique symbol; }
|
package/dist/AccountKeys.d.ts
CHANGED
|
@@ -16,6 +16,12 @@ export declare class AccountEntropyPool {
|
|
|
16
16
|
* @returns cryptographically random 64 character string of characters a-z, 0-9
|
|
17
17
|
*/
|
|
18
18
|
static generate(): string;
|
|
19
|
+
/**
|
|
20
|
+
* Checks whether a string can be used as an account entropy pool.
|
|
21
|
+
*
|
|
22
|
+
* @returns `true` if the string is a structurally valid account entropy value.
|
|
23
|
+
*/
|
|
24
|
+
static isValid(accountEntropyPool: string): boolean;
|
|
19
25
|
/**
|
|
20
26
|
* Derives an SVR key from the given account entropy pool.
|
|
21
27
|
*
|
package/dist/AccountKeys.js
CHANGED
|
@@ -32,6 +32,14 @@ class AccountEntropyPool {
|
|
|
32
32
|
static generate() {
|
|
33
33
|
return Native.AccountEntropyPool_Generate();
|
|
34
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Checks whether a string can be used as an account entropy pool.
|
|
37
|
+
*
|
|
38
|
+
* @returns `true` if the string is a structurally valid account entropy value.
|
|
39
|
+
*/
|
|
40
|
+
static isValid(accountEntropyPool) {
|
|
41
|
+
return Native.AccountEntropyPool_IsValid(accountEntropyPool);
|
|
42
|
+
}
|
|
35
43
|
/**
|
|
36
44
|
* Derives an SVR key from the given account entropy pool.
|
|
37
45
|
*
|
package/dist/acknowledgments.md
CHANGED
|
@@ -2895,7 +2895,7 @@ DEALINGS IN THE SOFTWARE.
|
|
|
2895
2895
|
|
|
2896
2896
|
```
|
|
2897
2897
|
|
|
2898
|
-
## idna 0.
|
|
2898
|
+
## idna 1.0.3, percent-encoding 2.3.1, url 2.5.4
|
|
2899
2899
|
|
|
2900
2900
|
```
|
|
2901
2901
|
Copyright (c) 2013-2022 The rust-url developers
|
|
@@ -3475,7 +3475,7 @@ DEALINGS IN THE SOFTWARE.
|
|
|
3475
3475
|
|
|
3476
3476
|
```
|
|
3477
3477
|
|
|
3478
|
-
## gimli 0.31.0, heck 0.5.0
|
|
3478
|
+
## gimli 0.31.0, heck 0.5.0
|
|
3479
3479
|
|
|
3480
3480
|
```
|
|
3481
3481
|
Copyright (c) 2015 The Rust Project Developers
|
|
@@ -3822,7 +3822,7 @@ THE SOFTWARE.
|
|
|
3822
3822
|
|
|
3823
3823
|
```
|
|
3824
3824
|
|
|
3825
|
-
## futures-channel 0.3.
|
|
3825
|
+
## futures-channel 0.3.31, futures-core 0.3.31, futures-executor 0.3.30, futures-io 0.3.31, futures-macro 0.3.31, futures-sink 0.3.31, futures-task 0.3.31, futures-util 0.3.31, futures 0.3.30
|
|
3826
3826
|
|
|
3827
3827
|
```
|
|
3828
3828
|
Copyright (c) 2016 Alex Crichton
|
|
@@ -3916,7 +3916,7 @@ DEALINGS IN THE SOFTWARE.
|
|
|
3916
3916
|
|
|
3917
3917
|
```
|
|
3918
3918
|
|
|
3919
|
-
## intmap
|
|
3919
|
+
## intmap 3.0.0
|
|
3920
3920
|
|
|
3921
3921
|
```
|
|
3922
3922
|
Copyright (c) 2016 Jesper Axelsson
|
|
@@ -3990,7 +3990,7 @@ DEALINGS IN THE SOFTWARE.
|
|
|
3990
3990
|
|
|
3991
3991
|
```
|
|
3992
3992
|
|
|
3993
|
-
## rustls-native-certs 0.7.3, rustls-pemfile 2.1.3, rustls 0.22.4, rustls 0.23.
|
|
3993
|
+
## rustls-native-certs 0.7.3, rustls-pemfile 2.1.3, rustls 0.22.4, rustls 0.23.20
|
|
3994
3994
|
|
|
3995
3995
|
```
|
|
3996
3996
|
Copyright (c) 2016 Joseph Birr-Pixton <jpixton@gmail.com>
|
|
@@ -4586,6 +4586,36 @@ DEALINGS IN THE SOFTWARE.
|
|
|
4586
4586
|
|
|
4587
4587
|
```
|
|
4588
4588
|
|
|
4589
|
+
## stable_deref_trait 1.2.0
|
|
4590
|
+
|
|
4591
|
+
```
|
|
4592
|
+
Copyright (c) 2017 Robert Grosse
|
|
4593
|
+
|
|
4594
|
+
Permission is hereby granted, free of charge, to any
|
|
4595
|
+
person obtaining a copy of this software and associated
|
|
4596
|
+
documentation files (the "Software"), to deal in the
|
|
4597
|
+
Software without restriction, including without
|
|
4598
|
+
limitation the rights to use, copy, modify, merge,
|
|
4599
|
+
publish, distribute, sublicense, and/or sell copies of
|
|
4600
|
+
the Software, and to permit persons to whom the Software
|
|
4601
|
+
is furnished to do so, subject to the following
|
|
4602
|
+
conditions:
|
|
4603
|
+
|
|
4604
|
+
The above copyright notice and this permission notice
|
|
4605
|
+
shall be included in all copies or substantial portions
|
|
4606
|
+
of the Software.
|
|
4607
|
+
|
|
4608
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
|
4609
|
+
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
4610
|
+
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
4611
|
+
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
|
4612
|
+
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
4613
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
4614
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
|
4615
|
+
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
4616
|
+
DEALINGS IN THE SOFTWARE.
|
|
4617
|
+
```
|
|
4618
|
+
|
|
4589
4619
|
## foreign-types-macros 0.2.3, foreign-types-shared 0.3.1, foreign-types 0.5.0
|
|
4590
4620
|
|
|
4591
4621
|
```
|
|
@@ -5969,7 +5999,7 @@ SOFTWARE.
|
|
|
5969
5999
|
|
|
5970
6000
|
```
|
|
5971
6001
|
|
|
5972
|
-
## rustls-pki-types 1.
|
|
6002
|
+
## rustls-pki-types 1.10.1
|
|
5973
6003
|
|
|
5974
6004
|
```
|
|
5975
6005
|
Copyright (c) 2023 Dirkjan Ochtman <dirkjan@ochtman.nl>
|
|
@@ -6137,6 +6167,37 @@ The above copyright notice and this permission notice shall be included in all c
|
|
|
6137
6167
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
6138
6168
|
```
|
|
6139
6169
|
|
|
6170
|
+
## idna_adapter 1.2.0
|
|
6171
|
+
|
|
6172
|
+
```
|
|
6173
|
+
Copyright (c) The rust-url developers
|
|
6174
|
+
|
|
6175
|
+
Permission is hereby granted, free of charge, to any
|
|
6176
|
+
person obtaining a copy of this software and associated
|
|
6177
|
+
documentation files (the "Software"), to deal in the
|
|
6178
|
+
Software without restriction, including without
|
|
6179
|
+
limitation the rights to use, copy, modify, merge,
|
|
6180
|
+
publish, distribute, sublicense, and/or sell copies of
|
|
6181
|
+
the Software, and to permit persons to whom the Software
|
|
6182
|
+
is furnished to do so, subject to the following
|
|
6183
|
+
conditions:
|
|
6184
|
+
|
|
6185
|
+
The above copyright notice and this permission notice
|
|
6186
|
+
shall be included in all copies or substantial portions
|
|
6187
|
+
of the Software.
|
|
6188
|
+
|
|
6189
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
|
6190
|
+
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
6191
|
+
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
6192
|
+
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
|
6193
|
+
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
6194
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
6195
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
|
6196
|
+
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
6197
|
+
DEALINGS IN THE SOFTWARE.
|
|
6198
|
+
|
|
6199
|
+
```
|
|
6200
|
+
|
|
6140
6201
|
## arrayvec 0.7.6
|
|
6141
6202
|
|
|
6142
6203
|
```
|
|
@@ -6168,6 +6229,19 @@ DEALINGS IN THE SOFTWARE.
|
|
|
6168
6229
|
|
|
6169
6230
|
```
|
|
6170
6231
|
|
|
6232
|
+
## synstructure 0.13.1
|
|
6233
|
+
|
|
6234
|
+
```
|
|
6235
|
+
Copyright 2016 Nika Layzell
|
|
6236
|
+
|
|
6237
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6238
|
+
|
|
6239
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6240
|
+
|
|
6241
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
6242
|
+
|
|
6243
|
+
```
|
|
6244
|
+
|
|
6171
6245
|
## rand 0.8.5, rand_chacha 0.3.1, rand_core 0.6.4
|
|
6172
6246
|
|
|
6173
6247
|
```
|
|
@@ -6245,7 +6319,7 @@ DEALINGS IN THE SOFTWARE.
|
|
|
6245
6319
|
|
|
6246
6320
|
```
|
|
6247
6321
|
|
|
6248
|
-
## encoding_rs 0.8.34
|
|
6322
|
+
## encoding_rs 0.8.34, utf16_iter 1.0.5, utf8_iter 1.0.4, write16 1.0.0
|
|
6249
6323
|
|
|
6250
6324
|
```
|
|
6251
6325
|
Copyright Mozilla Foundation
|
|
@@ -6762,33 +6836,6 @@ SOFTWARE.
|
|
|
6762
6836
|
|
|
6763
6837
|
```
|
|
6764
6838
|
|
|
6765
|
-
## tinyvec_macros 0.1.1
|
|
6766
|
-
|
|
6767
|
-
```
|
|
6768
|
-
MIT License
|
|
6769
|
-
|
|
6770
|
-
Copyright (c) 2020 Soveu
|
|
6771
|
-
|
|
6772
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6773
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
6774
|
-
in the Software without restriction, including without limitation the rights
|
|
6775
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
6776
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
6777
|
-
furnished to do so, subject to the following conditions:
|
|
6778
|
-
|
|
6779
|
-
The above copyright notice and this permission notice shall be included in all
|
|
6780
|
-
copies or substantial portions of the Software.
|
|
6781
|
-
|
|
6782
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
6783
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
6784
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
6785
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
6786
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
6787
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
6788
|
-
SOFTWARE.
|
|
6789
|
-
|
|
6790
|
-
```
|
|
6791
|
-
|
|
6792
6839
|
## snow 0.9.6
|
|
6793
6840
|
|
|
6794
6841
|
```
|
|
@@ -6870,7 +6917,7 @@ SOFTWARE.
|
|
|
6870
6917
|
|
|
6871
6918
|
```
|
|
6872
6919
|
|
|
6873
|
-
## rustls-platform-verifier-android 0.1.1, rustls-platform-verifier 0.
|
|
6920
|
+
## rustls-platform-verifier-android 0.1.1, rustls-platform-verifier 0.4.0
|
|
6874
6921
|
|
|
6875
6922
|
```
|
|
6876
6923
|
MIT License
|
|
@@ -7071,17 +7118,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
7071
7118
|
|
|
7072
7119
|
```
|
|
7073
7120
|
|
|
7074
|
-
## tinyvec 1.8.0
|
|
7075
|
-
|
|
7076
|
-
```
|
|
7077
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
7078
|
-
|
|
7079
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
7080
|
-
|
|
7081
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
7082
|
-
|
|
7083
|
-
```
|
|
7084
|
-
|
|
7085
7121
|
## android_system_properties 0.1.5
|
|
7086
7122
|
|
|
7087
7123
|
```
|
|
@@ -7406,7 +7442,7 @@ SOFTWARE.
|
|
|
7406
7442
|
|
|
7407
7443
|
```
|
|
7408
7444
|
|
|
7409
|
-
## derive_more 0.99.18
|
|
7445
|
+
## derive_more-impl 1.0.0, derive_more 0.99.18, derive_more 1.0.0
|
|
7410
7446
|
|
|
7411
7447
|
```
|
|
7412
7448
|
The MIT License (MIT)
|
|
@@ -7826,6 +7862,51 @@ SOFTWARE.
|
|
|
7826
7862
|
*/
|
|
7827
7863
|
```
|
|
7828
7864
|
|
|
7865
|
+
## icu_collections 1.5.0, icu_locid 1.5.0, icu_locid_transform 1.5.0, icu_locid_transform_data 1.5.0, icu_normalizer 1.5.0, icu_normalizer_data 1.5.0, icu_properties 1.5.1, icu_properties_data 1.5.0, icu_provider 1.5.0, icu_provider_macros 1.5.0, litemap 0.7.4, tinystr 0.7.6, writeable 0.5.5, yoke-derive 0.7.5, yoke 0.7.5, zerofrom-derive 0.1.5, zerofrom 0.1.5, zerovec-derive 0.10.3, zerovec 0.10.4
|
|
7866
|
+
|
|
7867
|
+
```
|
|
7868
|
+
UNICODE LICENSE V3
|
|
7869
|
+
|
|
7870
|
+
COPYRIGHT AND PERMISSION NOTICE
|
|
7871
|
+
|
|
7872
|
+
Copyright © 1991-2023 Unicode, Inc.
|
|
7873
|
+
|
|
7874
|
+
NOTICE TO USER: Carefully read the following legal agreement. BY
|
|
7875
|
+
DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR
|
|
7876
|
+
SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
|
|
7877
|
+
TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT
|
|
7878
|
+
DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
|
|
7879
|
+
|
|
7880
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
|
7881
|
+
copy of data files and any associated documentation (the "Data Files") or
|
|
7882
|
+
software and any associated documentation (the "Software") to deal in the
|
|
7883
|
+
Data Files or Software without restriction, including without limitation
|
|
7884
|
+
the rights to use, copy, modify, merge, publish, distribute, and/or sell
|
|
7885
|
+
copies of the Data Files or Software, and to permit persons to whom the
|
|
7886
|
+
Data Files or Software are furnished to do so, provided that either (a)
|
|
7887
|
+
this copyright and permission notice appear with all copies of the Data
|
|
7888
|
+
Files or Software, or (b) this copyright and permission notice appear in
|
|
7889
|
+
associated Documentation.
|
|
7890
|
+
|
|
7891
|
+
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
|
|
7892
|
+
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
7893
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
|
7894
|
+
THIRD PARTY RIGHTS.
|
|
7895
|
+
|
|
7896
|
+
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE
|
|
7897
|
+
BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,
|
|
7898
|
+
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
|
7899
|
+
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
|
7900
|
+
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA
|
|
7901
|
+
FILES OR SOFTWARE.
|
|
7902
|
+
|
|
7903
|
+
Except as contained in this notice, the name of a copyright holder shall
|
|
7904
|
+
not be used in advertising or otherwise to promote the sale, use or other
|
|
7905
|
+
dealings in these Data Files or Software without prior written
|
|
7906
|
+
authorization of the copyright holder.
|
|
7907
|
+
|
|
7908
|
+
```
|
|
7909
|
+
|
|
7829
7910
|
## unicode-ident 1.0.13
|
|
7830
7911
|
|
|
7831
7912
|
```
|
package/dist/net.d.ts
CHANGED
|
@@ -162,6 +162,7 @@ export type ChatConnection = {
|
|
|
162
162
|
export interface ConnectionInfo {
|
|
163
163
|
localPort: number;
|
|
164
164
|
ipVersion: 'IPv4' | 'IPv6';
|
|
165
|
+
toString: () => string;
|
|
165
166
|
}
|
|
166
167
|
export declare class UnauthenticatedChatConnection implements ChatConnection {
|
|
167
168
|
private readonly asyncContext;
|
|
@@ -246,10 +247,6 @@ export type NetConstructorOptions = Readonly<{
|
|
|
246
247
|
export declare class Net {
|
|
247
248
|
private readonly asyncContext;
|
|
248
249
|
private readonly connectionManager;
|
|
249
|
-
/**
|
|
250
|
-
* Instance of the {@link Svr3Client} to access SVR3.
|
|
251
|
-
*/
|
|
252
|
-
svr3: Svr3Client;
|
|
253
250
|
constructor(options: NetConstructorOptions);
|
|
254
251
|
/**
|
|
255
252
|
* Creates a new instance of {@link AuthenticatedChatService}.
|
|
@@ -323,136 +320,4 @@ export declare class Net {
|
|
|
323
320
|
onNetworkChange(): void;
|
|
324
321
|
cdsiLookup({ username, password }: Readonly<ServiceAuth>, { e164s, acisAndAccessKeys, abortSignal, }: ReadonlyDeep<CDSRequestOptionsType>): Promise<CDSResponseType<string, string>>;
|
|
325
322
|
}
|
|
326
|
-
/**
|
|
327
|
-
* This interface provides functionality for communicating with SVR3
|
|
328
|
-
*
|
|
329
|
-
* Its instance can be obtained from an {@link Net#svr3} property
|
|
330
|
-
* of the {@link Net} class.
|
|
331
|
-
*
|
|
332
|
-
* Example usage:
|
|
333
|
-
*
|
|
334
|
-
* @example
|
|
335
|
-
* ```ts
|
|
336
|
-
* import { Environment, Net } from '../net';
|
|
337
|
-
* // Obtain an instance
|
|
338
|
-
* const SVR3 = new Net(Environment.Staging).svr3;
|
|
339
|
-
* // Instantiate ServiceAuth with the username and password obtained from the Chat Server.
|
|
340
|
-
* const auth = { username: USERNAME, password: ENCLAVE_PASSWORD };
|
|
341
|
-
* // Store a value in SVR3. Here 10 is the number of permitted restore attempts.
|
|
342
|
-
* const shareSet = await SVR3.backup(SECRET_TO_BE_STORED, PASSWORD, 10, auth);
|
|
343
|
-
* const restoredSecret = await SVR3.restore( PASSWORD, shareSet, auth);
|
|
344
|
-
* ```
|
|
345
|
-
*/
|
|
346
|
-
export interface Svr3Client {
|
|
347
|
-
/**
|
|
348
|
-
* Backup a secret to SVR3.
|
|
349
|
-
*
|
|
350
|
-
* Error messages are log-safe and do not contain any sensitive data.
|
|
351
|
-
*
|
|
352
|
-
* @param what - The secret to be stored. Must be 32 bytes long.
|
|
353
|
-
* @param password - User-provided password that will be used to derive the
|
|
354
|
-
* encryption key for the secret.
|
|
355
|
-
* @param maxTries - Number of times the secret will be allowed to be guessed.
|
|
356
|
-
* Each call to {@link Svr3Client#restore} that has reached the server will
|
|
357
|
-
* decrement the counter. Must be positive.
|
|
358
|
-
* @param auth - An instance of {@link ServiceAuth} containing the username
|
|
359
|
-
* and password obtained from the Chat Server. The password is an OTP which is
|
|
360
|
-
* generally good for about 15 minutes, therefore it can be reused for the
|
|
361
|
-
* subsequent calls to either backup or restore that are not too far apart in
|
|
362
|
-
* time.
|
|
363
|
-
* @returns A `Promise` which--when awaited--will return a byte array with a
|
|
364
|
-
* serialized masked share set. It is supposed to be an opaque blob for the
|
|
365
|
-
* clients and therefore no assumptions should be made about its contents.
|
|
366
|
-
* This byte array should be stored by the clients and used to restore the
|
|
367
|
-
* secret along with the password. Please note that masked share set does not
|
|
368
|
-
* have to be treated as secret.
|
|
369
|
-
*
|
|
370
|
-
* The returned `Promise` can also fail due to the network issues (including a
|
|
371
|
-
* connection timeout), problems establishing the Noise connection to the
|
|
372
|
-
* enclaves, or invalid arguments' values. {@link IoError} errors can, in
|
|
373
|
-
* general, be retried, although there is already a retry-with-backoff
|
|
374
|
-
* mechanism inside libsignal used to connect to the SVR3 servers. Other
|
|
375
|
-
* exceptions are caused by the bad input or data missing on the server. They
|
|
376
|
-
* are therefore non-actionable and are guaranteed to be thrown again when
|
|
377
|
-
* retried.
|
|
378
|
-
*/
|
|
379
|
-
backup(what: Buffer, password: string, maxTries: number, auth: Readonly<ServiceAuth>, options?: {
|
|
380
|
-
abortSignal?: AbortSignal;
|
|
381
|
-
}): Promise<Buffer>;
|
|
382
|
-
/**
|
|
383
|
-
* Restore a secret from SVR3.
|
|
384
|
-
*
|
|
385
|
-
* Error messages are log-safe and do not contain any sensitive data.
|
|
386
|
-
*
|
|
387
|
-
* @param password - User-provided password that will be used to derive the
|
|
388
|
-
* decryption key for the secret.
|
|
389
|
-
* @param shareSet - a serialized masked share set returned by a call to
|
|
390
|
-
* {@link Svr3Client#backup}.
|
|
391
|
-
* @param auth - An instance of {@link ServiceAuth} containing the username
|
|
392
|
-
* and password obtained from the Chat Server. The password is an OTP which is
|
|
393
|
-
* generally good for about 15 minutes, therefore it can be reused for the
|
|
394
|
-
* subsequent calls to either backup or restore that are not too far apart in
|
|
395
|
-
* time.
|
|
396
|
-
* @returns A `Promise` which--when awaited--will return a
|
|
397
|
-
* {@link RestoredSecret} object, containing the restored secret.
|
|
398
|
-
*
|
|
399
|
-
* The returned `Promise` can also fail due to the network issues (including
|
|
400
|
-
* the connection timeout), problems establishing the Noise connection to the
|
|
401
|
-
* enclaves, or invalid arguments' values. {@link IoError} errors can, in
|
|
402
|
-
* general, be retried, although there is already a retry-with-backoff
|
|
403
|
-
* mechanism inside libsignal used to connect to the SVR3 servers. Other
|
|
404
|
-
* exceptions are caused by the bad input or data missing on the server. They
|
|
405
|
-
* are therefore non-actionable and are guaranteed to be thrown again when
|
|
406
|
-
* retried.
|
|
407
|
-
*
|
|
408
|
-
* - {@link SvrDataMissingError} is returned when the maximum restore attempts
|
|
409
|
-
* number has been exceeded or if the value has never been backed up.
|
|
410
|
-
* - {@link SvrRestoreFailedError} is returned when the combination of the
|
|
411
|
-
* password and masked share set does not result in successful restoration
|
|
412
|
-
* of the secret.
|
|
413
|
-
* - {@link SvrRequestFailedError} is returned when the de-serialization of a
|
|
414
|
-
* masked share set fails, or when the server requests fail for reasons
|
|
415
|
-
* other than "maximum attempts exceeded".
|
|
416
|
-
*/
|
|
417
|
-
restore(password: string, shareSet: Buffer, auth: Readonly<ServiceAuth>, options?: {
|
|
418
|
-
abortSignal?: AbortSignal;
|
|
419
|
-
}): Promise<RestoredSecret>;
|
|
420
|
-
/**
|
|
421
|
-
* Remove a value stored in SVR3.
|
|
422
|
-
*
|
|
423
|
-
* This method will succeed even if the data has never been backed up in the
|
|
424
|
-
* first place.
|
|
425
|
-
*
|
|
426
|
-
* Error messages are log-safe and do not contain any sensitive data.
|
|
427
|
-
*
|
|
428
|
-
* @param auth - An instance of {@link ServiceAuth} containing the username
|
|
429
|
-
* and password obtained from the Chat Server. The password is an OTP which is
|
|
430
|
-
* generally good for about 15 minutes, therefore it can be reused for the
|
|
431
|
-
* subsequent calls to either backup or restore that are not too far apart in
|
|
432
|
-
* time.
|
|
433
|
-
* @returns A `Promise` successful completion of which will mean the data has
|
|
434
|
-
* been removed.
|
|
435
|
-
*
|
|
436
|
-
* The returned `Promise` can also fail due to the network issues (including
|
|
437
|
-
* the connection timeout), problems establishing the Noise connection to the
|
|
438
|
-
* enclaves, or invalid arguments' values. {@link IoError} errors can, in
|
|
439
|
-
* general, be retried, although there is already a retry-with-backoff
|
|
440
|
-
* mechanism inside libsignal used to connect to the SVR3 servers. Other
|
|
441
|
-
* exceptions are caused by the bad input or data missing on the server. They
|
|
442
|
-
* are therefore non-actionable and are guaranteed to be thrown again when
|
|
443
|
-
* retried.
|
|
444
|
-
*/
|
|
445
|
-
remove(auth: Readonly<ServiceAuth>, options?: {
|
|
446
|
-
abortSignal?: AbortSignal;
|
|
447
|
-
}): Promise<void>;
|
|
448
|
-
}
|
|
449
|
-
/**
|
|
450
|
-
* A simple data class containing the secret restored from SVR3 as well as the
|
|
451
|
-
* number of restore attempts remaining.
|
|
452
|
-
*/
|
|
453
|
-
export declare class RestoredSecret {
|
|
454
|
-
readonly triesRemaining: number;
|
|
455
|
-
readonly value: Buffer;
|
|
456
|
-
constructor(serialized: Buffer);
|
|
457
|
-
}
|
|
458
323
|
export {};
|
package/dist/net.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
5
|
//
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
7
|
+
exports.Net = exports.buildHttpRequest = exports.UnauthenticatedChatService = exports.AuthenticatedChatService = exports.AuthenticatedChatConnection = exports.UnauthenticatedChatConnection = exports.ChatServerMessageAck = exports.TokioAsyncContext = exports.newNativeHandle = exports.Environment = void 0;
|
|
8
8
|
const Native = require("../Native");
|
|
9
9
|
const Address_1 = require("./Address");
|
|
10
10
|
const node_buffer_1 = require("node:buffer");
|
|
@@ -62,10 +62,10 @@ class ConnectionInfoImpl {
|
|
|
62
62
|
this._nativeHandle = _nativeHandle;
|
|
63
63
|
}
|
|
64
64
|
get localPort() {
|
|
65
|
-
return Native.
|
|
65
|
+
return Native.ChatConnectionInfo_local_port(this);
|
|
66
66
|
}
|
|
67
67
|
get ipVersion() {
|
|
68
|
-
const value = Native.
|
|
68
|
+
const value = Native.ChatConnectionInfo_ip_version(this);
|
|
69
69
|
switch (value) {
|
|
70
70
|
case 1:
|
|
71
71
|
return 'IPv4';
|
|
@@ -75,6 +75,9 @@ class ConnectionInfoImpl {
|
|
|
75
75
|
throw new TypeError(`ip type was unexpectedly ${value}`);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
+
toString() {
|
|
79
|
+
return Native.ChatConnectionInfo_description(this);
|
|
80
|
+
}
|
|
78
81
|
}
|
|
79
82
|
class UnauthenticatedChatConnection {
|
|
80
83
|
static async connect(asyncContext, connectionManager, listener, options) {
|
|
@@ -269,7 +272,6 @@ class Net {
|
|
|
269
272
|
else {
|
|
270
273
|
this.connectionManager = newNativeHandle(Native.ConnectionManager_new(options.env, options.userAgent));
|
|
271
274
|
}
|
|
272
|
-
this.svr3 = new Svr3ClientImpl(this.asyncContext, this.connectionManager);
|
|
273
275
|
}
|
|
274
276
|
/**
|
|
275
277
|
* Creates a new instance of {@link AuthenticatedChatService}.
|
|
@@ -368,31 +370,4 @@ class Net {
|
|
|
368
370
|
}
|
|
369
371
|
}
|
|
370
372
|
exports.Net = Net;
|
|
371
|
-
/**
|
|
372
|
-
* A simple data class containing the secret restored from SVR3 as well as the
|
|
373
|
-
* number of restore attempts remaining.
|
|
374
|
-
*/
|
|
375
|
-
class RestoredSecret {
|
|
376
|
-
constructor(serialized) {
|
|
377
|
-
this.triesRemaining = serialized.readInt32BE();
|
|
378
|
-
this.value = serialized.subarray(4);
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
exports.RestoredSecret = RestoredSecret;
|
|
382
|
-
class Svr3ClientImpl {
|
|
383
|
-
constructor(asyncContext, connectionManager) {
|
|
384
|
-
this.asyncContext = asyncContext;
|
|
385
|
-
this.connectionManager = connectionManager;
|
|
386
|
-
}
|
|
387
|
-
async backup(what, password, maxTries, auth, options) {
|
|
388
|
-
return this.asyncContext.makeCancellable(options?.abortSignal, Native.Svr3Backup(this.asyncContext, this.connectionManager, what, password, maxTries, auth.username, auth.password));
|
|
389
|
-
}
|
|
390
|
-
async restore(password, shareSet, auth, options) {
|
|
391
|
-
const serialized = await this.asyncContext.makeCancellable(options?.abortSignal, Native.Svr3Restore(this.asyncContext, this.connectionManager, password, shareSet, auth.username, auth.password));
|
|
392
|
-
return new RestoredSecret(serialized);
|
|
393
|
-
}
|
|
394
|
-
async remove(auth, options) {
|
|
395
|
-
return this.asyncContext.makeCancellable(options?.abortSignal, Native.Svr3Remove(this.asyncContext, this.connectionManager, auth.username, auth.password));
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
373
|
//# sourceMappingURL=net.js.map
|
|
@@ -5,6 +5,6 @@ export default class AuthCredentialPresentation extends ByteArray {
|
|
|
5
5
|
private readonly __type?;
|
|
6
6
|
constructor(contents: Buffer);
|
|
7
7
|
getUuidCiphertext(): UuidCiphertext;
|
|
8
|
-
getPniCiphertext(): UuidCiphertext
|
|
8
|
+
getPniCiphertext(): UuidCiphertext;
|
|
9
9
|
getRedemptionTime(): Date;
|
|
10
10
|
}
|
|
@@ -15,11 +15,7 @@ class AuthCredentialPresentation extends ByteArray_1.default {
|
|
|
15
15
|
return new UuidCiphertext_1.default(Native.AuthCredentialPresentation_GetUuidCiphertext(this.contents));
|
|
16
16
|
}
|
|
17
17
|
getPniCiphertext() {
|
|
18
|
-
|
|
19
|
-
if (ciphertextBytes === null) {
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
return new UuidCiphertext_1.default(ciphertextBytes);
|
|
18
|
+
return new UuidCiphertext_1.default(Native.AuthCredentialPresentation_GetPniCiphertext(this.contents));
|
|
23
19
|
}
|
|
24
20
|
getRedemptionTime() {
|
|
25
21
|
return new Date(1000 * Native.AuthCredentialPresentation_GetRedemptionTime(this.contents));
|
|
@@ -7,14 +7,6 @@ import { Aci, Pni } from '../../Address';
|
|
|
7
7
|
export default class ServerZkAuthOperations {
|
|
8
8
|
serverSecretParams: ServerSecretParams;
|
|
9
9
|
constructor(serverSecretParams: ServerSecretParams);
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated These credentials are no longer supported by the server; use `issueAuthCredentialWithPniZkc` instead.
|
|
12
|
-
*/
|
|
13
|
-
issueAuthCredentialWithPniAsServiceId(aci: Aci, pni: Pni, redemptionTime: number): AuthCredentialWithPniResponse;
|
|
14
|
-
/**
|
|
15
|
-
* @deprecated These credentials are no longer supported by the server; use `issueAuthCredentialWithPniZkc` instead.
|
|
16
|
-
*/
|
|
17
|
-
issueAuthCredentialWithPniAsServiceIdWithRandom(random: Buffer, aci: Aci, pni: Pni, redemptionTime: number): AuthCredentialWithPniResponse;
|
|
18
10
|
issueAuthCredentialWithPniZkc(aci: Aci, pni: Pni, redemptionTime: number): AuthCredentialWithPniResponse;
|
|
19
11
|
issueAuthCredentialWithPniZkcWithRandom(random: Buffer, aci: Aci, pni: Pni, redemptionTime: number): AuthCredentialWithPniResponse;
|
|
20
12
|
verifyAuthCredentialPresentation(groupPublicParams: GroupPublicParams, authCredentialPresentation: AuthCredentialPresentation, now?: Date): void;
|
|
@@ -12,19 +12,6 @@ class ServerZkAuthOperations {
|
|
|
12
12
|
constructor(serverSecretParams) {
|
|
13
13
|
this.serverSecretParams = serverSecretParams;
|
|
14
14
|
}
|
|
15
|
-
/**
|
|
16
|
-
* @deprecated These credentials are no longer supported by the server; use `issueAuthCredentialWithPniZkc` instead.
|
|
17
|
-
*/
|
|
18
|
-
issueAuthCredentialWithPniAsServiceId(aci, pni, redemptionTime) {
|
|
19
|
-
const random = (0, crypto_1.randomBytes)(Constants_1.RANDOM_LENGTH);
|
|
20
|
-
return this.issueAuthCredentialWithPniAsServiceIdWithRandom(random, aci, pni, redemptionTime);
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* @deprecated These credentials are no longer supported by the server; use `issueAuthCredentialWithPniZkc` instead.
|
|
24
|
-
*/
|
|
25
|
-
issueAuthCredentialWithPniAsServiceIdWithRandom(random, aci, pni, redemptionTime) {
|
|
26
|
-
return new AuthCredentialWithPniResponse_1.default(Native.ServerSecretParams_IssueAuthCredentialWithPniAsServiceIdDeterministic(this.serverSecretParams, random, aci.getServiceIdFixedWidthBinary(), pni.getServiceIdFixedWidthBinary(), redemptionTime));
|
|
27
|
-
}
|
|
28
15
|
issueAuthCredentialWithPniZkc(aci, pni, redemptionTime) {
|
|
29
16
|
const random = (0, crypto_1.randomBytes)(Constants_1.RANDOM_LENGTH);
|
|
30
17
|
return this.issueAuthCredentialWithPniZkcWithRandom(random, aci, pni, redemptionTime);
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|