Use RemoteConfig for UsePqRatchet.

Co-authored-by: Greyson Parrelli <greyson@signal.org>
This commit is contained in:
gram-signal
2025-06-30 11:46:36 -07:00
committed by Greyson Parrelli
parent f6b74ad2a0
commit 173983a1ab
9 changed files with 34 additions and 16 deletions

View File

@@ -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

View File

@@ -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) {

View File

@@ -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
}