Key file implemented!

Key Derivation setting added
More unit tests created
Some cleanup in lib
WIP Argon2 save
This commit is contained in:
2017-11-03 15:48:55 +01:00
committed by BONNEVILLE Geoffroy
parent 536bddf442
commit e495a1c2e7
12 changed files with 200 additions and 345 deletions

View File

@@ -1,4 +1,5 @@
using System;
using Windows.Storage.Pickers;
using Windows.System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Input;
@@ -49,7 +50,7 @@ namespace ModernKeePass.Controls
{
ValidationChecking?.Invoke(this, new EventArgs());
var app = (App)Application.Current;
StatusTextBlock.Text = app.Database.Open(PasswordBox.Password, CreateNew);
StatusTextBlock.Text = app.Database.Open(PasswordCheckBox.IsChecked.HasValue && PasswordCheckBox.IsChecked.Value ? PasswordBox.Password : null, CreateNew);
if (app.Database.Status == DatabaseHelper.DatabaseStatus.Opened)
{
ValidationChecked?.Invoke(this, new PasswordEventArgs(app.Database.RootGroup));
@@ -69,5 +70,23 @@ namespace ModernKeePass.Controls
StatusTextBlock.Text = string.Empty;
}
}
private async void KeyFileButton_Click(object sender, RoutedEventArgs e)
{
var picker =
new FileOpenPicker
{
ViewMode = PickerViewMode.List,
SuggestedStartLocation = PickerLocationId.DocumentsLibrary
};
picker.FileTypeFilter.Add(".key");
// Application now has read/write access to the picked file
var file = await picker.PickSingleFileAsync();
if (file == null) return;
var app = (App)Application.Current;
app.Database.KeyFile = file;
StatusTextBlock.Text = $"Key file: {file.Name}";
}
}
}