Log profile decryption failure

This commit is contained in:
AsamK 2021-12-25 16:06:33 +01:00
parent f03df0a8c0
commit 7e803dfc46

View file

@ -3,6 +3,8 @@ package org.asamk.signal.manager.util;
import org.asamk.signal.manager.api.Pair;
import org.asamk.signal.manager.storage.recipients.Profile;
import org.signal.zkgroup.profiles.ProfileKey;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.whispersystems.signalservice.api.crypto.InvalidCiphertextException;
import org.whispersystems.signalservice.api.crypto.ProfileCipher;
import org.whispersystems.signalservice.api.profiles.SignalServiceProfile;
@ -12,6 +14,8 @@ import java.util.HashSet;
public class ProfileUtils {
private final static Logger logger = LoggerFactory.getLogger(ProfileUtils.class);
public static Profile decryptProfile(
final ProfileKey profileKey, final SignalServiceProfile encryptedProfile
) {
@ -31,6 +35,7 @@ public class ProfileUtils {
getUnidentifiedAccessMode(encryptedProfile, profileCipher),
getCapabilities(encryptedProfile));
} catch (InvalidCiphertextException e) {
logger.debug("Failed to decrypt profile for {}", encryptedProfile.getAci(), e);
return null;
}
}