Make sender key max age remote configurable.

This commit is contained in:
Greyson Parrelli
2021-11-01 17:23:10 -04:00
parent f31e12572a
commit 35393fc331
2 changed files with 11 additions and 5 deletions

View File

@@ -63,8 +63,6 @@ public final class GroupSendUtil {
private static final String TAG = Log.tag(GroupSendUtil.class);
private static final long MAX_KEY_AGE = TimeUnit.DAYS.toMillis(30);
private GroupSendUtil() {}
@@ -223,7 +221,7 @@ public final class GroupSendUtil {
long keyCreateTime = SenderKeyUtil.getCreateTimeForOurKey(context, distributionId);
long keyAge = System.currentTimeMillis() - keyCreateTime;
if (keyCreateTime != -1 && keyAge > MAX_KEY_AGE) {
if (keyCreateTime != -1 && keyAge > FeatureFlags.senderKeyMaxAge()) {
Log.w(TAG, "Key is " + (keyAge) + " ms old (~" + TimeUnit.MILLISECONDS.toDays(keyAge) + " days). Rotating.");
SenderKeyUtil.rotateOurKey(context, distributionId);
}