@signalapp/libsignal-client 0.79.0 → 0.79.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 CHANGED
@@ -516,7 +516,7 @@ export function SenderCertificate_GetSerialized(obj: Wrapper<SenderCertificate>)
516
516
  export function SenderCertificate_GetServerCertificate(cert: Wrapper<SenderCertificate>): ServerCertificate;
517
517
  export function SenderCertificate_GetSignature(obj: Wrapper<SenderCertificate>): Uint8Array;
518
518
  export function SenderCertificate_New(senderUuid: string, senderE164: string | null, senderDeviceId: number, senderKey: Wrapper<PublicKey>, expiration: Timestamp, signerCert: Wrapper<ServerCertificate>, signerKey: Wrapper<PrivateKey>): SenderCertificate;
519
- export function SenderCertificate_Validate(cert: Wrapper<SenderCertificate>, key: Wrapper<PublicKey>, time: Timestamp): boolean;
519
+ export function SenderCertificate_Validate(cert: Wrapper<SenderCertificate>, trustRoots: Wrapper<PublicKey>[], time: Timestamp): boolean;
520
520
  export function SenderKeyDistributionMessage_Create(sender: Wrapper<ProtocolAddress>, distributionId: Uuid, store: SenderKeyStore): Promise<SenderKeyDistributionMessage>;
521
521
  export function SenderKeyDistributionMessage_Deserialize(data: Uint8Array): SenderKeyDistributionMessage;
522
522
  export function SenderKeyDistributionMessage_GetChainId(obj: Wrapper<SenderKeyDistributionMessage>): number;
@@ -700,6 +700,7 @@ export function UnauthenticatedChatConnection_connect(asyncRuntime: Wrapper<Toki
700
700
  export function UnauthenticatedChatConnection_disconnect(asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<UnauthenticatedChatConnection>): CancellablePromise<void>;
701
701
  export function UnauthenticatedChatConnection_info(chat: Wrapper<UnauthenticatedChatConnection>): ChatConnectionInfo;
702
702
  export function UnauthenticatedChatConnection_init_listener(chat: Wrapper<UnauthenticatedChatConnection>, listener: ChatListener): void;
703
+ export function UnauthenticatedChatConnection_look_up_username_hash(asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<UnauthenticatedChatConnection>, hash: Uint8Array): CancellablePromise<Uuid | null>;
703
704
  export function UnauthenticatedChatConnection_send(asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<UnauthenticatedChatConnection>, httpRequest: Wrapper<HttpRequest>, timeoutMillis: number): CancellablePromise<ChatResponse>;
704
705
  export function UnidentifiedSenderMessageContent_Deserialize(data: Uint8Array): UnidentifiedSenderMessageContent;
705
706
  export function UnidentifiedSenderMessageContent_GetContentHint(m: Wrapper<UnidentifiedSenderMessageContent>): number;
@@ -2591,7 +2591,7 @@ limitations under the License.
2591
2591
 
2592
2592
  ```
2593
2593
 
2594
- ## boring 4.15.0
2594
+ ## boring 4.18.0
2595
2595
 
2596
2596
  ```
2597
2597
  Copyright 2011-2017 Google Inc.
@@ -2613,7 +2613,7 @@ limitations under the License.
2613
2613
 
2614
2614
  ```
2615
2615
 
2616
- ## bindgen 0.70.1
2616
+ ## bindgen 0.72.0
2617
2617
 
2618
2618
  ```
2619
2619
  BSD 3-Clause License
@@ -2883,7 +2883,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2883
2883
 
2884
2884
  ```
2885
2885
 
2886
- ## boring-sys 4.15.0
2886
+ ## boring-sys 4.18.0
2887
2887
 
2888
2888
  ```
2889
2889
  /* Copyright (c) 2015, Google Inc.
@@ -3192,7 +3192,7 @@ DEALINGS IN THE SOFTWARE.
3192
3192
 
3193
3193
  ```
3194
3194
 
3195
- ## boring-sys 4.15.0
3195
+ ## boring-sys 4.18.0
3196
3196
 
3197
3197
  ```
3198
3198
  Copyright (c) 2014 Alex Crichton
@@ -3488,7 +3488,7 @@ THE SOFTWARE.
3488
3488
 
3489
3489
  ```
3490
3490
 
3491
- ## either 1.15.0, itertools 0.13.0, itertools 0.14.0, petgraph 0.7.1, serde_with 3.12.0, serde_with_macros 3.12.0
3491
+ ## either 1.15.0, itertools 0.10.5, itertools 0.14.0, petgraph 0.7.1, serde_with 3.12.0, serde_with_macros 3.12.0
3492
3492
 
3493
3493
  ```
3494
3494
  Copyright (c) 2015
@@ -3732,7 +3732,7 @@ DEALINGS IN THE SOFTWARE.
3732
3732
 
3733
3733
  ```
3734
3734
 
3735
- ## boring-sys 4.15.0
3735
+ ## boring-sys 4.18.0
3736
3736
 
3737
3737
  ```
3738
3738
  Copyright (c) 2015-2016 the fiat-crypto authors (see
@@ -4095,7 +4095,7 @@ SOFTWARE.
4095
4095
 
4096
4096
  ```
4097
4097
 
4098
- ## tokio-boring 4.15.0
4098
+ ## tokio-boring 4.18.0
4099
4099
 
4100
4100
  ```
4101
4101
  Copyright (c) 2016 Tokio contributors
@@ -6481,7 +6481,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
6481
6481
  SOFTWARE.
6482
6482
  ```
6483
6483
 
6484
- ## snow 0.9.6
6484
+ ## snow 0.10.0
6485
6485
 
6486
6486
  ```
6487
6487
  MIT License
@@ -6699,7 +6699,35 @@ SOFTWARE.
6699
6699
 
6700
6700
  ```
6701
6701
 
6702
- ## curve25519-dalek-derive 0.1.1, adler2 2.0.0, anyhow 1.0.97, async-trait 0.1.88, atomic-waker 1.1.2, auto_enums 0.8.7, derive_utils 0.15.0, displaydoc 0.2.5, dyn-clone 1.0.19, fastrand 2.3.0, home 0.5.9, itoa 1.0.15, linkme-impl 0.3.33, linkme 0.3.33, linux-raw-sys 0.4.15, linux-raw-sys 0.9.3, minimal-lexical 0.2.1, num_enum 0.7.3, num_enum_derive 0.7.3, once_cell 1.21.3, paste 1.0.15, pin-project-internal 1.1.10, pin-project-lite 0.2.16, pin-project 1.1.10, prettyplease 0.2.32, proc-macro-crate 3.3.0, proc-macro2 1.0.94, quote 1.0.40, rustc-hash 1.1.0, rustix 0.38.44, rustix 1.0.5, rustversion 1.0.20, semver 1.0.26, send_wrapper 0.6.0, serde 1.0.219, serde_derive 1.0.219, serde_json 1.0.140, syn-mid 0.6.0, syn 2.0.100, thiserror-impl 1.0.69, thiserror-impl 2.0.12, thiserror 1.0.69, thiserror 2.0.12, unicode-ident 1.0.18, utf-8 0.7.6
6702
+ ## rustc-hash 2.1.1
6703
+
6704
+ ```
6705
+ Permission is hereby granted, free of charge, to any
6706
+ person obtaining a copy of this software and associated
6707
+ documentation files (the "Software"), to deal in the
6708
+ Software without restriction, including without
6709
+ limitation the rights to use, copy, modify, merge,
6710
+ publish, distribute, sublicense, and/or sell copies of
6711
+ the Software, and to permit persons to whom the Software
6712
+ is furnished to do so, subject to the following
6713
+ conditions:
6714
+
6715
+ The above copyright notice and this permission notice
6716
+ shall be included in all copies or substantial portions
6717
+ of the Software.
6718
+
6719
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
6720
+ ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
6721
+ TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
6722
+ PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
6723
+ SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
6724
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
6725
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
6726
+ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
6727
+ DEALINGS IN THE SOFTWARE.
6728
+ ```
6729
+
6730
+ ## curve25519-dalek-derive 0.1.1, adler2 2.0.0, anyhow 1.0.97, async-trait 0.1.88, atomic-waker 1.1.2, auto_enums 0.8.7, derive_utils 0.15.0, displaydoc 0.2.5, dyn-clone 1.0.19, fastrand 2.3.0, home 0.5.9, itoa 1.0.15, linkme-impl 0.3.33, linkme 0.3.33, linux-raw-sys 0.4.15, linux-raw-sys 0.9.3, minimal-lexical 0.2.1, num_enum 0.7.3, num_enum_derive 0.7.3, once_cell 1.21.3, paste 1.0.15, pin-project-internal 1.1.10, pin-project-lite 0.2.16, pin-project 1.1.10, prettyplease 0.2.32, proc-macro-crate 3.3.0, proc-macro2 1.0.94, quote 1.0.40, rustix 0.38.44, rustix 1.0.5, rustversion 1.0.20, semver 1.0.26, send_wrapper 0.6.0, serde 1.0.219, serde_derive 1.0.219, serde_json 1.0.140, syn-mid 0.6.0, syn 2.0.100, thiserror-impl 1.0.69, thiserror-impl 2.0.12, thiserror 1.0.69, thiserror 2.0.12, unicode-ident 1.0.18, utf-8 0.7.6
6703
6731
 
6704
6732
  ```
6705
6733
  Permission is hereby granted, free of charge, to any
@@ -7628,7 +7656,7 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice
7628
7656
 
7629
7657
  ```
7630
7658
 
7631
- ## boring-sys 4.15.0
7659
+ ## boring-sys 4.18.0
7632
7660
 
7633
7661
  ```
7634
7662
  /* ====================================================================
package/dist/index.d.ts CHANGED
@@ -225,7 +225,21 @@ export declare class SenderCertificate {
225
225
  senderDeviceId(): number;
226
226
  serverCertificate(): ServerCertificate;
227
227
  signature(): Uint8Array;
228
+ /**
229
+ * Validates `this` against the given trust root at the given current time.
230
+ *
231
+ * @see validateWithTrustRoots
232
+ */
228
233
  validate(trustRoot: PublicKey, time: number): boolean;
234
+ /**
235
+ * Validates `this` against the given trust roots at the given current time.
236
+ *
237
+ * Checks the certificate against each key in `trustRoots` in constant time (that is, no result
238
+ * is produced until every key is checked), making sure **one** of them has signed its embedded
239
+ * server certificate. The `time` parameter is compared numerically against ``expiration``, and
240
+ * is not required to use any specific units, but Signal uses milliseconds since 1970.
241
+ */
242
+ validateWithTrustRoots(trustRoots: PublicKey[], time: number): boolean;
229
243
  }
230
244
  export declare class SenderKeyDistributionMessage {
231
245
  readonly _nativeHandle: Native.SenderKeyDistributionMessage;
package/dist/index.js CHANGED
@@ -505,8 +505,29 @@ class SenderCertificate {
505
505
  signature() {
506
506
  return Native.SenderCertificate_GetSignature(this);
507
507
  }
508
+ /**
509
+ * Validates `this` against the given trust root at the given current time.
510
+ *
511
+ * @see validateWithTrustRoots
512
+ */
508
513
  validate(trustRoot, time) {
509
- return Native.SenderCertificate_Validate(this, trustRoot, time);
514
+ return Native.SenderCertificate_Validate(this, [trustRoot], time);
515
+ }
516
+ /**
517
+ * Validates `this` against the given trust roots at the given current time.
518
+ *
519
+ * Checks the certificate against each key in `trustRoots` in constant time (that is, no result
520
+ * is produced until every key is checked), making sure **one** of them has signed its embedded
521
+ * server certificate. The `time` parameter is compared numerically against ``expiration``, and
522
+ * is not required to use any specific units, but Signal uses milliseconds since 1970.
523
+ */
524
+ validateWithTrustRoots(trustRoots, time) {
525
+ try {
526
+ return Native.SenderCertificate_Validate(this, trustRoots, time);
527
+ }
528
+ catch (_error) {
529
+ return false;
530
+ }
510
531
  }
511
532
  }
512
533
  exports.SenderCertificate = SenderCertificate;
@@ -10,6 +10,9 @@ export type ChatRequest = Readonly<{
10
10
  body?: Uint8Array;
11
11
  timeoutMillis?: number;
12
12
  }>;
13
+ export type RequestOptions = {
14
+ abortSignal?: AbortSignal;
15
+ };
13
16
  type ConnectionManager = Native.Wrapper<Native.ConnectionManager>;
14
17
  export declare class ChatServerMessageAck {
15
18
  readonly _nativeHandle: Native.ServerMessageAck;
@@ -65,9 +68,7 @@ export type ChatConnection = {
65
68
  /**
66
69
  * Sends request to the Chat service.
67
70
  */
68
- fetch(chatRequest: ChatRequest, options?: {
69
- abortSignal?: AbortSignal;
70
- }): Promise<Native.ChatResponse>;
71
+ fetch(chatRequest: ChatRequest, options?: RequestOptions): Promise<Native.ChatResponse>;
71
72
  /**
72
73
  * Information about the connection to the Chat service.
73
74
  */
@@ -79,8 +80,8 @@ export interface ConnectionInfo {
79
80
  toString: () => string;
80
81
  }
81
82
  export declare class UnauthenticatedChatConnection implements ChatConnection {
82
- private readonly asyncContext;
83
- private readonly chatService;
83
+ readonly _asyncContext: TokioAsyncContext;
84
+ readonly _chatService: Wrapper<Native.UnauthenticatedChatConnection>;
84
85
  private readonly chatListener;
85
86
  private readonly env?;
86
87
  static connect(asyncContext: TokioAsyncContext, connectionManager: ConnectionManager, listener: ConnectionEventsListener, env?: Environment, options?: {
@@ -97,9 +98,7 @@ export declare class UnauthenticatedChatConnection implements ChatConnection {
97
98
  */
98
99
  static fakeConnect(asyncContext: TokioAsyncContext, listener: ChatServiceListener): [UnauthenticatedChatConnection, Wrapper<Native.FakeChatRemoteEnd>];
99
100
  private constructor();
100
- fetch(chatRequest: ChatRequest, options?: {
101
- abortSignal?: AbortSignal;
102
- }): Promise<Native.ChatResponse>;
101
+ fetch(chatRequest: ChatRequest, options?: RequestOptions): Promise<Native.ChatResponse>;
103
102
  disconnect(): Promise<void>;
104
103
  connectionInfo(): ConnectionInfo;
105
104
  keyTransparencyClient(): KT.Client;
package/dist/net/Chat.js CHANGED
@@ -66,29 +66,31 @@ class UnauthenticatedChatConnection {
66
66
  (0, internal_1.newNativeHandle)(Native.TESTING_FakeChatConnection_TakeRemote(fakeChat)),
67
67
  ];
68
68
  }
69
- constructor(asyncContext, chatService,
69
+ constructor(
70
+ // Not true-private so that they can be accessed by the "Service" interfaces in chat/.
71
+ _asyncContext, _chatService,
70
72
  // Unused except to keep the listener alive since the Rust code only holds a
71
73
  // weak reference to the same object.
72
74
  chatListener, env) {
73
- this.asyncContext = asyncContext;
74
- this.chatService = chatService;
75
+ this._asyncContext = _asyncContext;
76
+ this._chatService = _chatService;
75
77
  this.chatListener = chatListener;
76
78
  this.env = env;
77
79
  }
78
80
  fetch(chatRequest, options) {
79
- return this.asyncContext.makeCancellable(options?.abortSignal, Native.UnauthenticatedChatConnection_send(this.asyncContext, this.chatService, buildHttpRequest(chatRequest), chatRequest.timeoutMillis ?? DEFAULT_CHAT_REQUEST_TIMEOUT_MILLIS));
81
+ return this._asyncContext.makeCancellable(options?.abortSignal, Native.UnauthenticatedChatConnection_send(this._asyncContext, this._chatService, buildHttpRequest(chatRequest), chatRequest.timeoutMillis ?? DEFAULT_CHAT_REQUEST_TIMEOUT_MILLIS));
80
82
  }
81
83
  disconnect() {
82
- return Native.UnauthenticatedChatConnection_disconnect(this.asyncContext, this.chatService);
84
+ return Native.UnauthenticatedChatConnection_disconnect(this._asyncContext, this._chatService);
83
85
  }
84
86
  connectionInfo() {
85
- return new ConnectionInfoImpl(Native.UnauthenticatedChatConnection_info(this.chatService));
87
+ return new ConnectionInfoImpl(Native.UnauthenticatedChatConnection_info(this._chatService));
86
88
  }
87
89
  keyTransparencyClient() {
88
90
  if (this.env == null) {
89
91
  throw new Error('KeyTransparency is not supported on local test server');
90
92
  }
91
- return new KT.ClientImpl(this.asyncContext, this.chatService, this.env);
93
+ return new KT.ClientImpl(this._asyncContext, this._chatService, this.env);
92
94
  }
93
95
  }
94
96
  exports.UnauthenticatedChatConnection = UnauthenticatedChatConnection;
@@ -0,0 +1,20 @@
1
+ import { Aci } from '../../Address';
2
+ import { RequestOptions } from '../Chat';
3
+ declare module '../Chat' {
4
+ interface UnauthenticatedChatConnection extends UnauthUsernamesService {
5
+ }
6
+ }
7
+ export interface UnauthUsernamesService {
8
+ /**
9
+ * Looks up a username hash on the service, like that computed by {@link usernames.hash}.
10
+ *
11
+ * Returns the corresponding account's ACI, or `null` if the username doesn't correspond to an
12
+ * account.
13
+ *
14
+ * Throws / completes with failure only if the request can't be completed, potentially including
15
+ * if the hash is structurally invalid.
16
+ */
17
+ lookUpUsernameHash(request: {
18
+ hash: Uint8Array;
19
+ }, options?: RequestOptions): Promise<Aci | null>;
20
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ //
3
+ // Copyright 2025 Signal Messenger, LLC.
4
+ // SPDX-License-Identifier: AGPL-3.0-only
5
+ //
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const Native = require("../../../Native");
8
+ const Address_1 = require("../../Address");
9
+ const Chat_1 = require("../Chat");
10
+ Chat_1.UnauthenticatedChatConnection.prototype.lookUpUsernameHash = async function ({ hash, }, options) {
11
+ const response = await this._asyncContext.makeCancellable(options?.abortSignal, Native.UnauthenticatedChatConnection_look_up_username_hash(this._asyncContext, this._chatService, Buffer.from(hash)));
12
+ return response ? Address_1.Aci.fromUuidBytes(response) : null;
13
+ };
14
+ //# sourceMappingURL=UnauthUsernamesService.js.map
package/dist/net.d.ts CHANGED
@@ -6,6 +6,7 @@ import { RegistrationService } from './net/Registration';
6
6
  import { SvrB } from './net/SvrB';
7
7
  export * from './net/CDSI';
8
8
  export * from './net/Chat';
9
+ export * from './net/chat/UnauthUsernamesService';
9
10
  export * from './net/Registration';
10
11
  export * from './net/SvrB';
11
12
  export declare enum Environment {
package/dist/net.js CHANGED
@@ -27,6 +27,7 @@ const SvrB_1 = require("./net/SvrB");
27
27
  const internal_1 = require("./internal");
28
28
  __exportStar(require("./net/CDSI"), exports);
29
29
  __exportStar(require("./net/Chat"), exports);
30
+ __exportStar(require("./net/chat/UnauthUsernamesService"), exports);
30
31
  __exportStar(require("./net/Registration"), exports);
31
32
  __exportStar(require("./net/SvrB"), exports);
32
33
  // This must match the libsignal-bridge Rust enum of the same name.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalapp/libsignal-client",
3
- "version": "0.79.0",
3
+ "version": "0.79.1",
4
4
  "license": "AGPL-3.0-only",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",