Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Not working
I implemented the WSSE token in Symfony 2 using *SHA512* algorithm *WITH* salt. Because bcrypt, without specifying the salt, generates one every time encodes a password, the hash_equals at the end of the AuthenticationProvider won't return TRUE ever. That's because a client encodes the password without a salt, generating a different hash stored in the database. When comparing ONLY these hashes, the password validates. But when concatenating with nonce, created and encode/decoding base64, the hashed won't match: $expected = base64_encode(sha1(base64_decode($nonce).$created.$secret, true)); So the salt it should be mentioned in the article.
  • Loading branch information
sergiu-popa authored Dec 20, 2017
commit c57dc9de60a5b7e2a9fbfb4b437a9742524aa7d3
1 change: 1 addition & 0 deletions security/custom_authentication_provider.rst
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ the ``PasswordDigest`` header value matches with the user's password::
$expected = base64_encode(sha1(base64_decode($nonce).$created.$secret, true));

return hash_equals($expected, $digest);
# this won't return TRUE ever
}

public function supports(TokenInterface $token)
Expand Down