mirror of
https://github.com/bitwarden/mobile
synced 2025-12-05 23:53:33 +00:00
[PM-2297] code format
This commit is contained in:
@@ -490,7 +490,7 @@ namespace Bit.Core.Services
|
||||
await _cryptoService.SetMasterKeyEncryptedUserKeyAsync(tokenResponse.Key);
|
||||
|
||||
var decryptOptions = await _stateService.GetAccountDecryptionOptions();
|
||||
if (await _deviceTrustCryptoService.IsDeviceTrustedAsync() && decryptOptions?.TrustedDeviceOption != null)
|
||||
if (decryptOptions?.TrustedDeviceOption != null)
|
||||
{
|
||||
var key = await _deviceTrustCryptoService.DecryptUserKeyWithDeviceKeyAsync(decryptOptions?.TrustedDeviceOption.EncryptedPrivateKey, decryptOptions?.TrustedDeviceOption.EncryptedUserKey);
|
||||
if (key != null)
|
||||
@@ -498,14 +498,12 @@ namespace Bit.Core.Services
|
||||
await _cryptoService.SetUserKeyAsync(key);
|
||||
}
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(tokenResponse.KeyConnectorUrl) || !string.IsNullOrEmpty(decryptOptions?.KeyConnectorOption?.KeyConnectorUrl))
|
||||
else if (masterKey != null &&
|
||||
(!string.IsNullOrEmpty(tokenResponse.KeyConnectorUrl) || !string.IsNullOrEmpty(decryptOptions?.KeyConnectorOption?.KeyConnectorUrl)))
|
||||
{
|
||||
if (masterKey != null)
|
||||
{
|
||||
await _cryptoService.SetMasterKeyAsync(masterKey);
|
||||
var userKey = await _cryptoService.DecryptUserKeyWithMasterKeyAsync(masterKey);
|
||||
await _cryptoService.SetUserKeyAsync(userKey);
|
||||
}
|
||||
await _cryptoService.SetMasterKeyAsync(masterKey);
|
||||
var userKey = await _cryptoService.DecryptUserKeyWithMasterKeyAsync(masterKey);
|
||||
await _cryptoService.SetUserKeyAsync(userKey);
|
||||
}
|
||||
|
||||
// User doesn't have a key pair yet (old account), let's generate one for them.
|
||||
|
||||
@@ -113,8 +113,8 @@ namespace Bit.Core.Services
|
||||
|
||||
if (existingDeviceKey == null)
|
||||
{
|
||||
// User doesn't have a device key anymore so device is untrusted
|
||||
return null;
|
||||
// User doesn't have a device key anymore so device is untrusted
|
||||
return null;
|
||||
}
|
||||
|
||||
// Attempt to decrypt encryptedDevicePrivateKey with device key
|
||||
|
||||
Reference in New Issue
Block a user