mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-21 00:52:33 -04:00
check for sodium in decrypt function
This commit is contained in:
@@ -50,6 +50,10 @@ async function sodium_encrypt(element) {
|
||||
}
|
||||
|
||||
async function sodium_decrypt(payload, element) {
|
||||
if (!window.sodium) {
|
||||
window.sodium = await SodiumPlus.auto();
|
||||
}
|
||||
|
||||
let arr = JSON.parse(window.atob(payload));
|
||||
|
||||
if (arr.alg !== 'XSalsa20') {
|
||||
|
||||
Reference in New Issue
Block a user