Comparison

plugins/mod_storage_xep0227.lua @ 11840:5e9e75c277a2

mod_storage_xep0227: Add scram-credentials to user element rather than server
author Matthew Wild <mwild1@gmail.com>
date Wed, 22 Sep 2021 16:16:30 +0100
parent 11789:f3085620b6ff
child 12082:e87563fefd85
comparison
equal deleted inserted replaced
11839:19b50ce9ef5a 11840:5e9e75c277a2
137 local scram_el = st.stanza("scram-credentials", { xmlns = "urn:xmpp:pie:0#scram", mechanism = "SCRAM-"..scram_hash_name }) 137 local scram_el = st.stanza("scram-credentials", { xmlns = "urn:xmpp:pie:0#scram", mechanism = "SCRAM-"..scram_hash_name })
138 :text_tag("server-key", hex_to_base64(data.server_key)) 138 :text_tag("server-key", hex_to_base64(data.server_key))
139 :text_tag("stored-key", hex_to_base64(data.stored_key)) 139 :text_tag("stored-key", hex_to_base64(data.stored_key))
140 :text_tag("iter-count", ("%d"):format(data.iteration_count)) 140 :text_tag("iter-count", ("%d"):format(data.iteration_count))
141 :text_tag("salt", base64.encode(data.salt)); 141 :text_tag("salt", base64.encode(data.salt));
142 xml:add_child(scram_el); 142 usere:add_child(scram_el);
143 account_properties:exclude(scram_properties); 143 account_properties:exclude(scram_properties);
144 end 144 end
145 145
146 -- Include the password if present 146 -- Include the password if present
147 if account_properties:contains("password") then 147 if account_properties:contains("password") then