mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-03-01 22:22:15 +00:00
Use RemoteConfig for UsePqRatchet.
Co-authored-by: Greyson Parrelli <greyson@signal.org>
This commit is contained in:
committed by
Greyson Parrelli
parent
f6b74ad2a0
commit
173983a1ab
@@ -170,7 +170,8 @@ public class ApplicationDependencyProvider implements AppDependencies.Provider {
|
||||
Optional.of(new SecurityEventListener(context)),
|
||||
SignalExecutors.newCachedBoundedExecutor("signal-messages", ThreadUtil.PRIORITY_IMPORTANT_BACKGROUND_THREAD, 1, 16, 30),
|
||||
ByteUnit.KILOBYTES.toBytes(256),
|
||||
RemoteConfig::useMessageSendRestFallback);
|
||||
RemoteConfig::useMessageSendRestFallback,
|
||||
RemoteConfig.usePqRatchet());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -142,7 +142,7 @@ object MessageDecryptor {
|
||||
|
||||
return try {
|
||||
val startTimeNanos = System.nanoTime()
|
||||
val cipherResult: SignalServiceCipherResult? = cipher.decrypt(envelope, serverDeliveredTimestamp)
|
||||
val cipherResult: SignalServiceCipherResult? = cipher.decrypt(envelope, serverDeliveredTimestamp, RemoteConfig.usePqRatchet)
|
||||
val endTimeNanos = System.nanoTime()
|
||||
|
||||
if (cipherResult == null) {
|
||||
|
||||
@@ -11,6 +11,7 @@ import org.signal.core.util.gibiBytes
|
||||
import org.signal.core.util.kibiBytes
|
||||
import org.signal.core.util.logging.Log
|
||||
import org.signal.core.util.mebiBytes
|
||||
import org.signal.libsignal.protocol.UsePqRatchet
|
||||
import org.thoughtcrime.securesms.BuildConfig
|
||||
import org.thoughtcrime.securesms.dependencies.AppDependencies
|
||||
import org.thoughtcrime.securesms.groups.SelectionLimits
|
||||
@@ -1154,5 +1155,15 @@ object RemoteConfig {
|
||||
durationUnit = DurationUnit.DAYS
|
||||
)
|
||||
|
||||
/** Whether or not to use the new post-quantum ratcheting. */
|
||||
@JvmStatic
|
||||
@get:JvmName("usePqRatchet")
|
||||
val usePqRatchet: UsePqRatchet by remoteValue(
|
||||
key = "global.usePqRatchet",
|
||||
hotSwappable = true
|
||||
) { value ->
|
||||
if (value.asBoolean(false)) UsePqRatchet.YES else UsePqRatchet.NO
|
||||
}
|
||||
|
||||
// endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user