mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-20 11:08:31 +00:00
Bump to libsignal v0.71.0.
This commit is contained in:
committed by
Michelle Tang
parent
a2a3dd28ee
commit
9b9888565b
@@ -9,6 +9,7 @@ import org.signal.libsignal.protocol.SignalProtocolAddress
|
|||||||
import org.signal.libsignal.protocol.ecc.ECKeyPair
|
import org.signal.libsignal.protocol.ecc.ECKeyPair
|
||||||
import org.signal.libsignal.protocol.groups.state.SenderKeyRecord
|
import org.signal.libsignal.protocol.groups.state.SenderKeyRecord
|
||||||
import org.signal.libsignal.protocol.state.IdentityKeyStore
|
import org.signal.libsignal.protocol.state.IdentityKeyStore
|
||||||
|
import org.signal.libsignal.protocol.state.IdentityKeyStore.IdentityChange
|
||||||
import org.signal.libsignal.protocol.state.KyberPreKeyRecord
|
import org.signal.libsignal.protocol.state.KyberPreKeyRecord
|
||||||
import org.signal.libsignal.protocol.state.PreKeyBundle
|
import org.signal.libsignal.protocol.state.PreKeyBundle
|
||||||
import org.signal.libsignal.protocol.state.PreKeyRecord
|
import org.signal.libsignal.protocol.state.PreKeyRecord
|
||||||
@@ -137,7 +138,7 @@ class BobClient(val serviceId: ServiceId, val e164: String, val identityKeyPair:
|
|||||||
override fun getLocalRegistrationId(): Int = registrationId
|
override fun getLocalRegistrationId(): Int = registrationId
|
||||||
override fun isTrustedIdentity(address: SignalProtocolAddress?, identityKey: IdentityKey?, direction: IdentityKeyStore.Direction?): Boolean = true
|
override fun isTrustedIdentity(address: SignalProtocolAddress?, identityKey: IdentityKey?, direction: IdentityKeyStore.Direction?): Boolean = true
|
||||||
override fun loadSession(address: SignalProtocolAddress?): SessionRecord = aliceSessionRecord ?: SessionRecord()
|
override fun loadSession(address: SignalProtocolAddress?): SessionRecord = aliceSessionRecord ?: SessionRecord()
|
||||||
override fun saveIdentity(address: SignalProtocolAddress?, identityKey: IdentityKey?): Boolean = false
|
override fun saveIdentity(address: SignalProtocolAddress?, identityKey: IdentityKey?): IdentityKeyStore.IdentityChange = IdentityChange.NEW_OR_UNCHANGED
|
||||||
override fun storeSession(address: SignalProtocolAddress?, record: SessionRecord?) {
|
override fun storeSession(address: SignalProtocolAddress?, record: SessionRecord?) {
|
||||||
aliceSessionRecord = record
|
aliceSessionRecord = record
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,8 +63,12 @@ public class SignalBaseIdentityKeyStore {
|
|||||||
return SignalStore.account().getRegistrationId();
|
return SignalStore.account().getRegistrationId();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean saveIdentity(SignalProtocolAddress address, IdentityKey identityKey) {
|
public IdentityKeyStore.IdentityChange saveIdentity(SignalProtocolAddress address, IdentityKey identityKey) {
|
||||||
return saveIdentity(address, identityKey, false) == SaveResult.UPDATE;
|
switch (saveIdentity(address, identityKey, false)) {
|
||||||
|
case NEW, NO_CHANGE, NON_BLOCKING_APPROVAL_REQUIRED -> { return IdentityKeyStore.IdentityChange.NEW_OR_UNCHANGED; }
|
||||||
|
case UPDATE -> { return IdentityKeyStore.IdentityChange.REPLACED_EXISTING; }
|
||||||
|
}
|
||||||
|
throw new AssertionError("unhandled save result");
|
||||||
}
|
}
|
||||||
|
|
||||||
public @NonNull SaveResult saveIdentity(SignalProtocolAddress address, IdentityKey identityKey, boolean nonBlockingApproval) {
|
public @NonNull SaveResult saveIdentity(SignalProtocolAddress address, IdentityKey identityKey, boolean nonBlockingApproval) {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public class SignalIdentityKeyStore implements IdentityKeyStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean saveIdentity(SignalProtocolAddress address, IdentityKey identityKey) {
|
public IdentityChange saveIdentity(SignalProtocolAddress address, IdentityKey identityKey) {
|
||||||
return baseStore.saveIdentity(address, identityKey);
|
return baseStore.saveIdentity(address, identityKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public class SignalServiceAccountDataStoreImpl implements SignalServiceAccountDa
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean saveIdentity(SignalProtocolAddress address, IdentityKey identityKey) {
|
public IdentityChange saveIdentity(SignalProtocolAddress address, IdentityKey identityKey) {
|
||||||
return identityKeyStore.saveIdentity(address, identityKey);
|
return identityKeyStore.saveIdentity(address, identityKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import org.signal.libsignal.protocol.IdentityKey
|
|||||||
import org.signal.libsignal.protocol.IdentityKeyPair
|
import org.signal.libsignal.protocol.IdentityKeyPair
|
||||||
import org.signal.libsignal.protocol.SignalProtocolAddress
|
import org.signal.libsignal.protocol.SignalProtocolAddress
|
||||||
import org.signal.libsignal.protocol.state.IdentityKeyStore
|
import org.signal.libsignal.protocol.state.IdentityKeyStore
|
||||||
|
import org.signal.libsignal.protocol.state.IdentityKeyStore.IdentityChange
|
||||||
import org.thoughtcrime.securesms.database.SignalDatabase
|
import org.thoughtcrime.securesms.database.SignalDatabase
|
||||||
import org.whispersystems.signalservice.api.SignalServiceAccountDataStore
|
import org.whispersystems.signalservice.api.SignalServiceAccountDataStore
|
||||||
import org.whispersystems.signalservice.api.push.ServiceId
|
import org.whispersystems.signalservice.api.push.ServiceId
|
||||||
@@ -30,16 +31,16 @@ class BufferedIdentityKeyStore(
|
|||||||
return selfRegistrationId
|
return selfRegistrationId
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun saveIdentity(address: SignalProtocolAddress, identityKey: IdentityKey): Boolean {
|
override fun saveIdentity(address: SignalProtocolAddress, identityKey: IdentityKey): IdentityChange {
|
||||||
val existing: IdentityKey? = getIdentity(address)
|
val existing: IdentityKey? = getIdentity(address)
|
||||||
|
|
||||||
store[address] = identityKey
|
store[address] = identityKey
|
||||||
|
|
||||||
return if (identityKey != existing) {
|
return if (identityKey != existing) {
|
||||||
updatedKeys[address] = identityKey
|
updatedKeys[address] = identityKey
|
||||||
true
|
IdentityChange.REPLACED_EXISTING
|
||||||
} else {
|
} else {
|
||||||
false
|
IdentityChange.NEW_OR_UNCHANGED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import org.signal.libsignal.protocol.IdentityKeyPair
|
|||||||
import org.signal.libsignal.protocol.SignalProtocolAddress
|
import org.signal.libsignal.protocol.SignalProtocolAddress
|
||||||
import org.signal.libsignal.protocol.groups.state.SenderKeyRecord
|
import org.signal.libsignal.protocol.groups.state.SenderKeyRecord
|
||||||
import org.signal.libsignal.protocol.state.IdentityKeyStore
|
import org.signal.libsignal.protocol.state.IdentityKeyStore
|
||||||
|
import org.signal.libsignal.protocol.state.IdentityKeyStore.IdentityChange
|
||||||
import org.signal.libsignal.protocol.state.KyberPreKeyRecord
|
import org.signal.libsignal.protocol.state.KyberPreKeyRecord
|
||||||
import org.signal.libsignal.protocol.state.PreKeyRecord
|
import org.signal.libsignal.protocol.state.PreKeyRecord
|
||||||
import org.signal.libsignal.protocol.state.SessionRecord
|
import org.signal.libsignal.protocol.state.SessionRecord
|
||||||
@@ -41,7 +42,7 @@ class BufferedSignalServiceAccountDataStore(selfServiceId: ServiceId) : SignalSe
|
|||||||
return identityStore.localRegistrationId
|
return identityStore.localRegistrationId
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun saveIdentity(address: SignalProtocolAddress, identityKey: IdentityKey): Boolean {
|
override fun saveIdentity(address: SignalProtocolAddress, identityKey: IdentityKey): IdentityChange {
|
||||||
return identityStore.saveIdentity(address, identityKey)
|
return identityStore.saveIdentity(address, identityKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import org.signal.core.util.logging.Log;
|
|||||||
import org.signal.libsignal.protocol.IdentityKey;
|
import org.signal.libsignal.protocol.IdentityKey;
|
||||||
import org.signal.libsignal.protocol.InvalidKeyException;
|
import org.signal.libsignal.protocol.InvalidKeyException;
|
||||||
import org.signal.libsignal.protocol.SignalProtocolAddress;
|
import org.signal.libsignal.protocol.SignalProtocolAddress;
|
||||||
|
import org.signal.libsignal.protocol.state.IdentityKeyStore;
|
||||||
import org.signal.libsignal.protocol.state.SessionRecord;
|
import org.signal.libsignal.protocol.state.SessionRecord;
|
||||||
import org.signal.libsignal.protocol.state.SessionStore;
|
import org.signal.libsignal.protocol.state.SessionStore;
|
||||||
import org.thoughtcrime.securesms.R;
|
import org.thoughtcrime.securesms.R;
|
||||||
@@ -172,7 +173,7 @@ public final class IdentityUtil {
|
|||||||
SessionStore sessionStore = AppDependencies.getProtocolStore().aci();
|
SessionStore sessionStore = AppDependencies.getProtocolStore().aci();
|
||||||
SignalProtocolAddress address = new SignalProtocolAddress(user, SignalServiceAddress.DEFAULT_DEVICE_ID);
|
SignalProtocolAddress address = new SignalProtocolAddress(user, SignalServiceAddress.DEFAULT_DEVICE_ID);
|
||||||
|
|
||||||
if (AppDependencies.getProtocolStore().aci().identities().saveIdentity(address, identityKey)) {
|
if (AppDependencies.getProtocolStore().aci().identities().saveIdentity(address, identityKey) == IdentityKeyStore.IdentityChange.REPLACED_EXISTING) {
|
||||||
if (sessionStore.containsSession(address)) {
|
if (sessionStore.containsSession(address)) {
|
||||||
SessionRecord sessionRecord = sessionStore.loadSession(address);
|
SessionRecord sessionRecord = sessionStore.loadSession(address);
|
||||||
sessionRecord.archiveCurrentState();
|
sessionRecord.archiveCurrentState();
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ androidx-window = "1.3.0"
|
|||||||
glide = "4.15.1"
|
glide = "4.15.1"
|
||||||
gradle = "8.9.0"
|
gradle = "8.9.0"
|
||||||
kotlin = "2.1.0"
|
kotlin = "2.1.0"
|
||||||
libsignal-client = "0.70.1"
|
libsignal-client = "0.71.0"
|
||||||
mp4parser = "1.9.39"
|
mp4parser = "1.9.39"
|
||||||
android-gradle-plugin = "8.7.2"
|
android-gradle-plugin = "8.7.2"
|
||||||
accompanist = "0.28.0"
|
accompanist = "0.28.0"
|
||||||
|
|||||||
@@ -7172,20 +7172,20 @@ https://docs.gradle.org/current/userguide/dependency_verification.html
|
|||||||
<sha256 value="57b3cf8f247f1990211110734a7d1af413db145c8f17eb1b2cdc9b9321188c2b" origin="Generated by Gradle"/>
|
<sha256 value="57b3cf8f247f1990211110734a7d1af413db145c8f17eb1b2cdc9b9321188c2b" origin="Generated by Gradle"/>
|
||||||
</artifact>
|
</artifact>
|
||||||
</component>
|
</component>
|
||||||
<component group="org.signal" name="libsignal-android" version="0.70.1">
|
<component group="org.signal" name="libsignal-android" version="0.71.0">
|
||||||
<artifact name="libsignal-android-0.70.1.aar">
|
<artifact name="libsignal-android-0.71.0.aar">
|
||||||
<sha256 value="e58049528b4bed3829a2196f867f1125592928225bb9736899d316cf61de75e1" origin="Generated by Gradle"/>
|
<sha256 value="5bb3b3e384efa96b9b7244567eb44cf660adced187818caca0bdc19411b3fabe" origin="Generated by Gradle"/>
|
||||||
</artifact>
|
</artifact>
|
||||||
<artifact name="libsignal-android-0.70.1.module">
|
<artifact name="libsignal-android-0.71.0.module">
|
||||||
<sha256 value="144c56787fb912c93a13aa798ccdd5be7c3b7a70a7b80e9ffe864a0ec3110400" origin="Generated by Gradle"/>
|
<sha256 value="1733be074121d61524f7dd52c0d8b4856489c7f53828cc37ed9c74b1f1a3b71f" origin="Generated by Gradle"/>
|
||||||
</artifact>
|
</artifact>
|
||||||
</component>
|
</component>
|
||||||
<component group="org.signal" name="libsignal-client" version="0.70.1">
|
<component group="org.signal" name="libsignal-client" version="0.71.0">
|
||||||
<artifact name="libsignal-client-0.70.1.jar">
|
<artifact name="libsignal-client-0.71.0.jar">
|
||||||
<sha256 value="d488a974270e79ad3100dc6eb775f5e74bc9e4cec979345ffab303d0d011af39" origin="Generated by Gradle"/>
|
<sha256 value="96e4890a8af0c51c63e447e1b05f5c66f571d4a1518e733c3f8e6d6c7a17c053" origin="Generated by Gradle"/>
|
||||||
</artifact>
|
</artifact>
|
||||||
<artifact name="libsignal-client-0.70.1.module">
|
<artifact name="libsignal-client-0.71.0.module">
|
||||||
<sha256 value="2da2042da8308840e177bff4a14b8d12b7fa36c62a19b1120e3dda67a1098bc9" origin="Generated by Gradle"/>
|
<sha256 value="9e3ef9803a6b8bec91bef0e917fcdbb75978b2f75d93300d524ffb6327394e5a" origin="Generated by Gradle"/>
|
||||||
</artifact>
|
</artifact>
|
||||||
</component>
|
</component>
|
||||||
<component group="org.signal" name="ringrtc-android" version="2.52.1">
|
<component group="org.signal" name="ringrtc-android" version="2.52.1">
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import org.signal.libsignal.protocol.IdentityKeyPair
|
|||||||
import org.signal.libsignal.protocol.SignalProtocolAddress
|
import org.signal.libsignal.protocol.SignalProtocolAddress
|
||||||
import org.signal.libsignal.protocol.groups.state.SenderKeyRecord
|
import org.signal.libsignal.protocol.groups.state.SenderKeyRecord
|
||||||
import org.signal.libsignal.protocol.state.IdentityKeyStore
|
import org.signal.libsignal.protocol.state.IdentityKeyStore
|
||||||
|
import org.signal.libsignal.protocol.state.IdentityKeyStore.IdentityChange
|
||||||
import org.signal.libsignal.protocol.state.KyberPreKeyRecord
|
import org.signal.libsignal.protocol.state.KyberPreKeyRecord
|
||||||
import org.signal.libsignal.protocol.state.PreKeyRecord
|
import org.signal.libsignal.protocol.state.PreKeyRecord
|
||||||
import org.signal.libsignal.protocol.state.SessionRecord
|
import org.signal.libsignal.protocol.state.SessionRecord
|
||||||
@@ -34,10 +35,13 @@ class InMemorySignalServiceAccountDataStore : SignalServiceAccountDataStore {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun saveIdentity(address: SignalProtocolAddress, identityKey: IdentityKey): Boolean {
|
override fun saveIdentity(address: SignalProtocolAddress, identityKey: IdentityKey): IdentityChange {
|
||||||
val hadPrevious = identities.containsKey(address)
|
val previous = identities.put(address, identityKey)
|
||||||
identities[address] = identityKey
|
return if (previous == null || previous == identityKey) {
|
||||||
return hadPrevious
|
IdentityChange.NEW_OR_UNCHANGED
|
||||||
|
} else {
|
||||||
|
IdentityChange.REPLACED_EXISTING
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun isTrustedIdentity(address: SignalProtocolAddress?, identityKey: IdentityKey?, direction: IdentityKeyStore.Direction?): Boolean {
|
override fun isTrustedIdentity(address: SignalProtocolAddress?, identityKey: IdentityKey?, direction: IdentityKeyStore.Direction?): Boolean {
|
||||||
|
|||||||
Reference in New Issue
Block a user