Skip to content

Commit

Permalink
salted WAMP-CRA helper; bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Oberstein committed Mar 11, 2013
1 parent 4f8bf11 commit 3bc3412
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down
14 changes: 14 additions & 0 deletions autobahn/autobahn.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.4
0.7.5

0 comments on commit 3bc3412

Please sign in to comment.