X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/995eaa6e7cb49b353e306adf08c0457e1aade618..75d7270d5a538e55d5c6a8b5aa833deba3631ab8:/lib/src/main/java/org/asamk/signal/manager/RegistrationManagerImpl.java diff --git a/lib/src/main/java/org/asamk/signal/manager/RegistrationManagerImpl.java b/lib/src/main/java/org/asamk/signal/manager/RegistrationManagerImpl.java index 3ce77557..4b7c8362 100644 --- a/lib/src/main/java/org/asamk/signal/manager/RegistrationManagerImpl.java +++ b/lib/src/main/java/org/asamk/signal/manager/RegistrationManagerImpl.java @@ -92,7 +92,15 @@ class RegistrationManagerImpl implements RegistrationManager { serviceEnvironmentConfig.getKeyBackupConfig().getServiceId(), serviceEnvironmentConfig.getKeyBackupConfig().getMrenclave(), 10); - this.pinHelper = new PinHelper(keyBackupService); + final var fallbackKeyBackupServices = serviceEnvironmentConfig.getFallbackKeyBackupConfigs() + .stream() + .map(config -> accountManager.getKeyBackupService(ServiceConfig.getIasKeyStore(), + config.getEnclaveName(), + config.getServiceId(), + config.getMrenclave(), + 10)) + .toList(); + this.pinHelper = new PinHelper(keyBackupService, fallbackKeyBackupServices); } @Override @@ -182,12 +190,13 @@ class RegistrationManagerImpl implements RegistrationManager { account.getLocalRegistrationId(), true, null, - account.getPinMasterKey() == null ? null : account.getPinMasterKey().deriveRegistrationLock(), + account.getRegistrationLock(), account.getSelfUnidentifiedAccessKey(), account.isUnrestrictedUnidentifiedAccess(), capabilities, account.isDiscoverableByPhoneNumber(), - account.getEncryptedDeviceName()); + account.getEncryptedDeviceName(), + account.getLocalPniRegistrationId()); account.setRegistered(true); logger.info("Reactivated existing account, verify is not necessary."); if (newManagerListener != null) { @@ -216,7 +225,8 @@ class RegistrationManagerImpl implements RegistrationManager { account.getSelfUnidentifiedAccessKey(), account.isUnrestrictedUnidentifiedAccess(), ServiceConfig.capabilities, - account.isDiscoverableByPhoneNumber()); + account.isDiscoverableByPhoneNumber(), + account.getLocalPniRegistrationId()); } else { return accountManager.verifyAccountWithRegistrationLockPin(verificationCode, account.getLocalRegistrationId(), @@ -225,7 +235,8 @@ class RegistrationManagerImpl implements RegistrationManager { account.getSelfUnidentifiedAccessKey(), account.isUnrestrictedUnidentifiedAccess(), ServiceConfig.capabilities, - account.isDiscoverableByPhoneNumber()); + account.isDiscoverableByPhoneNumber(), + account.getLocalPniRegistrationId()); } }