Skip to content

Commit

Permalink
Merge pull request #4 from robdavid/bugfix/digest
Browse files Browse the repository at this point in the history
Bugfix/digest. Thanks to @robdavid
  • Loading branch information
naqvis authored Mar 21, 2021
2 parents 31ca429 + e53b12c commit 8635a0a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ config = XMPP::Config.new(
sasl_auth_order: [XMPP::AuthMechanism::SCRAM_SHA_512, XMPP::AuthMechanism::SCRAM_SHA_256,
XMPP::AuthMechanism::SCRAM_SHA_1, XMPP::AuthMechanism::DIGEST_MD5,
XMPP::AuthMechanism::PLAIN, XMPP::AuthMechanism::ANONYMOUS]
)

router = XMPP::Router.new

Expand Down
2 changes: 1 addition & 1 deletion src/xmpp/auth/scram-sha.cr
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ module XMPP

# stored_key = OpenSSL::SHA1.hash(client_key.to_unsafe, LibC::SizeT.new(client_key.bytesize))
hasher.update(client_key)
stored_key = hasher.digest
stored_key = hasher.final

auth_msg = "#{initial_msg},#{server_resp},#{bare_msg}"
client_sig = OpenSSL::HMAC.digest(algorithm: algorithm, key: stored_key, data: auth_msg)
Expand Down

0 comments on commit 8635a0a

Please sign in to comment.