Commit Graph

208 Commits

Author SHA1 Message Date
Alex Bakon
24d2870b60 Use separate error types for chat connect vs. send (#1431) 2025-03-10 15:42:42 -04:00
Jordan Rose
835611fc7b Expose preconnectChat() to Swift and Java
Also added a JUnit Rule for initializing the libsignal logger to
print to stderr.
2025-03-07 10:35:07 -08:00
Jordan Rose
7ac3ce5d68 Implement preconnecting and expose it to Node 2025-03-06 10:56:56 -08:00
Jordan Rose
340324f5e4 Add X-Signal-Alert callbacks for Android and iOS 2025-03-05 15:02:20 -08:00
Jordan Rose
2ebd7cd2b3 Check for X-Signal-Alert header, and report it in a callback
This on-connect header will be used for lightweight "alerts" from the
server to an authenticated client. For now, it's only threaded through
to the Node implementation; the iOS and Android ones will come later.
2025-03-04 15:07:23 -08:00
adel-signal
83810ddbe0 Extract Endorsement keys from Server(Public/Private)Params 2025-03-01 21:10:04 -08:00
Alex Bakon
2ba84ac051 Bridge chat response sending as synchronous 2025-02-21 15:29:20 -05:00
Alex Bakon
efd6ef2424 Expose both CDSI connect methods 2025-02-19 14:19:56 -05:00
moiseev-signal
3a8bb9581f keytrans: Replace monitor with monitor_and_search in Android bridge 2025-02-12 13:05:35 -08:00
moiseev-signal
e949adc53f Java: fix javadoc warnings, enable non-hermetic tests in Docker builds 2025-02-11 15:17:16 -08:00
Alex Bakon
b34d84575f Remove chat service from bridge 2025-02-07 15:30:38 -05:00
Alex Bakon
23005551f2 Test chat connection send path
Add a test for the request send path and response receive path using the fake 
chat connection. This would have caught the bug fixed by bf680b09.
2025-02-05 15:15:34 -05:00
Milan Stevanovic
7785b8c3f6 Milan/mp4san update to v0 5 3 (#1343)
Propagating the mp4san new feature through all the layers of libsignal.

The feature allows seamless handling of transcoded MP4 files on Android, where multiple MDAT boxes (one per chunk of A/V streams) are first compounded and then passed to mp4san for format correction.
2025-02-04 11:17:35 -08:00
Jordan Rose
bd9a11f943 bridge: Separate proxy validation from proxy setting
And expose an explicit setInvalidProxy, both for testing and in case
apps want to do their own connection-poisoning.

This makes it easier to be consistent about "if you try to set a proxy
that turns out not to be valid, the ConnectionManager should end up in
the invalid state until explicitly cleared", whether the validation is
done on the Rust side of the bridge or the app language side.
2025-02-03 14:09:56 -08:00
andrew-signal
3bfbf95850 Catch all Throwables for System.loadLibrary(jni-testing) call 2025-02-03 12:27:13 -05:00
Jordan Rose
029b867b52 bridge: Add round-trip tests for u64 as well 2025-01-31 14:03:53 -08:00
Jordan Rose
9f496569ff Node: use JavaScript's URL class to provide Net.setProxyFromUrl
Also improves tests around proxies for all three languages.
2025-01-31 13:24:24 -08:00
Alex Bakon
c42963cfdf Write listener bridging tests for chat connection 2025-01-31 14:03:52 -05:00
Jordan Rose
6cc50a7ce9 bridge: Use IllegalArgumentException for out-of-range integers
...instead of a generic RuntimeException.
2025-01-31 10:55:17 -08:00
Jordan Rose
c49145fe3d bridge: Fix negative integer values coming from Node being rejected
And add tests for round-tripping integers to Java and Node, since the
types don't always match up as nicely as with C.
2025-01-31 10:55:17 -08:00
Alex Bakon
020f8f5a7b Include signal_jni fns in signal_jni_testing 2025-01-31 10:31:45 -05:00
Jordan Rose
c1ad890487 Expose a more complete Net.setProxy(...) to apps
This takes a full set of components describing the connection to a
proxy: a scheme, a host, and optionally a port and auth information.
The previous `setProxy(String, u16)` signature is still available for
Signal TLS proxies in particular, but now we have the flexibility to
support other kinds of proxies as well.
2025-01-27 17:53:09 -08:00
Jordan Rose
527222cf1f Revert "Implement and expose Net.setProxyFromUrl()"
This adds more code size than expected.
2025-01-22 11:49:14 -08:00
Jordan Rose
7e1be4700d Implement and expose Net.setProxyFromUrl()
This takes a full URL (as a string) to use as a proxy. The previous
`setProxy(String, int)` signature is still available for Signal TLS
proxies in particular, but now we have the flexibility to support
other kinds of proxies as well.
2025-01-22 11:42:00 -08:00
Alex Bakon
6eab52c405 Support KeyTransparencyClient with chat connection 2025-01-22 11:09:08 -05:00
Alex Bakon
f5d34398fb Bridge ChatConnection to Java 2025-01-17 11:44:07 -05:00
Alex Konradi
a060aa6f74 Add fn to check that an AccountEntropyPool string is valid 2024-12-19 15:39:15 -05:00
Jordan Rose
0b47709e98 Sink EC key types from libsignal_protocol to libsignal_core::curve
This is necessarily a breaking change because the EC key operations
can no longer return SignalProtocolError. However, the types are still
exported through libsignal_protocol, and SignalProtocolError
implements From<CurveError>, so hopefully any clients will be guided
to update to the new usage.

Other changes:

- PublicKey::public_key_bytes no longer uses Result; any future curve
  types will also need to keep their public key in a borrowable form.

- PublicKey::verify_signature also no longer uses Result; if a future
  curve type does not support verifying a signature, or if the
  signature is structurally invalid, that should be treated the same
  as a verification failure. (This is already how structurally invalid
  Curve25519 signatures were being treated.)

This change allows other crates to depend on the smaller
libsignal_core rather than all of libsignal_protocol (though it also
means libsignal_core is no longer as small as it used to be).
2024-12-18 10:12:25 -08:00
Alex Konradi
e28081415e Remove support for deprecated auth credential format 2024-12-16 16:28:47 -05:00
moiseev-signal
cf98c1a054 Remove SVR3 bridge from all platforms 2024-12-12 17:11:26 -08:00
moiseev-signal
0321d6d920 keytrans: Bridge monitor API to JNI 2024-12-06 16:00:55 -08:00
moiseev-signal
fc5b786fb7 keytrans: Remove ChatSearchContext type 2024-12-05 15:51:00 -08:00
moiseev-signal
107479ec4f keytrans: Rework the Store abstraction 2024-12-03 17:10:35 -08: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
Alex Konradi
b0117ea6ad Deprecate PniAsServiceId credential issuer methods 2024-11-19 07:35:23 -05:00
Alex Konradi
0dd5a0242f Remove CDSI return_acis_without_uaks 2024-11-18 09:50:47 -05:00
moiseev-signal
b53778e5aa keytrans: Support /search and /distinguished APIs through Chat Server 2024-11-13 11:24:47 -08:00
Alex Konradi
9b70d85ff0 Remove MakeChatListener trait 2024-11-12 16:52:01 -05:00
andrew-signal
716e3d0124 Bridge ChatListener to Android
Co-authored-by: Jordan Rose <jrose@signal.org>
2024-11-12 15:16:52 -05:00
Jordan Rose
77c246d74a jni: Create constant logging string on the Java side of the bridge 2024-11-08 09:45:33 -08:00
Jordan Rose
447f3655b5 java: Add a tool to run the backup validator through the bridge
./gradlew backup-tool:run --args "--hmac-key abcd --aes-key cdef
      path/to/backup"
2024-11-07 10:13:35 -08:00
Jordan Rose
7b75edeecd Add an API to ConnectionManager to enable/disable "connection fallbacks"
This will be off by default, unlike in previous releases of libsignal.
2024-11-05 13:45:52 -08:00
Jordan Rose
005412660c Add BackupKey.deriveThumbnailTransitEncryptionKey
One last key derivation that was previously omitted.
2024-10-31 09:28:59 -07:00
moiseev-signal
03c64b164d java: Make ECPublicKey extend SimpleOwner 2024-10-29 14:38:18 -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
4e22da3293 Add BackupCredentialType to BackupAuthCredential
Rename BackupLevel::{Messages, Media} to {Free, Paid}, then add 
BackupCredentialType::{Messages, Media}.

This is a breaking change for apps and the server, both because of the
new names, and because the credential attributes have changed (both
what's in a serialized credential, and what's included in the
signature).
2024-10-23 13:03:53 -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
andrew-signal
9fa6cf51f9 First iteration of JNI API for AccountEntropyPool 2024-10-03 14:59:27 -04:00
Jordan Rose
59cb7df6a3 bridge: Split Chat into AuthChat and UnauthChat
This matches the split that has already happened in the TypeScript and
Swift APIs. For now, both AuthChat and UnauthChat are wrappers around
the same type, a fully general chat::Chat, but we expect to eventually
split that into authenticated and unauthenticated variants as well. At
that point we can consider whether the common implementation here is
still pulling its weight.
2024-09-24 16:05:20 -07:00