@signalapp/libsignal-client 0.60.1 → 0.61.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 CHANGED
@@ -177,6 +177,7 @@ export function BackupKey_DeriveEcKey(backupKey: Buffer, aci: Buffer): PrivateKe
177
177
  export function BackupKey_DeriveLocalBackupMetadataKey(backupKey: Buffer): Buffer;
178
178
  export function BackupKey_DeriveMediaEncryptionKey(backupKey: Buffer, mediaId: Buffer): Buffer;
179
179
  export function BackupKey_DeriveMediaId(backupKey: Buffer, mediaName: string): Buffer;
180
+ export function BackupKey_DeriveThumbnailTransitEncryptionKey(backupKey: Buffer, mediaId: Buffer): Buffer;
180
181
  export function CallLinkAuthCredentialPresentation_CheckValidContents(presentationBytes: Buffer): void;
181
182
  export function CallLinkAuthCredentialPresentation_GetUserId(presentationBytes: Buffer): Serialized<UuidCiphertext>;
182
183
  export function CallLinkAuthCredentialPresentation_Verify(presentationBytes: Buffer, now: Timestamp, serverParamsBytes: Buffer, callLinkParamsBytes: Buffer): void;
@@ -215,6 +216,7 @@ export function ComparableBackup_ReadUnencrypted(stream: InputStream, len: bigin
215
216
  export function ConnectionManager_clear_proxy(connectionManager: Wrapper<ConnectionManager>): void;
216
217
  export function ConnectionManager_new(environment: number, userAgent: string): ConnectionManager;
217
218
  export function ConnectionManager_on_network_change(connectionManager: Wrapper<ConnectionManager>): void;
219
+ export function ConnectionManager_set_censorship_circumvention_enabled(connectionManager: Wrapper<ConnectionManager>, enabled: boolean): void;
218
220
  export function ConnectionManager_set_ipv6_enabled(connectionManager: Wrapper<ConnectionManager>, ipv6Enabled: boolean): void;
219
221
  export function ConnectionManager_set_proxy(connectionManager: Wrapper<ConnectionManager>, host: string, port: number): void;
220
222
  export function CreateCallLinkCredentialPresentation_CheckValidContents(presentationBytes: Buffer): void;
@@ -33,7 +33,13 @@ export declare class AccountEntropyPool {
33
33
  */
34
34
  static deriveBackupKey(accountEntropyPool: string): BackupKey;
35
35
  }
36
- /** A key used for many aspects of backups. */
36
+ /**
37
+ * A key used for many aspects of backups.
38
+ *
39
+ * Clients are typically concerned with two long-lived keys: a "messages" key (sometimes called "the
40
+ * root backup key" or just "the backup key") that's derived from an {@link AccountEntropyPool}, and
41
+ * a "media" key (formally the "media root backup key") that's not derived from anything else.
42
+ */
37
43
  export declare class BackupKey extends ByteArray {
38
44
  private readonly __type?;
39
45
  static SIZE: number;
@@ -46,18 +52,45 @@ export declare class BackupKey extends ByteArray {
46
52
  * @see {@link AccountEntropyPool.deriveBackupKey}
47
53
  */
48
54
  static generateRandom(): BackupKey;
49
- /** Derives the backup ID to use given the current device's ACI. */
55
+ /**
56
+ * Derives the backup ID to use given the current device's ACI.
57
+ *
58
+ * Used for both message and media backups.
59
+ */
50
60
  deriveBackupId(aci: Aci): Buffer;
51
- /** Derives the backup EC key to use given the current device's ACI. */
61
+ /**
62
+ * Derives the backup EC key to use given the current device's ACI.
63
+ *
64
+ * Used for both message and media backups.
65
+ */
52
66
  deriveEcKey(aci: Aci): PrivateKey;
53
- /** Derives the AES key used for encrypted fields in local backup metadata. */
67
+ /**
68
+ * Derives the AES key used for encrypted fields in local backup metadata.
69
+ *
70
+ * Only relevant for message backup keys.
71
+ */
54
72
  deriveLocalBackupMetadataKey(): Buffer;
55
- /** Derives the ID for uploading media with the name `mediaName`. */
73
+ /**
74
+ * Derives the ID for uploading media with the name `mediaName`.
75
+ *
76
+ * Only relevant for media backup keys.
77
+ */
56
78
  deriveMediaId(mediaName: string): Buffer;
57
79
  /**
58
- * Derives the composite encryption key for uploading media with the given ID.
80
+ * Derives the composite encryption key for re-encrypting media with the given ID.
59
81
  *
60
82
  * This is a concatenation of an HMAC key (32 bytes) and an AES-CBC key (also 32 bytes).
83
+ *
84
+ * Only relevant for media backup keys.
61
85
  */
62
86
  deriveMediaEncryptionKey(mediaId: Buffer): Buffer;
87
+ /**
88
+ * Derives the composite encryption key for uploading thumbnails with the given ID to the "transit
89
+ * tier" CDN.
90
+ *
91
+ * This is a concatenation of an HMAC key (32 bytes) and an AES-CBC key (also 32 bytes).
92
+ *
93
+ * Only relevant for media backup keys.
94
+ */
95
+ deriveThumbnailTransitEncryptionKey(mediaId: Buffer): Buffer;
63
96
  }
@@ -54,7 +54,13 @@ class AccountEntropyPool {
54
54
  }
55
55
  }
56
56
  exports.AccountEntropyPool = AccountEntropyPool;
57
- /** A key used for many aspects of backups. */
57
+ /**
58
+ * A key used for many aspects of backups.
59
+ *
60
+ * Clients are typically concerned with two long-lived keys: a "messages" key (sometimes called "the
61
+ * root backup key" or just "the backup key") that's derived from an {@link AccountEntropyPool}, and
62
+ * a "media" key (formally the "media root backup key") that's not derived from anything else.
63
+ */
58
64
  class BackupKey extends ByteArray_1.default {
59
65
  constructor(contents) {
60
66
  super(contents, BackupKey.checkLength(BackupKey.SIZE));
@@ -70,30 +76,59 @@ class BackupKey extends ByteArray_1.default {
70
76
  const bytes = crypto.randomBytes(BackupKey.SIZE);
71
77
  return new BackupKey(bytes);
72
78
  }
73
- /** Derives the backup ID to use given the current device's ACI. */
79
+ /**
80
+ * Derives the backup ID to use given the current device's ACI.
81
+ *
82
+ * Used for both message and media backups.
83
+ */
74
84
  deriveBackupId(aci) {
75
85
  return Native.BackupKey_DeriveBackupId(this.contents, aci.getServiceIdFixedWidthBinary());
76
86
  }
77
- /** Derives the backup EC key to use given the current device's ACI. */
87
+ /**
88
+ * Derives the backup EC key to use given the current device's ACI.
89
+ *
90
+ * Used for both message and media backups.
91
+ */
78
92
  deriveEcKey(aci) {
79
93
  return EcKeys_1.PrivateKey._fromNativeHandle(Native.BackupKey_DeriveEcKey(this.contents, aci.getServiceIdFixedWidthBinary()));
80
94
  }
81
- /** Derives the AES key used for encrypted fields in local backup metadata. */
95
+ /**
96
+ * Derives the AES key used for encrypted fields in local backup metadata.
97
+ *
98
+ * Only relevant for message backup keys.
99
+ */
82
100
  deriveLocalBackupMetadataKey() {
83
101
  return Native.BackupKey_DeriveLocalBackupMetadataKey(this.contents);
84
102
  }
85
- /** Derives the ID for uploading media with the name `mediaName`. */
103
+ /**
104
+ * Derives the ID for uploading media with the name `mediaName`.
105
+ *
106
+ * Only relevant for media backup keys.
107
+ */
86
108
  deriveMediaId(mediaName) {
87
109
  return Native.BackupKey_DeriveMediaId(this.contents, mediaName);
88
110
  }
89
111
  /**
90
- * Derives the composite encryption key for uploading media with the given ID.
112
+ * Derives the composite encryption key for re-encrypting media with the given ID.
91
113
  *
92
114
  * This is a concatenation of an HMAC key (32 bytes) and an AES-CBC key (also 32 bytes).
115
+ *
116
+ * Only relevant for media backup keys.
93
117
  */
94
118
  deriveMediaEncryptionKey(mediaId) {
95
119
  return Native.BackupKey_DeriveMediaEncryptionKey(this.contents, mediaId);
96
120
  }
121
+ /**
122
+ * Derives the composite encryption key for uploading thumbnails with the given ID to the "transit
123
+ * tier" CDN.
124
+ *
125
+ * This is a concatenation of an HMAC key (32 bytes) and an AES-CBC key (also 32 bytes).
126
+ *
127
+ * Only relevant for media backup keys.
128
+ */
129
+ deriveThumbnailTransitEncryptionKey(mediaId) {
130
+ return Native.BackupKey_DeriveThumbnailTransitEncryptionKey(this.contents, mediaId);
131
+ }
97
132
  }
98
133
  exports.BackupKey = BackupKey;
99
134
  BackupKey.SIZE = 32;
@@ -39,6 +39,8 @@ export type MessageBackupKeyInput = Readonly<{
39
39
  }>;
40
40
  /**
41
41
  * Key used to encrypt and decrypt a message backup bundle.
42
+ *
43
+ * @see {@link BackupKey}
42
44
  */
43
45
  export declare class MessageBackupKey {
44
46
  readonly _nativeHandle: Native.MessageBackupKey;
@@ -33,6 +33,8 @@ class ValidationOutcome {
33
33
  exports.ValidationOutcome = ValidationOutcome;
34
34
  /**
35
35
  * Key used to encrypt and decrypt a message backup bundle.
36
+ *
37
+ * @see {@link BackupKey}
36
38
  */
37
39
  class MessageBackupKey {
38
40
  constructor(inputOrMasterKeyBytes, maybeAci) {
@@ -669,7 +669,7 @@ For more information on this, and how to apply and follow the GNU AGPL, see
669
669
 
670
670
  ```
671
671
 
672
- ## libsignal-account-keys 0.1.0, attest 0.1.0, libsignal-ffi 0.60.1, libsignal-jni 0.60.1, libsignal-jni-testing 0.60.1, libsignal-node 0.60.1, signal-neon-futures 0.1.0, signal-neon-futures-tests 0.1.0, libsignal-bridge 0.1.0, libsignal-bridge-macros 0.1.0, libsignal-bridge-testing 0.1.0, libsignal-bridge-types 0.1.0, libsignal-core 0.1.0, signal-crypto 0.1.0, device-transfer 0.1.0, libsignal-keytrans 0.0.1, signal-media 0.1.0, libsignal-message-backup 0.1.0, libsignal-message-backup-macros 0.1.0, libsignal-net 0.1.0, libsignal-net-infra 0.1.0, poksho 0.7.0, libsignal-protocol 0.1.0, libsignal-svr3 0.1.0, usernames 0.1.0, zkcredential 0.1.0, zkgroup 0.9.0
672
+ ## libsignal-account-keys, attest, libsignal-ffi, libsignal-jni, libsignal-jni-testing, libsignal-node, signal-neon-futures, signal-neon-futures-tests, libsignal-bridge, libsignal-bridge-macros, libsignal-bridge-testing, libsignal-bridge-types, libsignal-core, signal-crypto, device-transfer, libsignal-keytrans, signal-media, libsignal-message-backup, libsignal-message-backup-macros, libsignal-net, libsignal-net-infra, poksho, libsignal-protocol, libsignal-svr3, usernames, zkcredential, zkgroup
673
673
 
674
674
  ```
675
675
  GNU AFFERO GENERAL PUBLIC LICENSE
@@ -3300,7 +3300,7 @@ THE SOFTWARE.
3300
3300
 
3301
3301
  ```
3302
3302
 
3303
- ## either 1.13.0, itertools 0.10.5, itertools 0.13.0, petgraph 0.6.5
3303
+ ## either 1.13.0, itertools 0.13.0, petgraph 0.6.5
3304
3304
 
3305
3305
  ```
3306
3306
  Copyright (c) 2015
@@ -6067,6 +6067,19 @@ DEALINGS IN THE SOFTWARE.
6067
6067
 
6068
6068
  ```
6069
6069
 
6070
+ ## rangemap 1.5.1
6071
+
6072
+ ```
6073
+ Copyright 2019 Jeffrey Parsons
6074
+
6075
+ 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:
6076
+
6077
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6078
+
6079
+ 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.
6080
+
6081
+ ```
6082
+
6070
6083
  ## zerocopy-derive 0.7.35, zerocopy 0.7.35
6071
6084
 
6072
6085
  ```
package/dist/net.d.ts CHANGED
@@ -96,6 +96,7 @@ export type ChatService = {
96
96
  *
97
97
  * @throws {AppExpiredError} if the current app version is too old (as judged by the server).
98
98
  * @throws {DeviceDelinkedError} if the current device has been delinked.
99
+ * @throws {RateLimitedError} if the device should wait, then retry.
99
100
  * @throws {LibSignalError} with other codes for other failures.
100
101
  */
101
102
  connect(options?: {
@@ -211,6 +212,17 @@ export declare class Net {
211
212
  * The flag is `true` by default.
212
213
  */
213
214
  setIpv6Enabled(ipv6Enabled: boolean): void;
215
+ /**
216
+ * Enables or disables censorship circumvention for all new connections (until changed).
217
+ *
218
+ * If CC is enabled, *new* connections and services may try additional routes to the Signal
219
+ * servers. Existing connections and services will continue with the setting they were created
220
+ * with. (In particular, changing this setting will not affect any existing
221
+ * {@link ChatService ChatServices}.)
222
+ *
223
+ * CC is off by default.
224
+ */
225
+ setCensorshipCircumventionEnabled(enabled: boolean): void;
214
226
  /**
215
227
  * Sets the proxy host to be used for all new connections (until overridden).
216
228
  *
package/dist/net.js CHANGED
@@ -176,6 +176,19 @@ class Net {
176
176
  setIpv6Enabled(ipv6Enabled) {
177
177
  Native.ConnectionManager_set_ipv6_enabled(this.connectionManager, ipv6Enabled);
178
178
  }
179
+ /**
180
+ * Enables or disables censorship circumvention for all new connections (until changed).
181
+ *
182
+ * If CC is enabled, *new* connections and services may try additional routes to the Signal
183
+ * servers. Existing connections and services will continue with the setting they were created
184
+ * with. (In particular, changing this setting will not affect any existing
185
+ * {@link ChatService ChatServices}.)
186
+ *
187
+ * CC is off by default.
188
+ */
189
+ setCensorshipCircumventionEnabled(enabled) {
190
+ Native.ConnectionManager_set_censorship_circumvention_enabled(this.connectionManager, enabled);
191
+ }
179
192
  /**
180
193
  * Sets the proxy host to be used for all new connections (until overridden).
181
194
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalapp/libsignal-client",
3
- "version": "0.60.1",
3
+ "version": "0.61.0",
4
4
  "license": "AGPL-3.0-only",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",