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
1a2e7b23
Commit
1a2e7b23
authored
Mar 30, 2019
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OMEMO bugfix. Store prekey as boolean and handle '1' and 'true'
parent
1dfdb36d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
dev.html
dev.html
+1
-1
dist/converse.js
dist/converse.js
+2
-2
src/converse-omemo.js
src/converse-omemo.js
+2
-2
No files found.
dev.html
View file @
1a2e7b23
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
<meta
name=
"keywords"
content=
"xmpp chat webchat converse.js"
/>
<meta
name=
"keywords"
content=
"xmpp chat webchat converse.js"
/>
<link
rel=
"shortcut icon"
type=
"image/ico"
href=
"css/images/favicon.ico"
/>
<link
rel=
"shortcut icon"
type=
"image/ico"
href=
"css/images/favicon.ico"
/>
<link
type=
"text/css"
rel=
"stylesheet"
media=
"screen"
href=
"css/converse.css"
/>
<link
type=
"text/css"
rel=
"stylesheet"
media=
"screen"
href=
"css/converse.css"
/>
<script
src=
"3rdparty/libsignal-protocol
-javascript/dist/libsignal-protocol
.js"
></script>
<script
src=
"3rdparty/libsignal-protocol.js"
></script>
<script
src=
"dist/converse.js"
></script>
<script
src=
"dist/converse.js"
></script>
</head>
</head>
...
...
dist/converse.js
View file @
1a2e7b23
...
@@ -56280,7 +56280,7 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins
...
@@ -56280,7 +56280,7 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins
const _converse = this.__super__._converse,
const _converse = this.__super__._converse,
session_cipher = this.getSessionCipher(attrs.from, parseInt(attrs.encrypted.device_id, 10)); // https://xmpp.org/extensions/xep-0384.html#usecases-receiving
session_cipher = this.getSessionCipher(attrs.from, parseInt(attrs.encrypted.device_id, 10)); // https://xmpp.org/extensions/xep-0384.html#usecases-receiving
if (attrs.encrypted.prekey ===
'true'
) {
if (attrs.encrypted.prekey ===
true
) {
let plaintext;
let plaintext;
return session_cipher.decryptPreKeyWhisperMessage(u.base64ToArrayBuffer(attrs.encrypted.key), 'binary').then(key_and_tag => {
return session_cipher.decryptPreKeyWhisperMessage(u.base64ToArrayBuffer(attrs.encrypted.key), 'binary').then(key_and_tag => {
if (attrs.encrypted.payload) {
if (attrs.encrypted.payload) {
...
@@ -56340,7 +56340,7 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins
...
@@ -56340,7 +56340,7 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins
'iv': header.querySelector('iv').textContent,
'iv': header.querySelector('iv').textContent,
'key': key.textContent,
'key': key.textContent,
'payload': _.get(encrypted.querySelector('payload'), 'textContent', null),
'payload': _.get(encrypted.querySelector('payload'), 'textContent', null),
'prekey':
key.getAttribute('prekey'
)
'prekey':
_.includes(['true', '1'], key.getAttribute('prekey')
)
};
};
return this.decrypt(attrs);
return this.decrypt(attrs);
} else {
} else {
src/converse-omemo.js
View file @
1a2e7b23
...
@@ -234,7 +234,7 @@ converse.plugins.add('converse-omemo', {
...
@@ -234,7 +234,7 @@ converse.plugins.add('converse-omemo', {
session_cipher
=
this
.
getSessionCipher
(
attrs
.
from
,
parseInt
(
attrs
.
encrypted
.
device_id
,
10
));
session_cipher
=
this
.
getSessionCipher
(
attrs
.
from
,
parseInt
(
attrs
.
encrypted
.
device_id
,
10
));
// https://xmpp.org/extensions/xep-0384.html#usecases-receiving
// https://xmpp.org/extensions/xep-0384.html#usecases-receiving
if
(
attrs
.
encrypted
.
prekey
===
'
true
'
)
{
if
(
attrs
.
encrypted
.
prekey
===
true
)
{
let
plaintext
;
let
plaintext
;
return
session_cipher
.
decryptPreKeyWhisperMessage
(
u
.
base64ToArrayBuffer
(
attrs
.
encrypted
.
key
),
'
binary
'
)
return
session_cipher
.
decryptPreKeyWhisperMessage
(
u
.
base64ToArrayBuffer
(
attrs
.
encrypted
.
key
),
'
binary
'
)
.
then
(
key_and_tag
=>
{
.
then
(
key_and_tag
=>
{
...
@@ -284,7 +284,7 @@ converse.plugins.add('converse-omemo', {
...
@@ -284,7 +284,7 @@ converse.plugins.add('converse-omemo', {
'
iv
'
:
header
.
querySelector
(
'
iv
'
).
textContent
,
'
iv
'
:
header
.
querySelector
(
'
iv
'
).
textContent
,
'
key
'
:
key
.
textContent
,
'
key
'
:
key
.
textContent
,
'
payload
'
:
_
.
get
(
encrypted
.
querySelector
(
'
payload
'
),
'
textContent
'
,
null
),
'
payload
'
:
_
.
get
(
encrypted
.
querySelector
(
'
payload
'
),
'
textContent
'
,
null
),
'
prekey
'
:
key
.
getAttribute
(
'
prekey
'
)
'
prekey
'
:
_
.
includes
([
'
true
'
,
'
1
'
],
key
.
getAttribute
(
'
prekey
'
)
)
}
}
return
this
.
decrypt
(
attrs
);
return
this
.
decrypt
(
attrs
);
}
else
{
}
else
{
...
...
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