Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

salted WAMP-CRA helper; bump version

  • Loading branch information...
commit 3bc341287ee51ba1282ab9af716e98f0a736ece8 1 parent 4f8bf11
Tobias Oberstein oberstet authored
4 CHANGELOG.md
View
@@ -1,5 +1,9 @@
# AutobahnJS: Changelog
+## v0.7.5
+ * add option to skip announcing of WebSocket subprotocol (WAMP)
+ * implement `deriveKey` function for salted WAMP-CRA
+
## v0.7.4
* update **whenjs** to v1.8.1
* update **CryptoJS** to v3.1.2
1  SConstruct
View
@@ -77,6 +77,7 @@ sources = ["autobahn/license.js",
"cryptojs/components/enc-base64.js",
"cryptojs/components/hmac.js",
"cryptojs/components/sha256.js",
+ "cryptojs/components/pbkdf2.js",
"autobahn/autobahn.js",
"autobahn/useragent.js"]
14 autobahn/autobahn.js
View
@@ -174,6 +174,20 @@ ab.getBrowser = function () {
ab.browserNotSupportedMessage = "Browser does not support WebSockets (RFC6455)";
+// PBKDF2-base key derivation function for salted WAMP-CRA
+ab.deriveKey = function (secret, extra) {
+ if (extra && extra.salt) {
+ var salt = extra.salt;
+ var keylen = extra.keylen || 32;
+ var iterations = extra.iterations || 10000;
+ var key = CryptoJS.PBKDF2(secret, salt, { keySize: keylen / 4, iterations: iterations, hasher: CryptoJS.algo.SHA256 });
+ return key.toString(CryptoJS.enc.Base64);
+ } else {
+ return secret;
+ }
+}
+
+
ab._idchars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
ab._idlen = 16;
ab._subprotocol = "wamp";
2  version.txt
View
@@ -1 +1 @@
-0.7.4
+0.7.5
Please sign in to comment.
Something went wrong with that request. Please try again.