Commit Graph

17 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
Jordan Rose
85686caa01 node: Combine Native.js and .d.ts into Native.ts
This allows the file to be checked by tsc, which would have caught
some of the missing type aliases sooner (now added to Native.ts.in).
Strictly speaking the behavior is slightly different: we have returned
to exporting many items individually instead of collecting them on a
single object.

Co-authored-by: Alex Bakon <akonradi@signal.org>
2025-10-15 17:50:37 -07:00
andrew-signal
b6db49f457 TypeScript: Provide BackupsJsonExporter for takeout flow 2025-10-09 20:27:00 -04: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
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
Alex Bakon
5d7ce2d165 Remove app language code marked as deprecated 2025-04-09 15:41:35 -04: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
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
b777cbcc90 Improve context for BackupKey key derivations 2024-10-31 09:28:59 -07: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
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
Jordan Rose
a4da946705 node: Use JsBigInt for u64 bridging instead of a Buffer 2024-02-23 13:40:44 -08: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