From b247fc24c1116eb3ed812cf19769e59acff70788 Mon Sep 17 00:00:00 2001 From: Jon Chambers Date: Wed, 26 Aug 2026 14:43:06 -0400 Subject: [PATCH] Use a TOTP algorithm supported by a wider range of authenticator apps --- .../storage/AccountsManager.java | 30 +++---- .../grpc/AccountsGrpcServiceTest.java | 22 ++++-- ...ccountCreationDeletionIntegrationTest.java | 2 +- .../textsecuregcm/storage/AccountTest.java | 2 +- ...ntsManagerChangeNumberIntegrationTest.java | 2 +- ...ConcurrentModificationIntegrationTest.java | 2 +- ...sManagerDeviceTransferIntegrationTest.java | 2 +- ...igrateRecoveryPasswordIntegrationTest.java | 2 +- .../storage/AccountsManagerTest.java | 79 ++++++------------- ...ccountsManagerUsernameIntegrationTest.java | 2 +- .../AddRemoveDeviceIntegrationTest.java | 2 +- 11 files changed, 58 insertions(+), 89 deletions(-) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/storage/AccountsManager.java b/service/src/main/java/org/whispersystems/textsecuregcm/storage/AccountsManager.java index 5659d83e9..04608400f 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/storage/AccountsManager.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/storage/AccountsManager.java @@ -8,7 +8,6 @@ package org.whispersystems.textsecuregcm.storage; import static java.util.Objects.requireNonNull; import static org.whispersystems.textsecuregcm.metrics.MetricsUtil.name; -import com.eatthepath.otp.HmacOneTimePasswordGenerator; import com.eatthepath.otp.TimeBasedOneTimePasswordGenerator; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectWriter; @@ -150,7 +149,6 @@ public class AccountsManager extends RedisPubSubAdapter implemen private final Duration maxTotpValidationDelay; private final KeyGenerator totpKeyGenerator; - private final TimeBasedOneTimePasswordGenerator totpGenerator; private final Key verificationTokenKey; @@ -206,13 +204,13 @@ public class AccountsManager extends RedisPubSubAdapter implemen static final String LINK_DEVICE_VERIFICATION_TOKEN_ALGORITHM = "HmacSHA256"; @VisibleForTesting - static final int TOTP_KEY_LENGTH_BITS = 256; + static final int TOTP_KEY_LENGTH_BITS = 160; @VisibleForTesting - public static final TotpParameters TOTP_PARAMETERS = new TotpParameters( - TimeBasedOneTimePasswordGenerator.TOTP_ALGORITHM_HMAC_SHA256, - HmacOneTimePasswordGenerator.DEFAULT_PASSWORD_LENGTH, - TimeBasedOneTimePasswordGenerator.DEFAULT_TIME_STEP); + public static final TimeBasedOneTimePasswordGenerator TOTP = new TimeBasedOneTimePasswordGenerator(); + + private static final TotpParameters TOTP_PARAMETERS = + new TotpParameters(TOTP.getAlgorithm(), TOTP.getPasswordLength(), TOTP.getTimeStep()); public static final int MAX_TOTP_KEYS = 2; @@ -324,7 +322,7 @@ public class AccountsManager extends RedisPubSubAdapter implemen this.retryExecutor = retryExecutor; this.clock = requireNonNull(clock); - if (maxTotpValidationDelay.compareTo(TOTP_PARAMETERS.timeStep()) > 0) { + if (maxTotpValidationDelay.compareTo(TOTP.getTimeStep()) > 0) { throw new IllegalArgumentException("Max TOTP validation delay must be less than or equal to TOTP time step"); } @@ -340,20 +338,12 @@ public class AccountsManager extends RedisPubSubAdapter implemen } try { - this.totpKeyGenerator = KeyGenerator.getInstance(TOTP_PARAMETERS.algorithm()); + this.totpKeyGenerator = KeyGenerator.getInstance(TOTP.getAlgorithm()); totpKeyGenerator.init(TOTP_KEY_LENGTH_BITS); } catch (final NoSuchAlgorithmException e) { throw new AssertionError("Every implementation of the Java platform is required to support the HmacSHA256 KeyGenerator algorithm", e); } - try { - this.totpGenerator = new TimeBasedOneTimePasswordGenerator(TOTP_PARAMETERS.timeStep(), - TOTP_PARAMETERS.passwordLength(), - TOTP_PARAMETERS.algorithm()); - } catch (final NoSuchAlgorithmException e) { - throw new AssertionError("Every implementation of the Java platform is required to support the HmacSHA256 MAC algorithm", e); - } - this.pubSubConnection = pubSubRedisClient.createPubSubConnection(); } @@ -2076,7 +2066,7 @@ public class AccountsManager extends RedisPubSubAdapter implemen final TotpKey pendingTotpKey = maybePendingTotpKey.get(); try { - if (totpGenerator.validateOneTimePassword(pendingTotpKey, timestamp, oneTimePassword)) { + if (TOTP.validateOneTimePassword(pendingTotpKey, timestamp, oneTimePassword)) { final AtomicInteger keyId = new AtomicInteger(); update(accountIdentifier, account -> { @@ -2112,7 +2102,7 @@ public class AccountsManager extends RedisPubSubAdapter implemen .max(Map.Entry.comparingByKey()) .filter(entry -> { try { - return totpGenerator.validateOneTimePassword(entry.getValue(), timestamp, oneTimePassword); + return TOTP.validateOneTimePassword(entry.getValue(), timestamp, oneTimePassword); } catch (final InvalidKeyException e) { ImpossibleEvents.logImpossible(logger, "Invalid TOTP key for account {}", accountIdentifier, e); return false; @@ -2134,7 +2124,7 @@ public class AccountsManager extends RedisPubSubAdapter implemen for (final Instant timestamp : new Instant[] { validationTimestamp, validationTimestamp.minus(maxTotpValidationDelay) }) { for (final SecretKey totpKey : account.getTotpKeys().values()) { try { - if (totpGenerator.validateOneTimePassword(totpKey, timestamp, oneTimePassword)) { + if (TOTP.validateOneTimePassword(totpKey, timestamp, oneTimePassword)) { return true; } } catch (final InvalidKeyException e) { diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/grpc/AccountsGrpcServiceTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/grpc/AccountsGrpcServiceTest.java index d0a31b3c1..2a5c270e6 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/grpc/AccountsGrpcServiceTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/grpc/AccountsGrpcServiceTest.java @@ -161,6 +161,12 @@ class AccountsGrpcServiceTest extends SimpleBaseGrpcTest expectedTotpKeys = totpKeys.entrySet().stream() @@ -1305,7 +1311,7 @@ class AccountsGrpcServiceTest extends SimpleBaseGrpcTest (byte) i) .collect(Collectors.toMap(keyId -> keyId, _ -> new AnnotatedTotpKey(new TotpKey( new TotpParameters( - TimeBasedOneTimePasswordGenerator.TOTP_ALGORITHM_HMAC_SHA256, + TimeBasedOneTimePasswordGenerator.TOTP_ALGORITHM_HMAC_SHA1, HmacOneTimePasswordGenerator.DEFAULT_PASSWORD_LENGTH, TimeBasedOneTimePasswordGenerator.DEFAULT_TIME_STEP), TestRandomUtil.nextBytes(16)), diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/storage/AccountsManagerChangeNumberIntegrationTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/storage/AccountsManagerChangeNumberIntegrationTest.java index bed46bb15..149a901d2 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/storage/AccountsManagerChangeNumberIntegrationTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/storage/AccountsManagerChangeNumberIntegrationTest.java @@ -156,7 +156,7 @@ class AccountsManagerChangeNumberIntegrationTest { executor, mock(Clock.class), "link-device-secret".getBytes(StandardCharsets.UTF_8), - AccountsManager.TOTP_PARAMETERS.timeStep().dividedBy(2)); + AccountsManager.TOTP.getTimeStep().dividedBy(2)); } } diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/storage/AccountsManagerConcurrentModificationIntegrationTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/storage/AccountsManagerConcurrentModificationIntegrationTest.java index 1b9f2f38b..ca377d4c3 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/storage/AccountsManagerConcurrentModificationIntegrationTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/storage/AccountsManagerConcurrentModificationIntegrationTest.java @@ -137,7 +137,7 @@ class AccountsManagerConcurrentModificationIntegrationTest { mock(ScheduledExecutorService.class), mock(Clock.class), "link-device-secret".getBytes(StandardCharsets.UTF_8), - AccountsManager.TOTP_PARAMETERS.timeStep().dividedBy(2) + AccountsManager.TOTP.getTimeStep().dividedBy(2) ); } } diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/storage/AccountsManagerDeviceTransferIntegrationTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/storage/AccountsManagerDeviceTransferIntegrationTest.java index 595d2a376..29a5abe81 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/storage/AccountsManagerDeviceTransferIntegrationTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/storage/AccountsManagerDeviceTransferIntegrationTest.java @@ -73,7 +73,7 @@ public class AccountsManagerDeviceTransferIntegrationTest { mock(ScheduledExecutorService.class), Clock.systemUTC(), "link-device-secret".getBytes(StandardCharsets.UTF_8), - AccountsManager.TOTP_PARAMETERS.timeStep().dividedBy(2)); + AccountsManager.TOTP.getTimeStep().dividedBy(2)); accountsManager.start(); } diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/storage/AccountsManagerMigrateRecoveryPasswordIntegrationTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/storage/AccountsManagerMigrateRecoveryPasswordIntegrationTest.java index 781c6c7af..083ba64f7 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/storage/AccountsManagerMigrateRecoveryPasswordIntegrationTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/storage/AccountsManagerMigrateRecoveryPasswordIntegrationTest.java @@ -142,7 +142,7 @@ public class AccountsManagerMigrateRecoveryPasswordIntegrationTest { executor, mock(Clock.class), "link-device-secret".getBytes(StandardCharsets.UTF_8), - AccountsManager.TOTP_PARAMETERS.timeStep().dividedBy(2)); + AccountsManager.TOTP.getTimeStep().dividedBy(2)); } } diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/storage/AccountsManagerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/storage/AccountsManagerTest.java index 66170478b..b8c45e505 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/storage/AccountsManagerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/storage/AccountsManagerTest.java @@ -33,7 +33,6 @@ import static org.mockito.Mockito.verifyNoInteractions; import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; -import com.eatthepath.otp.TimeBasedOneTimePasswordGenerator; import com.google.i18n.phonenumbers.PhoneNumberUtil; import io.lettuce.core.RedisException; import io.lettuce.core.api.async.RedisAsyncCommands; @@ -127,7 +126,11 @@ class AccountsManagerTest { private static final byte[] LINK_DEVICE_SECRET = "link-device-secret".getBytes(StandardCharsets.UTF_8); - private static final Duration MAX_TOTP_VALIDATION_DELAY = AccountsManager.TOTP_PARAMETERS.timeStep().dividedBy(2); + private static final Duration MAX_TOTP_VALIDATION_DELAY = AccountsManager.TOTP.getTimeStep().dividedBy(2); + + private static final TotpParameters TOTP_PARAMETERS = new TotpParameters(AccountsManager.TOTP.getAlgorithm(), + AccountsManager.TOTP.getPasswordLength(), + AccountsManager.TOTP.getTimeStep()); private static TestClock CLOCK; @@ -1958,7 +1961,7 @@ class AccountsManagerTest { when(account.getTotpKeys()).thenReturn(IntStream.range(0, AccountsManager.MAX_TOTP_KEYS) .boxed() .collect(Collectors.toMap(Integer::byteValue, _ -> new AnnotatedTotpKey( - new TotpKey(AccountsManager.TOTP_PARAMETERS, TestRandomUtil.nextBytes(16)), + new TotpKey(TOTP_PARAMETERS, TestRandomUtil.nextBytes(16)), TestRandomUtil.nextBytes(16))))); when(accounts.getByAccountIdentifier(accountIdentifier)) @@ -1984,15 +1987,10 @@ class AccountsManagerTest { when(account.getPendingTotpKey()).thenReturn(Optional.of(pendingTotpKey)); when(account.getNextTotpKeyId()).thenReturn(nextTotpKeyId); - final TimeBasedOneTimePasswordGenerator totpGenerator = - new TimeBasedOneTimePasswordGenerator(AccountsManager.TOTP_PARAMETERS.timeStep(), - AccountsManager.TOTP_PARAMETERS.passwordLength(), - AccountsManager.TOTP_PARAMETERS.algorithm()); - final Instant timestamp = Instant.now(); assertEquals(Optional.of(nextTotpKeyId), accountsManager.confirmPendingTotpKey(accountIdentifier, - totpGenerator.generateOneTimePassword(pendingTotpKey, timestamp), + AccountsManager.TOTP.generateOneTimePassword(pendingTotpKey, timestamp), timestamp, TestRandomUtil.nextBytes(16))); @@ -2011,11 +2009,11 @@ class AccountsManagerTest { final AnnotatedTotpKey confirmedTotpKey; { - final KeyGenerator totpKeyGenerator = KeyGenerator.getInstance(AccountsManager.TOTP_PARAMETERS.algorithm()); + final KeyGenerator totpKeyGenerator = KeyGenerator.getInstance(AccountsManager.TOTP.getAlgorithm()); totpKeyGenerator.init(AccountsManager.TOTP_KEY_LENGTH_BITS); confirmedTotpKey = new AnnotatedTotpKey( - new TotpKey(AccountsManager.TOTP_PARAMETERS, totpKeyGenerator.generateKey().getEncoded()), + new TotpKey(TOTP_PARAMETERS, totpKeyGenerator.generateKey().getEncoded()), TestRandomUtil.nextBytes(16)); } @@ -2026,15 +2024,10 @@ class AccountsManagerTest { (byte) (keyId - 1), confirmedTotpKey, keyId, confirmedTotpKey)); - final TimeBasedOneTimePasswordGenerator totpGenerator = - new TimeBasedOneTimePasswordGenerator(AccountsManager.TOTP_PARAMETERS.timeStep(), - AccountsManager.TOTP_PARAMETERS.passwordLength(), - AccountsManager.TOTP_PARAMETERS.algorithm()); - final Instant timestamp = Instant.now(); assertEquals(Optional.of(keyId), accountsManager.confirmPendingTotpKey(accountIdentifier, - totpGenerator.generateOneTimePassword(confirmedTotpKey, timestamp), + AccountsManager.TOTP.generateOneTimePassword(confirmedTotpKey, timestamp), timestamp, TestRandomUtil.nextBytes(16))); } @@ -2054,15 +2047,10 @@ class AccountsManagerTest { when(account.getPendingTotpKey()).thenReturn(Optional.empty()); when(account.getTotpKeys()).thenReturn(Collections.emptyMap()); - final TimeBasedOneTimePasswordGenerator totpGenerator = - new TimeBasedOneTimePasswordGenerator(AccountsManager.TOTP_PARAMETERS.timeStep(), - AccountsManager.TOTP_PARAMETERS.passwordLength(), - AccountsManager.TOTP_PARAMETERS.algorithm()); - final Instant timestamp = Instant.now(); assertEquals(Optional.empty(), accountsManager.confirmPendingTotpKey(accountIdentifier, - totpGenerator.generateOneTimePassword(pendingTotpKey, timestamp), + AccountsManager.TOTP.generateOneTimePassword(pendingTotpKey, timestamp), timestamp, TestRandomUtil.nextBytes(16))); } @@ -2084,13 +2072,8 @@ class AccountsManagerTest { when(account.getPendingTotpKey()).thenReturn(Optional.of(pendingTotpKey)); when(account.getNextTotpKeyId()).thenReturn(nextTotpKeyId); - final TimeBasedOneTimePasswordGenerator totpGenerator = - new TimeBasedOneTimePasswordGenerator(AccountsManager.TOTP_PARAMETERS.timeStep(), - AccountsManager.TOTP_PARAMETERS.passwordLength(), - AccountsManager.TOTP_PARAMETERS.algorithm()); - final Instant timestamp = Instant.now(); - final int incorrectPassword = totpGenerator.generateOneTimePassword(pendingTotpKey, timestamp) + 1; + final int incorrectPassword = AccountsManager.TOTP.generateOneTimePassword(pendingTotpKey, timestamp) + 1; assertEquals(Optional.empty(), accountsManager.confirmPendingTotpKey(accountIdentifier, incorrectPassword, @@ -2120,23 +2103,18 @@ class AccountsManagerTest { final AnnotatedTotpKey totpKey; final AnnotatedTotpKey secondTotpKey; { - final KeyGenerator totpKeyGenerator = KeyGenerator.getInstance(AccountsManager.TOTP_PARAMETERS.algorithm()); + final KeyGenerator totpKeyGenerator = KeyGenerator.getInstance(AccountsManager.TOTP.getAlgorithm()); totpKeyGenerator.init(AccountsManager.TOTP_KEY_LENGTH_BITS); totpKey = new AnnotatedTotpKey( - new TotpKey(AccountsManager.TOTP_PARAMETERS, totpKeyGenerator.generateKey().getEncoded()), + new TotpKey(TOTP_PARAMETERS, totpKeyGenerator.generateKey().getEncoded()), TestRandomUtil.nextBytes(16)); secondTotpKey = new AnnotatedTotpKey( - new TotpKey(AccountsManager.TOTP_PARAMETERS, totpKeyGenerator.generateKey().getEncoded()), + new TotpKey(TOTP_PARAMETERS, totpKeyGenerator.generateKey().getEncoded()), TestRandomUtil.nextBytes(16)); } - final TimeBasedOneTimePasswordGenerator totpGenerator = - new TimeBasedOneTimePasswordGenerator(AccountsManager.TOTP_PARAMETERS.timeStep(), - AccountsManager.TOTP_PARAMETERS.passwordLength(), - AccountsManager.TOTP_PARAMETERS.algorithm()); - return List.of( Arguments.argumentSet("No keys, no password provided", Collections.emptyMap(), timestamp, null, true), @@ -2145,16 +2123,16 @@ class AccountsManagerTest { Collections.emptyMap(), timestamp, 123456, false), Arguments.argumentSet("Has key, correct password provided", - Map.of((byte) 1, totpKey), timestamp, totpGenerator.generateOneTimePassword(totpKey, timestamp), true), + Map.of((byte) 1, totpKey), timestamp, AccountsManager.TOTP.generateOneTimePassword(totpKey, timestamp), true), Arguments.argumentSet("Has key, incorrect password provided", - Map.of((byte) 1, totpKey), timestamp, totpGenerator.generateOneTimePassword(totpKey, timestamp) + 1, false), + Map.of((byte) 1, totpKey), timestamp, AccountsManager.TOTP.generateOneTimePassword(totpKey, timestamp) + 1, false), Arguments.argumentSet("Has key, no password provided", Map.of((byte) 1, totpKey), timestamp, null, false), Arguments.argumentSet("Has multiple keys, correct password provided for one key", - Map.of((byte) 1, totpKey, (byte) 2, secondTotpKey), timestamp, totpGenerator.generateOneTimePassword(totpKey, timestamp), true) + Map.of((byte) 1, totpKey, (byte) 2, secondTotpKey), timestamp, AccountsManager.TOTP.generateOneTimePassword(totpKey, timestamp), true) ); } @@ -2162,40 +2140,35 @@ class AccountsManagerTest { void verifyTotpWithDelay() throws NoSuchAlgorithmException, InvalidKeyException { final AnnotatedTotpKey totpKey; { - final KeyGenerator totpKeyGenerator = KeyGenerator.getInstance(AccountsManager.TOTP_PARAMETERS.algorithm()); + final KeyGenerator totpKeyGenerator = KeyGenerator.getInstance(AccountsManager.TOTP.getAlgorithm()); totpKeyGenerator.init(AccountsManager.TOTP_KEY_LENGTH_BITS); totpKey = new AnnotatedTotpKey( - new TotpKey(AccountsManager.TOTP_PARAMETERS, totpKeyGenerator.generateKey().getEncoded()), + new TotpKey(TOTP_PARAMETERS, totpKeyGenerator.generateKey().getEncoded()), TestRandomUtil.nextBytes(16)); } - final TimeBasedOneTimePasswordGenerator totpGenerator = - new TimeBasedOneTimePasswordGenerator(AccountsManager.TOTP_PARAMETERS.timeStep(), - AccountsManager.TOTP_PARAMETERS.passwordLength(), - AccountsManager.TOTP_PARAMETERS.algorithm()); - final Account account = mock(Account.class); when(account.getTotpKeys()).thenReturn(Map.of((byte) 1, totpKey)); final Instant beginningOfTotpWindow = - Instant.ofEpochMilli((Instant.now().toEpochMilli() / AccountsManager.TOTP_PARAMETERS.timeStep().toMillis()) * - AccountsManager.TOTP_PARAMETERS.timeStep().toMillis()); + Instant.ofEpochMilli((Instant.now().toEpochMilli() / AccountsManager.TOTP.getTimeStep().toMillis()) * + AccountsManager.TOTP.getTimeStep().toMillis()); - final int oneTimePassword = totpGenerator.generateOneTimePassword(totpKey, beginningOfTotpWindow); + final int oneTimePassword = AccountsManager.TOTP.generateOneTimePassword(totpKey, beginningOfTotpWindow); assertTrue(accountsManager.verifyTotp(account, beginningOfTotpWindow, oneTimePassword), "One-time password should be valid at the start of the window in which it was generated"); - assertTrue(accountsManager.verifyTotp(account, beginningOfTotpWindow.plus(AccountsManager.TOTP_PARAMETERS.timeStep()), oneTimePassword), + assertTrue(accountsManager.verifyTotp(account, beginningOfTotpWindow.plus(AccountsManager.TOTP.getTimeStep()), oneTimePassword), "One-time password should be valid at the start of the window after which it was generated"); - assertTrue(accountsManager.verifyTotp(account, beginningOfTotpWindow.plus(AccountsManager.TOTP_PARAMETERS.timeStep()).plus(MAX_TOTP_VALIDATION_DELAY).minusMillis(1), oneTimePassword), + assertTrue(accountsManager.verifyTotp(account, beginningOfTotpWindow.plus(AccountsManager.TOTP.getTimeStep()).plus(MAX_TOTP_VALIDATION_DELAY).minusMillis(1), oneTimePassword), "One-time password should be valid up until max delay after end of current TOTP window"); // With six-digit OTPs, there's a one-in-a-million chance of this returning a false positive, and so we repeat the // test several allowing for failure - assertFalse(accountsManager.verifyTotp(account, beginningOfTotpWindow.plus(AccountsManager.TOTP_PARAMETERS.timeStep()).plus(MAX_TOTP_VALIDATION_DELAY), oneTimePassword), + assertFalse(accountsManager.verifyTotp(account, beginningOfTotpWindow.plus(AccountsManager.TOTP.getTimeStep()).plus(MAX_TOTP_VALIDATION_DELAY), oneTimePassword), "One-time password should not be valid after max delay past end of current TOTP window"); } } diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/storage/AccountsManagerUsernameIntegrationTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/storage/AccountsManagerUsernameIntegrationTest.java index 120c7b053..f6eb82d5b 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/storage/AccountsManagerUsernameIntegrationTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/storage/AccountsManagerUsernameIntegrationTest.java @@ -158,7 +158,7 @@ class AccountsManagerUsernameIntegrationTest { Executors.newSingleThreadScheduledExecutor(), Clock.systemUTC(), "link-device-secret".getBytes(StandardCharsets.UTF_8), - AccountsManager.TOTP_PARAMETERS.timeStep().dividedBy(2)); + AccountsManager.TOTP.getTimeStep().dividedBy(2)); } @Test diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/storage/AddRemoveDeviceIntegrationTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/storage/AddRemoveDeviceIntegrationTest.java index 7f459319f..6d8998e6c 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/storage/AddRemoveDeviceIntegrationTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/storage/AddRemoveDeviceIntegrationTest.java @@ -162,7 +162,7 @@ public class AddRemoveDeviceIntegrationTest { scheduledExecutorService, clock, "link-device-secret".getBytes(StandardCharsets.UTF_8), - AccountsManager.TOTP_PARAMETERS.timeStep().dividedBy(2)); + AccountsManager.TOTP.getTimeStep().dividedBy(2)); accountsManager.start(); }