mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-19 00:01:08 +01:00
Cap the number of incrementalMacs populated in an envelope.
Add a remote config `global.maxIncrementalMacsPerEnvelope` (client fallback of 10) that limits how many attachment pointers in a single envelope can have their incrementalMac field populated. Each incrementalMac can be up to 8 KiB, so having too many risks exceeding the 96 KiB envelope size threshold. Excess attachment pointers have their incrementalMac and chunkSize fields stripped.
This commit is contained in:
committed by
jeffrey-signal
parent
6eee4db87b
commit
2bd440e07c
@@ -176,6 +176,7 @@ public class ApplicationDependencyProvider implements AppDependencies.Provider {
|
||||
Optional.of(new SecurityEventListener(context)),
|
||||
SignalExecutors.newCachedBoundedExecutor("signal-messages", ThreadUtil.PRIORITY_IMPORTANT_BACKGROUND_THREAD, 1, 16, 30),
|
||||
RemoteConfig.maxEnvelopeSizeBytes(),
|
||||
RemoteConfig.maxIncrementalMacsPerEnvelope(),
|
||||
RemoteConfig::useMessageSendRestFallback,
|
||||
RemoteConfig.useBinaryId(),
|
||||
BuildConfig.USE_STRING_ID);
|
||||
|
||||
@@ -1182,6 +1182,15 @@ object RemoteConfig {
|
||||
hotSwappable = true
|
||||
)
|
||||
|
||||
/** The maximum number of attachment pointers that can have incrementalMac populated in a single envelope. */
|
||||
@JvmStatic
|
||||
@get:JvmName("maxIncrementalMacsPerEnvelope")
|
||||
val maxIncrementalMacsPerEnvelope: Int by remoteInt(
|
||||
key = "global.maxIncrementalMacsPerEnvelope",
|
||||
defaultValue = 10,
|
||||
hotSwappable = true
|
||||
)
|
||||
|
||||
/** Whether or not to send over binary service ids (alongside string service ids). */
|
||||
@JvmStatic
|
||||
@get:JvmName("useBinaryId")
|
||||
|
||||
Reference in New Issue
Block a user