Release new version

This commit is contained in:
Bart Butler 2017-07-21 22:06:51 -07:00
parent 93bbf0faca
commit 7b7c1b08fe
6 changed files with 85 additions and 34 deletions

View File

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

99
dist/openpgp.js vendored
View File

@ -4841,7 +4841,7 @@ exports.default = {
tolerant: true, // ignore unsupported/unrecognizable packets instead of throwing an error
show_version: true,
show_comment: true,
versionstring: "OpenPGP.js v2.5.7",
versionstring: "OpenPGP.js v2.5.8",
commentstring: "https://openpgpjs.org",
keyserver: "https://keyserver.ubuntu.com",
node_store: './openpgp.store'
@ -13263,7 +13263,7 @@ Key.prototype.packetlist2structure = function (packetlist) {
_util2.default.print_debug('Dropping subkey binding signature without preceding subkey packet');
continue;
}
subKey.bindingSignature = packetlist[i];
subKey.bindingSignatures.push(packetlist[i]);
break;
case _enums2.default.signature.key_revocation:
this.revocationSignature = packetlist[i];
@ -14022,7 +14022,7 @@ function SubKey(subKeyPacket) {
return new SubKey(subKeyPacket);
}
this.subKey = subKeyPacket;
this.bindingSignature = null;
this.bindingSignatures = [];
this.revocationSignature = null;
}
@ -14034,7 +14034,9 @@ SubKey.prototype.toPacketlist = function () {
var packetlist = new _packet2.default.List();
packetlist.push(this.subKey);
packetlist.push(this.revocationSignature);
packetlist.push(this.bindingSignature);
for (var i = 0; i < this.bindingSignatures.length; i++) {
packetlist.push(this.bindingSignatures[i]);
}
return packetlist;
};
@ -14044,7 +14046,15 @@ SubKey.prototype.toPacketlist = function () {
* @return {Boolean}
*/
SubKey.prototype.isValidEncryptionKey = function (primaryKey) {
return this.verify(primaryKey) === _enums2.default.keyStatus.valid && isValidEncryptionKeyPacket(this.subKey, this.bindingSignature);
if (this.verify(primaryKey) !== _enums2.default.keyStatus.valid) {
return false;
}
for (var i = 0; i < this.bindingSignatures.length; i++) {
if (isValidEncryptionKeyPacket(this.subKey, this.bindingSignatures[i])) {
return true;
}
}
return false;
};
/**
@ -14053,7 +14063,15 @@ SubKey.prototype.isValidEncryptionKey = function (primaryKey) {
* @return {Boolean}
*/
SubKey.prototype.isValidSigningKey = function (primaryKey) {
return this.verify(primaryKey) === _enums2.default.keyStatus.valid && isValidSigningKeyPacket(this.subKey, this.bindingSignature);
if (this.verify(primaryKey) !== _enums2.default.keyStatus.valid) {
return false;
}
for (var i = 0; i < this.bindingSignatures.length; i++) {
if (isValidSigningKeyPacket(this.subKey, this.bindingSignatures[i])) {
return true;
}
}
return false;
};
/**
@ -14070,21 +14088,39 @@ SubKey.prototype.verify = function (primaryKey) {
if (this.subKey.version === 3 && this.subKey.expirationTimeV3 !== 0 && Date.now() > this.subKey.created.getTime() + this.subKey.expirationTimeV3 * 24 * 3600 * 1000) {
return _enums2.default.keyStatus.expired;
}
// check subkey binding signature
if (!this.bindingSignature) {
return _enums2.default.keyStatus.invalid;
// check subkey binding signatures (at least one valid binding sig needed)
for (var i = 0; i < this.bindingSignatures.length; i++) {
var isLast = i === this.bindingSignatures.length - 1;
var sig = this.bindingSignatures[i];
// check binding signature is not expired
if (sig.isExpired()) {
if (isLast) {
return _enums2.default.keyStatus.expired; // last expired binding signature
} else {
continue;
}
}
// check binding signature can verify
if (!(sig.verified || sig.verify(primaryKey, { key: primaryKey, bind: this.subKey }))) {
if (isLast) {
return _enums2.default.keyStatus.invalid; // last invalid binding signature
} else {
continue;
}
}
// check V4 expiration time
if (this.subKey.version === 4) {
if (sig.keyNeverExpires === false && Date.now() > this.subKey.created.getTime() + sig.keyExpirationTime * 1000) {
if (isLast) {
return _enums2.default.keyStatus.expired; // last V4 expired binding signature
} else {
continue;
}
}
}
return _enums2.default.keyStatus.valid; // found a binding signature that passed all checks
}
if (this.bindingSignature.isExpired()) {
return _enums2.default.keyStatus.expired;
}
if (!(this.bindingSignature.verified || this.bindingSignature.verify(primaryKey, { key: primaryKey, bind: this.subKey }))) {
return _enums2.default.keyStatus.invalid;
}
// check V4 expiration time
if (this.subKey.version === 4 && this.bindingSignature.keyNeverExpires === false && Date.now() > this.subKey.created.getTime() + this.bindingSignature.keyExpirationTime * 1000) {
return _enums2.default.keyStatus.expired;
}
return _enums2.default.keyStatus.valid;
return _enums2.default.keyStatus.invalid; // no binding signatures to check
};
/**
@ -14092,7 +14128,17 @@ SubKey.prototype.verify = function (primaryKey) {
* @return {Date|null}
*/
SubKey.prototype.getExpirationTime = function () {
return getExpirationTime(this.subKey, this.bindingSignature);
var highest;
for (var i = 0; i < this.bindingSignatures.length; i++) {
var current = getExpirationTime(this.subKey, this.bindingSignatures[i]);
if (current === null) {
return null;
}
if (!highest || current > highest) {
highest = current;
}
}
return highest;
};
/**
@ -14111,9 +14157,14 @@ SubKey.prototype.update = function (subKey, primaryKey) {
if (this.subKey.tag === _enums2.default.packet.publicSubkey && subKey.subKey.tag === _enums2.default.packet.secretSubkey) {
this.subKey = subKey.subKey;
}
// binding signature
if (!this.bindingSignature && subKey.bindingSignature && (subKey.bindingSignature.verified || subKey.bindingSignature.verify(primaryKey, { key: primaryKey, bind: this.subKey }))) {
this.bindingSignature = subKey.bindingSignature;
// update missing binding signatures
if (this.bindingSignatures.length < subKey.bindingSignatures.length) {
for (var i = this.bindingSignatures.length; i < subKey.bindingSignatures.length; i++) {
var newSig = subKey.bindingSignatures[i];
if (newSig.verified || newSig.verify(primaryKey, { key: primaryKey, bind: this.subKey })) {
this.bindingSignatures.push(newSig);
}
}
}
// revocation signature
if (!this.revocationSignature && subKey.revocationSignature && !subKey.revocationSignature.isExpired() && (subKey.revocationSignature.verified || subKey.revocationSignature.verify(primaryKey, { key: primaryKey, bind: this.subKey }))) {

12
dist/openpgp.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
/*! OpenPGP.js v2.5.7 - 2017-07-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,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]);
/*! OpenPGP.js v2.5.8 - 2017-07-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,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.5.7",
"version": "2.5.8",
"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.5.7",
"version": "2.5.8",
"license": "LGPL-3.0+",
"homepage": "http://openpgpjs.org/",
"engines": {