1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-17 16:53:26 +00:00

[PM-2713] don't pass user key as param when encrypting

This commit is contained in:
Jacob Fink
2023-07-31 12:42:56 -04:00
parent de5113ede7
commit bb5a7383a8
5 changed files with 11 additions and 13 deletions

View File

@@ -143,9 +143,9 @@ namespace Bit.Core.Services
return _stateService.SetMasterKeyAsync(null, userId);
}
public async Task<Tuple<UserKey, EncString>> EncryptUserKeyWithMasterKeyAsync(MasterKey masterKey, UserKey userKey = null)
public async Task<Tuple<UserKey, EncString>> EncryptUserKeyWithMasterKeyAsync(MasterKey masterKey)
{
userKey ??= await GetUserKeyAsync();
var userKey = await GetUserKeyAsync() ?? await MakeUserKeyAsync();
return await BuildProtectedSymmetricKey(masterKey, userKey.Key, keyBytes => new UserKey(keyBytes));
}