Commit bd1fd7ee authored by JC Brand's avatar JC Brand

Key should be AES-128, not AES-256

parent c2f1b254
......@@ -71600,7 +71600,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
const TAG_LENGTH = 128;
const KEY_ALGO = {
'name': "AES-GCM",
'length': 256
'length': 128
};
function parseBundle(bundle_el) {
......@@ -71771,17 +71771,15 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
getKeyAndTag(string) {
return {
'key': string.slice(0, 43),
// 256bit key
'tag': string.slice(43, string.length) // rest is tag
'key': string.slice(0, 22),
'tag': string.slice(22)
};
},
decryptMessage(obj) {
const _converse = this.__super__._converse,
key_obj = {
"alg": "A256GCM",
"alg": "A128GCM",
"ext": true,
"k": obj.key,
"key_ops": ["encrypt", "decrypt"],
......@@ -28,7 +28,7 @@
const TAG_LENGTH = 128;
const KEY_ALGO = {
'name': "AES-GCM",
'length': 256
'length': 128
};
......@@ -203,15 +203,15 @@
getKeyAndTag (string) {
return {
'key': string.slice(0, 43), // 256bit key
'tag': string.slice(43, string.length) // rest is tag
'key': string.slice(0, 22),
'tag': string.slice(22)
}
},
decryptMessage (obj) {
const { _converse } = this.__super__,
key_obj = {
"alg": "A256GCM",
"alg": "A128GCM",
"ext": true,
"k": obj.key,
"key_ops": ["encrypt","decrypt"],
......@@ -222,7 +222,7 @@
const algo = {
'name': "AES-GCM",
'iv': u.base64ToArrayBuffer(obj.iv),
'tagLength': TAG_LENGTH
'tagLength': TAG_LENGTH
}
return window.crypto.subtle.decrypt(algo, key_obj, u.base64ToArrayBuffer(obj.payload));
}).then(out => (new TextDecoder()).decode(out));
......@@ -435,7 +435,6 @@
});
_converse.log(e, Strophe.LogLevel.ERROR);
});
} else {
return this.__super__.sendMessage.apply(this, arguments);
}
......
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