@signalapp/libsignal-client 0.60.1 → 0.60.2

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;
@@ -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 0.1.0, attest 0.1.0, libsignal-ffi 0.60.2, libsignal-jni 0.60.2, libsignal-jni-testing 0.60.2, libsignal-node 0.60.2, 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
673
673
 
674
674
  ```
675
675
  GNU AFFERO GENERAL PUBLIC LICENSE
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalapp/libsignal-client",
3
- "version": "0.60.1",
3
+ "version": "0.60.2",
4
4
  "license": "AGPL-3.0-only",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",