Commit Graph

18 Commits

Author SHA1 Message Date
andrew-signal
de881ddde4 backups: Exporter now returns [Result<String, Error>] instead of a serialized JSON array object
Co-authored-by: Jordan Rose <jrose@signal.org>
2025-11-11 16:52:47 -05:00
andrew-signal
b6db49f457 TypeScript: Provide BackupsJsonExporter for takeout flow 2025-10-09 20:27:00 -04:00
Jordan Rose
8b10397484 node: Explicitly import Buffer from node:buffer 2025-09-29 18:23:38 -07:00
Jordan Rose
42ff946228 node: Enforce @typescript-eslint/method-signature-style 2025-09-24 16:30:43 -07:00
Alex Bakon
1f01c19e5f Convert libsignal-client node package to ESM 2025-09-22 14:20:16 -04:00
Jordan Rose
9e9c375db9 Expose BackupForwardSecrecyToken-aware MessageBackupKey derivation 2025-07-28 13:53:19 -07:00
Jordan Rose
0dc81d3131 backup: Replace bespoke TooShort with io::ErrorKind::UnexpectedEof 2025-07-17 10:57:29 -07:00
Jordan Rose
97a2ded3f6 node: Replace Buffer with Uint8Array nearly everywhere
Exceptions:
- Buffers decoding from strings (usually for tests)
- Buffer.concat, if immediately fed into libsignal, which we know
  won't rely on the diverging behavior of slice()
- Encoding GroupIdentifier to base64

Everywhere else, Uint8Array was nearly a drop-in replacement. Places
where it wasn't:
- For tests, use assertArrayEquals more, which converts to hex first
  (better diffs anyway)
- Use TextEncoder and TextDecoder for going back and forth between
  strings and UTF-8 buffers *not* in the tests
2025-06-12 16:49:20 -07:00
Jordan Rose
b3a1e2e335 node: Make sure to close InputStreams created by libsignal
InputStream didn't previously *have* a close() method, and if any
subclasses already had a close() method this may result in it being
called more often than previously.

Note also that InputStreams that are *passed* to libsignal will still
not have close() called, even if libsignal reads the entire stream. In
practice, only MessageBackup's validate() method "creates streams" at
this time.
2025-03-25 13:57:04 -07:00
Alex Konradi
a060aa6f74 Add fn to check that an AccountEntropyPool string is valid 2024-12-19 15:39:15 -05:00
Jordan Rose
e03e665c57 Introduce OnlineBackupValidator
Validates a backup frame-by-frame, bypassing the encryption,
compression, and integrity-checking layers. Intended for use during an
export the user is waiting for, such as linking a new device.
2024-11-20 12:04:33 -08:00
Jordan Rose
22252be035 Expose additional key derivations to apps via new BackupKey class 2024-10-29 09:47:50 -07:00
Jordan Rose
39e8616479 backup: Expose MessageBackupKey's HMAC and AES keys
This lets clients use MessageBackupKey for their own key derivation.
2024-10-28 09:53:23 -07:00
Jordan Rose
595b5d78f3 account-keys: Adjust backup ID derivation
The new derivation can be used for both messages and media backup IDs.
2024-10-28 09:53:07 -07:00
Jordan Rose
a328e3278c backup: Expose new ways of constructing MessageBackupKey
And switch the encrypted backup tests over to AccountEntropyPool.
2024-10-23 10:34:09 -07:00
Alex Konradi
66cd3f0133 backup: bridge canonical serialization as ComparableBackup 2024-07-16 14:20:31 -04:00
Alex Konradi
274b680ef4 Expose message backup purpose as an argument
Add a flag to the CLI validation tool and an argument to the bridged validation 
functions so users can specify whether a provided message backup should be 
validated according to the rules for device-to-device transfers or backups 
intended for remote storage.
2024-03-01 09:53:00 -05:00
Alex Konradi
11f7b0b231 Bridge message backup validation to node
Expose message backup at the bridge layer as a separate async function. Add a 
TS wrapper with the same interface as for the other app languages.
2024-02-02 14:47:05 -05:00