Hashblockstream test now works

This commit is contained in:
2017-10-23 11:44:22 +02:00
committed by BONNEVILLE Geoffroy
parent 8c09d266e8
commit 2bbd931b1a
6 changed files with 24 additions and 22 deletions

View File

@@ -326,6 +326,6 @@
</UserControl.Resources>
<StackPanel>
<PasswordBox x:Name="PasswordBox" Password="{Binding Password, ElementName=UserControl, Mode=TwoWay}" Width="300" IsPasswordRevealButtonEnabled="True" KeyDown="PasswordBox_KeyDown" PlaceholderText="Password" Style="{StaticResource PasswordBoxWithButtonStyle}"/>
<TextBlock x:Name="StatusTextBlock" Height="32" Width="auto" Foreground="#FFBF6969" FontSize="16" FontWeight="Bold" />
<TextBlock x:Name="StatusTextBlock" Margin="20,0" Height="28" Foreground="#FFBF6969" FontSize="14" FontWeight="SemiBold" TextWrapping="WrapWholeWords" />
</StackPanel>
</UserControl>

View File

@@ -253,8 +253,8 @@
<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.1000, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ModernKeePassLib.2.37.1000\lib\netstandard1.2\ModernKeePassLib.dll</HintPath>
<Reference Include="ModernKeePassLib, Version=2.37.0.2000, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ModernKeePassLib.2.37.2000\lib\netstandard1.2\ModernKeePassLib.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Splat, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
@@ -321,15 +321,15 @@
<VisualStudioVersion>12.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<Import Project="..\packages\NETStandard.Library.2.0.0\build\NETStandard.Library.targets" Condition="Exists('..\packages\NETStandard.Library.2.0.0\build\NETStandard.Library.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\NETStandard.Library.2.0.0\build\NETStandard.Library.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NETStandard.Library.2.0.0\build\NETStandard.Library.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets'))" />
<Error Condition="!Exists('..\packages\NETStandard.Library.2.0.1\build\NETStandard.Library.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NETStandard.Library.2.0.1\build\NETStandard.Library.targets'))" />
</Target>
<Import Project="..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" />
<Import Project="..\packages\NETStandard.Library.2.0.1\build\NETStandard.Library.targets" Condition="Exists('..\packages\NETStandard.Library.2.0.1\build\NETStandard.Library.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">

View File

@@ -3,25 +3,25 @@
<package id="Microsoft.NETCore.Platforms" version="2.0.0" targetFramework="win81" />
<package id="Microsoft.NETCore.Portable.Compatibility" version="1.0.2" targetFramework="win81" />
<package id="Microsoft.Toolkit.Uwp.Notifications" version="2.0.0" targetFramework="win81" />
<package id="ModernKeePassLib" version="2.37.1000" targetFramework="win81" />
<package id="NETStandard.Library" version="2.0.0" targetFramework="win81" />
<package id="ModernKeePassLib" version="2.37.2000" targetFramework="win81" />
<package id="NETStandard.Library" version="2.0.1" targetFramework="win81" />
<package id="Portable.BouncyCastle" version="1.8.1.3" targetFramework="win81" />
<package id="Splat" version="2.0.0" targetFramework="win81" />
<package id="System.Collections" version="4.0.11" targetFramework="win81" />
<package id="System.Diagnostics.Debug" version="4.0.11" targetFramework="win81" />
<package id="System.Globalization" version="4.0.11" targetFramework="win81" />
<package id="System.IO" version="4.1.0" targetFramework="win81" />
<package id="System.Linq" version="4.1.0" targetFramework="win81" />
<package id="System.Collections" version="4.3.0" targetFramework="win81" />
<package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="win81" />
<package id="System.Globalization" version="4.3.0" targetFramework="win81" />
<package id="System.IO" version="4.3.0" targetFramework="win81" />
<package id="System.Linq" version="4.3.0" targetFramework="win81" />
<package id="System.Net.Requests" version="4.3.0" targetFramework="win81" />
<package id="System.Reflection" version="4.1.0" targetFramework="win81" />
<package id="System.Reflection.Extensions" version="4.0.1" targetFramework="win81" />
<package id="System.Runtime" version="4.1.0" targetFramework="win81" />
<package id="System.Reflection" version="4.3.0" targetFramework="win81" />
<package id="System.Reflection.Extensions" version="4.3.0" targetFramework="win81" />
<package id="System.Runtime" version="4.3.0" targetFramework="win81" />
<package id="System.Runtime.Extensions" version="4.3.0" targetFramework="win81" />
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="win81" />
<package id="System.Runtime.WindowsRuntime" version="4.3.0" targetFramework="win81" />
<package id="System.Text.Encoding" version="4.0.11" targetFramework="win81" />
<package id="System.Threading" version="4.0.11" targetFramework="win81" />
<package id="System.Threading.Tasks" version="4.0.11" targetFramework="win81" />
<package id="System.Text.Encoding" version="4.3.0" targetFramework="win81" />
<package id="System.Threading" version="4.3.0" targetFramework="win81" />
<package id="System.Threading.Tasks" version="4.3.0" targetFramework="win81" />
<package id="System.Xml.ReaderWriter" version="4.3.0" targetFramework="win81" />
<package id="System.Xml.XmlSerializer" version="4.3.0" targetFramework="win81" />
<package id="Validation" version="2.4.15" targetFramework="win81" />

View File

@@ -25,6 +25,7 @@ namespace ModernKeePassLib.Test.Shared.Utility
{
var testData = Convert.FromBase64String (testImageData);
var image = GfxUtil.ScaleImage(testData, 16, 16).GetAwaiter().GetResult();
//var image = GfxUtil.LoadImage(testData);
Assert.That (image.Width, Is.EqualTo (16));
Assert.That (image.Height, Is.EqualTo (16));
}

View File

@@ -2,7 +2,7 @@
<package >
<metadata>
<id>ModernKeePassLib</id>
<version>2.37.2000</version>
<version>2.37.3000</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</description>
<releaseNotes>This version compiles - tests in progress</releaseNotes>
<releaseNotes>Hashblockstream write works - now tests results on par with 2.28</releaseNotes>
<copyright>Copyright © 2017 Geoffroy Bonneville</copyright>
<tags>KeePass KeePassLib Portable PCL NetStandard</tags>
<dependencies>

View File

@@ -1,6 +1,6 @@
/*
KeePass Password Safe - The Open-Source Password Manager
Copyright (C) 2003-2014 Dominik Reichl <dominik.reichl@t-online.de>
Copyright (C) 2003-2017 Dominik Reichl <dominik.reichl@t-online.de>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,6 +20,7 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
#if ModernKeePassLib
using ModernKeePassLib.Native;
@@ -282,7 +283,7 @@ namespace ModernKeePassLib.Serialization
if(m_nBufferPos > 0)
{
byte[] pbHash = CryptoUtil.HashSha256(m_pbBuffer, 0, m_nBufferPos);
byte[] pbHash = CryptoUtil.HashSha256(m_pbBuffer.Where((x, i) => i < m_nBufferPos).ToArray(), 0, m_nBufferPos);
// For KeePassLibSD:
// SHA256Managed sha256 = new SHA256Managed();