Mercurial > sat_docs
view scripts/minifier/otr/dsa-webworker.js @ 42:bbb900a768ea
xeps: updated xep-0355 (namespace delegation):
Several updates according to feedbacks:
- Added attribute filtering, mainly to manage correctly MAM
- Simplification of configuration in admin mode: no more <iq/> negociation
- Delegations notifications to the managing entity are now done with a <message/> stanza
- Forwarding now use XEP-0297 to avoid server to parse every stanza and a to have a cleaner separation
- The behaviour when managing entity is unavailable is specified
- Use of namespace in field var for client mode negociation is now mandatory
- Behaviour when managing a delegation kept between session in client mode, when managing entity is not available, is specified
- Implementation note added for in-order processing issue (thanks to Kurt Zeilenga for pointing this)
- Added an note for discovery nesting with attribute filtering
- Updated namespace to reflect incompatible changes
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 21 Mar 2015 20:07:46 +0100 |
parents | 1596660ddf72 |
children |
line wrap: on
line source
;(function (root) { "use strict"; root.OTR = {} root.DSA = {} root.crypto = { randomBytes: function () { throw new Error("Haven't seeded yet.") } } // default imports var imports = [ 'vendor/salsa20.js' , 'vendor/bigint.js' , 'vendor/crypto.js' , 'vendor/eventemitter.js' , 'lib/const.js' , 'lib/helpers.js' , 'lib/dsa.js' ] function sendMsg(type, val) { postMessage({ type: type, val: val }) } onmessage = function (e) { var data = e.data; if (data.imports) imports = data.imports importScripts.apply(root, imports); // use salsa20 since there's no prng in webworkers var state = new root.Salsa20(data.seed.slice(0, 32), data.seed.slice(32)) root.crypto.randomBytes = function (n) { return state.getBytes(n) } if (data.debug) sendMsg('debug', 'DSA key creation started') var dsa try { dsa = new root.DSA() } catch (e) { if (data.debug) sendMsg('debug', e.toString()) return } if (data.debug) sendMsg('debug', 'DSA key creation finished') sendMsg('data', dsa.packPrivate()) } }(this))