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
490d96fd
Commit
490d96fd
authored
Nov 15, 2013
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't load the Crypto libraries if the browser doesn't have CSRNG
parent
5da32a59
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
3 deletions
+30
-3
CHANGES.rst
CHANGES.rst
+5
-0
converse.js
converse.js
+25
-3
No files found.
CHANGES.rst
View file @
490d96fd
Changelog
=========
0.7.1 (Unreleased)
------------------
* Don't load OTR crypto if the browser doesn't have a CSRNG [jcbrand]
0.7.0 (2013-11-13)
------------------
...
...
converse.js
View file @
490d96fd
...
...
@@ -12,7 +12,7 @@
console
=
{
log
:
function
()
{},
error
:
function
()
{}
};
}
if
(
typeof
define
===
'
function
'
&&
define
.
amd
)
{
define
(
"
converse
"
,
[
var
dependencies
=
[
"
crypto
"
,
"
otr
"
,
"
locales
"
,
...
...
@@ -23,13 +23,27 @@
"
strophe.roster
"
,
"
strophe.vcard
"
,
"
strophe.disco
"
],
function
(
CryptoJS
,
otr
)
{
];
if
((
typeof
crypto
===
'
undefined
'
)
||
(
(
typeof
crypto
.
randomBytes
!==
'
function
'
)
&&
(
typeof
crypto
.
getRandomValues
!==
'
function
'
)
))
{
// Don't load crypto stuff if the browser doesn't have a CSRNG
dependencies
.
splice
(
0
,
2
);
}
define
(
"
converse
"
,
dependencies
,
function
(
CryptoJS
,
otr
)
{
// Use Mustache style syntax for variable interpolation
_
.
templateSettings
=
{
evaluate
:
/
\{\[([\s\S]
+
?)\]\}
/g
,
interpolate
:
/
\{\{([\s\S]
+
?)\}\}
/g
};
return
factory
(
jQuery
,
_
,
CryptoJS
,
otr
.
OTR
,
otr
.
DSA
,
console
);
if
(
typeof
otr
!==
"
undefined
"
)
{
return
factory
(
jQuery
,
_
,
CryptoJS
,
otr
.
OTR
,
otr
.
DSA
,
console
);
}
else
{
return
factory
(
jQuery
,
_
,
undefined
,
undefined
,
undefined
,
console
);
}
}
);
}
else
{
...
...
@@ -54,6 +68,11 @@
var
KEY
=
{
ENTER
:
13
};
var
HAS_CRYPTO
=
(
(
typeof
CryptoJS
!==
"
undefined
"
)
&&
(
typeof
OTR
!==
"
undefined
"
)
&&
(
typeof
DSA
!==
"
undefined
"
)
);
// Default configuration values
// ----------------------------
...
...
@@ -105,6 +124,9 @@
'
xhr_user_search_url
'
]));
// Only allow OTR if we have the capability
this
.
allow_otr
=
this
.
allow_otr
&&
HAS_CRYPTO
;
// Translation machinery
// ---------------------
var
__
=
$
.
proxy
(
function
(
str
)
{
...
...
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