Commit Graph

348 Commits

Author SHA1 Message Date
Jordan Rose
024c618f20 protocol: Throw SessionNotFound for an expired unacknowledged session
For the most part this should happen transparently without any
explicit adoption, like the previous change, but for Java code the
NoSessionException is now properly declared on SessionCipher.encrypt.
(This was always technically possible, but clients were expected to
have previously checked for session validity before using
SessionCipher; now that there's an expiration involved, that's not
strictly possible.)
2023-08-22 17:00:35 -07:00
Jordan Rose
a04c4f27a6 protocol: Check expiration in hasSenderChain/hasCurrentState
And consolidate the implementations of these two separate checks; now
they both check for a valid session by looking for a sender chain
instead of just *some* current session, in addition to the new check
for an expired unacknowledged session. At the Rust level, this is now
one check named has_usable_sender_chain; at the app levels, the old
names of hasSenderChain (Java) and hasCurrentState (Swift, TypeScript)
have been preserved.

Tests to come in the next commit.
2023-08-22 17:00:35 -07:00
Jordan Rose
9ca91fe2c0 protocol: Record the timestamp when a pre-key bundle is processed 2023-08-22 17:00:35 -07:00
Jordan Rose
02e1c45fed protocol: Remove SessionRecord.fromSingleSessionState
This was only used to migrate from an old Android session format
(pre-2018)...and it's been broken for years on the Android side. Just
remove it.
2023-08-22 10:26:46 -07:00
moiseev-signal
f9471c9c68 Set up and apply code formatting for Java 2023-08-22 09:15:23 -07:00
Sebastian
81a8360606 Add Automatic-Module-Name attribute to jar manifest
This allows using the libraries from java modules.

https://docs.gradle.org/current/userguide/java_library_plugin.html#sec:java_library_modular_auto
2023-08-15 18:08:00 -07:00
moiseev-signal
1e9492ef60 java: Piggyback on base.clean Gradle task 2023-08-14 15:22:57 -07:00
moiseev-signal
62853d7d99 Address javadoc warnings 2023-08-10 15:13:32 -07:00
Max Moiseev
32f53a7894 Bump to version v0.31.0 2023-08-09 15:26:47 -07:00
moiseev-signal
716e683324 Update dependencies following curve25519-dalek 4.0.0 release
Co-authored-by: Jordan Rose <jrose@signal.org>
2023-08-09 15:04:41 -07:00
Jordan Rose
24f6c6bc20 Bump to version v0.30.2 2023-08-03 10:50:59 -07:00
Jordan Rose
ff81905fc6 Add senderAci() to SenderCertificate and DecryptionResult
Like ProtocolAddresses in 88a2d5c, these APIs will eventually only
support ACIs, so introducing strong types now helps move in that
direction. However, the existing APIs that produce strings have not
been removed yet.
2023-08-02 17:51:23 -07:00
Jordan Rose
45fb135880 Add {Aci,Pni}.parseFromServiceId{String,Binary}
These work the same as the equivalent factory methods on ServiceId,
but throw if the resulting parsed ServiceId doesn't match the specific
type you were trying to parse.
2023-08-02 17:51:23 -07:00
moiseev-signal
2938b65ffa java: Prefer checked exceptions for ServiceId parsing methods 2023-07-27 15:40:44 -07:00
Jordan Rose
761c8080ee java: Reorganize tests 2023-07-27 15:40:44 -07:00
Jordan Rose
008fad966e protocol: Rip "Context" out of the Rust layer
Only the iOS client ever used this extra parameter, and it's one
that's easily stored alongside the reference to a store. This is
massively simpler than having it threaded down to the Rust
libsignal_protocol and back up through the bridging layer.
2023-07-27 15:40:44 -07:00
Jordan Rose
dea887e94c Bump to version v0.30.1 2023-07-27 15:40:01 -07:00
Jordan Rose
3b7f3173cc Bump to version v0.30.0 2023-07-20 14:02:10 -07:00
Jordan Rose
231aa16510 Give AuthCredentialWithPni "PniAsServiceId" and "PniAsAci" variants
The former is what we want going forward; the latter is equivalent to
the old format for compatibility with previous client builds.
2023-07-20 12:28:19 -07:00
Jordan Rose
6a547bf3f2 zkgroup: Use ServiceId and Aci in public APIs instead of UidBytes
Some of these APIs have to match up with UuidCiphertexts, and so we
convert them all for consistency.
2023-07-20 12:26:46 -07:00
Jordan Rose
af34c38c03 zkgroup: Convert UuidCiphertext operations to use ServiceId
Eventually all of zkgroup will use ServiceId, but this part will
actually behave differently.
2023-07-20 12:23:10 -07:00
Sergey Skrobotov
28fea98c1b Bump to version v0.29.0 2023-07-19 18:24:46 -07:00
Jordan Rose
bc19fb33df java: Use our own mirror to reproducibly build for Android and Server
Co-authored-by: Greyson Parrelli <greyson@signal.org>
2023-07-19 15:51:07 -07:00
Jordan Rose
88a2d5c740 Add convenience APIs to ProtocolAddress for using ServiceIds
In a future release ProtocolAddresses will *only* support ServiceIds,
so these APIs are designed to be the nullable version of the signature
they'll eventually have. Since ProtocolAddresses are created by the
client app in nearly all cases, they should be able to ignore the null
case if they only use ServiceIds in their input.
2023-07-19 14:12:05 -07:00
Jordan Rose
86b2fcc427 Bump to version v0.28.1 2023-07-14 13:45:10 -07:00
Jordan Rose
e32cd70358 java: Override 'hashCode' in ServiceId to go with 'equals' 2023-07-14 13:36:25 -07:00
Sergey Skrobotov
68f851e1ca Bump to version v0.28.0 2023-07-13 17:26:49 -07:00
Jordan Rose
6800244a53 protocol: Add the ServiceId, Aci, and Pni types
Co-authored-by: Max Moiseev <moiseev@signal.org>
2023-07-13 13:54:53 -07:00
Sergey Skrobotov
ca262db5ec bridge for username links 2023-07-06 15:51:52 -07:00
moiseev-signal
7d37b1c2f8 Better handle incremental mac edge case 2023-06-28 10:56:25 -07:00
Jordan Rose
af7bb8567c Bump to version v0.27.0 2023-06-09 11:49:48 -07:00
moiseev-signal
19d9e9f0f4 node: Add PQXDH support 2023-06-02 10:42:39 -07:00
Jordan Rose
8abeeeb4ef Bump to version v0.26.0 2023-05-31 13:58:46 -07:00
Jordan Rose
d61cc8f13e java: Include a ProtocolAddress in NoSessionException
This is a minimal change to not lose information that we already have
in Rust; there may be further changes in the future (such as avoiding
the redundancy now in ProtocolNoSessionException, or splitting out
missing Sender Key sessions, which don't have an address, from missing
Double Ratchet sessions).
2023-05-31 10:34:55 -07:00
moiseev-signal
dda3e0f71a Update Java tests with PQXDH cases 2023-05-30 14:56:04 -07:00
ravi-signal
803e7fe752 pin: move svr2 pin hash out of Svr2Client
- moves svr2 pin hashing to a standalone function
- take string instead of utf-8 encoded bytes where possible
2023-05-30 11:24:54 -05:00
Jonathan Klabunde Tomer
c0a8e34aef add missing throws declarations on KEM*Key constructors 2023-05-23 17:25:18 -07:00
Max Moiseev
b0a1bf2bd6 Make javac treat sources as UTF-8 2023-05-17 17:00:13 -07:00
Ravi Khadiwala
a196fb8ecd Bump to version v0.25.0 2023-05-17 13:31:29 -05:00
Ravi Khadiwala
1a1e8e0285 attest: mark svr2 apis ready for use 2023-05-12 12:17:43 -05:00
Ravi Khadiwala
c70f19d294 attest: update svr2 constants 2023-05-12 12:17:43 -05:00
Max Moiseev
0e2f87f39a Bump to version v0.24.0 2023-05-09 17:19:28 -07:00
Rolfe Schmidt
ff09619432 Add Kyber KEM and implement PQXDH protocol
Co-authored-by: Jordan Rose <jrose@signal.org>
Co-authored-by: Max Moiseev <moiseev@signal.org>
2023-05-09 16:44:40 -07:00
moiseev-signal
2b46ae1e85 Implement incremental MAC 2023-05-09 12:29:25 -07:00
Jordan Rose
0e74a41eb9 bridge: Put signal-media behind a feature flag, off for iOS by default
The JNI tests have also been conditionalized in case we want to take
this out for Android as well. (Node still unconditionally depends on
it being present.) I've given it a separate feature flag from just
ffi/jni/node so that we can preserve the tests Jessa wrote for each
platform.
2023-05-09 11:02:31 -07:00
Jordan Rose
a27fc0c557 java: Allow Unicode characters in javadocs 2023-05-01 12:01:08 -07:00
Jessa
9eb3483938 Add MP4 format sanitizer
This MP4 format "sanitizer" currently only transforms (when necessary) outgoing media on iOS, Android, or Desktop to
make it suitable for streaming playback by the recepient. In the future, it will validate and be able to either repair
or reject outbound AND inbound media, to prevent malformed media from being fed to third party or OS media players.

An generic io module was added to the libsignal rust bridge containing the InputStream trait, modeled loosely after
Java's InputStream, which calls back into the client language to perform reads or skips. This infrastructure could
potentially also be for any other future large data inputs to libsignal functions.
2023-05-01 12:01:08 -07:00
Jordan Rose
d3e38b9e5c Bump version to v0.23.0 2023-05-01 12:01:08 -07:00
Jordan Rose
c433d1e34c Expose ProfileKey.deriveAccessKey()
Client apps will be able to switch over to this at their leisure.
2023-04-25 18:42:51 -07:00
Jordan Rose
e588fa5450 zkgroup: Add CallLinkAuthCredential
This is very similar to the AuthCredential used by the group server,
but using CallLinkParams to encrypt the user ID rather than
GroupParams (and using GenericServerParams to issue the credential
rather than the group server's ServerParams).
2023-04-25 17:18:05 -07:00