From 95843529bab5c15038809cba6a6bf71e9db00245 Mon Sep 17 00:00:00 2001 From: Ravi Khadiwala Date: Wed, 8 Apr 2026 12:13:52 -0500 Subject: [PATCH] Add comments to explain why we remove RRPs early --- .../textsecuregcm/controllers/VerificationController.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/VerificationController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/VerificationController.java index 3cd63cdc9..d1ad672ff 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/VerificationController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/VerificationController.java @@ -782,6 +782,10 @@ public class VerificationController { boolean existingRRP = false; if (resultSession.verified()) { + // Since there is a valid verification session we invalidate the other possible verification mechanism, + // the RRP. It's possible the client will not actually be able to register (e.g. failed reglock challenge), and + // so we will have removed the RRP unnecessarily. The impact of this is low, since the owner of the RRP + // can always just fallback to session-based verification. existingRRP = registrationRecoveryPasswordsManager.remove(phoneNumberIdentifiers.getPhoneNumberIdentifier(registrationServiceSession.number()).join()).join(); } @@ -854,6 +858,10 @@ public class VerificationController { .orElseThrow(NotFoundException::new); if (registrationServiceSession.verified()) { + // Since there is a valid verification session we invalidate the other possible verification mechanism, + // the RRP. It's possible the client will not actually be able to register (e.g. failed reglock challenge), and + // so we will have removed the RRP unnecessarily. The impact of this is low, since the owner of the RRP + // can always just fallback to session-based verification. registrationRecoveryPasswordsManager.remove(phoneNumberIdentifiers.getPhoneNumberIdentifier(registrationServiceSession.number()).join()).join(); }