Release new version

This commit is contained in:
Bart Butler 2016-10-26 17:05:14 -07:00
parent 659c6f23d2
commit d64665e5fe
7 changed files with 37 additions and 22 deletions

View File

@ -1,6 +1,6 @@
{
"name": "openpgp",
"version": "2.3.4",
"version": "2.3.5",
"license": "LGPL-3.0+",
"homepage": "http://openpgpjs.org/",
"authors": [

31
dist/openpgp.js vendored
View File

@ -4806,7 +4806,7 @@ exports.default = {
debug: false,
show_version: true,
show_comment: true,
versionstring: "OpenPGP.js v2.3.4",
versionstring: "OpenPGP.js v2.3.5",
commentstring: "http://openpgpjs.org",
keyserver: "https://keyserver.ubuntu.com",
node_store: './openpgp.store'
@ -17842,6 +17842,7 @@ SecretKey.prototype.decrypt = function (passphrase) {
}
this.mpi = this.mpi.concat(parsedMPI);
this.isDecrypted = true;
this.encrypted = null;
return true;
};
@ -20475,13 +20476,24 @@ function AsyncProxy() {
throw new Error('Unhandled error in openpgp worker: ' + e.message + ' (' + e.filename + ':' + e.lineno + ')');
};
this.seedRandom(INITIAL_RANDOM_SEED);
// FIFO
this.tasks = [];
if (config) {
this.worker.postMessage({ event: 'configure', config: config });
}
// Cannot rely on task order being maintained, use object keyed by request ID to track tasks
this.tasks = {};
this.currentID = 0;
}
/**
* Get new request ID
* @return {integer} New unique request ID
*/
AsyncProxy.prototype.getID = function () {
return this.currentID++;
};
/**
* Message handling
*/
@ -20491,11 +20503,12 @@ AsyncProxy.prototype.onMessage = function (event) {
case 'method-return':
if (msg.err) {
// fail
this.tasks.shift().reject(new Error(msg.err));
this.tasks[msg.id].reject(new Error(msg.err));
} else {
// success
this.tasks.shift().resolve(msg.data);
this.tasks[msg.id].resolve(msg.data);
}
delete this.tasks[msg.id];
break;
case 'request-seed':
this.seedRandom(RANDOM_SEED_REQUEST);
@ -20544,14 +20557,16 @@ AsyncProxy.prototype.terminate = function () {
AsyncProxy.prototype.delegate = function (method, options) {
var _this = this;
var id = this.getID();
return new Promise(function (_resolve, reject) {
// clone packets (for web worker structured cloning algorithm)
_this.worker.postMessage({ event: method, options: _packet2.default.clone.clonePackets(options) }, _util2.default.getTransferables.call(_util2.default, options));
_this.worker.postMessage({ id: id, event: method, options: _packet2.default.clone.clonePackets(options) }, _util2.default.getTransferables.call(_util2.default, options));
// remember to handle parsing cloned packets from worker
_this.tasks.push({ resolve: function resolve(data) {
_this.tasks[id] = { resolve: function resolve(data) {
return _resolve(_packet2.default.clone.parseClonedPackets(data, method));
}, reject: reject });
}, reject: reject };
});
};

10
dist/openpgp.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -45,7 +45,7 @@ self.onmessage = function(event) {
break;
default:
delegate(msg.event, msg.options || {});
delegate(msg.id, msg.event, msg.options || {});
}
};
@ -76,18 +76,18 @@ function seedRandom(buffer) {
* @param {String} method The public api function to be delegated to the worker thread
* @param {Object} options The api function's options
*/
function delegate(method, options) {
function delegate(id, method, options) {
if (typeof openpgp[method] !== 'function') {
response({ event:'method-return', err:'Unknown Worker Event' });
response({ id:id, event:'method-return', err:'Unknown Worker Event' });
return;
}
// parse cloned packets
options = openpgp.packet.clone.parseClonedPackets(options, method);
openpgp[method](options).then(function(data) {
// clone packets (for web worker structured cloning algorithm)
response({ event:'method-return', data:openpgp.packet.clone.clonePackets(data) });
response({ id:id, event:'method-return', data:openpgp.packet.clone.clonePackets(data) });
}).catch(function(e) {
response({ event:'method-return', err:e.message });
response({ id:id, event:'method-return', err:e.message });
});
}

View File

@ -1 +1 @@
/*! OpenPGP.js v2.3.4 - 2016-10-21 - this is LGPL licensed code, see LICENSE/our website http://openpgpjs.org/ for more information. */!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){function d(a){for(var b in a)h.config[b]=a[b]}function e(a){a instanceof Uint8Array||(a=new Uint8Array(a)),h.crypto.random.randomBuffer.set(a)}function f(a,b){return"function"!=typeof h[a]?void g({event:"method-return",err:"Unknown Worker Event"}):(b=h.packet.clone.parseClonedPackets(b,a),void h[a](b).then(function(a){g({event:"method-return",data:h.packet.clone.clonePackets(a)})})["catch"](function(a){g({event:"method-return",err:a.message})}))}function g(a){h.crypto.random.randomBuffer.size<i&&self.postMessage({event:"request-seed"}),self.postMessage(a,h.util.getTransferables.call(h.util,a.data))}self.window={},importScripts("openpgp.min.js");var h=window.openpgp,i=4e4,j=6e4;h.crypto.random.randomBuffer.init(j),self.onmessage=function(a){var b=a.data||{};switch(b.event){case"configure":d(b.config);break;case"seed-random":e(b.buf);break;default:f(b.event,b.options||{})}}},{}]},{},[1]);
/*! OpenPGP.js v2.3.5 - 2016-10-26 - this is LGPL licensed code, see LICENSE/our website http://openpgpjs.org/ for more information. */!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){function d(a){for(var b in a)h.config[b]=a[b]}function e(a){a instanceof Uint8Array||(a=new Uint8Array(a)),h.crypto.random.randomBuffer.set(a)}function f(a,b,c){return"function"!=typeof h[b]?void g({id:a,event:"method-return",err:"Unknown Worker Event"}):(c=h.packet.clone.parseClonedPackets(c,b),void h[b](c).then(function(b){g({id:a,event:"method-return",data:h.packet.clone.clonePackets(b)})})["catch"](function(b){g({id:a,event:"method-return",err:b.message})}))}function g(a){h.crypto.random.randomBuffer.size<i&&self.postMessage({event:"request-seed"}),self.postMessage(a,h.util.getTransferables.call(h.util,a.data))}self.window={},importScripts("openpgp.min.js");var h=window.openpgp,i=4e4,j=6e4;h.crypto.random.randomBuffer.init(j),self.onmessage=function(a){var b=a.data||{};switch(b.event){case"configure":d(b.config);break;case"seed-random":e(b.buf);break;default:f(b.id,b.event,b.options||{})}}},{}]},{},[1]);

2
npm-shrinkwrap.json generated
View File

@ -1,6 +1,6 @@
{
"name": "openpgp",
"version": "2.3.4",
"version": "2.3.5",
"dependencies": {
"asmcrypto-lite": {
"version": "1.1.0",

View File

@ -1,7 +1,7 @@
{
"name": "openpgp",
"description": "OpenPGP.js is a Javascript implementation of the OpenPGP protocol. This is defined in RFC 4880.",
"version": "2.3.4",
"version": "2.3.5",
"license": "LGPL-3.0+",
"homepage": "http://openpgpjs.org/",
"engines": {