Commit 0f2f7a2c authored by Romain Courteaud's avatar Romain Courteaud

CryptStorage: catch decrypt exception

parent d9d5519b
......@@ -149,6 +149,8 @@
coded = coded.currentTarget.result;
initializaton_vector = new Uint8Array(coded.slice(0, 12));
return new RSVP.Queue()
.push(function () {
return crypto.subtle.decrypt({
name : "AES-GCM",
iv : initializaton_vector
......@@ -158,14 +160,14 @@
.push(function (arr) {
//arraybuffer->string
arr = String.fromCharCode.apply(null, new Uint8Array(arr));
try {
return jIO.util.dataURItoBlob(arr);
} catch (error) {
})
.push(undefined, function (error) {
if (error instanceof DOMException) {
return blob;
}
throw error;
}
});
});
});
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment