Update libsignal-service

This commit is contained in:
AsamK 2026-07-11 13:18:45 +02:00
parent 5a525f51f6
commit c95a67862e
7 changed files with 42 additions and 10 deletions

View File

@ -3,7 +3,7 @@ slf4j = "2.0.18"
junit = "6.1.0"
micronaut-json-schema = "2.0.1"
micronaut-core = "5.0.0"
signal-service = "2.15.3_unofficial_148"
signal-service = "2.15.3_unofficial_149"
[libraries]
bouncycastle = "org.bouncycastle:bcprov-jdk18on:1.84"

View File

@ -19,6 +19,7 @@ import org.signal.core.models.ServiceId.PNI;
import org.signal.core.util.Base64;
import org.signal.libsignal.protocol.IdentityKeyPair;
import org.signal.libsignal.protocol.InvalidKeyException;
import org.signal.libsignal.protocol.NoSessionException;
import org.signal.libsignal.protocol.SignalProtocolAddress;
import org.signal.libsignal.protocol.state.KyberPreKeyRecord;
import org.signal.libsignal.protocol.state.SignedPreKeyRecord;
@ -280,7 +281,7 @@ public class AccountHelper {
final var message = messageSender.getEncryptedSyncPniInitializeDeviceMessage(deviceId,
pniChangeNumber);
encryptedDeviceMessages.add(message);
} catch (UntrustedIdentityException | IOException | InvalidKeyException e) {
} catch (UntrustedIdentityException | IOException | InvalidKeyException | NoSessionException e) {
throw new RuntimeException(e);
}
}

View File

@ -520,8 +520,7 @@ public class SendHelper {
if (unregisteredRecipientIds.isEmpty()) {
targetRecipientIds = recipientIds;
} else {
logger.debug("Skipping {} known-unregistered recipient(s) in group send.",
unregisteredRecipientIds.size());
logger.debug("Skipping {} known-unregistered recipient(s) in group send.", unregisteredRecipientIds.size());
targetRecipientIds = new HashSet<>(recipientIds);
targetRecipientIds.removeAll(unregisteredRecipientIds);
for (final var recipientId : unregisteredRecipientIds) {
@ -556,7 +555,9 @@ public class SendHelper {
logger.debug("Too few sender-key-capable users ({}). Doing all legacy sends.", senderKeyTargets.size());
senderKeyTargets = Set.of();
} else {
logger.debug("Can use sender key for {}/{} recipients.", senderKeyTargets.size(), targetRecipientIds.size());
logger.debug("Can use sender key for {}/{} recipients.",
senderKeyTargets.size(),
targetRecipientIds.size());
}
final var allResults = new ArrayList<SendMessageResult>(recipientIds.size());
@ -691,7 +692,7 @@ public class SendHelper {
final var successCount = results.stream().filter(SendMessageResult::isSuccess).count();
logger.debug("Successfully sent using 1:1 to {}/{} legacy targets.", successCount, addresses.size());
return results;
} catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException e) {
} catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException | NoSessionException e) {
return List.of();
}
}
@ -883,7 +884,7 @@ public class SendHelper {
SignalServiceAddress address,
SealedSenderAccess unidentifiedAccess,
boolean includePniSignature
) throws IOException, UnregisteredUserException, ProofRequiredException, RateLimitException, org.whispersystems.signalservice.api.crypto.UntrustedIdentityException;
) throws IOException, UnregisteredUserException, ProofRequiredException, RateLimitException, org.whispersystems.signalservice.api.crypto.UntrustedIdentityException, NoSessionException;
}
interface SenderKeySenderHandler {
@ -903,6 +904,6 @@ public class SendHelper {
List<SignalServiceAddress> recipients,
List<SealedSenderAccess> unidentifiedAccess,
boolean isRecipientUpdate
) throws IOException, UntrustedIdentityException;
) throws IOException, UntrustedIdentityException, NoSessionException;
}
}

View File

@ -100,6 +100,7 @@ import org.signal.core.models.ServiceId.PNI;
import org.signal.core.util.Base64;
import org.signal.core.util.Hex;
import org.signal.libsignal.protocol.InvalidMessageException;
import org.signal.libsignal.protocol.NoSessionException;
import org.signal.libsignal.usernames.BaseUsernameException;
import org.signal.network.exceptions.NonSuccessfulResponseCodeException;
import org.slf4j.Logger;
@ -1820,6 +1821,8 @@ public class ManagerImpl implements Manager {
dependencies.getMessageSender().sendCallMessage(address, null, callMessage);
} catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException e) {
throw new IOException("Untrusted identity for call recipient", e);
} catch (NoSessionException e) {
throw new IOException("No session for call recipient", e);
}
}
@ -1837,6 +1840,8 @@ public class ManagerImpl implements Manager {
dependencies.getMessageSender().sendCallMessage(address, null, callMessage);
} catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException e) {
throw new IOException("Untrusted identity for call recipient", e);
} catch (NoSessionException e) {
throw new IOException("No session for call recipient", e);
}
}
@ -1854,6 +1859,8 @@ public class ManagerImpl implements Manager {
dependencies.getMessageSender().sendCallMessage(address, null, callMessage);
} catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException e) {
throw new IOException("Untrusted identity for call recipient", e);
} catch (NoSessionException e) {
throw new IOException("No session for call recipient", e);
}
}
@ -1878,6 +1885,8 @@ public class ManagerImpl implements Manager {
dependencies.getMessageSender().sendCallMessage(address, null, callMessage);
} catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException e) {
throw new IOException("Untrusted identity for call recipient", e);
} catch (NoSessionException e) {
throw new IOException("No session for call recipient", e);
}
}
@ -1894,6 +1903,8 @@ public class ManagerImpl implements Manager {
dependencies.getMessageSender().sendCallMessage(address, null, callMessage);
} catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException e) {
throw new IOException("Untrusted identity for call recipient", e);
} catch (NoSessionException e) {
throw new IOException("No session for call recipient", e);
}
}

View File

@ -1924,7 +1924,8 @@ public class SignalAccount implements Closeable {
getSessionStore(),
getIdentityKeyStore(),
getSenderKeyStore(),
SignalAccount.this::isMultiDevice));
SignalAccount.this::isMultiDevice,
SignalAccount.this::setMultiDevice));
}
public PreKeyStore getPreKeyStore() {

View File

@ -26,6 +26,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.function.Consumer;
import java.util.function.Supplier;
public class SignalProtocolStore implements SignalServiceAccountDataStore {
@ -37,6 +38,7 @@ public class SignalProtocolStore implements SignalServiceAccountDataStore {
private final IdentityKeyStore identityKeyStore;
private final SignalServiceSenderKeyStore senderKeyStore;
private final Supplier<Boolean> isMultiDevice;
private final Consumer<Boolean> setMultiDeviceCallback;
public SignalProtocolStore(
final SignalServicePreKeyStore preKeyStore,
@ -45,7 +47,8 @@ public class SignalProtocolStore implements SignalServiceAccountDataStore {
final SignalServiceSessionStore sessionStore,
final IdentityKeyStore identityKeyStore,
final SignalServiceSenderKeyStore senderKeyStore,
final Supplier<Boolean> isMultiDevice
final Supplier<Boolean> isMultiDevice,
final Consumer<Boolean> setMultiDeviceCallback
) {
this.preKeyStore = preKeyStore;
this.signedPreKeyStore = signedPreKeyStore;
@ -54,6 +57,7 @@ public class SignalProtocolStore implements SignalServiceAccountDataStore {
this.identityKeyStore = identityKeyStore;
this.senderKeyStore = senderKeyStore;
this.isMultiDevice = isMultiDevice;
this.setMultiDeviceCallback = setMultiDeviceCallback;
}
@Override
@ -209,6 +213,11 @@ public class SignalProtocolStore implements SignalServiceAccountDataStore {
return isMultiDevice.get();
}
@Override
public void setMultiDevice(final boolean isMultiDevice) {
setMultiDeviceCallback.accept(isMultiDevice);
}
@Override
public KyberPreKeyRecord loadKyberPreKey(final int kyberPreKeyId) throws InvalidKeyIdException {
return kyberPreKeyStore.loadKyberPreKey(kyberPreKeyId);

View File

@ -9835,6 +9835,15 @@
}
]
},
{
"type": "sun.net.www.protocol.http.Handler",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "sun.security.provider.DSA$SHA224withDSA",
"methods": [