Merge pull request #629 from dkg/http-to-https
move from http to https where possible.
This commit is contained in:
commit
7bd78585fd
2
LICENSE
2
LICENSE
|
@ -1,7 +1,7 @@
|
|||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
|
19
README.md
19
README.md
|
@ -1,7 +1,8 @@
|
|||
OpenPGP.js [](https://travis-ci.org/openpgpjs/openpgpjs)
|
||||
==========
|
||||
|
||||
[OpenPGP.js](http://openpgpjs.org/) is a JavaScript implementation of the OpenPGP protocol. This is defined in [RFC 4880](http://tools.ietf.org/html/rfc4880).
|
||||
[OpenPGP.js](https://openpgpjs.org/) is a JavaScript implementation of the OpenPGP protocol. This is defined in [RFC 4880](https://tools.ietf.org/html/rfc4880).
|
||||
|
||||
|
||||
[](https://saucelabs.com/u/openpgpjs)
|
||||
|
||||
|
@ -35,11 +36,11 @@ OpenPGP.js [ to run in most environments. We support Node.js v8+ and browsers that implement [window.crypto.getRandomValues](http://caniuse.com/#feat=getrandomvalues).
|
||||
* OpenPGP.js v3.x is written in ES7 but is transpiled to ES5 using [Babel](https://babeljs.io/) to run in most environments. We support Node.js v8+ and browsers that implement [window.crypto.getRandomValues](https://caniuse.com/#feat=getrandomvalues).
|
||||
|
||||
* The API uses the Async/Await syntax introduced in ES7 to return Promise objects. Async functions are available in [most modern browsers](https://caniuse.com/#feat=async-functions). If you need to support older browsers, fear not! We use [core-js](https://github.com/zloirock/core-js) to polyfill new features so that no action is required on your part!
|
||||
|
||||
* For the OpenPGP HTTP Key Server (HKP) client the new [fetch API](http://caniuse.com/#feat=fetch) is used. The module is polyfilled for [browsers](https://github.com/github/fetch) and is included as a dependency for [Node.js](https://github.com/bitinn/node-fetch) runtimes.
|
||||
* For the OpenPGP HTTP Key Server (HKP) client the new [fetch API](https://caniuse.com/#feat=fetch) is used. The module is polyfilled for [browsers](https://github.com/github/fetch) and is included as a dependency for [Node.js](https://github.com/bitinn/node-fetch) runtimes.
|
||||
|
||||
### Performance
|
||||
|
||||
|
@ -56,11 +57,11 @@ OpenPGP.js [ via the `window.crypto.subtle` API, this will be used. Under Node.js the native [crypto module](https://nodejs.org/API/crypto.html#crypto_crypto) is used. This can be deactivated by setting `openpgp.config.use_native = false`.
|
||||
* If the user's browser supports [native WebCrypto](https://caniuse.com/#feat=cryptography) via the `window.crypto.subtle` API, this will be used. Under Node.js the native [crypto module](https://nodejs.org/API/crypto.html#crypto_crypto) is used. This can be deactivated by setting `openpgp.config.use_native = false`.
|
||||
|
||||
* The library implements the [IETF proposal](https://tools.ietf.org/html/draft-ford-openpgp-format-00) for authenticated encryption [using native AES-GCM](https://github.com/openpgpjs/openpgpjs/pull/430). This makes symmetric encryption about 30x faster on supported platforms. Since the specification has not been finalized and other OpenPGP implementations haven't adopted it yet, the feature is currently behind a flag. You can activate it by setting `openpgp.config.aead_protect = true`. **Note: activating this setting can break compatibility with other OpenPGP implementations, so be careful if that's one of your requirements.**
|
||||
|
||||
* For environments that don't provide native crypto, the library falls back to [asm.js](http://caniuse.com/#feat=asmjs) implementations of AES, SHA-1, and SHA-256. We use [Rusha](https://github.com/srijs/rusha) and [asmCrypto Lite](https://github.com/openpgpjs/asmcrypto-lite) (a minimal subset of asmCrypto.js built specifically for OpenPGP.js).
|
||||
* For environments that don't provide native crypto, the library falls back to [asm.js](https://caniuse.com/#feat=asmjs) implementations of AES, SHA-1, and SHA-256. We use [Rusha](https://github.com/srijs/rusha) and [asmCrypto Lite](https://github.com/openpgpjs/asmcrypto-lite) (a minimal subset of asmCrypto.js built specifically for OpenPGP.js).
|
||||
|
||||
|
||||
### Getting started
|
||||
|
@ -286,7 +287,7 @@ openpgp.verify(options).then(function(verified) {
|
|||
|
||||
### Documentation
|
||||
|
||||
A jsdoc build of our code comments is available at [doc/index.html](http://openpgpjs.org/openpgpjs/doc/index.html). Public calls should generally be made through the OpenPGP object [doc/openpgp.html](http://openpgpjs.org/openpgpjs/doc/module-openpgp.html).
|
||||
A jsdoc build of our code comments is available at [doc/index.html](https://openpgpjs.org/openpgpjs/doc/index.html). Public calls should generally be made through the OpenPGP object [doc/openpgp.html](https://openpgpjs.org/openpgpjs/doc/module-openpgp.html).
|
||||
|
||||
### Security Audit
|
||||
|
||||
|
@ -294,7 +295,7 @@ To date the OpenPGP.js code base has undergone two complete security audits from
|
|||
|
||||
### Security recommendations
|
||||
|
||||
It should be noted that js crypto apps deployed via regular web hosting (a.k.a. [**host-based security**](https://www.schneier.com/blog/archives/2012/08/cryptocat.html)) provide users with less security than installable apps with auditable static versions. Installable apps can be deployed as a [Firefox](https://developer.mozilla.org/en-US/Marketplace/Options/Packaged_apps) or [Chrome](https://developer.chrome.com/apps/about_apps.html) packaged app. These apps are basically signed zip files and their runtimes typically enforce a strict [Content Security Policy (CSP)](http://www.html5rocks.com/en/tutorials/security/content-security-policy/) to protect users against [XSS](https://en.wikipedia.org/wiki/Cross-site_scripting). This [blogpost](https://tankredhase.com/2014/04/13/heartbleed-and-javascript-crypto/) explains the trust model of the web quite well.
|
||||
It should be noted that js crypto apps deployed via regular web hosting (a.k.a. [**host-based security**](https://www.schneier.com/blog/archives/2012/08/cryptocat.html)) provide users with less security than installable apps with auditable static versions. Installable apps can be deployed as a [Firefox](https://developer.mozilla.org/en-US/Marketplace/Options/Packaged_apps) or [Chrome](https://developer.chrome.com/apps/about_apps.html) packaged app. These apps are basically signed zip files and their runtimes typically enforce a strict [Content Security Policy (CSP)](https://www.html5rocks.com/en/tutorials/security/content-security-policy/) to protect users against [XSS](https://en.wikipedia.org/wiki/Cross-site_scripting). This [blogpost](https://tankredhase.com/2014/04/13/heartbleed-and-javascript-crypto/) explains the trust model of the web quite well.
|
||||
|
||||
It is also recommended to set a strong passphrase that protects the user's private key on disk.
|
||||
|
||||
|
@ -320,10 +321,10 @@ GNU Lesser General Public License (3.0 or any later version). Please take a look
|
|||
|
||||
Below is a collection of resources, many of these were projects that were in someway a precursor to the current OpenPGP.js project. If you'd like to add your link here, please do so in a pull request or email to the list.
|
||||
|
||||
* [http://www.hanewin.net/encrypt/](http://www.hanewin.net/encrypt/)
|
||||
* [https://www.hanewin.net/encrypt/](https://www.hanewin.net/encrypt/)
|
||||
* [https://github.com/seancolyer/gmail-crypt](https://github.com/seancolyer/gmail-crypt)
|
||||
* [https://github.com/mete0r/jspg](https://github.com/mete0r/jspg)
|
||||
* [http://fitblip.pub/JSPGP-Stuffs/](http://fitblip.pub/JSPGP-Stuffs/)
|
||||
* [https://fitblip.pub/JSPGP-Stuffs/](https://fitblip.pub/JSPGP-Stuffs/)
|
||||
* [http://qooxdoo.org/contrib/project/crypto](http://qooxdoo.org/contrib/project/crypto)
|
||||
* [https://github.com/GPGTools/Mobile/wiki/Introduction](https://github.com/GPGTools/Mobile/wiki/Introduction)
|
||||
* [http://gpg4browsers.recurity.com/](http://gpg4browsers.recurity.com/)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"name": "openpgp",
|
||||
"version": "2.6.2",
|
||||
"license": "LGPL-3.0+",
|
||||
"homepage": "http://openpgpjs.org/",
|
||||
"homepage": "https://openpgpjs.org/",
|
||||
"authors": [
|
||||
"OpenPGP Development Team <list@openpgpjs.org> (https://github.com/openpgpjs/openpgpjs/graphs/contributors)"
|
||||
],
|
||||
|
|
100
dist/openpgp.js
vendored
100
dist/openpgp.js
vendored
|
@ -4855,7 +4855,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|||
/**
|
||||
* @class
|
||||
* @classdesc Class that represents an OpenPGP cleartext signed message.
|
||||
* See {@link http://tools.ietf.org/html/rfc4880#section-7}
|
||||
* See {@link https://tools.ietf.org/html/rfc4880#section-7}
|
||||
* @param {String} text The cleartext of the signed message
|
||||
* @param {module:signature} signature The detached signature or an empty signature if message not yet signed
|
||||
*/
|
||||
|
@ -5230,7 +5230,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|||
|
||||
// Modified by Recurity Labs GmbH
|
||||
|
||||
// modified version of http://www.hanewin.net/encrypt/PGdecode.js:
|
||||
// modified version of https://www.hanewin.net/encrypt/PGdecode.js:
|
||||
|
||||
/* OpenPGP encryption using RSA/AES
|
||||
* Copyright 2005-2006 Herbert Hanewinkel, www.haneWIN.de
|
||||
|
@ -7193,7 +7193,7 @@ exports.default = {
|
|||
/**
|
||||
* Encrypts data using the specified public key multiprecision integers
|
||||
* and the specified algorithm.
|
||||
* @param {module:enums.publicKey} algo Algorithm to be used (See {@link http://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1})
|
||||
* @param {module:enums.publicKey} algo Algorithm to be used (See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1})
|
||||
* @param {Array<module:type/mpi>} publicMPIs Algorithm dependent multiprecision integers
|
||||
* @param {module:type/mpi} data Data to be encrypted as MPI
|
||||
* @return {Array<module:type/mpi>} if RSA an module:type/mpi;
|
||||
|
@ -7234,7 +7234,7 @@ exports.default = {
|
|||
/**
|
||||
* Decrypts data using the specified public key multiprecision integers of the private key,
|
||||
* the specified secretMPIs of the private key and the specified algorithm.
|
||||
* @param {module:enums.publicKey} algo Algorithm to be used (See {@link http://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1})
|
||||
* @param {module:enums.publicKey} algo Algorithm to be used (See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1})
|
||||
* @param {Array<module:type/mpi>} publicMPIs Algorithm dependent multiprecision integers
|
||||
* of the public key part of the private key
|
||||
* @param {Array<module:type/mpi>} secretMPIs Algorithm dependent multiprecision integers
|
||||
|
@ -7369,7 +7369,7 @@ exports.default = {
|
|||
|
||||
/**
|
||||
* generate random byte prefix as string for the specified algorithm
|
||||
* @param {module:enums.symmetric} algo Algorithm to use (see {@link http://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2})
|
||||
* @param {module:enums.symmetric} algo Algorithm to use (see {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2})
|
||||
* @return {Uint8Array} Random bytes with length equal to the block
|
||||
* size of the cipher
|
||||
*/
|
||||
|
@ -7379,7 +7379,7 @@ exports.default = {
|
|||
|
||||
/**
|
||||
* Generating a session key for the specified symmetric algorithm
|
||||
* @param {module:enums.symmetric} algo Algorithm to use (see {@link http://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2})
|
||||
* @param {module:enums.symmetric} algo Algorithm to use (see {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2})
|
||||
* @return {Uint8Array} Random bytes as a string to be used as a key
|
||||
*/
|
||||
generateSessionKey: function generateSessionKey(algo) {
|
||||
|
@ -7634,7 +7634,7 @@ exports.default = {
|
|||
|
||||
/**
|
||||
* Create a hash on the specified data using the specified algorithm
|
||||
* @param {module:enums.hash} algo Hash algorithm type (see {@link http://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4})
|
||||
* @param {module:enums.hash} algo Hash algorithm type (see {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4})
|
||||
* @param {Uint8Array} data Data to be hashed
|
||||
* @return {Uint8Array} hash value
|
||||
*/
|
||||
|
@ -7668,7 +7668,7 @@ exports.default = {
|
|||
|
||||
/**
|
||||
* Returns the hash size in bytes of the specified hash algorithm type
|
||||
* @param {module:enums.hash} algo Hash algorithm type (See {@link http://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4})
|
||||
* @param {module:enums.hash} algo Hash algorithm type (See {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4})
|
||||
* @return {Integer} Size in bytes of the resulting hash
|
||||
*/
|
||||
getHashByteLength: function getHashByteLength(algo) {
|
||||
|
@ -8208,7 +8208,7 @@ function RMDstring(message) {
|
|||
*
|
||||
* Copyright Brian Turek 2008-2015
|
||||
* Distributed under the BSD License
|
||||
* See http://caligatio.github.com/jsSHA/ for more information
|
||||
* See https://caligatio.github.io/jsSHA/ for more information
|
||||
*
|
||||
* Several functions taken from Paul Johnston
|
||||
*/
|
||||
|
@ -9664,7 +9664,7 @@ var _hash2 = _interopRequireDefault(_hash);
|
|||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* ASN1 object identifiers for hashes (See {@link http://tools.ietf.org/html/rfc4880#section-5.2.2})
|
||||
* ASN1 object identifiers for hashes (See {@link https://tools.ietf.org/html/rfc4880#section-5.2.2})
|
||||
*/
|
||||
var hash_headers = [];
|
||||
hash_headers[1] = [0x30, 0x20, 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x05, 0x05, 0x00, 0x04, 0x10];
|
||||
|
@ -9696,7 +9696,7 @@ function getPkcs1Padding(length) {
|
|||
exports.default = {
|
||||
eme: {
|
||||
/**
|
||||
* create a EME-PKCS1-v1_5 padding (See {@link http://tools.ietf.org/html/rfc4880#section-13.1.1|RFC 4880 13.1.1})
|
||||
* create a EME-PKCS1-v1_5 padding (See {@link https://tools.ietf.org/html/rfc4880#section-13.1.1|RFC 4880 13.1.1})
|
||||
* @param {String} M message to be encoded
|
||||
* @param {Integer} k the length in octets of the key modulus
|
||||
* @return {String} EME-PKCS1 padded message
|
||||
|
@ -9716,7 +9716,7 @@ exports.default = {
|
|||
return EM;
|
||||
},
|
||||
/**
|
||||
* decodes a EME-PKCS1-v1_5 padding (See {@link http://tools.ietf.org/html/rfc4880#section-13.1.2|RFC 4880 13.1.2})
|
||||
* decodes a EME-PKCS1-v1_5 padding (See {@link https://tools.ietf.org/html/rfc4880#section-13.1.2|RFC 4880 13.1.2})
|
||||
* @param {String} EM encoded message, an octet string
|
||||
* @return {String} message, an octet string
|
||||
*/
|
||||
|
@ -9743,7 +9743,7 @@ exports.default = {
|
|||
|
||||
emsa: {
|
||||
/**
|
||||
* create a EMSA-PKCS1-v1_5 padding (See {@link http://tools.ietf.org/html/rfc4880#section-13.1.3|RFC 4880 13.1.3})
|
||||
* create a EMSA-PKCS1-v1_5 padding (See {@link https://tools.ietf.org/html/rfc4880#section-13.1.3|RFC 4880 13.1.3})
|
||||
* @param {Integer} algo Hash algorithm type used
|
||||
* @param {String} M message to be encoded
|
||||
* @param {Integer} emLen intended length in octets of the encoded message
|
||||
|
@ -12302,8 +12302,8 @@ exports.default = {
|
|||
|
||||
/**
|
||||
* Create a signature on data using the specified algorithm
|
||||
* @param {module:enums.hash} hash_algo hash Algorithm to use (See {@link http://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4})
|
||||
* @param {module:enums.publicKey} algo Asymmetric cipher algorithm to use (See {@link http://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1})
|
||||
* @param {module:enums.hash} hash_algo hash Algorithm to use (See {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4})
|
||||
* @param {module:enums.publicKey} algo Asymmetric cipher algorithm to use (See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1})
|
||||
* @param {Array<module:type/mpi>} publicMPIs Public key multiprecision integers
|
||||
* of the private key
|
||||
* @param {Array<module:type/mpi>} secretMPIs Private key multiprecision
|
||||
|
@ -12866,7 +12866,7 @@ exports.default = {
|
|||
gnu: 101
|
||||
},
|
||||
|
||||
/** {@link http://tools.ietf.org/html/rfc4880#section-9.1|RFC4880, section 9.1}
|
||||
/** {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC4880, section 9.1}
|
||||
* @enum {Integer}
|
||||
* @readonly
|
||||
*/
|
||||
|
@ -12878,7 +12878,7 @@ exports.default = {
|
|||
dsa: 17
|
||||
},
|
||||
|
||||
/** {@link http://tools.ietf.org/html/rfc4880#section-9.2|RFC4880, section 9.2}
|
||||
/** {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC4880, section 9.2}
|
||||
* @enum {Integer}
|
||||
* @readonly
|
||||
*/
|
||||
|
@ -12895,7 +12895,7 @@ exports.default = {
|
|||
twofish: 10
|
||||
},
|
||||
|
||||
/** {@link http://tools.ietf.org/html/rfc4880#section-9.3|RFC4880, section 9.3}
|
||||
/** {@link https://tools.ietf.org/html/rfc4880#section-9.3|RFC4880, section 9.3}
|
||||
* @enum {Integer}
|
||||
* @readonly
|
||||
*/
|
||||
|
@ -12908,7 +12908,7 @@ exports.default = {
|
|||
bzip2: 3
|
||||
},
|
||||
|
||||
/** {@link http://tools.ietf.org/html/rfc4880#section-9.4|RFC4880, section 9.4}
|
||||
/** {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC4880, section 9.4}
|
||||
* @enum {Integer}
|
||||
* @readonly
|
||||
*/
|
||||
|
@ -13935,7 +13935,7 @@ Key.prototype.verifyPrimaryKey = function () {
|
|||
return _enums2.default.keyStatus.expired;
|
||||
}
|
||||
// check for at least one self signature. Self signature of user ID not mandatory
|
||||
// See {@link http://tools.ietf.org/html/rfc4880#section-11.1}
|
||||
// See {@link https://tools.ietf.org/html/rfc4880#section-11.1}
|
||||
var selfSigned = false;
|
||||
for (var i = 0; i < this.users.length; i++) {
|
||||
if (this.users[i].userId && this.users[i].selfCertifications) {
|
||||
|
@ -14589,7 +14589,7 @@ function readArmored(armoredText) {
|
|||
* Generates a new OpenPGP key. Currently only supports RSA keys.
|
||||
* Primary and subkey will be of same type.
|
||||
* @param {module:enums.publicKey} [options.keyType=module:enums.publicKey.rsa_encrypt_sign] to indicate what type of key to make.
|
||||
* RSA is 1. See {@link http://tools.ietf.org/html/rfc4880#section-9.1}
|
||||
* RSA is 1. See {@link https://tools.ietf.org/html/rfc4880#section-9.1}
|
||||
* @param {Integer} options.numBits number of bits for the key creation.
|
||||
* @param {String|Array<String>} options.userIds assumes already in form of "User Name <username@email.com>"
|
||||
If array is used, the first userId is set as primary user Id
|
||||
|
@ -15264,7 +15264,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|||
* @classdesc Class that represents an OpenPGP message.
|
||||
* Can be an encrypted message, signed message, compressed message or literal message
|
||||
* @param {module:packet/packetlist} packetlist The packets that form this message
|
||||
* See {@link http://tools.ietf.org/html/rfc4880#section-11.3}
|
||||
* See {@link https://tools.ietf.org/html/rfc4880#section-11.3}
|
||||
*/
|
||||
|
||||
function Message(packetlist) {
|
||||
|
@ -16715,7 +16715,7 @@ function newPacketFromTag(tag) {
|
|||
|
||||
/**
|
||||
* Allocate a new packet from structured packet clone
|
||||
* See {@link http://www.w3.org/html/wg/drafts/html/master/infrastructure.html#safe-passing-of-structured-data}
|
||||
* See {@link https://w3c.github.io/html/infrastructure.html#safe-passing-of-structured-data}
|
||||
* @param {Object} packetClone packet clone
|
||||
* @returns {Object} new packet object with data from packet clone
|
||||
*/
|
||||
|
@ -16947,7 +16947,7 @@ function packetlistCloneToSignature(clone) {
|
|||
/**
|
||||
* Implementation of the Compressed Data Packet (Tag 8)<br/>
|
||||
* <br/>
|
||||
* {@link http://tools.ietf.org/html/rfc4880#section-5.6|RFC4880 5.6}: The Compressed Data packet contains compressed data. Typically,
|
||||
* {@link https://tools.ietf.org/html/rfc4880#section-5.6|RFC4880 5.6}: The Compressed Data packet contains compressed data. Typically,
|
||||
* this packet is found as the contents of an encrypted packet, or following
|
||||
* a Signature or One-Pass Signature packet, and contains a literal data packet.
|
||||
* @requires compression/zlib
|
||||
|
@ -17166,7 +17166,7 @@ exports.default = mod;
|
|||
/**
|
||||
* Implementation of the Literal Data Packet (Tag 11)<br/>
|
||||
* <br/>
|
||||
* {@link http://tools.ietf.org/html/rfc4880#section-5.9|RFC4880 5.9}: A Literal Data packet contains the body of a message; data that
|
||||
* {@link https://tools.ietf.org/html/rfc4880#section-5.9|RFC4880 5.9}: A Literal Data packet contains the body of a message; data that
|
||||
* is not to be further interpreted.
|
||||
* @requires enums
|
||||
* @requires util
|
||||
|
@ -17317,7 +17317,7 @@ Literal.prototype.write = function () {
|
|||
/**
|
||||
* Implementation of the strange "Marker packet" (Tag 10)<br/>
|
||||
* <br/>
|
||||
* {@link http://tools.ietf.org/html/rfc4880#section-5.8|RFC4880 5.8}: An experimental version of PGP used this packet as the Literal
|
||||
* {@link https://tools.ietf.org/html/rfc4880#section-5.8|RFC4880 5.8}: An experimental version of PGP used this packet as the Literal
|
||||
* packet, but no released version of PGP generated Literal packets with this
|
||||
* tag. With PGP 5.x, this packet has been reassigned and is reserved for use as
|
||||
* the Marker packet.<br/>
|
||||
|
@ -17390,7 +17390,7 @@ Marker.prototype.read = function (bytes) {
|
|||
/**
|
||||
* Implementation of the One-Pass Signature Packets (Tag 4)<br/>
|
||||
* <br/>
|
||||
* {@link http://tools.ietf.org/html/rfc4880#section-5.4|RFC4880 5.4}: The One-Pass Signature packet precedes the signed data and contains
|
||||
* {@link https://tools.ietf.org/html/rfc4880#section-5.4|RFC4880 5.4}: The One-Pass Signature packet precedes the signed data and contains
|
||||
* enough information to allow the receiver to begin calculating any
|
||||
* hashes needed to verify the signature. It allows the Signature
|
||||
* packet to be placed at the end of the message, so that the signer
|
||||
|
@ -17428,9 +17428,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|||
function OnePassSignature() {
|
||||
this.tag = _enums2.default.packet.onePassSignature; // The packet type
|
||||
this.version = null; // A one-octet version number. The current version is 3.
|
||||
this.type = null; // A one-octet signature type. Signature types are described in {@link http://tools.ietf.org/html/rfc4880#section-5.2.1|RFC4880 Section 5.2.1}.
|
||||
this.hashAlgorithm = null; // A one-octet number describing the hash algorithm used. (See {@link http://tools.ietf.org/html/rfc4880#section-9.4|RFC4880 9.4})
|
||||
this.publicKeyAlgorithm = null; // A one-octet number describing the public-key algorithm used. (See {@link http://tools.ietf.org/html/rfc4880#section-9.1|RFC4880 9.1})
|
||||
this.type = null; // A one-octet signature type. Signature types are described in {@link https://tools.ietf.org/html/rfc4880#section-5.2.1|RFC4880 Section 5.2.1}.
|
||||
this.hashAlgorithm = null; // A one-octet number describing the hash algorithm used. (See {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC4880 9.4})
|
||||
this.publicKeyAlgorithm = null; // A one-octet number describing the public-key algorithm used. (See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC4880 9.1})
|
||||
this.signingKeyId = null; // An eight-octet number holding the Key ID of the signing key.
|
||||
this.flags = null; // A one-octet number holding a flag showing whether the signature is nested. A zero value indicates that the next packet is another One-Pass Signature packet that describes another signature to be applied to the same message data.
|
||||
}
|
||||
|
@ -17991,7 +17991,7 @@ Packetlist.prototype.concat = function (packetlist) {
|
|||
|
||||
/**
|
||||
* Allocate a new packetlist from structured packetlist clone
|
||||
* See {@link http://www.w3.org/html/wg/drafts/html/master/infrastructure.html#safe-passing-of-structured-data}
|
||||
* See {@link https://w3c.github.io/html/infrastructure.html#safe-passing-of-structured-data}
|
||||
* @param {Object} packetClone packetlist clone
|
||||
* @returns {Object} new packetlist object with data from packetlist clone
|
||||
*/
|
||||
|
@ -18029,7 +18029,7 @@ Packetlist.fromStructuredClone = function (packetlistClone) {
|
|||
/**
|
||||
* Implementation of the Key Material Packet (Tag 5,6,7,14)<br/>
|
||||
* <br/>
|
||||
* {@link http://tools.ietf.org/html/rfc4880#section-5.5|RFC4480 5.5}:
|
||||
* {@link https://tools.ietf.org/html/rfc4880#section-5.5|RFC4480 5.5}:
|
||||
* A key material packet contains all the information about a public or
|
||||
* private key. There are four variants of this packet type, and two
|
||||
* major versions. Consequently, this section is complex.
|
||||
|
@ -18100,7 +18100,7 @@ function PublicKey() {
|
|||
}
|
||||
|
||||
/**
|
||||
* Internal Parser for public keys as specified in {@link http://tools.ietf.org/html/rfc4880#section-5.5.2|RFC 4880 section 5.5.2 Public-Key Packet Formats}
|
||||
* Internal Parser for public keys as specified in {@link https://tools.ietf.org/html/rfc4880#section-5.5.2|RFC 4880 section 5.5.2 Public-Key Packet Formats}
|
||||
* called by read_tag<num>
|
||||
* @param {Uint8Array} bytes Input array to read the packet from
|
||||
* @return {Object} This object with attributes set by the parser
|
||||
|
@ -18276,7 +18276,7 @@ PublicKey.prototype.postCloneTypeFix = function () {
|
|||
/**
|
||||
* Public-Key Encrypted Session Key Packets (Tag 1)<br/>
|
||||
* <br/>
|
||||
* {@link http://tools.ietf.org/html/rfc4880#section-5.1|RFC4880 5.1}: A Public-Key Encrypted Session Key packet holds the session key
|
||||
* {@link https://tools.ietf.org/html/rfc4880#section-5.1|RFC4880 5.1}: A Public-Key Encrypted Session Key packet holds the session key
|
||||
* used to encrypt a message. Zero or more Public-Key Encrypted Session Key
|
||||
* packets and/or Symmetric-Key Encrypted Session Key packets may precede a
|
||||
* Symmetrically Encrypted Data Packet, which holds an encrypted message. The
|
||||
|
@ -18519,7 +18519,7 @@ PublicSubkey.prototype.constructor = PublicSubkey;
|
|||
/**
|
||||
* Implementation of the Key Material Packet (Tag 5,6,7,14)<br/>
|
||||
* <br/>
|
||||
* {@link http://tools.ietf.org/html/rfc4880#section-5.5|RFC4480 5.5}:
|
||||
* {@link https://tools.ietf.org/html/rfc4880#section-5.5|RFC4480 5.5}:
|
||||
* A key material packet contains all the information about a public or
|
||||
* private key. There are four variants of this packet type, and two
|
||||
* major versions. Consequently, this section is complex.
|
||||
|
@ -18645,7 +18645,7 @@ function write_cleartext_mpi(hash_algorithm, algorithm, mpi) {
|
|||
// 5.5.3. Secret-Key Packet Formats
|
||||
|
||||
/**
|
||||
* Internal parser for private keys as specified in {@link http://tools.ietf.org/html/rfc4880#section-5.5.3|RFC 4880 section 5.5.3}
|
||||
* Internal parser for private keys as specified in {@link https://tools.ietf.org/html/rfc4880#section-5.5.3|RFC 4880 section 5.5.3}
|
||||
* @param {String} bytes Input string to read the packet from
|
||||
*/
|
||||
SecretKey.prototype.read = function (bytes) {
|
||||
|
@ -18918,7 +18918,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|||
/**
|
||||
* Implementation of the Signature Packet (Tag 2)<br/>
|
||||
* <br/>
|
||||
* {@link http://tools.ietf.org/html/rfc4880#section-5.2|RFC4480 5.2}:
|
||||
* {@link https://tools.ietf.org/html/rfc4880#section-5.2|RFC4480 5.2}:
|
||||
* A Signature packet describes a binding between some public key and
|
||||
* some data. The most common signatures are a signature of a file or a
|
||||
* block of text, and a signature that is a certification of a User ID.
|
||||
|
@ -19243,11 +19243,11 @@ Signature.prototype.write_all_sub_packets = function () {
|
|||
};
|
||||
|
||||
/**
|
||||
* creates a string representation of a sub signature packet (See {@link http://tools.ietf.org/html/rfc4880#section-5.2.3.1|RFC 4880 5.2.3.1})
|
||||
* creates a string representation of a sub signature packet (See {@link https://tools.ietf.org/html/rfc4880#section-5.2.3.1|RFC 4880 5.2.3.1})
|
||||
* @param {Integer} type subpacket signature type. Signature types as described
|
||||
* in {@link http://tools.ietf.org/html/rfc4880#section-5.2.3.2|RFC4880 Section 5.2.3.2}
|
||||
* in {@link https://tools.ietf.org/html/rfc4880#section-5.2.3.2|RFC4880 Section 5.2.3.2}
|
||||
* @param {String} data data to be included
|
||||
* @return {String} a string-representation of a sub signature packet (See {@link http://tools.ietf.org/html/rfc4880#section-5.2.3.1|RFC 4880 5.2.3.1})
|
||||
* @return {String} a string-representation of a sub signature packet (See {@link https://tools.ietf.org/html/rfc4880#section-5.2.3.1|RFC 4880 5.2.3.1})
|
||||
*/
|
||||
function write_sub_packet(type, data) {
|
||||
var arr = [];
|
||||
|
@ -19676,7 +19676,7 @@ SymEncryptedAEADProtected.prototype.encrypt = function (sessionKeyAlgorithm, key
|
|||
* Implementation of the Sym. Encrypted Integrity Protected Data
|
||||
* Packet (Tag 18)<br/>
|
||||
* <br/>
|
||||
* {@link http://tools.ietf.org/html/rfc4880#section-5.13|RFC4880 5.13}:
|
||||
* {@link https://tools.ietf.org/html/rfc4880#section-5.13|RFC4880 5.13}:
|
||||
* The Symmetrically Encrypted Integrity Protected Data packet is
|
||||
* a variant of the Symmetrically Encrypted Data packet. It is a new feature
|
||||
* created for OpenPGP that addresses the problem of detecting a modification to
|
||||
|
@ -19880,7 +19880,7 @@ function nodeDecrypt(algo, ct, key) {
|
|||
/**
|
||||
* Public-Key Encrypted Session Key Packets (Tag 1)<br/>
|
||||
* <br/>
|
||||
* {@link http://tools.ietf.org/html/rfc4880#section-5.1|RFC4880 5.1}: A Public-Key Encrypted Session Key packet holds the session key
|
||||
* {@link https://tools.ietf.org/html/rfc4880#section-5.1|RFC4880 5.1}: A Public-Key Encrypted Session Key packet holds the session key
|
||||
* used to encrypt a message. Zero or more Public-Key Encrypted Session Key
|
||||
* packets and/or Symmetric-Key Encrypted Session Key packets may precede a
|
||||
* Symmetrically Encrypted Data Packet, which holds an encrypted message. The
|
||||
|
@ -20049,7 +20049,7 @@ SymEncryptedSessionKey.prototype.postCloneTypeFix = function () {
|
|||
/**
|
||||
* Implementation of the Symmetrically Encrypted Data Packet (Tag 9)<br/>
|
||||
* <br/>
|
||||
* {@link http://tools.ietf.org/html/rfc4880#section-5.7|RFC4880 5.7}: The Symmetrically Encrypted Data packet contains data encrypted
|
||||
* {@link https://tools.ietf.org/html/rfc4880#section-5.7|RFC4880 5.7}: The Symmetrically Encrypted Data packet contains data encrypted
|
||||
* with a symmetric-key algorithm. When it has been decrypted, it contains other
|
||||
* packets (usually a literal data packet or compressed data packet, but in
|
||||
* theory other Symmetrically Encrypted Data packets or sequences of packets
|
||||
|
@ -20104,7 +20104,7 @@ SymmetricallyEncrypted.prototype.write = function () {
|
|||
* Symmetrically decrypt the packet data
|
||||
*
|
||||
* @param {module:enums.symmetric} sessionKeyAlgorithm
|
||||
* Symmetric key algorithm to use // See {@link http://tools.ietf.org/html/rfc4880#section-9.2|RFC4880 9.2}
|
||||
* Symmetric key algorithm to use // See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC4880 9.2}
|
||||
* @param {String} key
|
||||
* Key as string with the corresponding length to the
|
||||
* algorithm
|
||||
|
@ -20460,7 +20460,7 @@ function read(input) {
|
|||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
/**
|
||||
* Implementation of type key id ({@link http://tools.ietf.org/html/rfc4880#section-3.3|RFC4880 3.3})<br/>
|
||||
* Implementation of type key id ({@link https://tools.ietf.org/html/rfc4880#section-3.3|RFC4880 3.3})<br/>
|
||||
* <br/>
|
||||
* A Key ID is an eight-octet scalar that identifies a key.
|
||||
* Implementations SHOULD NOT assume that Key IDs are unique. The
|
||||
|
@ -20554,7 +20554,7 @@ Keyid.fromId = function (hex) {
|
|||
// - MPI = c | d << 8 | e << ((MPI.length -2)*8) | f ((MPI.length -2)*8)
|
||||
|
||||
/**
|
||||
* Implementation of type MPI ({@link http://tools.ietf.org/html/rfc4880#section-3.2|RFC4880 3.2})<br/>
|
||||
* Implementation of type MPI ({@link https://tools.ietf.org/html/rfc4880#section-3.2|RFC4880 3.2})<br/>
|
||||
* <br/>
|
||||
* Multiprecision integers (also called MPIs) are unsigned integers used
|
||||
* to hold large integers such as the ones used in cryptographic
|
||||
|
@ -20593,7 +20593,7 @@ function MPI() {
|
|||
}
|
||||
|
||||
/**
|
||||
* Parsing function for a mpi ({@link http://tools.ietf.org/html/rfc4880#section3.2|RFC 4880 3.2}).
|
||||
* Parsing function for a mpi ({@link https://tools.ietf.org/html/rfc4880#section3.2|RFC 4880 3.2}).
|
||||
* @param {String} input Payload of mpi data
|
||||
* @return {Integer} Length of data read
|
||||
*/
|
||||
|
@ -20637,7 +20637,7 @@ MPI.prototype.byteLength = function () {
|
|||
};
|
||||
|
||||
/**
|
||||
* Converts the mpi object to a bytes as specified in {@link http://tools.ietf.org/html/rfc4880#section-3.2|RFC4880 3.2}
|
||||
* Converts the mpi object to a bytes as specified in {@link https://tools.ietf.org/html/rfc4880#section-3.2|RFC4880 3.2}
|
||||
* @return {Uint8Aray} mpi Byte representation
|
||||
*/
|
||||
MPI.prototype.write = function () {
|
||||
|
@ -20680,7 +20680,7 @@ MPI.fromClone = function (clone) {
|
|||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
/**
|
||||
* Implementation of the String-to-key specifier ({@link http://tools.ietf.org/html/rfc4880#section-3.7|RFC4880 3.7})<br/>
|
||||
* Implementation of the String-to-key specifier ({@link https://tools.ietf.org/html/rfc4880#section-3.7|RFC4880 3.7})<br/>
|
||||
* <br/>
|
||||
* String-to-key (S2K) specifiers are used to convert passphrase strings
|
||||
* into symmetric-key encryption/decryption keys. They are used in two
|
||||
|
@ -20737,7 +20737,7 @@ S2K.prototype.get_count = function () {
|
|||
};
|
||||
|
||||
/**
|
||||
* Parsing function for a string-to-key specifier ({@link http://tools.ietf.org/html/rfc4880#section-3.7|RFC 4880 3.7}).
|
||||
* Parsing function for a string-to-key specifier ({@link https://tools.ietf.org/html/rfc4880#section-3.7|RFC 4880 3.7}).
|
||||
* @param {String} input Payload of string-to-key specifier
|
||||
* @return {Integer} Actual length of the object
|
||||
*/
|
||||
|
|
2
dist/openpgp.min.js
vendored
2
dist/openpgp.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/openpgp.worker.min.js
vendored
2
dist/openpgp.worker.min.js
vendored
|
@ -1,2 +1,2 @@
|
|||
/*! OpenPGP.js v2.6.2 - 2018-01-21 - this is LGPL licensed code, see LICENSE/our website http://openpgpjs.org/ for more information. */
|
||||
/*! OpenPGP.js v2.6.2 - 2018-01-21 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */
|
||||
!function e(n,r,t){function o(i,f){if(!r[i]){if(!n[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(a)return a(i,!0);var s=new Error("Cannot find module '"+i+"'");throw s.code="MODULE_NOT_FOUND",s}var u=r[i]={exports:{}};n[i][0].call(u.exports,function(e){var r=n[i][1][e];return o(r||e)},u,u.exports,e,n,r,t)}return r[i].exports}for(var a="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}({1:[function(e,n,r){function t(e){o.crypto.random.randomBuffer.size<a&&self.postMessage({event:"request-seed"}),self.postMessage(e,o.util.getTransferables.call(o.util,e.data))}self.window={},importScripts("openpgp.min.js");var o=window.openpgp,a=4e4;o.crypto.random.randomBuffer.init(6e4),self.onmessage=function(e){var n=e.data||{};switch(n.event){case"configure":!function(e){for(var n in e)o.config[n]=e[n]}(n.config);break;case"seed-random":!function(e){e instanceof Uint8Array||(e=new Uint8Array(e)),o.crypto.random.randomBuffer.set(e)}(n.buf);break;default:!function(e,n,r){"function"==typeof o[n]?(r=o.packet.clone.parseClonedPackets(r,n),o[n](r).then(function(n){t({id:e,event:"method-return",data:o.packet.clone.clonePackets(n)})}).catch(function(n){t({id:e,event:"method-return",err:n.message,stack:n.stack})})):t({id:e,event:"method-return",err:"Unknown Worker Event"})}(n.id,n.event,n.options||{})}}},{}]},{},[1]);
|
|
@ -3,7 +3,7 @@
|
|||
"description": "OpenPGP.js is a Javascript implementation of the OpenPGP protocol. This is defined in RFC 4880.",
|
||||
"version": "3.0.0",
|
||||
"license": "LGPL-3.0+",
|
||||
"homepage": "http://openpgpjs.org/",
|
||||
"homepage": "https://openpgpjs.org/",
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
},
|
||||
|
|
|
@ -35,7 +35,7 @@ import { Signature } from './signature';
|
|||
/**
|
||||
* @class
|
||||
* @classdesc Class that represents an OpenPGP cleartext signed message.
|
||||
* See {@link http://tools.ietf.org/html/rfc4880#section-7}
|
||||
* See {@link https://tools.ietf.org/html/rfc4880#section-7}
|
||||
* @param {String} text The cleartext of the signed message
|
||||
* @param {module:signature} signature The detached signature or an empty signature if message not yet signed
|
||||
*/
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
// Modified by Recurity Labs GmbH
|
||||
|
||||
// modified version of http://www.hanewin.net/encrypt/PGdecode.js:
|
||||
// modified version of https://www.hanewin.net/encrypt/PGdecode.js:
|
||||
|
||||
/* OpenPGP encryption using RSA/AES
|
||||
* Copyright 2005-2006 Herbert Hanewinkel, www.haneWIN.de
|
||||
|
|
|
@ -53,7 +53,7 @@ export default {
|
|||
/**
|
||||
* Encrypts data using the specified public key multiprecision integers
|
||||
* and the specified algorithm.
|
||||
* @param {module:enums.publicKey} algo Algorithm to be used (See {@link http://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1})
|
||||
* @param {module:enums.publicKey} algo Algorithm to be used (See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1})
|
||||
* @param {Array<module:type/mpi|module:type/oid|module:type/kdf_params|module:type/ecdh_symkey>} publicParams Algorithm dependent params
|
||||
* @param {module:type/mpi} data Data to be encrypted as MPI
|
||||
* @param {String} fingerprint Recipient fingerprint
|
||||
|
@ -99,7 +99,7 @@ export default {
|
|||
/**
|
||||
* Decrypts data using the specified public key multiprecision integers of the private key,
|
||||
* the specified secretMPIs of the private key and the specified algorithm.
|
||||
* @param {module:enums.publicKey} algo Algorithm to be used (See {@link http://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1})
|
||||
* @param {module:enums.publicKey} algo Algorithm to be used (See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1})
|
||||
* @param {Array<module:type/mpi|module:type/oid|module:type/kdf_params>} keyIntegers Algorithm dependent params
|
||||
* @param {Array<module:type/mpi|module:type/ecdh_symkey>} dataIntegers encrypted session key parameters
|
||||
* @param {String} fingerprint Recipient fingerprint
|
||||
|
@ -286,7 +286,7 @@ export default {
|
|||
|
||||
/**
|
||||
* generate random byte prefix as string for the specified algorithm
|
||||
* @param {module:enums.symmetric} algo Algorithm to use (see {@link http://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2})
|
||||
* @param {module:enums.symmetric} algo Algorithm to use (see {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2})
|
||||
* @return {Uint8Array} Random bytes with length equal to the block
|
||||
* size of the cipher
|
||||
*/
|
||||
|
@ -296,7 +296,7 @@ export default {
|
|||
|
||||
/**
|
||||
* Generating a session key for the specified symmetric algorithm
|
||||
* @param {module:enums.symmetric} algo Algorithm to use (see {@link http://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2})
|
||||
* @param {module:enums.symmetric} algo Algorithm to use (see {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2})
|
||||
* @return {Uint8Array} Random bytes as a string to be used as a key
|
||||
*/
|
||||
generateSessionKey: function(algo) {
|
||||
|
|
|
@ -75,7 +75,7 @@ export default {
|
|||
|
||||
/**
|
||||
* Create a hash on the specified data using the specified algorithm
|
||||
* @param {module:enums.hash} algo Hash algorithm type (see {@link http://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4})
|
||||
* @param {module:enums.hash} algo Hash algorithm type (see {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4})
|
||||
* @param {Uint8Array} data Data to be hashed
|
||||
* @return {Uint8Array} hash value
|
||||
*/
|
||||
|
@ -109,7 +109,7 @@ export default {
|
|||
|
||||
/**
|
||||
* Returns the hash size in bytes of the specified hash algorithm type
|
||||
* @param {module:enums.hash} algo Hash algorithm type (See {@link http://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4})
|
||||
* @param {module:enums.hash} algo Hash algorithm type (See {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4})
|
||||
* @return {Integer} Size in bytes of the resulting hash
|
||||
*/
|
||||
getHashByteLength: function(algo) {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*
|
||||
* Copyright Brian Turek 2008-2015
|
||||
* Distributed under the BSD License
|
||||
* See http://caligatio.github.com/jsSHA/ for more information
|
||||
* See https://caligatio.github.com/jsSHA/ for more information
|
||||
*
|
||||
* Several functions taken from Paul Johnston
|
||||
*/
|
||||
|
|
|
@ -33,7 +33,7 @@ import BigInteger from './public_key/jsbn.js';
|
|||
import hash from './hash';
|
||||
|
||||
/**
|
||||
* ASN1 object identifiers for hashes (See {@link http://tools.ietf.org/html/rfc4880#section-5.2.2})
|
||||
* ASN1 object identifiers for hashes (See {@link https://tools.ietf.org/html/rfc4880#section-5.2.2})
|
||||
*/
|
||||
var hash_headers = [];
|
||||
hash_headers[1] = [0x30, 0x20, 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x05, 0x05, 0x00, 0x04,
|
||||
|
@ -71,7 +71,7 @@ function getPkcs1Padding(length) {
|
|||
export default {
|
||||
eme: {
|
||||
/**
|
||||
* create a EME-PKCS1-v1_5 padding (See {@link http://tools.ietf.org/html/rfc4880#section-13.1.1|RFC 4880 13.1.1})
|
||||
* create a EME-PKCS1-v1_5 padding (See {@link https://tools.ietf.org/html/rfc4880#section-13.1.1|RFC 4880 13.1.1})
|
||||
* @param {String} M message to be encoded
|
||||
* @param {Integer} k the length in octets of the key modulus
|
||||
* @return {String} EME-PKCS1 padded message
|
||||
|
@ -95,7 +95,7 @@ export default {
|
|||
return EM;
|
||||
},
|
||||
/**
|
||||
* decodes a EME-PKCS1-v1_5 padding (See {@link http://tools.ietf.org/html/rfc4880#section-13.1.2|RFC 4880 13.1.2})
|
||||
* decodes a EME-PKCS1-v1_5 padding (See {@link https://tools.ietf.org/html/rfc4880#section-13.1.2|RFC 4880 13.1.2})
|
||||
* @param {String} EM encoded message, an octet string
|
||||
* @return {String} message, an octet string
|
||||
*/
|
||||
|
@ -122,7 +122,7 @@ export default {
|
|||
|
||||
emsa: {
|
||||
/**
|
||||
* create a EMSA-PKCS1-v1_5 padding (See {@link http://tools.ietf.org/html/rfc4880#section-13.1.3|RFC 4880 13.1.3})
|
||||
* create a EMSA-PKCS1-v1_5 padding (See {@link https://tools.ietf.org/html/rfc4880#section-13.1.3|RFC 4880 13.1.3})
|
||||
* @param {Integer} algo Hash algorithm type used
|
||||
* @param {String} M message to be encoded
|
||||
* @param {Integer} emLen intended length in octets of the encoded message
|
||||
|
|
|
@ -85,8 +85,8 @@ export default {
|
|||
|
||||
/**
|
||||
* Create a signature on data using the specified algorithm
|
||||
* @param {module:enums.hash} hash_algo hash Algorithm to use (See {@link http://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4})
|
||||
* @param {module:enums.publicKey} algo Asymmetric cipher algorithm to use (See {@link http://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1})
|
||||
* @param {module:enums.hash} hash_algo hash Algorithm to use (See {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4})
|
||||
* @param {module:enums.publicKey} algo Asymmetric cipher algorithm to use (See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1})
|
||||
* @param {Array<module:type/mpi>} keyIntegers Public followed by Private key multiprecision algorithm-specific parameters
|
||||
* @param {Uint8Array} data Data to be signed
|
||||
* @return {Array<module:type/mpi>}
|
||||
|
|
|
@ -69,7 +69,7 @@ export default {
|
|||
gnu: 101
|
||||
},
|
||||
|
||||
/** {@link http://tools.ietf.org/html/rfc4880#section-9.1|RFC4880, section 9.1}
|
||||
/** {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC4880, section 9.1}
|
||||
* @enum {Integer}
|
||||
* @readonly
|
||||
*/
|
||||
|
@ -84,7 +84,7 @@ export default {
|
|||
eddsa: 22
|
||||
},
|
||||
|
||||
/** {@link http://tools.ietf.org/html/rfc4880#section-9.2|RFC4880, section 9.2}
|
||||
/** {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC4880, section 9.2}
|
||||
* @enum {Integer}
|
||||
* @readonly
|
||||
*/
|
||||
|
@ -101,7 +101,7 @@ export default {
|
|||
twofish: 10
|
||||
},
|
||||
|
||||
/** {@link http://tools.ietf.org/html/rfc4880#section-9.3|RFC4880, section 9.3}
|
||||
/** {@link https://tools.ietf.org/html/rfc4880#section-9.3|RFC4880, section 9.3}
|
||||
* @enum {Integer}
|
||||
* @readonly
|
||||
*/
|
||||
|
@ -114,7 +114,7 @@ export default {
|
|||
bzip2: 3
|
||||
},
|
||||
|
||||
/** {@link http://tools.ietf.org/html/rfc4880#section-9.4|RFC4880, section 9.4}
|
||||
/** {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC4880, section 9.4}
|
||||
* @enum {Integer}
|
||||
* @readonly
|
||||
*/
|
||||
|
|
|
@ -465,7 +465,7 @@ Key.prototype.verifyPrimaryKey = async function(allowExpired=false) {
|
|||
return enums.keyStatus.expired;
|
||||
}
|
||||
// check for at least one self signature. Self signature of user ID not mandatory
|
||||
// See {@link http://tools.ietf.org/html/rfc4880#section-11.1}
|
||||
// See {@link https://tools.ietf.org/html/rfc4880#section-11.1}
|
||||
if (!this.users.some(user => user.userId && user.selfCertifications)) {
|
||||
return enums.keyStatus.no_self_cert;
|
||||
}
|
||||
|
@ -1156,7 +1156,7 @@ export function readArmored(armoredText) {
|
|||
* Generates a new OpenPGP key. Supports RSA and ECC keys.
|
||||
* Primary and subkey will be of same type.
|
||||
* @param {module:enums.publicKey} [options.keyType=module:enums.publicKey.rsa_encrypt_sign] to indicate what type of key to make.
|
||||
* RSA is 1. See {@link http://tools.ietf.org/html/rfc4880#section-9.1}
|
||||
* RSA is 1. See {@link https://tools.ietf.org/html/rfc4880#section-9.1}
|
||||
* @param {Integer} options.numBits number of bits for the key creation.
|
||||
* @param {String|Array<String>} options.userIds assumes already in form of "User Name <username@email.com>"
|
||||
If array is used, the first userId is set as primary user Id
|
||||
|
|
|
@ -44,7 +44,7 @@ import { getPreferredHashAlgo, getPreferredSymAlgo } from './key';
|
|||
* @classdesc Class that represents an OpenPGP message.
|
||||
* Can be an encrypted message, signed message, compressed message or literal message
|
||||
* @param {module:packet/packetlist} packetlist The packets that form this message
|
||||
* See {@link http://tools.ietf.org/html/rfc4880#section-11.3}
|
||||
* See {@link https://tools.ietf.org/html/rfc4880#section-11.3}
|
||||
*/
|
||||
|
||||
export function Message(packetlist) {
|
||||
|
|
|
@ -54,7 +54,7 @@ export function newPacketFromTag(tag) {
|
|||
|
||||
/**
|
||||
* Allocate a new packet from structured packet clone
|
||||
* See {@link http://www.w3.org/html/wg/drafts/html/master/infrastructure.html#safe-passing-of-structured-data}
|
||||
* See {@link https://w3c.github.io/html/infrastructure.html#safe-passing-of-structured-data}
|
||||
* @param {Object} packetClone packet clone
|
||||
* @returns {Object} new packet object with data from packet clone
|
||||
*/
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
/**
|
||||
* Implementation of the Compressed Data Packet (Tag 8)<br/>
|
||||
* <br/>
|
||||
* {@link http://tools.ietf.org/html/rfc4880#section-5.6|RFC4880 5.6}: The Compressed Data packet contains compressed data. Typically,
|
||||
* {@link https://tools.ietf.org/html/rfc4880#section-5.6|RFC4880 5.6}: The Compressed Data packet contains compressed data. Typically,
|
||||
* this packet is found as the contents of an encrypted packet, or following
|
||||
* a Signature or One-Pass Signature packet, and contains a literal data packet.
|
||||
* @requires compression/zlib
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
/**
|
||||
* Implementation of the Literal Data Packet (Tag 11)<br/>
|
||||
* <br/>
|
||||
* {@link http://tools.ietf.org/html/rfc4880#section-5.9|RFC4880 5.9}: A Literal Data packet contains the body of a message; data that
|
||||
* {@link https://tools.ietf.org/html/rfc4880#section-5.9|RFC4880 5.9}: A Literal Data packet contains the body of a message; data that
|
||||
* is not to be further interpreted.
|
||||
* @requires enums
|
||||
* @requires util
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
/**
|
||||
* Implementation of the strange "Marker packet" (Tag 10)<br/>
|
||||
* <br/>
|
||||
* {@link http://tools.ietf.org/html/rfc4880#section-5.8|RFC4880 5.8}: An experimental version of PGP used this packet as the Literal
|
||||
* {@link https://tools.ietf.org/html/rfc4880#section-5.8|RFC4880 5.8}: An experimental version of PGP used this packet as the Literal
|
||||
* packet, but no released version of PGP generated Literal packets with this
|
||||
* tag. With PGP 5.x, this packet has been reassigned and is reserved for use as
|
||||
* the Marker packet.<br/>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
/**
|
||||
* Implementation of the One-Pass Signature Packets (Tag 4)<br/>
|
||||
* <br/>
|
||||
* {@link http://tools.ietf.org/html/rfc4880#section-5.4|RFC4880 5.4}: The One-Pass Signature packet precedes the signed data and contains
|
||||
* {@link https://tools.ietf.org/html/rfc4880#section-5.4|RFC4880 5.4}: The One-Pass Signature packet precedes the signed data and contains
|
||||
* enough information to allow the receiver to begin calculating any
|
||||
* hashes needed to verify the signature. It allows the Signature
|
||||
* packet to be placed at the end of the message, so that the signer
|
||||
|
@ -41,9 +41,9 @@ import type_keyid from '../type/keyid.js';
|
|||
export default function OnePassSignature() {
|
||||
this.tag = enums.packet.onePassSignature; // The packet type
|
||||
this.version = null; // A one-octet version number. The current version is 3.
|
||||
this.type = null; // A one-octet signature type. Signature types are described in {@link http://tools.ietf.org/html/rfc4880#section-5.2.1|RFC4880 Section 5.2.1}.
|
||||
this.hashAlgorithm = null; // A one-octet number describing the hash algorithm used. (See {@link http://tools.ietf.org/html/rfc4880#section-9.4|RFC4880 9.4})
|
||||
this.publicKeyAlgorithm = null; // A one-octet number describing the public-key algorithm used. (See {@link http://tools.ietf.org/html/rfc4880#section-9.1|RFC4880 9.1})
|
||||
this.type = null; // A one-octet signature type. Signature types are described in {@link https://tools.ietf.org/html/rfc4880#section-5.2.1|RFC4880 Section 5.2.1}.
|
||||
this.hashAlgorithm = null; // A one-octet number describing the hash algorithm used. (See {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC4880 9.4})
|
||||
this.publicKeyAlgorithm = null; // A one-octet number describing the public-key algorithm used. (See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC4880 9.1})
|
||||
this.signingKeyId = null; // An eight-octet number holding the Key ID of the signing key.
|
||||
this.flags = null; // A one-octet number holding a flag showing whether the signature is nested. A zero value indicates that the next packet is another One-Pass Signature packet that describes another signature to be applied to the same message data.
|
||||
}
|
||||
|
|
|
@ -245,7 +245,7 @@ Packetlist.prototype.concat = function (packetlist) {
|
|||
|
||||
/**
|
||||
* Allocate a new packetlist from structured packetlist clone
|
||||
* See {@link http://www.w3.org/html/wg/drafts/html/master/infrastructure.html#safe-passing-of-structured-data}
|
||||
* See {@link https://w3c.github.io/html/infrastructure.html#safe-passing-of-structured-data}
|
||||
* @param {Object} packetClone packetlist clone
|
||||
* @returns {Object} new packetlist object with data from packetlist clone
|
||||
*/
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
/**
|
||||
* Implementation of the Key Material Packet (Tag 5,6,7,14)<br/>
|
||||
* <br/>
|
||||
* {@link http://tools.ietf.org/html/rfc4880#section-5.5|RFC4480 5.5}:
|
||||
* {@link https://tools.ietf.org/html/rfc4880#section-5.5|RFC4480 5.5}:
|
||||
* A key material packet contains all the information about a public or
|
||||
* private key. There are four variants of this packet type, and two
|
||||
* major versions. Consequently, this section is complex.
|
||||
|
@ -62,7 +62,7 @@ export default function PublicKey() {
|
|||
}
|
||||
|
||||
/**
|
||||
* Internal Parser for public keys as specified in {@link http://tools.ietf.org/html/rfc4880#section-5.5.2|RFC 4880 section 5.5.2 Public-Key Packet Formats}
|
||||
* Internal Parser for public keys as specified in {@link https://tools.ietf.org/html/rfc4880#section-5.5.2|RFC 4880 section 5.5.2 Public-Key Packet Formats}
|
||||
* called by read_tag<num>
|
||||
* @param {Uint8Array} bytes Input array to read the packet from
|
||||
* @return {Object} This object with attributes set by the parser
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
/**
|
||||
* Public-Key Encrypted Session Key Packets (Tag 1)<br/>
|
||||
* <br/>
|
||||
* {@link http://tools.ietf.org/html/rfc4880#section-5.1|RFC4880 5.1}: A Public-Key Encrypted Session Key packet holds the session key
|
||||
* {@link https://tools.ietf.org/html/rfc4880#section-5.1|RFC4880 5.1}: A Public-Key Encrypted Session Key packet holds the session key
|
||||
* used to encrypt a message. Zero or more Public-Key Encrypted Session Key
|
||||
* packets and/or Symmetric-Key Encrypted Session Key packets may precede a
|
||||
* Symmetrically Encrypted Data Packet, which holds an encrypted message. The
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
/**
|
||||
* Implementation of the Key Material Packet (Tag 5,6,7,14)<br/>
|
||||
* <br/>
|
||||
* {@link http://tools.ietf.org/html/rfc4880#section-5.5|RFC4480 5.5}:
|
||||
* {@link https://tools.ietf.org/html/rfc4880#section-5.5|RFC4480 5.5}:
|
||||
* A key material packet contains all the information about a public or
|
||||
* private key. There are four variants of this packet type, and two
|
||||
* major versions. Consequently, this section is complex.
|
||||
|
@ -121,7 +121,7 @@ function write_cleartext_params(hash_algorithm, algorithm, params) {
|
|||
// 5.5.3. Secret-Key Packet Formats
|
||||
|
||||
/**
|
||||
* Internal parser for private keys as specified in {@link http://tools.ietf.org/html/rfc4880#section-5.5.3|RFC 4880 section 5.5.3}
|
||||
* Internal parser for private keys as specified in {@link https://tools.ietf.org/html/rfc4880#section-5.5.3|RFC 4880 section 5.5.3}
|
||||
* @param {String} bytes Input string to read the packet from
|
||||
*/
|
||||
SecretKey.prototype.read = function (bytes) {
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
/**
|
||||
* Implementation of the Signature Packet (Tag 2)<br/>
|
||||
* <br/>
|
||||
* {@link http://tools.ietf.org/html/rfc4880#section-5.2|RFC4480 5.2}:
|
||||
* {@link https://tools.ietf.org/html/rfc4880#section-5.2|RFC4480 5.2}:
|
||||
* A Signature packet describes a binding between some public key and
|
||||
* some data. The most common signatures are a signature of a file or a
|
||||
* block of text, and a signature that is a certification of a User ID.
|
||||
|
@ -358,11 +358,11 @@ Signature.prototype.write_all_sub_packets = function () {
|
|||
};
|
||||
|
||||
/**
|
||||
* creates a string representation of a sub signature packet (See {@link http://tools.ietf.org/html/rfc4880#section-5.2.3.1|RFC 4880 5.2.3.1})
|
||||
* creates a string representation of a sub signature packet (See {@link https://tools.ietf.org/html/rfc4880#section-5.2.3.1|RFC 4880 5.2.3.1})
|
||||
* @param {Integer} type subpacket signature type. Signature types as described
|
||||
* in {@link http://tools.ietf.org/html/rfc4880#section-5.2.3.2|RFC4880 Section 5.2.3.2}
|
||||
* in {@link https://tools.ietf.org/html/rfc4880#section-5.2.3.2|RFC4880 Section 5.2.3.2}
|
||||
* @param {String} data data to be included
|
||||
* @return {String} a string-representation of a sub signature packet (See {@link http://tools.ietf.org/html/rfc4880#section-5.2.3.1|RFC 4880 5.2.3.1})
|
||||
* @return {String} a string-representation of a sub signature packet (See {@link https://tools.ietf.org/html/rfc4880#section-5.2.3.1|RFC 4880 5.2.3.1})
|
||||
*/
|
||||
function write_sub_packet(type, data) {
|
||||
var arr = [];
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
* Implementation of the Sym. Encrypted Integrity Protected Data
|
||||
* Packet (Tag 18)<br/>
|
||||
* <br/>
|
||||
* {@link http://tools.ietf.org/html/rfc4880#section-5.13|RFC4880 5.13}:
|
||||
* {@link https://tools.ietf.org/html/rfc4880#section-5.13|RFC4880 5.13}:
|
||||
* The Symmetrically Encrypted Integrity Protected Data packet is
|
||||
* a variant of the Symmetrically Encrypted Data packet. It is a new feature
|
||||
* created for OpenPGP that addresses the problem of detecting a modification to
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
/**
|
||||
* Public-Key Encrypted Session Key Packets (Tag 1)<br/>
|
||||
* <br/>
|
||||
* {@link http://tools.ietf.org/html/rfc4880#section-5.1|RFC4880 5.1}: A Public-Key Encrypted Session Key packet holds the session key
|
||||
* {@link https://tools.ietf.org/html/rfc4880#section-5.1|RFC4880 5.1}: A Public-Key Encrypted Session Key packet holds the session key
|
||||
* used to encrypt a message. Zero or more Public-Key Encrypted Session Key
|
||||
* packets and/or Symmetric-Key Encrypted Session Key packets may precede a
|
||||
* Symmetrically Encrypted Data Packet, which holds an encrypted message. The
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
/**
|
||||
* Implementation of the Symmetrically Encrypted Data Packet (Tag 9)<br/>
|
||||
* <br/>
|
||||
* {@link http://tools.ietf.org/html/rfc4880#section-5.7|RFC4880 5.7}: The Symmetrically Encrypted Data packet contains data encrypted
|
||||
* {@link https://tools.ietf.org/html/rfc4880#section-5.7|RFC4880 5.7}: The Symmetrically Encrypted Data packet contains data encrypted
|
||||
* with a symmetric-key algorithm. When it has been decrypted, it contains other
|
||||
* packets (usually a literal data packet or compressed data packet, but in
|
||||
* theory other Symmetrically Encrypted Data packets or sequences of packets
|
||||
|
@ -58,7 +58,7 @@ SymmetricallyEncrypted.prototype.write = function () {
|
|||
* Symmetrically decrypt the packet data
|
||||
*
|
||||
* @param {module:enums.symmetric} sessionKeyAlgorithm
|
||||
* Symmetric key algorithm to use // See {@link http://tools.ietf.org/html/rfc4880#section-9.2|RFC4880 9.2}
|
||||
* Symmetric key algorithm to use // See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC4880 9.2}
|
||||
* @param {String} key
|
||||
* Key as string with the corresponding length to the
|
||||
* algorithm
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
/**
|
||||
* Implementation of type key id ({@link http://tools.ietf.org/html/rfc4880#section-3.3|RFC4880 3.3})<br/>
|
||||
* Implementation of type key id ({@link https://tools.ietf.org/html/rfc4880#section-3.3|RFC4880 3.3})<br/>
|
||||
* <br/>
|
||||
* A Key ID is an eight-octet scalar that identifies a key.
|
||||
* Implementations SHOULD NOT assume that Key IDs are unique. The
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
// - MPI = c | d << 8 | e << ((MPI.length -2)*8) | f ((MPI.length -2)*8)
|
||||
|
||||
/**
|
||||
* Implementation of type MPI ({@link http://tools.ietf.org/html/rfc4880#section-3.2|RFC4880 3.2})<br/>
|
||||
* Implementation of type MPI ({@link https://tools.ietf.org/html/rfc4880#section-3.2|RFC4880 3.2})<br/>
|
||||
* <br/>
|
||||
* Multiprecision integers (also called MPIs) are unsigned integers used
|
||||
* to hold large integers such as the ones used in cryptographic
|
||||
|
@ -54,7 +54,7 @@ export default function MPI(data) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Parsing function for a mpi ({@link http://tools.ietf.org/html/rfc4880#section3.2|RFC 4880 3.2}).
|
||||
* Parsing function for a mpi ({@link https://tools.ietf.org/html/rfc4880#section3.2|RFC 4880 3.2}).
|
||||
* @param {String} input Payload of mpi data
|
||||
* @param {String} endian Endianness of the payload; 'be' for big-endian and 'le' for little-endian
|
||||
* @return {Integer} Length of data read
|
||||
|
@ -102,7 +102,7 @@ MPI.prototype.byteLength = function () {
|
|||
};
|
||||
|
||||
/**
|
||||
* Converts the mpi object to a bytes as specified in {@link http://tools.ietf.org/html/rfc4880#section-3.2|RFC4880 3.2}
|
||||
* Converts the mpi object to a bytes as specified in {@link https://tools.ietf.org/html/rfc4880#section-3.2|RFC4880 3.2}
|
||||
* @return {Uint8Aray} mpi Byte representation
|
||||
*/
|
||||
MPI.prototype.write = function () {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
/**
|
||||
* Implementation of the String-to-key specifier ({@link http://tools.ietf.org/html/rfc4880#section-3.7|RFC4880 3.7})<br/>
|
||||
* Implementation of the String-to-key specifier ({@link https://tools.ietf.org/html/rfc4880#section-3.7|RFC4880 3.7})<br/>
|
||||
* <br/>
|
||||
* String-to-key (S2K) specifiers are used to convert passphrase strings
|
||||
* into symmetric-key encryption/decryption keys. They are used in two
|
||||
|
@ -58,7 +58,7 @@ S2K.prototype.get_count = function () {
|
|||
};
|
||||
|
||||
/**
|
||||
* Parsing function for a string-to-key specifier ({@link http://tools.ietf.org/html/rfc4880#section-3.7|RFC 4880 3.7}).
|
||||
* Parsing function for a string-to-key specifier ({@link https://tools.ietf.org/html/rfc4880#section-3.7|RFC 4880 3.7}).
|
||||
* @param {String} input Payload of string-to-key specifier
|
||||
* @return {Integer} Actual length of the object
|
||||
*/
|
||||
|
|
|
@ -7,7 +7,7 @@ var util = openpgp.util,
|
|||
chai = require('chai'),
|
||||
expect = chai.expect;
|
||||
|
||||
it('Blowfish cipher test with test vectors from http://www.schneier.com/code/vectors.txt', function(done) {
|
||||
it('Blowfish cipher test with test vectors from https://www.schneier.com/code/vectors.txt', function(done) {
|
||||
function test_bf(input, key, output) {
|
||||
var blowfish = new openpgp.crypto.cipher.blowfish(util.bin2str(key));
|
||||
var result = util.bin2str(blowfish.encrypt(input));
|
||||
|
|
|
@ -7,7 +7,7 @@ var util = openpgp.util,
|
|||
expect = chai.expect;
|
||||
|
||||
describe('TripleDES (EDE) cipher test with test vectors from NIST SP 800-20', function() {
|
||||
// see http://csrc.nist.gov/publications/nistpubs/800-20/800-20.pdf
|
||||
// see https://csrc.nist.gov/publications/nistpubs/800-20/800-20.pdf
|
||||
var key = new Uint8Array([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]);
|
||||
var testvectors = [[[0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00],[0x95,0xF8,0xA5,0xE5,0xDD,0x31,0xD9,0x00]],
|
||||
[[0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00],[0xDD,0x7F,0x12,0x1C,0xA5,0x01,0x56,0x19]],
|
||||
|
|
|
@ -6,7 +6,7 @@ var util = openpgp.util,
|
|||
chai = require('chai'),
|
||||
expect = chai.expect;
|
||||
|
||||
it('Twofish with test vectors from http://www.schneier.com/code/ecb_ival.txt', function(done) {
|
||||
it('Twofish with test vectors from https://www.schneier.com/code/ecb_ival.txt', function(done) {
|
||||
function TFencrypt(block, key) {
|
||||
var tf = new openpgp.crypto.cipher.twofish(util.str2Uint8Array(key));
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ var util = openpgp.util,
|
|||
chai = require('chai'),
|
||||
expect = chai.expect;
|
||||
|
||||
it("RIPE-MD 160 bits with test vectors from http://homes.esat.kuleuven.be/~bosselae/ripemd160.html", function(done) {
|
||||
it("RIPE-MD 160 bits with test vectors from https://homes.esat.kuleuven.be/~bosselae/ripemd160.html", function(done) {
|
||||
expect(util.hexstrdump(util.Uint8Array2str(RMDstring(util.str2Uint8Array(''))), 'RMDstring("") = 9c1185a5c5e9fc54612808977ee8f548b2258d31')).to.equal('9c1185a5c5e9fc54612808977ee8f548b2258d31');
|
||||
expect(util.hexstrdump(util.Uint8Array2str(RMDstring(util.str2Uint8Array('a'))), 'RMDstring("a") = 0bdc9d2d256b3ee9daae347be6f4dc835a467ffe')).to.equal('0bdc9d2d256b3ee9daae347be6f4dc835a467ffe');
|
||||
expect(util.hexstrdump(util.Uint8Array2str(RMDstring(util.str2Uint8Array('abc'))), 'RMDstring("abc") = 8eb208f7e05d987a9b044a8e98c6b087f15a0bfc')).to.equal('8eb208f7e05d987a9b044a8e98c6b087f15a0bfc');
|
||||
|
|
|
@ -151,7 +151,7 @@ describe("ASCII armor", function() {
|
|||
var privKey =
|
||||
['-----BEGIN PGP PRIVATE KEY BLOCK-----',
|
||||
'Version: OpenPGP.js v0.3.0',
|
||||
'Comment: http://openpgpjs.org',
|
||||
'Comment: https://openpgpjs.org',
|
||||
'',
|
||||
'xbYEUubX7gEBANDWhzoP+Tr/IyRSv++vl5jBesQIPTYGQBdzF4YDnGEBABEB',
|
||||
'AAH+CQMIfzdw4/PKNl5gVXdtfDFdSIN8yJT2rbeg3+SsWexXZNNdRaONWaiB',
|
||||
|
@ -187,7 +187,7 @@ describe("ASCII armor", function() {
|
|||
var privKey =
|
||||
['-----BEGIN PGP PRIVATE KEY BLOCK-----',
|
||||
'Version: OpenPGP.js v0.3.0',
|
||||
'Comment: http://openpgpjs.org',
|
||||
'Comment: https://openpgpjs.org',
|
||||
'',
|
||||
'xbYEUubX7gEBANDWhzoP+Tr/IyRSv++vl5jBesQIPTYGQBdzF4YDnGEBABEB',
|
||||
'AAH+CQMIfzdw4/PKNl5gVXdtfDFdSIN8yJT2rbeg3+SsWexXZNNdRaONWaiB',
|
||||
|
@ -221,7 +221,7 @@ describe("ASCII armor", function() {
|
|||
var privKeyNoCheckSum =
|
||||
['-----BEGIN PGP PRIVATE KEY BLOCK-----',
|
||||
'Version: OpenPGP.js v0.3.0',
|
||||
'Comment: http://openpgpjs.org',
|
||||
'Comment: https://openpgpjs.org',
|
||||
'',
|
||||
'xbYEUubX7gEBANDWhzoP+Tr/IyRSv++vl5jBesQIPTYGQBdzF4YDnGEBABEB',
|
||||
'AAH+CQMIfzdw4/PKNl5gVXdtfDFdSIN8yJT2rbeg3+SsWexXZNNdRaONWaiB',
|
||||
|
@ -264,7 +264,7 @@ describe("ASCII armor", function() {
|
|||
var privKeyNoCheckSumWithTrailingNewline =
|
||||
['-----BEGIN PGP PRIVATE KEY BLOCK-----',
|
||||
'Version: OpenPGP.js v0.3.0',
|
||||
'Comment: http://openpgpjs.org',
|
||||
'Comment: https://openpgpjs.org',
|
||||
'',
|
||||
'xbYEUubX7gEBANDWhzoP+Tr/IyRSv++vl5jBesQIPTYGQBdzF4YDnGEBABEB',
|
||||
'AAH+CQMIfzdw4/PKNl5gVXdtfDFdSIN8yJT2rbeg3+SsWexXZNNdRaONWaiB',
|
||||
|
@ -308,7 +308,7 @@ describe("ASCII armor", function() {
|
|||
var privKey =
|
||||
['-----BEGIN PGP PRIVATE KEY BLOCK-----\t \r',
|
||||
'Version: OpenPGP.js v0.3.0',
|
||||
'Comment: http://openpgpjs.org',
|
||||
'Comment: https://openpgpjs.org',
|
||||
'',
|
||||
'xbYEUubX7gEBANDWhzoP+Tr/IyRSv++vl5jBesQIPTYGQBdzF4YDnGEBABEB',
|
||||
'AAH+CQMIfzdw4/PKNl5gVXdtfDFdSIN8yJT2rbeg3+SsWexXZNNdRaONWaiB',
|
||||
|
|
|
@ -14,7 +14,7 @@ describe("Keyring", function() {
|
|||
keyFingerP = '5856cef789c3a307e8a1b976f6f60e9b42cdff4c',
|
||||
pubkey = '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
|
||||
'Version: OpenPGP.js v.1.20131011\n' +
|
||||
'Comment: http://openpgpjs.org\n' +
|
||||
'Comment: https://openpgpjs.org\n' +
|
||||
'\n' +
|
||||
'xk0EUlhMvAEB/2MZtCUOAYvyLFjDp3OBMGn3Ev8FwjzyPbIF0JUw+L7y2XR5\n' +
|
||||
'RVGvbK88unV3cU/1tOYdNsXI6pSp/Ztjyv7vbBUAEQEAAc0pV2hpdGVvdXQg\n' +
|
||||
|
@ -25,7 +25,7 @@ describe("Keyring", function() {
|
|||
'-----END PGP PUBLIC KEY BLOCK-----',
|
||||
privkey = '-----BEGIN PGP PRIVATE KEY BLOCK-----\n' +
|
||||
'Version: OpenPGP.js v.1.20131011\n' +
|
||||
'Comment: http://openpgpjs.org\n' +
|
||||
'Comment: https://openpgpjs.org\n' +
|
||||
'\n' +
|
||||
'xcBeBFJYTLwBAf9jGbQlDgGL8ixYw6dzgTBp9xL/BcI88j2yBdCVMPi+8tl0\n' +
|
||||
'eUVRr2yvPLp1d3FP9bTmHTbFyOqUqf2bY8r+72wVABEBAAH+AwMIhNB4ivtv\n' +
|
||||
|
|
|
@ -1203,7 +1203,7 @@ describe('OpenPGP.js public api tests', function() {
|
|||
var pgp_msg =
|
||||
['-----BEGIN PGP MESSAGE-----',
|
||||
'Version: GnuPG/MacGPG2 v2.0.19 (Darwin)',
|
||||
'Comment: GPGTools - http://gpgtools.org',
|
||||
'Comment: GPGTools - https://gpgtools.org',
|
||||
'',
|
||||
'hIwDBU4Dycfvp2EBA/9tuhQgOrcATcm2PRmIOcs6q947YhlsBTZZdVJDfVjkKlyM',
|
||||
'M0yE+lnNplWb041Cpfkkl6IvorKQd2iPbAkOL0IXwmVN41l+PvVgMcuFvvzetehG',
|
||||
|
@ -1216,7 +1216,7 @@ describe('OpenPGP.js public api tests', function() {
|
|||
var priv_key =
|
||||
['-----BEGIN PGP PRIVATE KEY BLOCK-----',
|
||||
'Version: GnuPG/MacGPG2 v2.0.19 (Darwin)',
|
||||
'Comment: GPGTools - http://gpgtools.org',
|
||||
'Comment: GPGTools - https://gpgtools.org',
|
||||
'',
|
||||
'lQH+BFLqLegBBAC/rN3g30Jrcpx5lTb7Kxe+ZfS7ppOIoBjjN+qcOh81cJJVS5dT',
|
||||
'UGcDsm2tCLVS3P2dGaYhfU9fsoSq/wK/tXsdoWXvXdjHbbueyi1kTZqlnyT190UE',
|
||||
|
|
|
@ -765,7 +765,7 @@ describe("Signature", function() {
|
|||
var detachedSig = ['-----BEGIN PGP SIGNATURE-----',
|
||||
'Version: GnuPG v1.4.13 (Darwin)',
|
||||
'Comment: GPGTools - https://gpgtools.org',
|
||||
'Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/',
|
||||
'Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/',
|
||||
'',
|
||||
'iQEcBAEBCgAGBQJTqH5OAAoJENf7k/zfv8I8oFoH/R6EFTw2CYUQoOKSAQstWIHp',
|
||||
'fVVseLOkFbByUV5eLuGVBNI3DM4GQ6C7dGntKAn34a1iTGcAIZH+fIhaZ2WtNdtA',
|
||||
|
@ -799,7 +799,7 @@ describe("Signature", function() {
|
|||
''
|
||||
].join('\r\n');
|
||||
|
||||
var publicKeyArmored = '-----BEGIN PGP PUBLIC KEY BLOCK-----\r\nVersion: OpenPGP.js v.1.20131116\r\nComment: Whiteout Mail - http://whiteout.io\r\n\r\nxsBNBFKODs4BB/9iOF4THsjQMY+WEpT7ShgKxj4bHzRRaQkqczS4nZvP0U3g\r\nqeqCnbpagyeKXA+bhWFQW4GmXtgAoeD5PXs6AZYrw3tWNxLKu2Oe6Tp9K/XI\r\nxTMQ2wl4qZKDXHvuPsJ7cmgaWqpPyXtxA4zHHS3WrkI/6VzHAcI/y6x4szSB\r\nKgSuhI3hjh3s7TybUC1U6AfoQGx/S7e3WwlCOrK8GTClirN/2mCPRC5wuIft\r\nnkoMfA6jK8d2OPrJ63shy5cgwHOjQg/xuk46dNS7tkvGmbaa+X0PgqSKB+Hf\r\nYPPNS/ylg911DH9qa8BqYU2QpNh9jUKXSF+HbaOM+plWkCSAL7czV+R3ABEB\r\nAAHNLVdoaXRlb3V0IFVzZXIgPHNhZmV3aXRobWUudGVzdHVzZXJAZ21haWwu\r\nY29tPsLAXAQQAQgAEAUCUo4O2gkQ1/uT/N+/wjwAAN2cB/9gFRmAfvEQ2qz+\r\nWubmT2EsSSnjPMxzG4uyykFoa+TaZCWo2Xa2tQghmU103kEkQb1OEjRjpgwJ\r\nYX9Kghnl8DByM686L5AXnRyHP78qRJCLXSXl0AGicboUDp5sovaa4rswQceH\r\nvcdWgZ/mgHTRoiQeJddy9k+H6MPFiyFaVcFwegVsmpc+dCcC8yT+qh8ZIbyG\r\nRJU60PmKKN7LUusP+8DbSv39zCGJCBlVVKyA4MzdF5uM+sqTdXbKzOrT5DGd\r\nCZaox4s+w16Sq1rHzZKFWfQPfKLDB9pyA0ufCVRA3AF6BUi7G3ZqhZiHNhMP\r\nNvE45V/hS1PbZcfPVoUjE2qc1Ix1\r\n=7Wpe\r\n-----END PGP PUBLIC KEY BLOCK-----';
|
||||
var publicKeyArmored = '-----BEGIN PGP PUBLIC KEY BLOCK-----\r\nVersion: OpenPGP.js v.1.20131116\r\nComment: Whiteout Mail - https://whiteout.io\r\n\r\nxsBNBFKODs4BB/9iOF4THsjQMY+WEpT7ShgKxj4bHzRRaQkqczS4nZvP0U3g\r\nqeqCnbpagyeKXA+bhWFQW4GmXtgAoeD5PXs6AZYrw3tWNxLKu2Oe6Tp9K/XI\r\nxTMQ2wl4qZKDXHvuPsJ7cmgaWqpPyXtxA4zHHS3WrkI/6VzHAcI/y6x4szSB\r\nKgSuhI3hjh3s7TybUC1U6AfoQGx/S7e3WwlCOrK8GTClirN/2mCPRC5wuIft\r\nnkoMfA6jK8d2OPrJ63shy5cgwHOjQg/xuk46dNS7tkvGmbaa+X0PgqSKB+Hf\r\nYPPNS/ylg911DH9qa8BqYU2QpNh9jUKXSF+HbaOM+plWkCSAL7czV+R3ABEB\r\nAAHNLVdoaXRlb3V0IFVzZXIgPHNhZmV3aXRobWUudGVzdHVzZXJAZ21haWwu\r\nY29tPsLAXAQQAQgAEAUCUo4O2gkQ1/uT/N+/wjwAAN2cB/9gFRmAfvEQ2qz+\r\nWubmT2EsSSnjPMxzG4uyykFoa+TaZCWo2Xa2tQghmU103kEkQb1OEjRjpgwJ\r\nYX9Kghnl8DByM686L5AXnRyHP78qRJCLXSXl0AGicboUDp5sovaa4rswQceH\r\nvcdWgZ/mgHTRoiQeJddy9k+H6MPFiyFaVcFwegVsmpc+dCcC8yT+qh8ZIbyG\r\nRJU60PmKKN7LUusP+8DbSv39zCGJCBlVVKyA4MzdF5uM+sqTdXbKzOrT5DGd\r\nCZaox4s+w16Sq1rHzZKFWfQPfKLDB9pyA0ufCVRA3AF6BUi7G3ZqhZiHNhMP\r\nNvE45V/hS1PbZcfPVoUjE2qc1Ix1\r\n=7Wpe\r\n-----END PGP PUBLIC KEY BLOCK-----';
|
||||
var publicKeys = openpgp.key.readArmored(publicKeyArmored).keys;
|
||||
|
||||
var msg = openpgp.message.readSignedContent(content, detachedSig);
|
||||
|
|
Loading…
Reference in New Issue
Block a user