Software /
code /
prosody
Diff
util/sasl/scram.lua @ 10912:646af16a3f32 0.11
util.sasl.scram: Apply saslprep before hashing password, fixes #1560
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 22 May 2020 20:59:01 +0200 |
parent | 8728:41c959c5c84b |
child | 10916:c7ed8f754033 |
line wrap: on
line diff
--- a/util/sasl/scram.lua Fri May 15 21:22:35 2020 +0200 +++ b/util/sasl/scram.lua Fri May 22 20:59:01 2020 +0200 @@ -106,6 +106,10 @@ if iteration_count < 4096 then log("warn", "Iteration count < 4096 which is the suggested minimum according to RFC 5802.") end + password = saslprep(password); + if not password then + return false, "password fails SASLprep"; + end local salted_password = Hi(password, salt, iteration_count); local stored_key = sha1(hmac_sha1(salted_password, "Client Key")) local server_key = hmac_sha1(salted_password, "Server Key");