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

1990 Commits

Author SHA1 Message Date
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
moiseev-signal
d7d2576ae6
SVR3: FFI bridge 2024-02-29 18:22:59 -08:00
Alex Konradi
b1e996d3c3
Disallow messages that are expiring soon
Reject backups that include expiring messages that are expiring soon or have 
already expired.
2024-02-29 17:01:58 -05:00
Alex Konradi
ec7f630f76 Build Rust dev artifacts with limited debug info
Reduce the amount of disk size taken up by debug symbols.
2024-02-29 13:58:33 -05:00
Ehren Kret
daddc0fb5c use consistent copyright notice as other repos 2024-02-28 18:13:11 -06:00
Sergey Skrobotov
2d0b32d9df libsignal-net: use millis for timeout, pass status message back 2024-02-28 15:30:31 -08:00
Alex Konradi
e571290a56
Check the HMAC after validating contents
Prevent a TOC/TOU bug by checking the MAC of the backup reader before 
validating contents, and then again after reading the contents. This makes sure 
that if the file contents change between the first and second read, that will 
be detected.
2024-02-28 16:22:33 -05:00
Alex Konradi
e2be72fea4
Add AsType wrapper for bridging
Move fallibility of conversion of bridged types into the argument type. This
lets us have cleaner code in the bridge function code itself, and makes it
simpler to bridge trivially convertible enums.
2024-02-28 16:14:30 -05:00
Alex Konradi
297556cd17
Build docs only with the stable toolchain in CI; clean before building 2024-02-28 14:58:35 -05:00
Sergey Skrobotov
ec49a9774b libsignal-net: ChatService node bridge 2024-02-27 11:07:57 -08:00
Jordan Rose
b9d2a5b81d acknowledgments: Manually mention NIST's Kyber patent license PDF 2024-02-23 16:56:43 -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
Jordan Rose
f0f18e82b3 node: Update to Neon 1.0
- Feature flags removed for unconditionally-provided APIs.
- A function's this() is no longer guaranteed to be an object,
  so we have to check and error out more often.
- Use of usize instead of i32 in a few places.
- Convenience for fetching globals.
2024-02-23 13:40:44 -08:00
Jordan Rose
26ccb1c42d CI: Clean before checking fuzz targets in Rust builds
The fuzz targets are deliberately not considered part of the
workspace, so they end up building the dependencies they rely on from
scratch.
2024-02-23 12:47:30 -08:00
moiseev-signal
58f43107ab
Enforce Swift code formatting 2024-02-23 09:56:38 -08:00
Jordan Rose
4f4d21a8ca java: Mark all bridge_fns that return Result as throws Exception
Then, use FilterExceptions to filter out any exceptions that aren't
declared in the calling method's exception spec. Note that this isn't
perfect: Java's checks for typed exceptions prevents an *extra*
exception from being thrown this way, but it's still possible to
forget to *allow* an exception using FilterExceptions.

This is 99% a mechanical change; the interesting bit is in
gen_java_decl.py and one unusual pattern in NativeErrorsTest.java. No
exception specs were changed here.
2024-02-22 13:34:57 -08:00
Jordan Rose
8cd6f8c68c java: Add the FilterExceptions helper
These methods wrap any unexpected checked exceptions in AssertionError
after logging them. The next commit will use this to enforce our
exception specifications for methods that wrap JNI calls.
2024-02-22 13:34:57 -08:00
Jordan Rose
071adfc689 bridge: Distinguish Throwing and non-throwing JNI bridge_fns
This commit does not actually do anything with that information; that
will come next commit.
2024-02-22 13:34:57 -08:00
Jordan Rose
e115f69cd0 bridge: Make ProtocolAddress's getters infallible
The bridge_get! macro assumes every getter ought to be allowed to
fail, which isn't really correct but can be revisited later.
ProtocolAddress is simple enough to manually avoid that, though.
2024-02-22 13:34:57 -08:00
Alex Konradi
f30edf082f Add benchmark for poksho 2024-02-22 16:16:20 -05:00
Jordan Rose
77606128c2 Use the default SecureRandom generator for registration IDs
SHA1PRNG may have been more reliable in earlier versions of Android,
but that shouldn't be true anymore.
2024-02-22 12:26:51 -08:00
moiseev-signal
6f783269db
SVR3: JNI bridge 2024-02-22 12:22:10 -08:00
Alex Konradi
5b5b85e715
Expose CDSI lookup via FFI 2024-02-22 10:31:01 -05:00
Jordan Rose
4d5ae34c1a Make "endorsements" the name of the New thing, instead of "passes"
And demote the thing we called "pass" to a plain bag of bytes, like a
hash.
2024-02-21 18:09:45 -08:00
Jordan Rose
bcbba73917 bridge: Filter out log messages that aren't from libsignal 2024-02-21 15:16:46 -08:00
Jordan Rose
7b0ada80c5 usernames: Fix missing Cargo feature for curve25519-dalek
This was getting enabled by other crates in the build, but trying to
build something that *just* depended on this crate was failing.
2024-02-20 17:33:26 -08:00
Jordan Rose
6d8f559df8
Implement 3HashSDHI-based "passes" in zkcredential
(further tweaks to come)
2024-02-20 16:33:12 -08:00
moiseev-signal
c5537a98a5
Add .editorconfig 2024-02-20 10:26:38 -08:00
Alex Konradi
20e8fb23e6 Improve error messages for empty oneofs
Point to the offending oneof by name in error messages.
2024-02-20 13:22:11 -05:00
Alex Konradi
f980fccd8a Bump to version v0.40.1 2024-02-20 09:48:25 -05:00
Alex Konradi
0676a89c90
Build Swift docs in CI
Fix existing documentation issues. Prevent backsliding on documentation by 
requiring cross-links to be correct for CI checks to pass.
2024-02-16 17:14:03 -05:00
Alex Konradi
ac538311e9
Use failOnError instead of try! in Swift
Replace existing usages of try! with the failOnError helper. Add guidance to 
the coding guidelines doc.
2024-02-16 14:31:34 -05: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
b8802028d8
Message backup validation cleanup 2024-02-15 17:53:03 -05:00
Alex Konradi
b85ec11255
Map Call.conversationRecipientId to RecipientId
Fix a bug in validation of the Call proto: the conversationRecipientId 
identifies a recipient, not a chat. Add a test case that only has a call with a 
recipient, not a chat.
2024-02-15 17:16:11 -05:00
Alex Konradi
8959e64ed1
Build TESTING_ functions for Android test
Run tests that call native TESTING_ functions on Android. This requires 
building a separate version of libsignal_jni.so with the testing functions 
included. The test code is still omitted from the published artifacts.
2024-02-15 16:53:05 -05:00
Alex Konradi
467b0f17b9
Add message backup validation negative tests
Add the ability to write tests that check error messages produced during
validation. Add a couple test cases.
2024-02-15 14:59:08 -05:00
Jordan Rose
786f5e9547 acknowledgments: "clarify" licenses that aren't properly recognized
Mostly just puts names next to copyrights for a few more crates.
2024-02-15 10:21:42 -08:00
moiseev-signal
37aa5fb323
ci: Upgrade actions to latest versions for Node 20.0 compatibility 2024-02-13 10:45:50 -08:00
Max Moiseev
7ef4efdb85 Bump to version 0.40.0 2024-02-12 12:03:40 -08:00
Alex Konradi
bd26a00b3e Clean cargo outputs before changing working dirs
Clean the contents of the default target directory before switching.
This should hopefully help us to avoid running out of disk space during
the following steps (running cross-version tests).
2024-02-12 14:06:26 -05:00
Sergey Skrobotov
22802cd22a libsignal-net: fix implementations for Arc<dyn ChatService> methods 2024-02-09 17:12:47 -08: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
Jordan Rose
2077213e64 node: include the libsignal version in the node module file on macOS
This shows up in crash dumps (and RingRTC has been doing it for a
while).
2024-02-09 09:42:16 -08:00
moiseev-signal
bb7f178948
Check Java Strings for null when bridging 2024-02-08 16:59:51 -08:00
Jordan Rose
1827eb7780 java: DecryptionErrorMessage deserialization can InvalidKeyException 2024-02-08 15:43:35 -08:00
Jordan Rose
09abe004cc java: HsmEnclaveClient can fail at any point during the protocol 2024-02-08 15:43:35 -08:00
Jordan Rose
204ce07c21 java: Aes256GcmSiv.encrypt can't fail
More specifically, it can't throw an InvalidMessageException, and
IllegalArgumentException is a RuntimeException already.
2024-02-08 15:43:35 -08:00