mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Argon2KDF write mode works! (thanks to an option in XMLWriterSettings)
This commit is contained in:
@@ -124,7 +124,7 @@ namespace ModernKeePass.Common
|
||||
public void Save()
|
||||
{
|
||||
// TODO: Save is disabled for now for Argon2Kdf because it corrupts DB (read works)
|
||||
if (_pwDatabase == null || !_pwDatabase.IsOpen || KdfPool.Get(KeyDerivation.KdfUuid) is Argon2Kdf) return;
|
||||
if (_pwDatabase == null || !_pwDatabase.IsOpen /*|| KdfPool.Get(KeyDerivation.KdfUuid) is Argon2Kdf*/) return;
|
||||
_pwDatabase.Save(new NullStatusLogger());
|
||||
}
|
||||
|
||||
|
@@ -296,10 +296,6 @@
|
||||
<HintPath>..\packages\Microsoft.Toolkit.Uwp.Notifications.2.0.0\lib\dotnet\Microsoft.Toolkit.Uwp.Notifications.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="ModernKeePassLib, Version=2.37.0.2000, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ModernKeePassLib.2.37.5000\lib\netstandard1.2\ModernKeePassLib.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Splat, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Splat.2.0.0\lib\Portable-Win81+Wpa81\Splat.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
@@ -360,6 +356,12 @@
|
||||
<Content Include="Assets\Wide310x150Logo.scale-180.png" />
|
||||
<Content Include="Assets\Wide310x150Logo.scale-80.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ModernKeePassLib\ModernKeePassLib.csproj">
|
||||
<Project>{2e710089-9559-4967-846c-e763dd1f3acb}</Project>
|
||||
<Name>ModernKeePassLib</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '12.0' ">
|
||||
<VisualStudioVersion>12.0</VisualStudioVersion>
|
||||
</PropertyGroup>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest">
|
||||
<Identity Name="wismna.ModernKeePass" Publisher="CN=0719A91A-C322-4EE0-A257-E60733EECF06" Version="1.6.0.27" />
|
||||
<Identity Name="wismna.ModernKeePass" Publisher="CN=0719A91A-C322-4EE0-A257-E60733EECF06" Version="1.7.0.27" />
|
||||
<Properties>
|
||||
<DisplayName>ModernKeePass</DisplayName>
|
||||
<PublisherDisplayName>wismna</PublisherDisplayName>
|
||||
|
@@ -24,6 +24,6 @@
|
||||
<TextBlock Text="Compression Algorithm" FontSize="14" Margin="5,20,0,10" />
|
||||
<ComboBox ItemsSource="{Binding Source={StaticResource Compressions}}" SelectedItem="{Binding CompressionName, Mode=TwoWay}" />
|
||||
<TextBlock Text="Key Derivation Algorithm" FontSize="14" Margin="5,20,0,10" />
|
||||
<ComboBox ItemsSource="{Binding Source={StaticResource KeyDerivations}}" SelectedItem="{Binding KeyDerivationName, Mode=TwoWay}" IsEnabled="False" />
|
||||
<ComboBox ItemsSource="{Binding Source={StaticResource KeyDerivations}}" SelectedItem="{Binding KeyDerivationName, Mode=TwoWay}" />
|
||||
</StackPanel>
|
||||
</Page>
|
||||
|
@@ -24,6 +24,6 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.6.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.6.0.0")]
|
||||
[assembly: AssemblyVersion("1.7.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.7.0.0")]
|
||||
[assembly: ComVisible(false)]
|
@@ -2,7 +2,7 @@
|
||||
<package >
|
||||
<metadata>
|
||||
<id>ModernKeePassLib</id>
|
||||
<version>2.37.5000</version>
|
||||
<version>2.37.6000</version>
|
||||
<title>ModernKeePassLib</title>
|
||||
<authors>Geoffroy Bonneville</authors>
|
||||
<owners>Geoffroy Bonneville</owners>
|
||||
@@ -10,7 +10,7 @@
|
||||
<projectUrl>https://github.com/wismna/ModernKeePass</projectUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>Portable KeePass Password Management Library that targets .Net Standard and WinRT. Allows reading, editing and writing to KeePass 2.x databases.</description>
|
||||
<releaseNotes>KDBX 4 file format supported</releaseNotes>
|
||||
<releaseNotes>TBD</releaseNotes>
|
||||
<copyright>Copyright © 2017 Geoffroy Bonneville</copyright>
|
||||
<tags>KeePass KeePassLib Portable PCL NetStandard</tags>
|
||||
<dependencies>
|
||||
|
@@ -26,11 +26,8 @@ using System.IO;
|
||||
using System.Security;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
#if ModernKeePassLib
|
||||
using Windows.Security.Cryptography;
|
||||
using Windows.Security.Cryptography.Core;
|
||||
using Windows.Storage.Streams;
|
||||
#else
|
||||
|
||||
#if !ModernKeePassLib && !KeePassUAP
|
||||
using System.Security.Cryptography;
|
||||
#endif
|
||||
|
||||
@@ -40,15 +37,15 @@ using System.IO.Compression;
|
||||
using KeePassLibSD;
|
||||
#endif
|
||||
|
||||
using ModernKeePassLib.Collections;
|
||||
using ModernKeePassLib.Cryptography;
|
||||
using ModernKeePassLib.Cryptography.Cipher;
|
||||
using ModernKeePassLib.Cryptography.KeyDerivation;
|
||||
using ModernKeePassLib.Interfaces;
|
||||
using ModernKeePassLib.Keys;
|
||||
using ModernKeePassLib.Resources;
|
||||
using ModernKeePassLib.Utility;
|
||||
using ModernKeePassLib.Collections;
|
||||
using ModernKeePassLib.Cryptography.KeyDerivation;
|
||||
using ModernKeePassLib.Security;
|
||||
using ModernKeePassLib.Utility;
|
||||
|
||||
namespace ModernKeePassLib.Serialization
|
||||
{
|
||||
|
@@ -25,9 +25,8 @@ using System.IO;
|
||||
using System.Security;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
#if ModernKeePassLib
|
||||
using Windows.Security.Cryptography;
|
||||
#else
|
||||
|
||||
#if !ModernKeePassLib && !KeePassUAP
|
||||
using System.Drawing;
|
||||
using System.Security.Cryptography;
|
||||
#endif
|
||||
@@ -41,15 +40,13 @@ using System.IO.Compression;
|
||||
using ModernKeePassLib.Collections;
|
||||
using ModernKeePassLib.Cryptography;
|
||||
using ModernKeePassLib.Cryptography.Cipher;
|
||||
using ModernKeePassLib.Cryptography.KeyDerivation;
|
||||
using ModernKeePassLib.Delegates;
|
||||
using ModernKeePassLib.Interfaces;
|
||||
using ModernKeePassLib.Keys;
|
||||
using ModernKeePassLib.Resources;
|
||||
using ModernKeePassLib.Security;
|
||||
using ModernKeePassLib.Utility;
|
||||
using Windows.Security.Cryptography.Core;
|
||||
using Windows.Storage.Streams;
|
||||
using ModernKeePassLib.Cryptography.KeyDerivation;
|
||||
|
||||
namespace ModernKeePassLib.Serialization
|
||||
{
|
||||
@@ -212,8 +209,13 @@ namespace ModernKeePassLib.Serialization
|
||||
xws.Indent = true;
|
||||
xws.IndentChars = "\t";
|
||||
xws.NewLineOnAttributes = false;
|
||||
#if ModernKeePassLib
|
||||
// This is needed for Argon2Kdf write
|
||||
xws.Async = true;
|
||||
if (m_uFileVersion >= FileVersion32_4) xws.CloseOutput = true;
|
||||
#endif
|
||||
|
||||
XmlWriter xw = XmlWriter.Create(sXml, xws);
|
||||
XmlWriter xw = XmlWriter.Create(sXml, xws);
|
||||
#else
|
||||
XmlTextWriter xw = new XmlTextWriter(sXml, encNoBom);
|
||||
|
||||
|
@@ -519,8 +519,8 @@ namespace ModernKeePassLib.Serialization
|
||||
byte[] pbData = pb.ReadData();
|
||||
/*var file = FileSystem.Current.GetFileFromPathAsync(strPath).Result;
|
||||
using (var stream = file.OpenAsync(FileAccess.ReadAndWrite).Result) {*/
|
||||
var file = StorageFile.GetFileFromPathAsync(strPath).GetResults();
|
||||
using (var stream = file.OpenAsync(FileAccessMode.ReadWrite).GetResults().AsStream())
|
||||
var file = StorageFile.GetFileFromPathAsync(strPath).GetAwaiter().GetResult();
|
||||
using (var stream = file.OpenAsync(FileAccessMode.ReadWrite).GetAwaiter().GetResult().AsStream())
|
||||
{
|
||||
stream.Write (pbData, 0, pbData.Length);
|
||||
}
|
||||
|
Reference in New Issue
Block a user