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