Commit Graph

179 Commits

Author SHA1 Message Date
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
moiseev-signal
88c2ab1dcc svr3: Bridge rotate API to mobile platforms 2024-09-13 09:59:56 -07:00
Alex Konradi
40aaecb9f3 Propagate reason for chat disconnect to listeners 2024-09-05 16:49:55 -04:00
Jordan Rose
eb860ea051 java: use 'assertThat' from org.hamcrest rather than org.junit
(as preferred by JUnit)
2024-08-30 09:05:04 -07:00
Jordan Rose
9400604090 java: Set up class loader for libsignal_jni_testing.so too
The class loader is a rare process-wide variable for us. When the
testing crates are compiled into the same .so as the main bridge
crates, they all use the same variable, but when we build for Android
we have two separate native library files that get loaded, and so we
need to initialize both.
2024-08-29 11:26:24 -07:00
Jordan Rose
a8814d16f8 Move all "testing-fns" APIs into libsignal-bridge-testing
This means they'll be shipped to clients, but still filtered out of
the device builds on Android (via having two separate libraries on
disk) and iOS (by not being included in non-simulator builds). The
biggest benefit of this is dropping the :android:makeTestJniLibraries
step for running libsignal's Android tests.
2024-08-27 08:29:06 -07:00
Jordan Rose
5e81e01a38 java: {Signed,Kyber}PreKeyRecord.getKeyPair throws InvalidKeyException
Since the usual constructor is strongly typed, this can only happen
when the serialized data is corrupted. But that is a possibility.
2024-08-20 14:54:46 -07:00
Alex Konradi
7c8a3e957d java: include unexpected exception name in message 2024-08-13 14:05:59 -04:00
Jordan Rose
669b43f12d java: Compare strings correctly in ee552962 2024-08-07 12:01:24 -07:00
Jordan Rose
ee552962b9 java: Special-case the arch-specific load to account for "x86_64"
0453438d added the capability to prefer arch-specific versions of
libsignal_jni, but it turns out that some Java implementations use
"x86_64" rather than the "amd64" we expected. Rather than doing
something clever and general, just handle this one special case. If
this happens again with "arm64" vs "aarch64", we can spend more time
on it then.
2024-08-06 10:18:10 -07:00
Jordan Rose
a561392cff Expose the "network changed" event to apps 2024-07-30 15:27:42 -07:00
Jonathan Klabunde Tomer
0453438d98 Prepare libsignal-server Java build for arm64 2024-07-30 13:37:55 -07:00
Sergey Skrobotov
d694cff1a1 net: adding a parameter to opt in/out of receiving stories 2024-07-25 14:55:23 -07:00
Alex Konradi
66cd3f0133 backup: bridge canonical serialization as ComparableBackup 2024-07-16 14:20:31 -04:00
moiseev-signal
f794998389 SVR3: implement migrate API 2024-07-10 11:40:56 -07:00
Alex Konradi
0e4d420f69 Add libsignal-jni-testing crate with test-only functions for Java
This parallels the exiting libsignal-jni crate but exports functions from 
libsignal-bridge-testing instead of libsignal-bridge. The crate is compiled as 
a separate shared object that is included in the published libsignal package, 
but which can be excluded at Android packaging time.
2024-07-09 13:07:36 -04:00
Alex Konradi
c6857dd58e Don't assume EOF on 0-length read for Node
Remove the special handling code that detects EOF now that the upstream crate 
has fixed the bug that was being worked around. This also fixes a bug where EOF 
was being incorrectly detected when the provided buffer was empty. Add a test 
case to prevent regression in the future.
2024-07-09 11:58:43 -04:00
Chris Eager
2b5b51c7b3 Fix error string whitespace 2024-06-21 16:34:27 -07:00
Jordan Rose
4e2a7de574 Expose the 'Stopped' event to Swift and Node
Swift: ChatListener.chatServiceConnectionWasInterrupted(_:)
Node: ChatServiceListener.onConnectionInterrupted()
2024-06-13 15:54:21 -07:00
Jordan Rose
4791773954 java: Add -P debugLevelLogs as a Gradle build option
Similar to the previous commits, but for Java/Android. If invoking
build_jni.sh directly, use `--debug-level-logs` like build_ffi.sh.

As a consequence, LOGGING IS NO LONGER AUTOMATICALLY ENABLED FOR
JAVA/ANDROID. Clients must call SignalProtocolLoggerProvider.
initializeLogging() in addition to setting a provider.
2024-06-13 12:08:31 -07:00
Jordan Rose
44b6057bce java (mostly): audit for checked AttestationFailedException
The "mostly" is because there was one place in the Rust layer where
establishing attestation could *additionally* generate a Noise error
(theoretically, not in practice), which gets turned into an
SgxCommunicationFailureException (suboptimally named now that we have
non-SGX enclaves, but oh well). Change that to treat that as an
AttestationData error as well, since it *is* about the data that comes
from the attestation blob rather than the actual Noise handshake.
2024-06-05 15:59:21 -07:00
Jordan Rose
9a8429da46 net: Add AppExpired and DeviceDeregistered errors for ChatService
And check bridging for every high-level ChatServiceError like we do
with CdsiLookupErrors.
2024-05-23 10:27:28 -07:00
Jordan Rose
a5fa231a1c bridge: Expose ChatService_InjectRawServerRequest for testing 2024-05-21 13:04:18 -07:00
Jordan Rose
a513d61a09 bridge: Expose ChatListener to Swift
(and lay groundwork for the other bridges)
2024-05-21 13:04:18 -07:00
moiseev-signal
70ba17491c SVR3: Implement remove API 2024-05-21 10:33:33 -07:00
Jon Chambers
59addf10ec Make ECPrivateKey#<init>(byte[]) public 2024-05-20 18:09:50 -04:00
Jordan Rose
b9e021659b java: Check for invalid key sizes more thoroughly in ECPublicKey 2024-05-20 10:41:55 -07:00
Jordan Rose
7dc63b99af ffi: Expose cancellation to Swift 2024-05-17 11:30:24 -07:00
Jordan Rose
99e337f552 bridge: Expose authenticated sends on ChatService 2024-05-15 15:48:47 -07:00
Jordan Rose
a09eb567f0 net: "Poison" the TCP connector if an invalid proxy is set
This ensures that if there's an error setting a proxy, the previous
settings won't continue to be used for new connections.

This only applies to the Java, Swift, and TypeScript layers; the Rust
layer's set_proxy isn't a fallible API in the first place today. The
Java API now explicitly throws a checked IOException instead of
IllegalArgumentException.
2024-05-08 16:18:03 -07:00