mirror of
https://github.com/bitwarden/android.git
synced 2024-12-25 02:18:27 +03:00
PBKDF2 is SHA256
This commit is contained in:
parent
d278fde5f2
commit
42c21ce892
4 changed files with 5 additions and 5 deletions
|
@ -2,6 +2,6 @@
|
|||
{
|
||||
public enum KdfType : short
|
||||
{
|
||||
PBKDF2 = 0
|
||||
PBKDF2_SHA256 = 0
|
||||
}
|
||||
}
|
||||
|
|
|
@ -192,7 +192,7 @@ namespace Bit.App.Pages
|
|||
return;
|
||||
}
|
||||
|
||||
var kdf = Enums.KdfType.PBKDF2;
|
||||
var kdf = Enums.KdfType.PBKDF2_SHA256;
|
||||
var kdfIterations = 5000;
|
||||
var normalizedEmail = EmailCell.Entry.Text.ToLower();
|
||||
var key = _cryptoService.MakeKeyFromPassword(PasswordCell.Entry.Text, normalizedEmail, kdf, kdfIterations);
|
||||
|
|
|
@ -168,7 +168,7 @@ namespace Bit.App.Services
|
|||
{
|
||||
if(!_kdf.HasValue)
|
||||
{
|
||||
_kdf = (KdfType)_settings.GetValueOrDefault(KdfKey, (short)KdfType.PBKDF2);
|
||||
_kdf = (KdfType)_settings.GetValueOrDefault(KdfKey, (short)KdfType.PBKDF2_SHA256);
|
||||
}
|
||||
return _kdf.Value;
|
||||
}
|
||||
|
@ -269,7 +269,7 @@ namespace Bit.App.Services
|
|||
|
||||
public async Task<FullLoginResult> TokenPostAsync(string email, string masterPassword)
|
||||
{
|
||||
Kdf = KdfType.PBKDF2;
|
||||
Kdf = KdfType.PBKDF2_SHA256;
|
||||
KdfIterations = 5000;
|
||||
var preloginResponse = await _accountsApiRepository.PostPreloginAsync(
|
||||
new PreloginRequest { Email = email });
|
||||
|
|
|
@ -445,7 +445,7 @@ namespace Bit.App.Services
|
|||
var saltBytes = Encoding.UTF8.GetBytes(salt);
|
||||
|
||||
byte[] keyBytes = null;
|
||||
if(kdf == KdfType.PBKDF2)
|
||||
if(kdf == KdfType.PBKDF2_SHA256)
|
||||
{
|
||||
if(kdfIterations < 5000)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue