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
e05b7e9d
Commit
e05b7e9d
authored
Sep 25, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OMEMO fixes for Edge.
parent
bf76b3b4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
2 deletions
+23
-2
CHANGES.md
CHANGES.md
+1
-0
dist/converse.js
dist/converse.js
+10
-1
src/converse-omemo.js
src/converse-omemo.js
+12
-1
No files found.
CHANGES.md
View file @
e05b7e9d
...
...
@@ -3,6 +3,7 @@
## 4.0.2 (Unreleased)
-
M4A and WEBM files when sent as XEP-0066 Out of Band Data, are now playable directly in chat
-
OMEMO fixes for Edge.
-
#1220 Converse not working in Edge
## 4.0.1 (2018-09-19)
...
...
dist/converse.js
View file @
e05b7e9d
...
...
@@ -72889,11 +72889,19 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
async encryptMessage(plaintext) {
// The client MUST use fresh, randomly generated key/IV pairs
// with AES-128 in Galois/Counter Mode (GCM).
const iv = crypto.getRandomValues(new window.Uint8Array(16)),
// For GCM a 12 byte IV is strongly suggested as other IV lengths
// will require additional calculations. In principle any IV size
// can be used as long as the IV doesn't ever repeat. NIST however
// suggests that only an IV size of 12 bytes needs to be supported
// by implementations.
//
// https://crypto.stackexchange.com/questions/26783/ciphertext-and-tag-size-and-iv-transmission-with-aes-in-gcm-mode
const iv = crypto.getRandomValues(new window.Uint8Array(12)),
key = await crypto.subtle.generateKey(KEY_ALGO, true, ["encrypt", "decrypt"]),
algo = {
'name': 'AES-GCM',
'iv': iv,
'additionalData': new Uint8Array(1),
'tagLength': TAG_LENGTH
},
encrypted = await crypto.subtle.encrypt(algo, key, u.stringToArrayBuffer(plaintext)),
...
...
@@ -72916,6 +72924,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
algo = {
'name': "AES-GCM",
'iv': u.base64ToArrayBuffer(obj.iv),
'additionalData': new Uint8Array(1),
'tagLength': TAG_LENGTH
};
return u.arrayBufferToString((await crypto.subtle.decrypt(algo, key_obj, cipher)));
src/converse-omemo.js
View file @
e05b7e9d
...
...
@@ -204,11 +204,21 @@
async
encryptMessage
(
plaintext
)
{
// The client MUST use fresh, randomly generated key/IV pairs
// with AES-128 in Galois/Counter Mode (GCM).
const
iv
=
crypto
.
getRandomValues
(
new
window
.
Uint8Array
(
16
)),
// For GCM a 12 byte IV is strongly suggested as other IV lengths
// will require additional calculations. In principle any IV size
// can be used as long as the IV doesn't ever repeat. NIST however
// suggests that only an IV size of 12 bytes needs to be supported
// by implementations.
//
// https://crypto.stackexchange.com/questions/26783/ciphertext-and-tag-size-and-iv-transmission-with-aes-in-gcm-mode
const
iv
=
crypto
.
getRandomValues
(
new
window
.
Uint8Array
(
12
)),
key
=
await
crypto
.
subtle
.
generateKey
(
KEY_ALGO
,
true
,
[
"
encrypt
"
,
"
decrypt
"
]),
algo
=
{
'
name
'
:
'
AES-GCM
'
,
'
iv
'
:
iv
,
'
additionalData
'
:
new
Uint8Array
(
1
),
'
tagLength
'
:
TAG_LENGTH
},
encrypted
=
await
crypto
.
subtle
.
encrypt
(
algo
,
key
,
u
.
stringToArrayBuffer
(
plaintext
)),
...
...
@@ -232,6 +242,7 @@
algo
=
{
'
name
'
:
"
AES-GCM
"
,
'
iv
'
:
u
.
base64ToArrayBuffer
(
obj
.
iv
),
'
additionalData
'
:
new
Uint8Array
(
1
),
'
tagLength
'
:
TAG_LENGTH
}
return
u
.
arrayBufferToString
(
await
crypto
.
subtle
.
decrypt
(
algo
,
key_obj
,
cipher
));
...
...
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