Skip to content

Commit

Permalink
Merge branch 'master' into fix-url-domain-retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-schofield committed Apr 10, 2017
2 parents 3eff8d9 + c65eb4d commit fd249fa
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 6 deletions.
Binary file modified HaveIBeenPwned.plgx
Binary file not shown.
3 changes: 2 additions & 1 deletion HaveIBeenPwned/HaveIBeenPwned.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@
<Compile Include="HaveIBeenPwnedExt.cs" />
<Compile Include="IBreach.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="PwEntryExtension.cs" />
<Compile Include="ProtectedStringExtensions.cs" />
<Compile Include="PwEntryExtensions.cs" />
<Compile Include="Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
Expand Down
4 changes: 2 additions & 2 deletions HaveIBeenPwned/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// 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("0.2.8.1")]
[assembly: AssemblyFileVersion("0.2.8.1")]
[assembly: AssemblyVersion("0.2.9")]
[assembly: AssemblyFileVersion("0.2.9")]
25 changes: 25 additions & 0 deletions HaveIBeenPwned/ProtectedStringExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using KeePassLib.Security;
using KeePassLib.Utility;

namespace HaveIBeenPwned
{
public static class ProtectedStringExtensions
{
public static bool Equals(this ProtectedString protectedString, ProtectedString compareWith)
{
// extract the unencrypted strings
byte[] string1 = protectedString.ReadUtf8();
byte[] string2 = compareWith.ReadUtf8();

// compare the results
var result = string1 == string2;

// clean up the byte arrays so we don't leak data
MemUtil.ZeroByteArray(string1);
MemUtil.ZeroByteArray(string2);

// finally return the result
return result;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace HaveIBeenPwned
{
public static class PwEntryExtension
public static class PwEntryExtensions
{
public static DateTime GetPasswordLastModified(this PwEntry entry)
{
Expand All @@ -14,7 +14,7 @@ public static DateTime GetPasswordLastModified(this PwEntry entry)
var sortedEntries = entry.History.OrderByDescending(h => h.LastModificationTime);
foreach (var historyEntry in sortedEntries)
{
if (entry.Strings.GetSafe(PwDefs.PasswordField).ReadString() != historyEntry.Strings.GetSafe(PwDefs.PasswordField).ReadString())
if(!entry.Strings.GetSafe(PwDefs.PasswordField).Equals(historyEntry.Strings.GetSafe(PwDefs.PasswordField)))
{
return historyEntry.LastModificationTime;
}
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
:
HaveIBeenPwned checker:0.2.8.1
HaveIBeenPwned checker:0.2.9
:
Binary file modified mono/HaveIBeenPwned.dll
Binary file not shown.

0 comments on commit fd249fa

Please sign in to comment.