1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-05 23:53:33 +00:00

[PM-2713] remove broken casting

This commit is contained in:
Jacob Fink
2023-07-20 16:17:30 -04:00
parent a2f1ca583a
commit 10574a7117

View File

@@ -85,7 +85,7 @@ namespace Bit.Core.Services
// Legacy support: encryption used to be done with the master key (derived from master password).
// Users who have not migrated will have a null user key and must use the master key instead.
return (SymmetricCryptoKey)await GetMasterKeyAsync() as UserKey;
return new UserKey((await GetMasterKeyAsync()).Key);
}
public async Task<bool> HasUserKeyAsync(string userId = null)
@@ -124,7 +124,7 @@ namespace Bit.Core.Services
if (masterKey == null)
{
// Migration support
masterKey = await _stateService.GetKeyDecryptedAsync(userId) as MasterKey;
masterKey = new MasterKey((await _stateService.GetKeyDecryptedAsync(userId)).Key);
if (masterKey != null)
{
await SetMasterKeyAsync(masterKey, userId);