From d78d7c726e0ffd686e48e2e8575363d91bb7afde Mon Sep 17 00:00:00 2001 From: Jon Chambers Date: Fri, 3 Dec 2021 15:48:52 -0500 Subject: [PATCH] Fix a UUID transposition when requesting profile key credentials --- .../textsecuregcm/controllers/ProfileController.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ProfileController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ProfileController.java index c5468cce7..ae6fbee0e 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ProfileController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ProfileController.java @@ -265,10 +265,10 @@ public class ProfileController { Optional accountProfile = accountsManager.getByAccountIdentifier(uuid); OptionalAccess.verify(requestAccount, accessKey, accountProfile); - assert(accountProfile.isPresent()); + assert accountProfile.isPresent(); - Optional username = accountProfile.flatMap(Account::getUsername); - Optional profile = profilesManager.get(uuid, version); + Optional username = accountProfile.flatMap(Account::getUsername); + Optional profile = profilesManager.get(uuid, version); String name = profile.map(VersionedProfile::getName).orElse(accountProfile.get().getProfileName()); String about = profile.map(VersionedProfile::getAbout).orElse(null); @@ -286,7 +286,7 @@ public class ProfileController { final ProfileKeyCredentialResponse profileKeyCredentialResponse; final PniCredentialResponse pniCredentialResponse; - if (credentialRequest.isPresent() && credentialType.isPresent() && profile.isPresent() && requestAccount.isPresent()) { + if (credentialRequest.isPresent() && credentialType.isPresent() && profile.isPresent()) { if (PNI_CREDENTIAL_TYPE.equals(credentialType.get())) { if (!isSelf) { throw new ForbiddenException(); @@ -300,7 +300,7 @@ public class ProfileController { } else if (PROFILE_KEY_CREDENTIAL_TYPE.equals(credentialType.get())) { profileKeyCredentialResponse = getProfileCredential(credentialRequest.get(), profile.get(), - requestAccount.get().getUuid()); + uuid); pniCredentialResponse = null; } else {