mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 23:50:18 -04:00
WIP sqving - removed some useless async await
This commit is contained in:
@@ -57,7 +57,7 @@ namespace ModernKeePassLib.Serialization
|
||||
IOConnectionInfo ioc = IOConnectionInfo.FromPath(strFilePath);
|
||||
IOConnection ioConnection = new IOConnection();
|
||||
Stream abc = await ioConnection.OpenRead(ioc);
|
||||
await Load(abc, kdbFormat, slLogger);
|
||||
Load(abc, kdbFormat, slLogger);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -67,7 +67,7 @@ namespace ModernKeePassLib.Serialization
|
||||
/// a KDB4 stream.</param>
|
||||
/// <param name="kdbFormat">Format specifier.</param>
|
||||
/// <param name="slLogger">Status logger (optional).</param>
|
||||
public async Task Load(Stream sSource, Kdb4Format kdbFormat, IStatusLogger slLogger)
|
||||
public void Load(Stream sSource, Kdb4Format kdbFormat, IStatusLogger slLogger)
|
||||
{
|
||||
|
||||
Debug.Assert(sSource != null);
|
||||
@@ -90,7 +90,7 @@ namespace ModernKeePassLib.Serialization
|
||||
br = new BinaryReaderEx(hashedStream, encNoBom, KLRes.FileCorrupted);
|
||||
ReadHeader(br);
|
||||
|
||||
Stream sDecrypted = await AttachStreamDecryptor(hashedStream);
|
||||
Stream sDecrypted = AttachStreamDecryptor(hashedStream);
|
||||
if((sDecrypted == null) || (sDecrypted == hashedStream))
|
||||
throw new SecurityException(KLRes.CryptoStreamFailed);
|
||||
|
||||
@@ -312,7 +312,7 @@ namespace ModernKeePassLib.Serialization
|
||||
m_craInnerRandomStream = (CrsAlgorithm)uID;
|
||||
}
|
||||
|
||||
private async Task<Stream> AttachStreamDecryptor(Stream s)
|
||||
private Stream AttachStreamDecryptor(Stream s)
|
||||
{
|
||||
MemoryStream ms = new MemoryStream();
|
||||
|
||||
@@ -321,7 +321,7 @@ namespace ModernKeePassLib.Serialization
|
||||
throw new FormatException(KLRes.MasterSeedLengthInvalid);
|
||||
ms.Write(m_pbMasterSeed, 0, 32);
|
||||
|
||||
Security.ProtectedBinary pb = await m_pwDatabase.MasterKey.GenerateKey32(m_pbTransformSeed,
|
||||
Security.ProtectedBinary pb = m_pwDatabase.MasterKey.GenerateKey32(m_pbTransformSeed,
|
||||
m_pwDatabase.KeyEncryptionRounds);
|
||||
|
||||
byte[] pKey32 = pb.ReadData();
|
||||
|
@@ -71,7 +71,7 @@ namespace ModernKeePassLib.Serialization
|
||||
/// be written.</param>
|
||||
/// <param name="format">Format of the file to create.</param>
|
||||
/// <param name="slLogger">Logger that recieves status information.</param>
|
||||
public async void Save(Stream sSaveTo, PwGroup pgDataSource, Kdb4Format format,
|
||||
public void Save(Stream sSaveTo, PwGroup pgDataSource, Kdb4Format format,
|
||||
IStatusLogger slLogger)
|
||||
{
|
||||
Debug.Assert(sSaveTo != null);
|
||||
@@ -105,7 +105,7 @@ namespace ModernKeePassLib.Serialization
|
||||
bw = new BinaryWriter(hashedStream, encNoBom);
|
||||
WriteHeader(bw); // Also flushes bw
|
||||
|
||||
Stream sEncrypted = await AttachStreamEncryptor(hashedStream);
|
||||
Stream sEncrypted = AttachStreamEncryptor(hashedStream);
|
||||
if((sEncrypted == null) || (sEncrypted == hashedStream))
|
||||
throw new SecurityException(KLRes.CryptoStreamFailed);
|
||||
|
||||
@@ -193,18 +193,17 @@ namespace ModernKeePassLib.Serialization
|
||||
else bwOut.Write((ushort)0);
|
||||
}
|
||||
|
||||
private async Task<Stream> AttachStreamEncryptor(Stream s)
|
||||
private Stream AttachStreamEncryptor(Stream s)
|
||||
{
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
|
||||
Debug.Assert(m_pbMasterSeed != null);
|
||||
Debug.Assert(m_pbMasterSeed.Length == 32);
|
||||
ms.Write(m_pbMasterSeed, 0, 32);
|
||||
|
||||
Debug.Assert(m_pwDatabase != null);
|
||||
Debug.Assert(m_pwDatabase.MasterKey != null);
|
||||
ProtectedBinary pbinKey = await m_pwDatabase.MasterKey.GenerateKey32(
|
||||
ProtectedBinary pbinKey = m_pwDatabase.MasterKey.GenerateKey32(
|
||||
m_pbTransformSeed, m_pwDatabase.KeyEncryptionRounds);
|
||||
Debug.Assert(pbinKey != null);
|
||||
if (pbinKey == null)
|
||||
|
Reference in New Issue
Block a user