mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 23:50:18 -04:00
Argon2KDF write mode works! (thanks to an option in XMLWriterSettings)
This commit is contained in:
@@ -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