diff --git a/src/Core/Models/Domain/Account.cs b/src/Core/Models/Domain/Account.cs index b6fc42f58..efab6c763 100644 --- a/src/Core/Models/Domain/Account.cs +++ b/src/Core/Models/Domain/Account.cs @@ -119,7 +119,7 @@ namespace Bit.Core.Models.Domain { public UserKey UserKey; public MasterKey MasterKey; - public EncString UserKeyPinEphemeral; + public EncString PinKeyEncryptedUserKeyEphemeral; public bool? BiometricLocked; [Obsolete("Jul 6 2023: Key has been deprecated. We will use the User Key in the future. It remains here for migration during app upgrade.")] public SymmetricCryptoKey Key; diff --git a/src/Core/Services/CryptoService.cs b/src/Core/Services/CryptoService.cs index b61d5aaab..dbfe99b74 100644 --- a/src/Core/Services/CryptoService.cs +++ b/src/Core/Services/CryptoService.cs @@ -673,7 +673,7 @@ namespace Bit.Core.Services // Refresh, set, or clear the pin key if (await _stateService.GetProtectedPinAsync(userId) != null) { - await UpdateUserKeyPinAsync(userKey, userId); + await UpdatePinKeyAsync(userKey, userId); } else { @@ -692,7 +692,7 @@ namespace Bit.Core.Services } } - private async Task UpdateUserKeyPinAsync(UserKey userKey, string userId = null) + private async Task UpdatePinKeyAsync(UserKey userKey, string userId = null) { var pin = await DecryptToUtf8Async(new EncString(await _stateService.GetProtectedPinAsync(userId))); var pinKey = await MakePinKeyAsync( diff --git a/src/Core/Services/StateService.cs b/src/Core/Services/StateService.cs index 77d51833c..b8f505dba 100644 --- a/src/Core/Services/StateService.cs +++ b/src/Core/Services/StateService.cs @@ -428,7 +428,7 @@ namespace Bit.Core.Services { return (await GetAccountAsync( ReconcileOptions(new StorageOptions { UserId = userId }, await GetDefaultInMemoryOptionsAsync()) - ))?.VolatileData?.UserKeyPinEphemeral; + ))?.VolatileData?.PinKeyEncryptedUserKeyEphemeral; } public async Task SetPinKeyEncryptedUserKeyEphemeralAsync(EncString value, string userId = null) @@ -436,7 +436,7 @@ namespace Bit.Core.Services var reconciledOptions = ReconcileOptions(new StorageOptions { UserId = userId }, await GetDefaultInMemoryOptionsAsync()); var account = await GetAccountAsync(reconciledOptions); - account.VolatileData.UserKeyPinEphemeral = value; + account.VolatileData.PinKeyEncryptedUserKeyEphemeral = value; await SaveAccountAsync(account, reconciledOptions); }