mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Cryptography service now handles random byte generation
Protected strings are now protected in memory
This commit is contained in:
@@ -126,7 +126,12 @@ namespace ModernKeePass.ViewModels
|
||||
{
|
||||
AdditionalFields =
|
||||
new ObservableCollection<EntryFieldVm>(
|
||||
SelectedItem.AdditionalFields.Select(f => new EntryFieldVm(f.Name, f.Value, f.IsProtected)));
|
||||
SelectedItem.AdditionalFields.Select(f =>
|
||||
{
|
||||
var field = new EntryFieldVm(_cryptography);
|
||||
field.Initialize(f.Name, f.Value, f.IsProtected);
|
||||
return field;
|
||||
}));
|
||||
Attachments = new ObservableCollection<Attachment>(SelectedItem.Attachments.Select(f => new Attachment
|
||||
{
|
||||
Name = f.Key,
|
||||
@@ -161,8 +166,7 @@ namespace ModernKeePass.ViewModels
|
||||
DeleteAdditionalField.RaiseCanExecuteChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public string Title
|
||||
{
|
||||
get { return SelectedItem.Title.Value; }
|
||||
@@ -186,11 +190,12 @@ namespace ModernKeePass.ViewModels
|
||||
|
||||
public string Password
|
||||
{
|
||||
get { return SelectedItem.Password.Value; }
|
||||
get { return _cryptography.UnProtect(SelectedItem.Password.Value).GetAwaiter().GetResult(); }
|
||||
set
|
||||
{
|
||||
SelectedItem.Password.Value = value;
|
||||
SetFieldValue(nameof(Password), value, true).Wait();
|
||||
var protectedPassword = _cryptography.Protect(value).GetAwaiter().GetResult();
|
||||
SelectedItem.Password.Value = protectedPassword;
|
||||
SetFieldValue(nameof(Password), protectedPassword, true).Wait();
|
||||
RaisePropertyChanged(nameof(Password));
|
||||
RaisePropertyChanged(nameof(PasswordComplexityIndicator));
|
||||
}
|
||||
@@ -316,6 +321,7 @@ namespace ModernKeePass.ViewModels
|
||||
private readonly INotificationService _notification;
|
||||
private readonly IFileProxy _file;
|
||||
private readonly ISettingsProxy _settings;
|
||||
private readonly ICryptographyClient _cryptography;
|
||||
private GroupVm _parent;
|
||||
private EntryVm _selectedItem;
|
||||
private int _selectedIndex;
|
||||
@@ -324,7 +330,7 @@ namespace ModernKeePass.ViewModels
|
||||
private bool _isRevealPassword;
|
||||
private bool _isDirty;
|
||||
|
||||
public EntryDetailVm(IMediator mediator, INavigationService navigation, IResourceProxy resource, IDialogService dialog, INotificationService notification, IFileProxy file, ISettingsProxy settings)
|
||||
public EntryDetailVm(IMediator mediator, INavigationService navigation, IResourceProxy resource, IDialogService dialog, INotificationService notification, IFileProxy file, ISettingsProxy settings, ICryptographyClient cryptography)
|
||||
{
|
||||
_mediator = mediator;
|
||||
_navigation = navigation;
|
||||
@@ -333,6 +339,7 @@ namespace ModernKeePass.ViewModels
|
||||
_notification = notification;
|
||||
_file = file;
|
||||
_settings = settings;
|
||||
_cryptography = cryptography;
|
||||
|
||||
SaveCommand = new RelayCommand(async () => await SaveChanges(), () => Database.IsDirty);
|
||||
GeneratePasswordCommand = new RelayCommand(async () => await GeneratePassword());
|
||||
@@ -417,7 +424,7 @@ namespace ModernKeePass.ViewModels
|
||||
|
||||
private void AddField()
|
||||
{
|
||||
AdditionalFields.Add(new EntryFieldVm(string.Empty, string.Empty, false));
|
||||
AdditionalFields.Add(new EntryFieldVm(_cryptography));
|
||||
AdditionalFieldSelectedIndex = AdditionalFields.Count - 1;
|
||||
}
|
||||
|
||||
|
@@ -140,7 +140,7 @@ namespace ModernKeePass.ViewModels
|
||||
|
||||
Entries = new ObservableCollection<EntryVm>(_group.Entries);
|
||||
Entries.CollectionChanged += Entries_CollectionChanged;
|
||||
Groups = new ObservableCollection<GroupVm>(_group.SubGroups);
|
||||
Groups = new ObservableCollection<GroupVm>(_group.Groups);
|
||||
Groups.CollectionChanged += Groups_CollectionChanged;
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ namespace ModernKeePass.ViewModels
|
||||
{
|
||||
case NotifyCollectionChangedAction.Remove:
|
||||
var oldIndex = e.OldStartingIndex;
|
||||
_reorderedGroup = _group.SubGroups[oldIndex];
|
||||
_reorderedGroup = _group.Groups[oldIndex];
|
||||
break;
|
||||
case NotifyCollectionChangedAction.Add:
|
||||
if (_reorderedGroup == null)
|
||||
@@ -251,7 +251,7 @@ namespace ModernKeePass.ViewModels
|
||||
private async Task SortGroupsAsync()
|
||||
{
|
||||
await _mediator.Send(new SortGroupsCommand {Group = _group});
|
||||
Groups = new ObservableCollection<GroupVm>(_group.SubGroups);
|
||||
Groups = new ObservableCollection<GroupVm>(_group.Groups);
|
||||
RaisePropertyChanged(nameof(Groups));
|
||||
SaveCommand.RaiseCanExecuteChanged();
|
||||
}
|
||||
|
@@ -128,7 +128,7 @@
|
||||
<MenuFlyoutItem x:Uid="EntryItemCopyPassword">
|
||||
<interactivity:Interaction.Behaviors>
|
||||
<core:EventTriggerBehavior EventName="Click">
|
||||
<actions:ClipboardAction Text="{Binding Password}" />
|
||||
<actions:ClipboardAction Text="{Binding Password}" IsProtected="True" />
|
||||
<actions:ToastAction x:Uid="ToastCopyPassword" Title="{Binding Title}" />
|
||||
</core:EventTriggerBehavior>
|
||||
</interactivity:Interaction.Behaviors>
|
||||
|
@@ -1,8 +1 @@
|
||||
Support for additional fields
|
||||
Support for attachments
|
||||
Add an expiration timer for clipboard data
|
||||
Ability to manually reorder groups
|
||||
Ability to set max history count and size
|
||||
Design changes
|
||||
Update to KeePassLib version 2.45
|
||||
Bug corrections
|
||||
Data is now protected in memory as well as at rest
|
@@ -1,8 +1 @@
|
||||
Ajout des champs additionnels
|
||||
Ajout des pi<70>ces-jointes
|
||||
Ajout d'une expiration du presse papier
|
||||
Possibilite de reorganiser les groupes manuellement
|
||||
Possibilite de parametrer le nombre max et la taille de l'historique
|
||||
Quelques changements de design
|
||||
Mise a jour de la KeePassLib version 2.45
|
||||
Correction de bugs
|
||||
Protection des donnees en memoire en plus du chiffrement de la base de donnees
|
Reference in New Issue
Block a user