mirror of
https://github.com/AsamK/signal-cli.git
synced 2026-09-22 06:29:04 +00:00
Update libsignal-service
This commit is contained in:
parent
5a525f51f6
commit
c95a67862e
@ -3,7 +3,7 @@ slf4j = "2.0.18"
|
|||||||
junit = "6.1.0"
|
junit = "6.1.0"
|
||||||
micronaut-json-schema = "2.0.1"
|
micronaut-json-schema = "2.0.1"
|
||||||
micronaut-core = "5.0.0"
|
micronaut-core = "5.0.0"
|
||||||
signal-service = "2.15.3_unofficial_148"
|
signal-service = "2.15.3_unofficial_149"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
bouncycastle = "org.bouncycastle:bcprov-jdk18on:1.84"
|
bouncycastle = "org.bouncycastle:bcprov-jdk18on:1.84"
|
||||||
|
|||||||
@ -19,6 +19,7 @@ import org.signal.core.models.ServiceId.PNI;
|
|||||||
import org.signal.core.util.Base64;
|
import org.signal.core.util.Base64;
|
||||||
import org.signal.libsignal.protocol.IdentityKeyPair;
|
import org.signal.libsignal.protocol.IdentityKeyPair;
|
||||||
import org.signal.libsignal.protocol.InvalidKeyException;
|
import org.signal.libsignal.protocol.InvalidKeyException;
|
||||||
|
import org.signal.libsignal.protocol.NoSessionException;
|
||||||
import org.signal.libsignal.protocol.SignalProtocolAddress;
|
import org.signal.libsignal.protocol.SignalProtocolAddress;
|
||||||
import org.signal.libsignal.protocol.state.KyberPreKeyRecord;
|
import org.signal.libsignal.protocol.state.KyberPreKeyRecord;
|
||||||
import org.signal.libsignal.protocol.state.SignedPreKeyRecord;
|
import org.signal.libsignal.protocol.state.SignedPreKeyRecord;
|
||||||
@ -280,7 +281,7 @@ public class AccountHelper {
|
|||||||
final var message = messageSender.getEncryptedSyncPniInitializeDeviceMessage(deviceId,
|
final var message = messageSender.getEncryptedSyncPniInitializeDeviceMessage(deviceId,
|
||||||
pniChangeNumber);
|
pniChangeNumber);
|
||||||
encryptedDeviceMessages.add(message);
|
encryptedDeviceMessages.add(message);
|
||||||
} catch (UntrustedIdentityException | IOException | InvalidKeyException e) {
|
} catch (UntrustedIdentityException | IOException | InvalidKeyException | NoSessionException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -520,8 +520,7 @@ public class SendHelper {
|
|||||||
if (unregisteredRecipientIds.isEmpty()) {
|
if (unregisteredRecipientIds.isEmpty()) {
|
||||||
targetRecipientIds = recipientIds;
|
targetRecipientIds = recipientIds;
|
||||||
} else {
|
} else {
|
||||||
logger.debug("Skipping {} known-unregistered recipient(s) in group send.",
|
logger.debug("Skipping {} known-unregistered recipient(s) in group send.", unregisteredRecipientIds.size());
|
||||||
unregisteredRecipientIds.size());
|
|
||||||
targetRecipientIds = new HashSet<>(recipientIds);
|
targetRecipientIds = new HashSet<>(recipientIds);
|
||||||
targetRecipientIds.removeAll(unregisteredRecipientIds);
|
targetRecipientIds.removeAll(unregisteredRecipientIds);
|
||||||
for (final var recipientId : 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());
|
logger.debug("Too few sender-key-capable users ({}). Doing all legacy sends.", senderKeyTargets.size());
|
||||||
senderKeyTargets = Set.of();
|
senderKeyTargets = Set.of();
|
||||||
} else {
|
} 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());
|
final var allResults = new ArrayList<SendMessageResult>(recipientIds.size());
|
||||||
@ -691,7 +692,7 @@ public class SendHelper {
|
|||||||
final var successCount = results.stream().filter(SendMessageResult::isSuccess).count();
|
final var successCount = results.stream().filter(SendMessageResult::isSuccess).count();
|
||||||
logger.debug("Successfully sent using 1:1 to {}/{} legacy targets.", successCount, addresses.size());
|
logger.debug("Successfully sent using 1:1 to {}/{} legacy targets.", successCount, addresses.size());
|
||||||
return results;
|
return results;
|
||||||
} catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException e) {
|
} catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException | NoSessionException e) {
|
||||||
return List.of();
|
return List.of();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -883,7 +884,7 @@ public class SendHelper {
|
|||||||
SignalServiceAddress address,
|
SignalServiceAddress address,
|
||||||
SealedSenderAccess unidentifiedAccess,
|
SealedSenderAccess unidentifiedAccess,
|
||||||
boolean includePniSignature
|
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 {
|
interface SenderKeySenderHandler {
|
||||||
@ -903,6 +904,6 @@ public class SendHelper {
|
|||||||
List<SignalServiceAddress> recipients,
|
List<SignalServiceAddress> recipients,
|
||||||
List<SealedSenderAccess> unidentifiedAccess,
|
List<SealedSenderAccess> unidentifiedAccess,
|
||||||
boolean isRecipientUpdate
|
boolean isRecipientUpdate
|
||||||
) throws IOException, UntrustedIdentityException;
|
) throws IOException, UntrustedIdentityException, NoSessionException;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -100,6 +100,7 @@ import org.signal.core.models.ServiceId.PNI;
|
|||||||
import org.signal.core.util.Base64;
|
import org.signal.core.util.Base64;
|
||||||
import org.signal.core.util.Hex;
|
import org.signal.core.util.Hex;
|
||||||
import org.signal.libsignal.protocol.InvalidMessageException;
|
import org.signal.libsignal.protocol.InvalidMessageException;
|
||||||
|
import org.signal.libsignal.protocol.NoSessionException;
|
||||||
import org.signal.libsignal.usernames.BaseUsernameException;
|
import org.signal.libsignal.usernames.BaseUsernameException;
|
||||||
import org.signal.network.exceptions.NonSuccessfulResponseCodeException;
|
import org.signal.network.exceptions.NonSuccessfulResponseCodeException;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@ -1820,6 +1821,8 @@ public class ManagerImpl implements Manager {
|
|||||||
dependencies.getMessageSender().sendCallMessage(address, null, callMessage);
|
dependencies.getMessageSender().sendCallMessage(address, null, callMessage);
|
||||||
} catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException e) {
|
} catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException e) {
|
||||||
throw new IOException("Untrusted identity for call recipient", 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);
|
dependencies.getMessageSender().sendCallMessage(address, null, callMessage);
|
||||||
} catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException e) {
|
} catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException e) {
|
||||||
throw new IOException("Untrusted identity for call recipient", 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);
|
dependencies.getMessageSender().sendCallMessage(address, null, callMessage);
|
||||||
} catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException e) {
|
} catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException e) {
|
||||||
throw new IOException("Untrusted identity for call recipient", 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);
|
dependencies.getMessageSender().sendCallMessage(address, null, callMessage);
|
||||||
} catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException e) {
|
} catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException e) {
|
||||||
throw new IOException("Untrusted identity for call recipient", 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);
|
dependencies.getMessageSender().sendCallMessage(address, null, callMessage);
|
||||||
} catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException e) {
|
} catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException e) {
|
||||||
throw new IOException("Untrusted identity for call recipient", e);
|
throw new IOException("Untrusted identity for call recipient", e);
|
||||||
|
} catch (NoSessionException e) {
|
||||||
|
throw new IOException("No session for call recipient", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1924,7 +1924,8 @@ public class SignalAccount implements Closeable {
|
|||||||
getSessionStore(),
|
getSessionStore(),
|
||||||
getIdentityKeyStore(),
|
getIdentityKeyStore(),
|
||||||
getSenderKeyStore(),
|
getSenderKeyStore(),
|
||||||
SignalAccount.this::isMultiDevice));
|
SignalAccount.this::isMultiDevice,
|
||||||
|
SignalAccount.this::setMultiDevice));
|
||||||
}
|
}
|
||||||
|
|
||||||
public PreKeyStore getPreKeyStore() {
|
public PreKeyStore getPreKeyStore() {
|
||||||
|
|||||||
@ -26,6 +26,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import java.util.function.Consumer;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
public class SignalProtocolStore implements SignalServiceAccountDataStore {
|
public class SignalProtocolStore implements SignalServiceAccountDataStore {
|
||||||
@ -37,6 +38,7 @@ public class SignalProtocolStore implements SignalServiceAccountDataStore {
|
|||||||
private final IdentityKeyStore identityKeyStore;
|
private final IdentityKeyStore identityKeyStore;
|
||||||
private final SignalServiceSenderKeyStore senderKeyStore;
|
private final SignalServiceSenderKeyStore senderKeyStore;
|
||||||
private final Supplier<Boolean> isMultiDevice;
|
private final Supplier<Boolean> isMultiDevice;
|
||||||
|
private final Consumer<Boolean> setMultiDeviceCallback;
|
||||||
|
|
||||||
public SignalProtocolStore(
|
public SignalProtocolStore(
|
||||||
final SignalServicePreKeyStore preKeyStore,
|
final SignalServicePreKeyStore preKeyStore,
|
||||||
@ -45,7 +47,8 @@ public class SignalProtocolStore implements SignalServiceAccountDataStore {
|
|||||||
final SignalServiceSessionStore sessionStore,
|
final SignalServiceSessionStore sessionStore,
|
||||||
final IdentityKeyStore identityKeyStore,
|
final IdentityKeyStore identityKeyStore,
|
||||||
final SignalServiceSenderKeyStore senderKeyStore,
|
final SignalServiceSenderKeyStore senderKeyStore,
|
||||||
final Supplier<Boolean> isMultiDevice
|
final Supplier<Boolean> isMultiDevice,
|
||||||
|
final Consumer<Boolean> setMultiDeviceCallback
|
||||||
) {
|
) {
|
||||||
this.preKeyStore = preKeyStore;
|
this.preKeyStore = preKeyStore;
|
||||||
this.signedPreKeyStore = signedPreKeyStore;
|
this.signedPreKeyStore = signedPreKeyStore;
|
||||||
@ -54,6 +57,7 @@ public class SignalProtocolStore implements SignalServiceAccountDataStore {
|
|||||||
this.identityKeyStore = identityKeyStore;
|
this.identityKeyStore = identityKeyStore;
|
||||||
this.senderKeyStore = senderKeyStore;
|
this.senderKeyStore = senderKeyStore;
|
||||||
this.isMultiDevice = isMultiDevice;
|
this.isMultiDevice = isMultiDevice;
|
||||||
|
this.setMultiDeviceCallback = setMultiDeviceCallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -209,6 +213,11 @@ public class SignalProtocolStore implements SignalServiceAccountDataStore {
|
|||||||
return isMultiDevice.get();
|
return isMultiDevice.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setMultiDevice(final boolean isMultiDevice) {
|
||||||
|
setMultiDeviceCallback.accept(isMultiDevice);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public KyberPreKeyRecord loadKyberPreKey(final int kyberPreKeyId) throws InvalidKeyIdException {
|
public KyberPreKeyRecord loadKyberPreKey(final int kyberPreKeyId) throws InvalidKeyIdException {
|
||||||
return kyberPreKeyStore.loadKyberPreKey(kyberPreKeyId);
|
return kyberPreKeyStore.loadKyberPreKey(kyberPreKeyId);
|
||||||
|
|||||||
@ -9835,6 +9835,15 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "sun.net.www.protocol.http.Handler",
|
||||||
|
"methods": [
|
||||||
|
{
|
||||||
|
"name": "<init>",
|
||||||
|
"parameterTypes": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "sun.security.provider.DSA$SHA224withDSA",
|
"type": "sun.security.provider.DSA$SHA224withDSA",
|
||||||
"methods": [
|
"methods": [
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user