Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix warnings in unit test #176

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/BCrypt.Net.UnitTests/BCryptTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ public void GithubIssue119_WoltLabForumPHPDoubleBcrypt()
const string salt = "$2y$07$BCryptRequires22Chrcte"; // used as a fixed salt in the php code as per the behaviour

// Password hash created through being passed via bcrypt once (This Should Fail)
const string passwordHashOneRound = "$2y$07$BCryptRequires22Chrctet7rDxl8RPE0hiH8EeV/YklkNceXZOjm";
var hash = BCrypt.HashPassword(BCrypt.HashPassword(pass, salt), salt);

Assert.True(HashParser.IsValidHash(hash, out _));
Expand All @@ -162,7 +161,7 @@ public void GithubIssue119_WoltLabForumPHPDoubleBcrypt()
Assert.False(BCrypt.Verify(pass, passwordHashTwoRound));

// This will pass, but is open to timing attacks (Taken from sample in https://github.com/BcryptNet/bcrypt.net/issues/119)
Assert.True(string.Equals(passwordHashTwoRound, doubleBcryptSaltGiven));
Assert.Equal(passwordHashTwoRound, doubleBcryptSaltGiven);

// This will pass and effectively behaves the same as WCF
Assert.True(BCrypt.Verify(BCrypt.HashPassword(pass, passwordHashTwoRound), passwordHashTwoRound));
Expand Down