1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-14 23:33:34 +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). // 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. // 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) public async Task<bool> HasUserKeyAsync(string userId = null)
@@ -124,7 +124,7 @@ namespace Bit.Core.Services
if (masterKey == null) if (masterKey == null)
{ {
// Migration support // Migration support
masterKey = await _stateService.GetKeyDecryptedAsync(userId) as MasterKey; masterKey = new MasterKey((await _stateService.GetKeyDecryptedAsync(userId)).Key);
if (masterKey != null) if (masterKey != null)
{ {
await SetMasterKeyAsync(masterKey, userId); await SetMasterKeyAsync(masterKey, userId);