0
0
mirror of https://github.com/signalapp/libsignal.git synced 2024-09-20 03:52:17 +02:00
Commit Graph

116 Commits

Author SHA1 Message Date
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
Sergey Skrobotov
ab733bf00a libsignal-net: support for User-Agent header 2024-05-01 20:02:08 -07:00
Sergey Skrobotov
eb3929f1bf
libsignal-net: expose ipv6_enabled DnsResolver option to Node 2024-04-19 14:14:45 -07:00
Jordan Rose
9f53f3d1e7 BackupAuthCredential: verify the redemption time on receive
This is passed both within the credential response and outside it, so
it's important to make sure the two times match.
2024-04-19 13:41:59 -07:00
ravi-signal
9204831745
Use an enum for BackupAuthCredential's level 2024-04-19 11:46:49 -07:00
Sergey Skrobotov
3864f33b4d libsignal-net: dropping DebugInfo.connectionReused field 2024-04-16 10:20:00 -07:00
Alex Konradi
f72f33d3ee
Remove code that handles auth cred with ACI as PNI
These functions are unused in client and server code.
2024-04-11 17:08:18 -04:00
Alex Konradi
06c1780a14
Hold server zkparams as pointers 2024-04-09 16:13:22 -04:00
Alex Konradi
79bab1ce78
Expose TLS proxy in app libraries
Co-authored-by: Sergey Skrobotov <sergey@signal.org>
2024-04-02 16:22:18 -04:00
Sergey Skrobotov
a829c8f2e3
libsignal-net: introducing a separate ChatService class for Node 2024-04-01 16:25:23 -07:00
Jordan Rose
96fce497db
Bridge unauthenticated connection to Swift
- Remove From<http::header::ToStrError> for ChatServiceError
- bridge: Response -> ChatResponse, DebugInfo -> ChatServiceDebugInfo
2024-04-01 09:24:46 -07:00
Alex Konradi
10a6d8b744
Remove enclave operation timeout arguments
The enclave interactions have internal progress monitoring in the form of 
websocket PING/PONG frames, so the timeout parameters aren't necessary for 
broken connection detection.
2024-03-29 18:13:40 -04:00
Sergey Skrobotov
8c1eadc0e7 libsignal-net: refining ServiceWithReconnect activity states logic 2024-03-29 13:33:19 -07:00
Sergey Skrobotov
aca995d745 libsignal-net: additional API and debug info 2024-03-27 12:39:24 -07:00
Alex Konradi
ed19489470
Improve CDSI errors
Add bridging tests for all the CDSI error types, and diversify the types of 
exceptions that can be thrown from Java code.
2024-03-25 13:39:06 -04:00
Sergey Skrobotov
d7a4b8c817 libsignal-net: ChatService jni bridge 2024-03-21 13:19:27 -07:00
Jordan Rose
8ed2dc1195 Remove GroupSendCredential
Long live GroupSendEndorsements!
2024-03-14 12:31:30 -07:00
Jordan Rose
256f4742c7 bridge: Add tests for bridging arrays of bytestrings 2024-03-13 12:22:46 -07:00
Jordan Rose
8fb6cc31cf bridge: Make a combined endorsement for GroupSendEndorsementsResponse
Specifically, make this on the Rust side bridge layer, and tack it on
to the end of per-member endorsements for the app side to peel off
later, rather than the app layer calling back down to Rust to compute
it. This saves a fair amount of marshalling work.
2024-03-12 14:54:04 -07:00
Alex Konradi
60f066dbac
Remove AuthCredential
This hasn't been used in client code for some time.
2024-03-11 16:43:23 -04:00
Jordan Rose
cdef8228a2 bridge: Expose GroupSendEndorsement APIs 2024-03-11 13:41:48 -07:00
Alex Konradi
f4f478fd06
Add authentication credential implemented with zkc
Add a new version of the existing auth credential used for groups, but 
implemented with the zkcredential crate instead of hand-written proofs. Expose 
issuance point for the server, and extend existing client methods to support it 
and the existing formats transparently.
2024-03-08 15:38:23 -05: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
Sergey Skrobotov
2d0b32d9df libsignal-net: use millis for timeout, pass status message back 2024-02-28 15:30:31 -08:00
Sergey Skrobotov
ec49a9774b libsignal-net: ChatService node bridge 2024-02-27 11:07:57 -08:00
moiseev-signal
536ec242c9
SVR3: Node bridge 2024-02-23 14:50:53 -08:00
Jordan Rose
a4da946705 node: Use JsBigInt for u64 bridging instead of a Buffer 2024-02-23 13:40:44 -08:00
moiseev-signal
6f783269db
SVR3: JNI bridge 2024-02-22 12:22:10 -08:00
Alex Konradi
1359b67486
Cache classes during initial Java library load
Use the class loader from the main thread to cache java.lang.Class
instances for some libsignal classes.

This enables constructing instances of libsignal classes on threads
where the classes aren't accessible via the default class loader. This
can occur on Android, where threads spawned via the native API only get
access to the system class loader, not the application loader that has
access to the application's class files. Since Tokio worker threads are
spawned via the native API, and the completion process for async tasks
converts results to Java objects, application class instances can't be
used there unless they are preloaded.

Since classes used in client code are only included in the client .jar
file, failure to load classes is a normal occurrence. If there are ever
separate builds for server and client .so library files, this could be
changed to a fatal error.
2024-02-16 10:38:12 -05:00
Alex Konradi
100ce19945
Fix Java error handling for CDSI lookup
CDSI error handling code would attempt to instantiate a nonexistent Java class. 
Add the missing class and split up the handling for CDSI lookup errors to reuse 
existing error types.
2024-02-09 15:31:35 -05:00
Fedor Indutny
45d513a548
Introduce processMinidumpBuffer for Desktop 2024-02-09 09:46:55 -08:00
Alex Konradi
483d220aba Expose CDSI debugPermitsUsed in app libs 2024-02-08 15:25:33 -05:00
Alex Konradi
d08adf19bb
Return username candidates as string array
Use the string bridging code introduced previously to provide string arrays to 
client directly instead of joining and splitting. This eliminates the use of a 
magic ',' character as a delimiter.
2024-02-06 09:46:06 -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
Alex Konradi
c70b66dc8c
Bridge message backup validator to Java
Provide a simple API for validating message backups read from InputStream 
instances.
2024-01-26 13:33:36 -05:00
Jordan Rose
1f8701213b
zkgroup: Add GroupSendCredentialResponse::receive_with_ciphertexts
If a client already has the members of a group as ciphertexts, it's
more efficient to receive a GroupSendCredential that way, because then
they get to skip the conversion from ServiceId to UidStruct. If they
don't, however, the existing entry point is going to be both more
convenient and faster.

For Swift and Java, this is an overload of the existing receive()
method; for TypeScript, it's receiveWithCiphertexts.
2024-01-22 12:34:34 -08:00
Jordan Rose
bf6ef9063c Node: Expose SealedSenderMultiRecipientMessage parsing
...for testing purposes (@signalapp/mock-server).
2024-01-18 14:55:14 -08:00
Jordan Rose
b31ca0781c Remove length parameter for webpsan
The way images are displayed on Android makes it annoying to provide,
and the implementation of webpsan doesn't actually need it.
2024-01-18 12:36:31 -08:00
Jordan Rose
70a9662acd usernames: Expose Username.fromParts to app languages 2024-01-10 12:26:19 -08:00
Jordan Rose
0d09a8352c
Add GroupSendCredential
This credential is issued by the group server and presented to the
chat server to prove that the holder is a member of *some* group with
a known list of people. This can be used to replace the access key
requirement for multi-recipient sealed sender sends.
2023-12-11 13:45:12 -08:00
Jordan Rose
16653ffea1 SSv2: Add send support for excluded recipients 2023-12-11 12:36:54 -08:00
Alex Konradi
1f2d761889
Allow returning handle types from Swift invokeAsyncFunction
Implement the Completable protocol for OpaquePointer and add a test that runs
futures that return handle types to prove that it works.
2023-12-04 16:39:32 -05:00
Alex Konradi
f06faef7a4
Split CDSI lookup to allow token retrieval
Split the libsignal-net implementation of CDSI lookup into two parts: one that
does the initial handshake and token acquisition, and the other to acknowledge
the token and then parse results. Expose the token in Java via the same Consumer
type used in the Android codebase.
2023-12-01 16:05:10 -05:00
Alex Konradi
4c78373114
Expose libsignal-net function for CDSI via JNI
Expose the existing CDSI lookup async function to Java clients. Provide a small
library that can be easily integrated into the existing codebase.
2023-11-15 10:00:46 -05:00
Jordan Rose
d768f47020 usernames: Allow generating a new link buffer with existing entropy
This allows updating the encrypted username associated with a link
without rotating the link itself.
2023-11-02 15:02:36 -07:00
akonradi-signal
e0465badb6
Add CDSI lookup bridge code for node
Use the async CDSI lookup function introduced in libsignal-net and expose it via
the bridging layer to node. Add a typescript library that provides a more
convenient interface for callers and exposes a close-to-drop-in-compatible API
for the desktop client.
2023-11-02 16:33:24 -04:00
Jessa
7af14c6b06
Add WebP sanitizer
This adds integration bits for the new webpsan, a WebP image sanitizer -- which
currently simply checks the validity of a WebP file input, so that passing a
malformed file to an unsafe parser can be avoided. The integration pretty much
just leverages the integration work that was already done for mp4san.
2023-10-26 15:16:59 -04:00
ravi-signal
790db2383e
zkgroup: add backup auth credential
Allows a client to request a credential for a backup-id without
revealing the backup-id to the issuing server. Later, the client may use
this to make requests for the backup-id without identifying themselves
to the server.
2023-10-25 17:26:58 -05:00
Jordan Rose
55a1958a15 Test various error and panic scenarios for bridge_fn and bridge_io 2023-10-12 12:23:22 -07:00