Compare commits

...

6 Commits
main ... v4.4.9

Author SHA1 Message Date
Sanjana Rajan
f50ed731b9 Release new version 2019-02-14 22:51:10 +01:00
Sanjana Rajan
f7a3cfd809 put back node encoder/decoder 2019-02-14 22:47:36 +01:00
Daniel Huigens
d6a774d89f Release new version 2019-02-14 16:18:06 +01:00
Sanjana Rajan
a0080ebfd1 Release new version 2019-02-14 16:15:50 +01:00
Sanjana Rajan
16a4e17c7b don't check create time 2019-02-14 16:15:50 +01:00
Daniel Huigens
807d037612 Don't use Node's TextEncoder/TextDecoder
They seem to be buggy in some versions and occasionally throw.
2019-02-14 16:12:04 +01:00
11 changed files with 39 additions and 37 deletions

View File

@ -1,6 +1,6 @@
{
"name": "openpgp",
"version": "4.4.7",
"version": "4.4.9",
"license": "LGPL-3.0+",
"homepage": "https://openpgpjs.org/",
"authors": [

View File

@ -29654,7 +29654,7 @@ exports.default = {
* @memberof module:config
* @property {String} versionstring A version string to be included in armored messages
*/
versionstring: "OpenPGP.js v4.4.7",
versionstring: "OpenPGP.js v4.4.9",
/**
* @memberof module:config
* @property {String} commentstring A comment string to be included in armored messages
@ -38915,7 +38915,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
* Initialize the HKP client and configure it with the key server url and fetch function.
* @constructor
* @param {String} keyServerBaseUrl (optional) The HKP key server base url including
* the protocol to use e.g. https://pgp.mit.edu
* the protocol to use, e.g. 'https://pgp.mit.edu'; defaults to
* openpgp.config.keyserver (https://keyserver.ubuntu.com)
*/
function HKP(keyServerBaseUrl) {
this._baseUrl = keyServerBaseUrl || _config2.default.keyserver;
@ -43400,7 +43401,7 @@ function isDataExpired(keyPacket, signature) {
var normDate = _util2.default.normalizeDate(date);
if (normDate !== null) {
var expirationTime = getExpirationTime(keyPacket, signature);
return !(keyPacket.created <= normDate && normDate <= expirationTime) || signature && signature.isExpired(date);
return !(normDate <= expirationTime) || signature && signature.isExpired(date);
}
return false;
}
@ -51896,7 +51897,7 @@ Signature.prototype.isExpired = function () {
var normDate = _util2.default.normalizeDate(date);
if (normDate !== null) {
var expirationTime = this.getExpirationTime();
return !(this.created <= normDate && normDate <= expirationTime);
return !(normDate <= expirationTime);
}
return false;
};
@ -53231,25 +53232,24 @@ SymmetricallyEncrypted.prototype.decrypt = function () {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return _webStreamTools2.default.readToEnd(this.encrypted);
case 2:
this.encrypted = _context.sent;
_context.next = 5;
return _crypto2.default.cfb.decrypt(sessionKeyAlgorithm, key, this.encrypted.subarray(_crypto2.default.cipher[sessionKeyAlgorithm].blockSize + 2), this.encrypted.subarray(2, _crypto2.default.cipher[sessionKeyAlgorithm].blockSize + 2));
case 5:
decrypted = _context.sent;
if (this.ignore_mdc_error) {
_context.next = 8;
_context.next = 2;
break;
}
throw new Error('Decryption failed due to missing MDC.');
case 8:
case 2:
_context.next = 4;
return _webStreamTools2.default.readToEnd(this.encrypted);
case 4:
this.encrypted = _context.sent;
_context.next = 7;
return _crypto2.default.cfb.decrypt(sessionKeyAlgorithm, key, this.encrypted.subarray(_crypto2.default.cipher[sessionKeyAlgorithm].blockSize + 2), this.encrypted.subarray(2, _crypto2.default.cipher[sessionKeyAlgorithm].blockSize + 2));
case 7:
decrypted = _context.sent;
_context.next = 10;
return this.packets.read(decrypted);
@ -53301,7 +53301,7 @@ SymmetricallyEncrypted.prototype.encrypt = function () {
case 9:
ciphertext = _context2.sent;
this.encrypted = _util2.default.concatUint8Array([FRE, ciphertext]);
this.encrypted = _util2.default.concat([FRE, ciphertext]);
return _context2.abrupt('return', true);

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,2 @@
/*! OpenPGP.js v4.4.7 - 2019-02-06 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */
/*! OpenPGP.js v4.4.9 - 2019-02-14 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */
!function(){return function e(n,r,t){function o(a,f){if(!r[a]){if(!n[a]){var u="function"==typeof require&&require;if(!f&&u)return u(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var s=r[a]={exports:{}};n[a][0].call(s.exports,function(e){return o(n[a][1][e]||e)},s,s.exports,e,n,r,t)}return r[a].exports}for(var i="function"==typeof require&&require,a=0;a<t.length;a++)o(t[a]);return o}}()({1:[function(e,n,r){self.window=self,importScripts("openpgp.min.js");var t=window.openpgp,o=[],i=6e4;function a(e){self.postMessage(e,t.util.getTransferables(e.data,!0))}t.crypto.random.randomBuffer.init(i,function(){return o.length||self.postMessage({event:"request-seed",amount:i}),new Promise(function(e){o.push(e)})}),self.onmessage=function(e){var n,r=e.data||{};switch(r.event){case"configure":n=r.config,Object.keys(n).forEach(function(e){t.config[e]=n[e]});break;case"seed-random":!function(e){e instanceof Uint8Array||(e=new Uint8Array(e));t.crypto.random.randomBuffer.set(e)}(r.buf);var i=o;o=[];for(var f=0;f<i.length;f++)i[f]();break;default:!function(e,n,r){if("function"!=typeof t[n])return void a({id:e,event:"method-return",err:"Unknown Worker Event"});r=t.packet.clone.parseClonedPackets(r,n),t.util.restoreStreams(r),t[n](r).then(function(n){a({id:e,event:"method-return",data:t.packet.clone.clonePackets(n)})}).catch(function(n){t.util.print_debug_error(n),a({id:e,event:"method-return",err:n.message,stack:n.stack})})}(r.id,r.event,r.options||{})}}},{}]},{},[1]);

18
dist/openpgp.js vendored
View File

@ -23752,7 +23752,7 @@ exports.default = {
* @memberof module:config
* @property {String} versionstring A version string to be included in armored messages
*/
versionstring: "OpenPGP.js v4.4.7",
versionstring: "OpenPGP.js v4.4.9",
/**
* @memberof module:config
* @property {String} commentstring A comment string to be included in armored messages
@ -30481,7 +30481,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
* Initialize the HKP client and configure it with the key server url and fetch function.
* @constructor
* @param {String} keyServerBaseUrl (optional) The HKP key server base url including
* the protocol to use e.g. https://pgp.mit.edu
* the protocol to use, e.g. 'https://pgp.mit.edu'; defaults to
* openpgp.config.keyserver (https://keyserver.ubuntu.com)
*/
function HKP(keyServerBaseUrl) {
this._baseUrl = keyServerBaseUrl || _config2.default.keyserver;
@ -32520,7 +32521,7 @@ function isDataExpired(keyPacket, signature, date = new Date()) {
const normDate = _util2.default.normalizeDate(date);
if (normDate !== null) {
const expirationTime = getExpirationTime(keyPacket, signature);
return !(keyPacket.created <= normDate && normDate <= expirationTime) || signature && signature.isExpired(date);
return !(normDate <= expirationTime) || signature && signature.isExpired(date);
}
return false;
}
@ -38036,7 +38037,7 @@ Signature.prototype.isExpired = function (date = new Date()) {
const normDate = _util2.default.normalizeDate(date);
if (normDate !== null) {
const expirationTime = this.getExpirationTime();
return !(this.created <= normDate && normDate <= expirationTime);
return !(normDate <= expirationTime);
}
return false;
};
@ -38770,13 +38771,14 @@ SymmetricallyEncrypted.prototype.write = function () {
* @async
*/
SymmetricallyEncrypted.prototype.decrypt = async function (sessionKeyAlgorithm, key) {
this.encrypted = await _webStreamTools2.default.readToEnd(this.encrypted);
const decrypted = await _crypto2.default.cfb.decrypt(sessionKeyAlgorithm, key, this.encrypted.subarray(_crypto2.default.cipher[sessionKeyAlgorithm].blockSize + 2), this.encrypted.subarray(2, _crypto2.default.cipher[sessionKeyAlgorithm].blockSize + 2));
// If MDC errors are not being ignored, all missing MDC packets in symmetrically encrypted data should throw an error
if (!this.ignore_mdc_error) {
throw new Error('Decryption failed due to missing MDC.');
}
this.encrypted = await _webStreamTools2.default.readToEnd(this.encrypted);
const decrypted = await _crypto2.default.cfb.decrypt(sessionKeyAlgorithm, key, this.encrypted.subarray(_crypto2.default.cipher[sessionKeyAlgorithm].blockSize + 2), this.encrypted.subarray(2, _crypto2.default.cipher[sessionKeyAlgorithm].blockSize + 2));
await this.packets.read(decrypted);
return true;
@ -38796,7 +38798,7 @@ SymmetricallyEncrypted.prototype.encrypt = async function (algo, key) {
const prefix = await _crypto2.default.getPrefixRandom(algo);
const FRE = await _crypto2.default.cfb.encrypt(algo, key, prefix, new Uint8Array(_crypto2.default.cipher[algo].blockSize));
const ciphertext = await _crypto2.default.cfb.encrypt(algo, key, data, FRE.subarray(2));
this.encrypted = _util2.default.concatUint8Array([FRE, ciphertext]);
this.encrypted = _util2.default.concat([FRE, ciphertext]);
return true;
};

4
dist/openpgp.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,2 @@
/*! OpenPGP.js v4.4.7 - 2019-02-06 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */
/*! OpenPGP.js v4.4.9 - 2019-02-14 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */
!function(){return function e(n,r,t){function o(a,f){if(!r[a]){if(!n[a]){var u="function"==typeof require&&require;if(!f&&u)return u(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var s=r[a]={exports:{}};n[a][0].call(s.exports,function(e){return o(n[a][1][e]||e)},s,s.exports,e,n,r,t)}return r[a].exports}for(var i="function"==typeof require&&require,a=0;a<t.length;a++)o(t[a]);return o}}()({1:[function(e,n,r){self.window=self,importScripts("openpgp.min.js");var t=window.openpgp,o=[],i=6e4;function a(e){self.postMessage(e,t.util.getTransferables(e.data,!0))}t.crypto.random.randomBuffer.init(i,function(){return o.length||self.postMessage({event:"request-seed",amount:i}),new Promise(function(e){o.push(e)})}),self.onmessage=function(e){var n,r=e.data||{};switch(r.event){case"configure":n=r.config,Object.keys(n).forEach(function(e){t.config[e]=n[e]});break;case"seed-random":!function(e){e instanceof Uint8Array||(e=new Uint8Array(e));t.crypto.random.randomBuffer.set(e)}(r.buf);var i=o;o=[];for(var f=0;f<i.length;f++)i[f]();break;default:!function(e,n,r){if("function"!=typeof t[n])return void a({id:e,event:"method-return",err:"Unknown Worker Event"});r=t.packet.clone.parseClonedPackets(r,n),t.util.restoreStreams(r),t[n](r).then(function(n){a({id:e,event:"method-return",data:t.packet.clone.clonePackets(n)})}).catch(function(n){t.util.print_debug_error(n),a({id:e,event:"method-return",err:n.message,stack:n.stack})})}(r.id,r.event,r.options||{})}}},{}]},{},[1]);

2
npm-shrinkwrap.json generated
View File

@ -1,6 +1,6 @@
{
"name": "openpgp",
"version": "4.4.7",
"version": "4.4.9",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

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": "4.4.7",
"version": "4.4.9",
"license": "LGPL-3.0+",
"homepage": "https://openpgpjs.org/",
"engines": {

View File

@ -1643,7 +1643,7 @@ function isDataExpired(keyPacket, signature, date=new Date()) {
const normDate = util.normalizeDate(date);
if (normDate !== null) {
const expirationTime = getExpirationTime(keyPacket, signature);
return !(keyPacket.created <= normDate && normDate <= expirationTime) ||
return !(normDate <= expirationTime) ||
(signature && signature.isExpired(date));
}
return false;

View File

@ -727,7 +727,7 @@ Signature.prototype.isExpired = function (date=new Date()) {
const normDate = util.normalizeDate(date);
if (normDate !== null) {
const expirationTime = this.getExpirationTime();
return !(this.created <= normDate && normDate <= expirationTime);
return !(normDate <= expirationTime);
}
return false;
};