Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
bd1fd7ee
Commit
bd1fd7ee
authored
Aug 31, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Key should be AES-128, not AES-256
parent
c2f1b254
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
12 deletions
+9
-12
dist/converse.js
dist/converse.js
+4
-6
src/converse-omemo.js
src/converse-omemo.js
+5
-6
No files found.
dist/converse.js
View file @
bd1fd7ee
...
...
@@ -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": "A
256
GCM",
"alg": "A
128
GCM",
"ext": true,
"k": obj.key,
"key_ops": ["encrypt", "decrypt"],
src/converse-omemo.js
View file @
bd1fd7ee
...
...
@@ -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
"
:
"
A
256
GCM
"
,
"
alg
"
:
"
A
128
GCM
"
,
"
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
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment