Software /
code /
prosody-modules
Comparison
mod_cloud_notify_encrypted/mod_cloud_notify_encrypted.lua @ 4457:091d06c7d724
mod_cloud_notify_encrypted: Fix traceback (incorrect variable name)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 22 Feb 2021 13:45:29 +0000 |
parent | 4456:8ed1989e99f9 |
child | 4465:2a7a76712e71 |
comparison
equal
deleted
inserted
replaced
4456:8ed1989e99f9 | 4457:091d06c7d724 |
---|---|
103 -- Siskin does not validate the tag anyway. | 103 -- Siskin does not validate the tag anyway. |
104 local encrypted_payload = base64.encode(ciphers.new("AES-128-GCM"):encrypt(key_binary, iv):final(push_json)..string.rep("\0", 16)); | 104 local encrypted_payload = base64.encode(ciphers.new("AES-128-GCM"):encrypt(key_binary, iv):final(push_json)..string.rep("\0", 16)); |
105 local encrypted_element = st.stanza("encrypted", { xmlns = xmlns_push_encrypt, iv = base64.encode(iv) }) | 105 local encrypted_element = st.stanza("encrypted", { xmlns = xmlns_push_encrypt, iv = base64.encode(iv) }) |
106 :text(encrypted_payload); | 106 :text(encrypted_payload); |
107 if push_payload.type == "call" then | 107 if push_payload.type == "call" then |
108 encrypted_payload.attr.type = "voip"; | 108 encrypted_element.attr.type = "voip"; |
109 event.important = true; | 109 event.important = true; |
110 end | 110 end |
111 -- Replace the unencrypted notification data with the encrypted one | 111 -- Replace the unencrypted notification data with the encrypted one |
112 event.notification_payload | 112 event.notification_payload |
113 :remove_children("x", "jabber:x:data") | 113 :remove_children("x", "jabber:x:data") |