mirror of
https://github.com/bitwarden/mobile
synced 2025-12-16 00:03:22 +00:00
[PM-2297] code format
This commit is contained in:
@@ -490,7 +490,7 @@ namespace Bit.Core.Services
|
|||||||
await _cryptoService.SetMasterKeyEncryptedUserKeyAsync(tokenResponse.Key);
|
await _cryptoService.SetMasterKeyEncryptedUserKeyAsync(tokenResponse.Key);
|
||||||
|
|
||||||
var decryptOptions = await _stateService.GetAccountDecryptionOptions();
|
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);
|
var key = await _deviceTrustCryptoService.DecryptUserKeyWithDeviceKeyAsync(decryptOptions?.TrustedDeviceOption.EncryptedPrivateKey, decryptOptions?.TrustedDeviceOption.EncryptedUserKey);
|
||||||
if (key != null)
|
if (key != null)
|
||||||
@@ -498,14 +498,12 @@ namespace Bit.Core.Services
|
|||||||
await _cryptoService.SetUserKeyAsync(key);
|
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.SetMasterKeyAsync(masterKey);
|
await _cryptoService.SetUserKeyAsync(userKey);
|
||||||
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.
|
// 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)
|
if (existingDeviceKey == null)
|
||||||
{
|
{
|
||||||
// User doesn't have a device key anymore so device is untrusted
|
// User doesn't have a device key anymore so device is untrusted
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Attempt to decrypt encryptedDevicePrivateKey with device key
|
// Attempt to decrypt encryptedDevicePrivateKey with device key
|
||||||
|
|||||||
Reference in New Issue
Block a user