Skip to content

Commit 083dad0

Browse files
committed
bump version
1 parent 6925833 commit 083dad0

File tree

7 files changed

+42
-20
lines changed

7 files changed

+42
-20
lines changed

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "otr",
3-
"version": "0.2.15",
3+
"version": "0.2.16",
44
"main": "build/otr.js",
55
"ignore": [
66
"**/.*",

build/dsa-webworker.js

+15-8
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@
33

44
root.OTR = {}
55
root.DSA = {}
6-
root.crypto = {
7-
randomBytes: function () {
8-
throw new Error("Haven't seeded yet.")
6+
7+
var hasCrypto = false
8+
if (root.crypto)
9+
hasCrypto = true
10+
else
11+
root.crypto = {
12+
randomBytes: function () {
13+
throw new Error("Haven't seeded yet.")
14+
}
915
}
10-
}
1116

1217
// default imports
1318
var imports = [
@@ -30,10 +35,12 @@
3035
if (data.imports) imports = data.imports
3136
importScripts.apply(root, imports);
3237

33-
// use salsa20 since there's no prng in webworkers
34-
var state = new root.Salsa20(data.seed.slice(0, 32), data.seed.slice(32))
35-
root.crypto.randomBytes = function (n) {
36-
return state.getBytes(n)
38+
if (!hasCrypto) {
39+
// use salsa20 when there's no prng in webworkers
40+
var state = new root.Salsa20(data.seed.slice(0, 32), data.seed.slice(32))
41+
root.crypto.randomBytes = function (n) {
42+
return state.getBytes(n)
43+
}
3744
}
3845

3946
if (data.debug) sendMsg('debug', 'DSA key creation started')

build/otr.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/*!
22
3-
otr.js v0.2.15 - 2015-05-04
3+
otr.js v0.2.16 - 2015-12-03
44
(c) 2015 - Arlo Breault <[email protected]>
5-
Freely distributed under the MPL v2.0 license.
5+
Freely distributed under the MPL-2.0 license.
66
77
This file is concatenated for the browser.
88
Please see: https://github.com/arlolra/otr

build/otr.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/sm-webworker.js

+13-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22
"use strict";
33

44
root.OTR = {}
5-
root.crypto = {
6-
randomBytes: function () {
7-
throw new Error("Haven't seeded yet.")
5+
6+
var hasCrypto = false
7+
if (root.crypto)
8+
hasCrypto = true
9+
else
10+
root.crypto = {
11+
randomBytes: function () {
12+
throw new Error("Haven't seeded yet.")
13+
}
814
}
9-
}
1015

1116
// default imports
1217
var imports = [
@@ -36,7 +41,10 @@
3641
if (data.imports) imports = data.imports
3742
importScripts.apply(root, imports)
3843

39-
// use salsa20 since there's no prng in webworkers
44+
if (hasCrypto)
45+
break
46+
47+
// use salsa20 when there's no prng in webworkers
4048
var state = new root.Salsa20(
4149
data.seed.slice(0, 32),
4250
data.seed.slice(32)

changelog.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11

2+
0.2.16 / 2015-12-03
3+
===================
4+
5+
* handle already defined crypto object in webworker
6+
* cleanup the readme
7+
28
0.2.15 / 2015-05-04
39
===================
410

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "otr",
3-
"version": "0.2.15",
3+
"version": "0.2.16",
44
"description": "Off-the-Record Messaging Protocol",
55
"homepage": "https://github.com/arlolra/otr",
66
"main": "index.js",
@@ -38,7 +38,8 @@
3838
"Nadim Kobeissi <[email protected]>",
3939
"Klaus Herberth <[email protected]>",
4040
"JC Brand <[email protected]>",
41-
"Mark Vayngrib <[email protected]>"
41+
"Mark Vayngrib <[email protected]>",
42+
"Jérémie Astori <[email protected]>"
4243
],
4344
"license": "MPL-2.0"
4445
}

0 commit comments

Comments
 (0)