From 0d2885d52d7885e85fbf7f14f064740455376ec1 Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Mon, 6 Jan 2014 16:29:02 +0100 Subject: [PATCH] build new docs --- doc/JXG.Util.html | 10 +- doc/aes.html | 2 +- doc/aes.js.html | 8 +- doc/all_packets.js.html | 6 +- doc/armor.html | 2 +- doc/armor.js.html | 20 ++-- doc/base64.html | 2 +- doc/base64.js.html | 14 +-- doc/blowfish.html | 2 +- doc/blowfish.js.html | 6 +- doc/cast5.html | 2 +- doc/cast5.js.html | 24 ++-- doc/cfb.html | 2 +- doc/cfb.js.html | 47 ++++---- doc/cipher.html | 2 +- doc/cleartext.js.html | 4 +- doc/compressed.html | 4 +- doc/compressed.js.html | 28 ++--- doc/config.html | 2 +- doc/config.js.html | 2 +- doc/crypto.html | 10 +- doc/crypto.js.html | 13 ++- doc/des.html | 2 +- doc/des.js.html | 12 +- doc/dsa.html | 2 +- doc/dsa.js.html | 104 +++++++++--------- doc/elgamal.html | 2 +- doc/elgamal.js.html | 2 +- doc/enums.js.html | 4 +- doc/hash.html | 2 +- doc/index.html | 46 ++++---- doc/index.js.html | 2 +- doc/index.js_.html | 5 +- doc/index.js__.html | 8 +- doc/index.js___.html | 6 +- doc/index.js____.html | 4 +- doc/jsbn.html | 2 +- doc/jsbn.js.html | 2 +- doc/jxg.js.html | 69 ++++++------ doc/key.js.html | 24 ++-- doc/keyid.html | 2 +- doc/keyid.js.html | 4 +- doc/keyring.html | 2 +- doc/keyring.js.html | 2 +- doc/literal.html | 2 +- doc/literal.js.html | 16 +-- doc/localStorage.html | 2 +- doc/localStorage.js.html | 8 +- doc/localstore.html | 2 +- doc/localstore.js.html | 6 +- doc/marker.html | 2 +- doc/marker.js.html | 6 +- doc/md5.html | 2 +- doc/md5.js.html | 4 +- doc/message.js.html | 12 +- doc/module-armor.html | 2 +- doc/module-cleartext-CleartextMessage.html | 2 +- doc/module-cleartext.html | 2 +- doc/module-config.html | 2 +- doc/module-crypto.html | 2 +- doc/module-enums.html | 2 +- doc/module-key-Key.html | 38 +++---- doc/module-key-SubKey.html | 12 +- doc/module-key-User.html | 12 +- doc/module-key.html | 6 +- doc/module-keyid.html | 2 +- doc/module-message-Message.html | 2 +- doc/module-message.html | 2 +- doc/module-mpi.html | 2 +- doc/module-openpgp.html | 2 +- doc/module-packet.html | 2 +- doc/module-s2k.html | 2 +- doc/module-util.html | 2 +- doc/mpi.html | 2 +- doc/mpi.js.html | 8 +- doc/one_pass_signature.html | 2 +- doc/one_pass_signature.js.html | 6 +- doc/openpgp.js.html | 4 +- doc/packet.html | 2 +- doc/packet.js.html | 21 ++-- doc/packetlist.html | 2 +- doc/packetlist.js.html | 31 +++--- doc/pkcs1.html | 2 +- doc/pkcs1.js.html | 19 ++-- doc/public_key.html | 2 +- doc/public_key.js.html | 6 +- doc/public_key_.html | 2 +- doc/public_key_encrypted_session_key.html | 2 +- doc/public_key_encrypted_session_key.js.html | 6 +- doc/public_subkey.html | 2 +- doc/public_subkey.js.html | 4 +- doc/random.html | 2 +- doc/random.js.html | 2 +- doc/ripe-md.html | 2 +- doc/ripe-md.js.html | 32 +++--- doc/rsa.html | 2 +- doc/rsa.js.html | 10 +- doc/s2k.html | 6 +- doc/s2k.js.html | 3 +- doc/secret_key.html | 71 +++++++++++- doc/secret_key.js.html | 4 +- doc/secret_subkey.html | 85 ++++++++++++-- doc/secret_subkey.js.html | 4 +- doc/sha.html | 2 +- doc/sha.js.html | 16 +-- doc/signature.html | 2 +- doc/signature.js.html | 18 +-- doc/signature.js_.html | 37 +++---- doc/signature_.html | 12 +- doc/sym_encrypted_integrity_protected.html | 2 +- doc/sym_encrypted_integrity_protected.js.html | 10 +- doc/sym_encrypted_session_key.html | 2 +- doc/sym_encrypted_session_key.js.html | 12 +- doc/symmetrically_encrypted.html | 2 +- doc/symmetrically_encrypted.js.html | 2 +- doc/trust.html | 2 +- doc/trust.js.html | 2 +- doc/twofish.html | 2 +- doc/twofish.js.html | 4 +- doc/user_attribute.html | 2 +- doc/user_attribute.js.html | 2 +- doc/userid.html | 2 +- doc/userid.js.html | 4 +- doc/util.html | 2 +- doc/util.js.html | 10 +- 125 files changed, 651 insertions(+), 522 deletions(-) diff --git a/doc/JXG.Util.html b/doc/JXG.Util.html index c29632cf..0f48c66f 100644 --- a/doc/JXG.Util.html +++ b/doc/JXG.Util.html @@ -166,7 +166,7 @@ The code is based on the source code for gunzip.c by Pasi Ojala
Source:
@@ -227,7 +227,7 @@ The code is based on the source code for gunzip.c by Pasi Ojala
Source:
@@ -305,7 +305,7 @@ EXAMPLES:
Source:
@@ -491,7 +491,7 @@ EXAMPLES:
Source:
@@ -560,7 +560,7 @@ EXAMPLES:
diff --git a/doc/aes.html b/doc/aes.html index 90875076..4fe8f0a7 100644 --- a/doc/aes.html +++ b/doc/aes.html @@ -117,7 +117,7 @@
diff --git a/doc/aes.js.html b/doc/aes.js.html index 92e89619..3bb76d96 100644 --- a/doc/aes.js.html +++ b/doc/aes.js.html @@ -520,8 +520,8 @@ function makeClass(length) { this.encrypt = function(block) { return AESencrypt(block, this.key); - } - } + }; + }; c.blockSize = c.prototype.blockSize = 16; c.keySize = c.prototype.keySize = length / 8; @@ -529,7 +529,7 @@ function makeClass(length) { return c; } -module.exports = {} +module.exports = {}; var types = [128, 192, 256]; @@ -552,7 +552,7 @@ for (var i in types) {
diff --git a/doc/all_packets.js.html b/doc/all_packets.js.html index a0e6c3f9..b31690df 100644 --- a/doc/all_packets.js.html +++ b/doc/all_packets.js.html @@ -66,12 +66,12 @@ module.exports = { signature: require('./signature.js'), /** @see module:packet/trust */ trust: require('./trust.js') -} +}; for (var i in enums.packet) { var packetClass = module.exports[i]; - if (packetClass != undefined) + if (packetClass !== undefined) packetClass.prototype.tag = enums.packet[i]; } @@ -90,7 +90,7 @@ for (var i in enums.packet) {
diff --git a/doc/armor.html b/doc/armor.html index 7f68f4be..03b119e1 100644 --- a/doc/armor.html +++ b/doc/armor.html @@ -1364,7 +1364,7 @@ given base64 encoded checksum
diff --git a/doc/armor.js.html b/doc/armor.js.html index 8b6fc8de..ef43062f 100644 --- a/doc/armor.js.html +++ b/doc/armor.js.html @@ -240,7 +240,7 @@ function splitHeaders(text) { var matchResult = reEmptyLine.exec(text); - if (matchResult != null) { + if (matchResult !== null) { headers = text.slice(0, matchResult.index); body = text.slice(matchResult.index + matchResult[0].length); } @@ -262,7 +262,7 @@ function splitChecksum(text) { var matchResult = reChecksumStart.exec(text); - if (matchResult != null) { + if (matchResult !== null) { body = text.slice(0, matchResult.index); checksum = text.slice(matchResult.index + 1); } @@ -295,14 +295,14 @@ function dearmor(text) { // so we know the index of the data we are interested in. var indexBase = 1; - var result, checksum; + var result, checksum, msg; if (text.search(reSplit) != splittext[0].length) { indexBase = 0; } if (type != 2) { - var msg = splitHeaders(splittext[indexBase]); + msg = splitHeaders(splittext[indexBase]); var msg_sum = splitChecksum(msg.body); result = { @@ -313,7 +313,7 @@ function dearmor(text) { checksum = msg_sum.checksum; } else { // Reverse dash-escaping for msg and remove trailing whitespace at end of line - var msg = splitHeaders(splittext[indexBase].replace(/^- /mg, '').replace(/[\t ]+\n/g, "\n")); + msg = splitHeaders(splittext[indexBase].replace(/^- /mg, '').replace(/[\t ]+\n/g, "\n")); var sig = splitHeaders(splittext[indexBase + 1].replace(/^- /mg, '')); var sig_sum = splitChecksum(sig.body); @@ -327,10 +327,10 @@ function dearmor(text) { } if (!verifyCheckSum(result.data, checksum)) { - throw new Error("Ascii armor integrity check on message failed: '" - + checksum - + "' should be '" - + getCheckSum(result) + "'"); + throw new Error("Ascii armor integrity check on message failed: '" + + checksum + + "' should be '" + + getCheckSum(result) + "'"); } else { return result; } @@ -419,7 +419,7 @@ module.exports = {
diff --git a/doc/base64.html b/doc/base64.html index d2cd492d..1a43e276 100644 --- a/doc/base64.html +++ b/doc/base64.html @@ -393,7 +393,7 @@
diff --git a/doc/base64.js.html b/doc/base64.js.html index 0442407f..f6a0bdad 100644 --- a/doc/base64.js.html +++ b/doc/base64.js.html @@ -59,7 +59,7 @@ function s2r(t) { for (n = 0; n < tl; n++) { c = t.charCodeAt(n); - if (s == 0) { + if (s === 0) { r += b64s.charAt((c >> 2) & 63); a = (c & 3) << 4; } else if (s == 1) { @@ -68,12 +68,12 @@ function s2r(t) { } else if (s == 2) { r += b64s.charAt(a | ((c >> 6) & 3)); l += 1; - if ((l % 60) == 0) + if ((l % 60) === 0) r += "\n"; r += b64s.charAt(c & 63); } l += 1; - if ((l % 60) == 0) + if ((l % 60) === 0) r += "\n"; s += 1; @@ -83,13 +83,13 @@ function s2r(t) { if (s > 0) { r += b64s.charAt(a); l += 1; - if ((l % 60) == 0) + if ((l % 60) === 0) r += "\n"; r += '='; l += 1; } if (s == 1) { - if ((l % 60) == 0) + if ((l % 60) === 0) r += "\n"; r += '='; } @@ -125,7 +125,7 @@ function r2s(t) { module.exports = { encode: s2r, decode: r2s -} +}; @@ -142,7 +142,7 @@ module.exports = {
diff --git a/doc/blowfish.html b/doc/blowfish.html index b311cbff..d14c8a00 100644 --- a/doc/blowfish.html +++ b/doc/blowfish.html @@ -111,7 +111,7 @@
diff --git a/doc/blowfish.js.html b/doc/blowfish.js.html index 8fb76d56..bb45b0fa 100644 --- a/doc/blowfish.js.html +++ b/doc/blowfish.js.html @@ -41,7 +41,7 @@ * The constructor doesn't do much of anything. It's just here * so we can start defining properties and methods and such. */ -function Blowfish() {}; +function Blowfish() {} /* * Declare the block size so that protocols know what size @@ -434,7 +434,7 @@ function BF(key) { this.encrypt = function(block) { return this.bf.encrypt_block(block); - } + }; } @@ -457,7 +457,7 @@ module.exports.blockSize = BF.prototype.blockSize = 16;
diff --git a/doc/cast5.html b/doc/cast5.html index 3089499d..61899838 100644 --- a/doc/cast5.html +++ b/doc/cast5.html @@ -111,7 +111,7 @@
diff --git a/doc/cast5.js.html b/doc/cast5.js.html index 8651ba82..6e543d96 100644 --- a/doc/cast5.js.html +++ b/doc/cast5.js.html @@ -279,19 +279,22 @@ function openpgp_symenc_cast5() { var t = new Array(8); var k = new Array(32); - for (var i = 0; i < 4; i++) { - var j = i * 4; + var i, j; + + for (i = 0; i < 4; i++) { + j = i * 4; t[i] = inn[j] << 24 | inn[j + 1] << 16 | inn[j + 2] << 8 | inn[j + 3]; } var x = [6, 7, 4, 5]; var ki = 0; + var w; for (var half = 0; half < 2; half++) { for (var round = 0; round < 4; round++) { - for (var j = 0; j < 4; j++) { + for (j = 0; j < 4; j++) { var a = scheduleA[round][j]; - var w = t[a[1]]; + w = t[a[1]]; w ^= sBox[4][(t[a[2] >>> 2] >>> (24 - 8 * (a[2] & 3))) & 0xff]; w ^= sBox[5][(t[a[3] >>> 2] >>> (24 - 8 * (a[3] & 3))) & 0xff]; @@ -301,9 +304,9 @@ function openpgp_symenc_cast5() { t[a[0]] = w; } - for (var j = 0; j < 4; j++) { + for (j = 0; j < 4; j++) { var b = scheduleB[round][j]; - var w = sBox[4][(t[b[0] >>> 2] >>> (24 - 8 * (b[0] & 3))) & 0xff]; + w = sBox[4][(t[b[0] >>> 2] >>> (24 - 8 * (b[0] & 3))) & 0xff]; w ^= sBox[5][(t[b[1] >>> 2] >>> (24 - 8 * (b[1] & 3))) & 0xff]; w ^= sBox[6][(t[b[2] >>> 2] >>> (24 - 8 * (b[2] & 3))) & 0xff]; @@ -315,7 +318,7 @@ function openpgp_symenc_cast5() { } } - for (var i = 0; i < 16; i++) { + for (i = 0; i < 16; i++) { this.masking[i] = k[i]; this.rotate[i] = k[16 + i] & 0x1f; } @@ -614,8 +617,7 @@ function openpgp_symenc_cast5() { 0xe97625a5, 0x0614d1b7, 0x0e25244b, 0x0c768347, 0x589e8d82, 0x0d2059d1, 0xa466bb1e, 0xf8da0a82, 0x04f19130, 0xba6e4ec0, 0x99265164, 0x1ee7230d, 0x50b2ad80, 0xeaee6801, 0x8db2a283, 0xea8bf59e); -}; - +} var util = require('../../util'); function cast5(key) { @@ -624,7 +626,7 @@ function cast5(key) { this.encrypt = function(block) { return this.cast5.encrypt(block); - } + }; } module.exports = cast5; @@ -646,7 +648,7 @@ module.exports.keySize = cast5.prototype.keySize = 16;
diff --git a/doc/cfb.html b/doc/cfb.html index c860d141..2dad5ea4 100644 --- a/doc/cfb.html +++ b/doc/cfb.html @@ -768,7 +768,7 @@ This will be passed to the cipherfn
diff --git a/doc/cfb.js.html b/doc/cfb.js.html index 189c1415..3883d646 100644 --- a/doc/cfb.js.html +++ b/doc/cfb.js.html @@ -79,8 +79,9 @@ module.exports = { prefixrandom = prefixrandom + prefixrandom.charAt(block_size - 2) + prefixrandom.charAt(block_size - 1); util.print_debug("prefixrandom:" + util.hexstrdump(prefixrandom)); var ciphertext = ""; + var i; // 1. The feedback register (FR) is set to the IV, which is all zeros. - for (var i = 0; i < block_size; i++) FR[i] = 0; + for (i = 0; i < block_size; i++) FR[i] = 0; // 2. FR is encrypted to produce FRE (FR Encrypted). This is the // encryption of an all-zero value. @@ -88,13 +89,13 @@ module.exports = { // 3. FRE is xored with the first BS octets of random data prefixed to // the plaintext to produce C[1] through C[BS], the first BS octets // of ciphertext. - for (var i = 0; i < block_size; i++) ciphertext += String.fromCharCode(FRE[i] ^ prefixrandom.charCodeAt(i)); + for (i = 0; i < block_size; i++) ciphertext += String.fromCharCode(FRE[i] ^ prefixrandom.charCodeAt(i)); // 4. FR is loaded with C[1] through C[BS]. - for (var i = 0; i < block_size; i++) FR[i] = ciphertext.charCodeAt(i); + for (i = 0; i < block_size; i++) FR[i] = ciphertext.charCodeAt(i); // 5. FR is encrypted to produce FRE, the encryption of the first BS - // octets of ciphertext. + // octets of ciphertext. FRE = cipherfn.encrypt(FR); // 6. The left two octets of FRE get xored with the next two octets of @@ -105,22 +106,22 @@ module.exports = { if (resync) { // 7. (The resync step) FR is loaded with C3-C10. - for (var i = 0; i < block_size; i++) FR[i] = ciphertext.charCodeAt(i + 2); + for (i = 0; i < block_size; i++) FR[i] = ciphertext.charCodeAt(i + 2); } else { - for (var i = 0; i < block_size; i++) FR[i] = ciphertext.charCodeAt(i); + for (i = 0; i < block_size; i++) FR[i] = ciphertext.charCodeAt(i); } // 8. FR is encrypted to produce FRE. FRE = cipherfn.encrypt(FR, key); if (resync) { // 9. FRE is xored with the first 8 octets of the given plaintext, now - // that we have finished encrypting the 10 octets of prefixed data. - // This produces C11-C18, the next 8 octets of ciphertext. - for (var i = 0; i < block_size; i++) + // that we have finished encrypting the 10 octets of prefixed data. + // This produces C11-C18, the next 8 octets of ciphertext. + for (i = 0; i < block_size; i++) ciphertext += String.fromCharCode(FRE[i] ^ plaintext.charCodeAt(i)); for (n = block_size + 2; n < plaintext.length; n += block_size) { // 10. FR is loaded with C11-C18 - for (var i = 0; i < block_size; i++) FR[i] = ciphertext.charCodeAt(n + i); + for (i = 0; i < block_size; i++) FR[i] = ciphertext.charCodeAt(n + i); // 11. FR is encrypted to produce FRE. FRE = cipherfn.encrypt(FR); @@ -128,20 +129,20 @@ module.exports = { // 12. FRE is xored with the next 8 octets of plaintext, to produce the // next 8 octets of ciphertext. These are loaded into FR and the // process is repeated until the plaintext is used up. - for (var i = 0; i < block_size; i++) ciphertext += String.fromCharCode(FRE[i] ^ plaintext.charCodeAt((n - 2) + + for (i = 0; i < block_size; i++) ciphertext += String.fromCharCode(FRE[i] ^ plaintext.charCodeAt((n - 2) + i)); } } else { plaintext = " " + plaintext; // 9. FRE is xored with the first 8 octets of the given plaintext, now - // that we have finished encrypting the 10 octets of prefixed data. - // This produces C11-C18, the next 8 octets of ciphertext. - for (var i = 2; i < block_size; i++) ciphertext += String.fromCharCode(FRE[i] ^ plaintext.charCodeAt(i)); + // that we have finished encrypting the 10 octets of prefixed data. + // This produces C11-C18, the next 8 octets of ciphertext. + for (i = 2; i < block_size; i++) ciphertext += String.fromCharCode(FRE[i] ^ plaintext.charCodeAt(i)); var tempCiphertext = ciphertext.substring(0, 2 * block_size).split(''); var tempCiphertextString = ciphertext.substring(block_size); for (n = block_size; n < plaintext.length; n += block_size) { // 10. FR is loaded with C11-C18 - for (var i = 0; i < block_size; i++) FR[i] = tempCiphertextString.charCodeAt(i); + for (i = 0; i < block_size; i++) FR[i] = tempCiphertextString.charCodeAt(i); tempCiphertextString = ''; // 11. FR is encrypted to produce FRE. @@ -150,13 +151,12 @@ module.exports = { // 12. FRE is xored with the next 8 octets of plaintext, to produce the // next 8 octets of ciphertext. These are loaded into FR and the // process is repeated until the plaintext is used up. - for (var i = 0; i < block_size; i++) { + for (i = 0; i < block_size; i++) { tempCiphertext.push(String.fromCharCode(FRE[i] ^ plaintext.charCodeAt(n + i))); tempCiphertextString += String.fromCharCode(FRE[i] ^ plaintext.charCodeAt(n + i)); } } ciphertext = tempCiphertext.join(''); - } ciphertext = ciphertext.substring(0, plaintext.length + 2 + block_size); @@ -266,7 +266,7 @@ module.exports = { } } - var n = resync ? 0 : 2; + n = resync ? 0 : 2; text = text.join(''); @@ -308,14 +308,15 @@ module.exports = { var pos = 0; var plaintext = []; var offset = 0; - if (iv == null) - for (var i = 0; i < block_size; i++) blockp += String.fromCharCode(0); + var i; + if (iv === null) + for (i = 0; i < block_size; i++) blockp += String.fromCharCode(0); else blockp = iv.substring(0, block_size); while (ciphertext.length > (block_size * pos)) { var decblock = cipherfn.encrypt(util.str2bin(blockp)); blockp = ciphertext.substring((pos * (block_size)) + offset, (pos * (block_size)) + (block_size) + offset); - for (var i = 0; i < blockp.length; i++) { + for (i = 0; i < blockp.length; i++) { plaintext.push(String.fromCharCode(blockp.charCodeAt(i) ^ decblock[i])); } pos++; @@ -323,7 +324,7 @@ module.exports = { return plaintext.join(''); } -} +}; @@ -340,7 +341,7 @@ module.exports = {
diff --git a/doc/cipher.html b/doc/cipher.html index 2bfea5bf..7b17a810 100644 --- a/doc/cipher.html +++ b/doc/cipher.html @@ -412,7 +412,7 @@
diff --git a/doc/cleartext.js.html b/doc/cleartext.js.html index 8af1a8ef..7a870c14 100644 --- a/doc/cleartext.js.html +++ b/doc/cleartext.js.html @@ -151,7 +151,7 @@ CleartextMessage.prototype.armor = function() { hash: enums.read(enums.hash, config.prefer_hash_algorithm).toUpperCase(), text: this.text, data: this.packets.write() - } + }; return armor.encode(enums.armor.signed, body); }; @@ -191,7 +191,7 @@ exports.readArmored = readArmored;
diff --git a/doc/compressed.html b/doc/compressed.html index 9f58e225..ef04efc7 100644 --- a/doc/compressed.html +++ b/doc/compressed.html @@ -415,7 +415,7 @@ a Signature or One-Pass Signature packet, and contains a literal data packet.Source:
@@ -740,7 +740,7 @@ read by read_packet
diff --git a/doc/compressed.js.html b/doc/compressed.js.html index b60c43ca..a3f77506 100644 --- a/doc/compressed.js.html +++ b/doc/compressed.js.html @@ -92,7 +92,7 @@ module.exports = function compressed() { this.compressed = bytes.substr(1); this.decompress(); - } + }; @@ -101,11 +101,11 @@ module.exports = function compressed() { * @return {String} binary compressed packet */ this.write = function() { - if (this.compressed == null) + if (this.compressed === null) this.compress(); return String.fromCharCode(enums.write(enums.compression, this.algorithm)) + this.compressed; - } + }; /** @@ -113,7 +113,7 @@ module.exports = function compressed() { * read by read_packet */ this.decompress = function() { - var decompressed; + var decompressed, compdata, radix; switch (this.algorithm) { case 'uncompressed': @@ -121,9 +121,9 @@ module.exports = function compressed() { break; case 'zip': - var compData = this.compressed; + compData = this.compressed; - var radix = base64.encode(compData).replace(/\n/g, ""); + radix = base64.encode(compData).replace(/\n/g, ""); // no header in this case, directly call deflate var jxg_obj = new JXG.Util.Unzip(JXG.Util.Base64.decodeAsArray(radix)); @@ -140,8 +140,8 @@ module.exports = function compressed() { if (compressionMethod == 8) { //CM 8 is for DEFLATE, RFC 1951 // remove 4 bytes ADLER32 checksum from the end - var compData = this.compressed.substring(0, this.compressed.length - 4); - var radix = base64.encode(compData).replace(/\n/g, ""); + compData = this.compressed.substring(0, this.compressed.length - 4); + radix = base64.encode(compData).replace(/\n/g, ""); //TODO check ADLER32 checksum decompressed = JXG.decompress(radix); break; @@ -155,15 +155,13 @@ module.exports = function compressed() { case 'bzip2': // TODO: need to implement this throw new Error('Compression algorithm BZip2 [BZ2] is not implemented.'); - break; default: throw new Error("Compression algorithm unknown :" + this.alogrithm); - break; } this.packets.read(decompressed); - } + }; /** * Compress the packet data (member decompressedData) @@ -179,25 +177,21 @@ module.exports = function compressed() { case 'zip': // - ZIP [RFC1951] throw new Error("Compression algorithm ZIP [RFC1951] is not implemented."); - break; case 'zlib': // - ZLIB [RFC1950] // TODO: need to implement this throw new Error("Compression algorithm ZLIB [RFC1950] is not implemented."); - break; case 'bzip2': // - BZip2 [BZ2] // TODO: need to implement this throw new Error("Compression algorithm BZip2 [BZ2] is not implemented."); - break; default: throw new Error("Compression algorithm unknown :" + this.type); - break; } - } + }; }; @@ -215,7 +209,7 @@ module.exports = function compressed() {
diff --git a/doc/config.html b/doc/config.html index 7469c56d..42f31947 100644 --- a/doc/config.html +++ b/doc/config.html @@ -331,7 +331,7 @@
diff --git a/doc/config.js.html b/doc/config.js.html index b7499701..1628075f 100644 --- a/doc/config.js.html +++ b/doc/config.js.html @@ -88,7 +88,7 @@ module.exports = {
diff --git a/doc/crypto.html b/doc/crypto.html index 16d37a92..41ac73ff 100644 --- a/doc/crypto.html +++ b/doc/crypto.html @@ -197,7 +197,7 @@
Source:
@@ -336,7 +336,7 @@
Source:
@@ -476,7 +476,7 @@ size of the cipher
Source:
@@ -687,7 +687,7 @@ of the private key used
Source:
@@ -943,7 +943,7 @@ if elgamal encryption an array of two module:type/mpi is returned; otherwise nul
diff --git a/doc/crypto.js.html b/doc/crypto.js.html index 14d2a0d0..ebbadf74 100644 --- a/doc/crypto.js.html +++ b/doc/crypto.js.html @@ -69,13 +69,14 @@ module.exports = { */ publicKeyEncrypt: function(algo, publicMPIs, data) { var result = (function() { + var m; switch (algo) { case 'rsa_encrypt': case 'rsa_encrypt_sign': var rsa = new publicKey.rsa(); var n = publicMPIs[0].toBigInteger(); var e = publicMPIs[1].toBigInteger(); - var m = data.toBigInteger(); + m = data.toBigInteger(); return [rsa.encrypt(m, e, n)]; case 'elgamal': @@ -83,7 +84,7 @@ module.exports = { var p = publicMPIs[0].toBigInteger(); var g = publicMPIs[1].toBigInteger(); var y = publicMPIs[2].toBigInteger(); - var m = data.toBigInteger(); + m = data.toBigInteger(); return elgamal.encrypt(m, g, p, y); default: @@ -111,6 +112,8 @@ module.exports = { */ publicKeyDecrypt: function(algo, keyIntegers, dataIntegers) { + var p; + var bn = (function() { switch (algo) { case 'rsa_encrypt_sign': @@ -118,7 +121,7 @@ module.exports = { var rsa = new publicKey.rsa(); // 0 and 1 are the public key. var d = keyIntegers[2].toBigInteger(); - var p = keyIntegers[3].toBigInteger(); + p = keyIntegers[3].toBigInteger(); var q = keyIntegers[4].toBigInteger(); var u = keyIntegers[5].toBigInteger(); var m = dataIntegers[0].toBigInteger(); @@ -128,7 +131,7 @@ module.exports = { var x = keyIntegers[3].toBigInteger(); var c1 = dataIntegers[0].toBigInteger(); var c2 = dataIntegers[1].toBigInteger(); - var p = keyIntegers[0].toBigInteger(); + p = keyIntegers[0].toBigInteger(); return elgamal.decrypt(c1, c2, p, x); default: return null; @@ -264,7 +267,7 @@ module.exports = {
diff --git a/doc/des.html b/doc/des.html index 0d832eaf..f13b674f 100644 --- a/doc/des.html +++ b/doc/des.html @@ -215,7 +215,7 @@
diff --git a/doc/des.js.html b/doc/des.js.html index 3ace6958..f1a1fef1 100644 --- a/doc/des.js.html +++ b/doc/des.js.html @@ -108,7 +108,7 @@ function des(keys, message, encrypt, mode, iv, padding) { //create the 16 or 48 subkeys we will need var m = 0, i, j, temp, temp2, right1, right2, left, right, looping; - var cbcleft, cbcleft2, cbcright, cbcright2 + var cbcleft, cbcleft2, cbcright, cbcright2; var endloop, loopinc; var len = message.length; var chunk = 0; @@ -405,7 +405,7 @@ function Des(key) { des(des_createKeys(this.key[0]), util.bin2str(block), true, 0, null, null), false, 0, null, null), true, 0, null, null)); - } + }; } Des.keySize = Des.prototype.keySize = 24; @@ -420,12 +420,12 @@ function OriginalDes(key) { this.encrypt = function(block, padding) { var keys = des_createKeys(this.key); return util.str2bin(des(keys, util.bin2str(block), true, 0, null, padding)); - } + }; this.decrypt = function(block, padding) { var keys = des_createKeys(this.key); return util.str2bin(des(keys, util.bin2str(block), false, 0, null, padding)); - } + }; } module.exports = { @@ -433,7 +433,7 @@ module.exports = { des: Des, /** @static */ originalDes: OriginalDes -} +}; @@ -450,7 +450,7 @@ module.exports = {
diff --git a/doc/dsa.html b/doc/dsa.html index 80815f6e..0d898a6b 100644 --- a/doc/dsa.html +++ b/doc/dsa.html @@ -123,7 +123,7 @@
diff --git a/doc/dsa.js.html b/doc/dsa.js.html index b0f0fab1..324f4488 100644 --- a/doc/dsa.js.html +++ b/doc/dsa.js.html @@ -72,7 +72,7 @@ function DSA() { var k = random.getRandomBigIntegerInRange(BigInteger.ONE.add(BigInteger.ONE), q.subtract(BigInteger.ONE)); var s1 = (g.modPow(k, p)).mod(q); var s2 = (k.modInverse(q).multiply(hash.add(x.multiply(s1)))).mod(q); - var result = new Array(); + var result = []; result[0] = s1.toMPI(); result[1] = s2.toMPI(); return result; @@ -135,61 +135,61 @@ function DSA() { * unused code. This can be used as a start to write a key generator * function. - function generateKey(bitcount) { - var qi = new BigInteger(bitcount, primeCenterie); - var pi = generateP(q, 512); - var gi = generateG(p, q, bitcount); - var xi; - do { - xi = new BigInteger(q.bitCount(), rand); - } while (x.compareTo(BigInteger.ZERO) != 1 && x.compareTo(q) != -1); - var yi = g.modPow(x, p); - return {x: xi, q: qi, p: pi, g: gi, y: yi}; - } + function generateKey(bitcount) { + var qi = new BigInteger(bitcount, primeCenterie); + var pi = generateP(q, 512); + var gi = generateG(p, q, bitcount); + var xi; + do { + xi = new BigInteger(q.bitCount(), rand); + } while (x.compareTo(BigInteger.ZERO) != 1 && x.compareTo(q) != -1); + var yi = g.modPow(x, p); + return {x: xi, q: qi, p: pi, g: gi, y: yi}; + } - function generateP(q, bitlength, randomfn) { - if (bitlength % 64 != 0) { - return false; - } - var pTemp; - var pTemp2; - do { - pTemp = randomfn(bitcount, true); - pTemp2 = pTemp.subtract(BigInteger.ONE); - pTemp = pTemp.subtract(pTemp2.remainder(q)); - } while (!pTemp.isProbablePrime(primeCenterie) || pTemp.bitLength() != l); - return pTemp; - } + function generateP(q, bitlength, randomfn) { + if (bitlength % 64 != 0) { + return false; + } + var pTemp; + var pTemp2; + do { + pTemp = randomfn(bitcount, true); + pTemp2 = pTemp.subtract(BigInteger.ONE); + pTemp = pTemp.subtract(pTemp2.remainder(q)); + } while (!pTemp.isProbablePrime(primeCenterie) || pTemp.bitLength() != l); + return pTemp; + } - function generateG(p, q, bitlength, randomfn) { - var aux = p.subtract(BigInteger.ONE); - var pow = aux.divide(q); - var gTemp; - do { - gTemp = randomfn(bitlength); - } while (gTemp.compareTo(aux) != -1 && gTemp.compareTo(BigInteger.ONE) != 1); - return gTemp.modPow(pow, p); - } + function generateG(p, q, bitlength, randomfn) { + var aux = p.subtract(BigInteger.ONE); + var pow = aux.divide(q); + var gTemp; + do { + gTemp = randomfn(bitlength); + } while (gTemp.compareTo(aux) != -1 && gTemp.compareTo(BigInteger.ONE) != 1); + return gTemp.modPow(pow, p); + } - function generateK(q, bitlength, randomfn) { - var tempK; - do { - tempK = randomfn(bitlength, false); - } while (tempK.compareTo(q) != -1 && tempK.compareTo(BigInteger.ZERO) != 1); - return tempK; - } + function generateK(q, bitlength, randomfn) { + var tempK; + do { + tempK = randomfn(bitlength, false); + } while (tempK.compareTo(q) != -1 && tempK.compareTo(BigInteger.ZERO) != 1); + return tempK; + } - function generateR(q,p) { - k = generateK(q); - var r = g.modPow(k, p).mod(q); - return r; - } + function generateR(q,p) { + k = generateK(q); + var r = g.modPow(k, p).mod(q); + return r; + } - function generateS(hashfn,k,r,m,q,x) { - var hash = hashfn(m); - s = (k.modInverse(q).multiply(hash.add(x.multiply(r)))).mod(q); - return s; - } */ + function generateS(hashfn,k,r,m,q,x) { + var hash = hashfn(m); + s = (k.modInverse(q).multiply(hash.add(x.multiply(r)))).mod(q); + return s; + } */ this.sign = sign; this.verify = verify; // this.generate = generateKey; @@ -212,7 +212,7 @@ module.exports = DSA;
diff --git a/doc/elgamal.html b/doc/elgamal.html index 4a80def7..1a1ec552 100644 --- a/doc/elgamal.html +++ b/doc/elgamal.html @@ -121,7 +121,7 @@
diff --git a/doc/elgamal.js.html b/doc/elgamal.js.html index bad86554..57c3f548 100644 --- a/doc/elgamal.js.html +++ b/doc/elgamal.js.html @@ -101,7 +101,7 @@ module.exports = Elgamal;
diff --git a/doc/enums.js.html b/doc/enums.js.html index e6bd811b..eb6d106a 100644 --- a/doc/enums.js.html +++ b/doc/enums.js.html @@ -341,7 +341,7 @@ module.exports = { throw new Error('Invalid enum value.'); } -} +}; @@ -358,7 +358,7 @@ module.exports = {
diff --git a/doc/hash.html b/doc/hash.html index da528cab..8b729b6e 100644 --- a/doc/hash.html +++ b/doc/hash.html @@ -825,7 +825,7 @@
diff --git a/doc/index.html b/doc/index.html index 35a9596f..3cbe0f03 100644 --- a/doc/index.html +++ b/doc/index.html @@ -41,45 +41,37 @@
-

[Build Status

- -

What is OpenPGP.js?

- +

OpenPGP.js Build Status

OpenPGP.js is a Javascript implementation of the OpenPGP protocol. This is defined in RFC 4880.

-

How do I use it?

- -

As a developer, the best place to start is in the resources/ directory. Within this you will find a basic example implementation and the "binary" files for this library. It is likely that you will want to use resources/openpgp.min.js on your site, this is a minified version of our library.

- +

You can download a prebuilt minified version of the library under releases.

+

You can also build a current version yourself:

+
npm install && grunt
+

Then take the resulting file from resources/openpgp.min.js to use in your project.

I need some help

-

Mailing List

- -

You can sign up for our mailing list and ask for help there. We've recently worked on getting our archive up and running.

- +

You can sign up for our mailing list and ask for help there. We've recently worked on getting our archive up and running.

Documentation

-

A jsdoc build of our code comments is available at doc/index.html. Public calls should generally be made through the OpenPGP object doc/openpgp.html.

-

How do I get involved?

- -

You want to help, great! Go ahead and fork our repo, make your changes and make a pull request. Please be sure that you run make minify from the root directory to concatenate and minify the library into the resources/ directory.

- +

You want to help, great! Go ahead and fork our repo, make your changes +and make a pull request.

It is extra awesome if you write tests for the code you change. Our test coverage is relatively weak, so if you can add cases that is great.

-

What License do you use?

-

GNU Lesser General Public License (2.1). Please take a look at the LICENSE file for more information.

-

What are the requirements to use it?

-

OpenPGP.js currently only fully supports Chrome. Firefox support should be coming soon with the advent of Firefox 23 with native javascript support for window.crypto.getRandomValues. If you can help us support more browsers and situations, please chip in!

-

Resources

- -

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.

- -
+

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.

+
@@ -181,7 +173,7 @@ for extending and developing on top of the base library.
diff --git a/doc/index.js.html b/doc/index.js.html index 902d6691..747e923f 100644 --- a/doc/index.js.html +++ b/doc/index.js.html @@ -80,7 +80,7 @@ module.exports.crypto = require('./crypto');
diff --git a/doc/index.js_.html b/doc/index.js_.html index 55766af2..e1a4023c 100644 --- a/doc/index.js_.html +++ b/doc/index.js_.html @@ -44,8 +44,7 @@ module.exports = { random: require('./random.js'), /** @see module:crypto/pkcs1 */ pkcs1: require('./pkcs1.js') - -} +}; var crypto = require('./crypto.js'); @@ -67,7 +66,7 @@ for (var i in crypto)
diff --git a/doc/index.js__.html b/doc/index.js__.html index c302f9d9..520441dd 100644 --- a/doc/index.js__.html +++ b/doc/index.js__.html @@ -37,16 +37,16 @@ var desModule = require('./des.js'); module.exports = { /** @see module:crypto/cipher/des.des */ - des: desModule['des'], + des: desModule.des, /** @see module:crypto/cipher/des.originalDes */ - originalDes: desModule['originalDes'], + originalDes: desModule.originalDes, /** @see module:crypto/cipher/cast5 */ cast5: require('./cast5.js'), /** @see module:crypto/cipher/twofish */ twofish: require('./twofish.js'), /** @see module:crypto/cipher/blowfish */ blowfish: require('./blowfish.js') -} +}; var aes = require('./aes.js'); @@ -69,7 +69,7 @@ for (var i in aes) {
diff --git a/doc/index.js___.html b/doc/index.js___.html index f622a880..5b2ce05d 100644 --- a/doc/index.js___.html +++ b/doc/index.js___.html @@ -101,7 +101,7 @@ module.exports = { return 32; case 9: // - SHA384 [FIPS180] - return 48 + return 48; case 10: // - SHA512 [FIPS180] return 64; @@ -112,7 +112,7 @@ module.exports = { throw new Error('Invalid hash algorithm.'); } } -} +}; @@ -129,7 +129,7 @@ module.exports = {
diff --git a/doc/index.js____.html b/doc/index.js____.html index 05e4110b..91283e08 100644 --- a/doc/index.js____.html +++ b/doc/index.js____.html @@ -38,7 +38,7 @@ module.exports = { elgamal: require('./elgamal.js'), /** @see module:crypto/public_key/dsa */ dsa: require('./dsa.js') -} +}; @@ -55,7 +55,7 @@ module.exports = {
diff --git a/doc/jsbn.html b/doc/jsbn.html index b38910fa..1609810e 100644 --- a/doc/jsbn.html +++ b/doc/jsbn.html @@ -117,7 +117,7 @@
diff --git a/doc/jsbn.js.html b/doc/jsbn.js.html index 01fd1900..6d7da935 100644 --- a/doc/jsbn.js.html +++ b/doc/jsbn.js.html @@ -1751,7 +1751,7 @@ BigInteger.prototype.square = bnSquare;
diff --git a/doc/jxg.js.html b/doc/jxg.js.html index 54b8047b..f051f105 100644 --- a/doc/jxg.js.html +++ b/doc/jxg.js.html @@ -29,7 +29,7 @@ exists: (function(undefined) { return function(v) { return !(v === undefined || v === null); - } + }; })() }; JXG.decompress = function(str) { @@ -169,24 +169,24 @@ JXG.Util.Unzip = function(barray) { return bA[bytepos++]; } else return -1; - }; + } function byteAlign() { bb = 1; - }; + } function readBit() { var carry; bits++; carry = (bb & 1); bb >>= 1; - if (bb == 0) { + if (bb === 0) { bb = readByte(); carry = (bb & 1); bb = (bb >> 1) | 0x80; } return carry; - }; + } function readBits(a) { var res = 0, @@ -199,12 +199,12 @@ JXG.Util.Unzip = function(barray) { res = bitReverse[res] >> (8 - a); } return res; - }; + } function flushBuffer() { //document.write('FLUSHBUFFER:'+buf32k); bIdx = 0; - }; + } function addBuffer(a) { SIZE++; @@ -216,14 +216,14 @@ JXG.Util.Unzip = function(barray) { //document.write('ADDBUFFER:'+buf32k); bIdx = 0; } - }; + } function HufNode() { this.b0 = 0; this.b1 = 0; this.jump = null; this.jumppos = -1; - }; + } var LITERALS = 288; @@ -250,7 +250,7 @@ JXG.Util.Unzip = function(barray) { return fpos[len]++; fpos[len]++; } - }; + } function Rec() { var curplace = Places[treepos]; @@ -296,7 +296,7 @@ JXG.Util.Unzip = function(barray) { } len--; return 0; - }; + } function CreateTree(currentTree, numval, lengths, show) { var i; @@ -341,7 +341,7 @@ JXG.Util.Unzip = function(barray) { } }*/ return 0; - }; + } function DecodeValue(currentTree) { var len, i, @@ -380,10 +380,10 @@ JXG.Util.Unzip = function(barray) { X = currentTree[xtreepos]; } } - }; + } function DeflateLoop() { - var last, c, type, i, len; + var last, c, type, i, j, len, dist; do { /*if((last = readBit())){ @@ -416,7 +416,7 @@ JXG.Util.Unzip = function(barray) { break; } - if (type == 0) { + if (type === 0) { var blockLen, cSum; // Stored @@ -435,8 +435,6 @@ JXG.Util.Unzip = function(barray) { addBuffer(c); } } else if (type == 1) { - var j; - /* Fixed Huffman tables -- fixed decode routine */ while (1) { /* @@ -481,8 +479,6 @@ JXG.Util.Unzip = function(barray) { /* EOF */ break; } else { - var len, dist; - j -= 256 + 1; /* bytes + EOF */ len = readBits(cplext[j]) + cplens[j]; @@ -497,13 +493,13 @@ JXG.Util.Unzip = function(barray) { /*fprintf(errfp, "@%d (l%02x,d%04x)\n", SIZE, len, dist);*/ for (j = 0; j < len; j++) { - var c = buf32k[(bIdx - dist) & 0x7fff]; + c = buf32k[(bIdx - dist) & 0x7fff]; addBuffer(c); } } } // while } else if (type == 2) { - var j, n, literalCodes, distCodes, lenCodes; + var n, literalCodes, distCodes, lenCodes; var ll = new Array(288 + 32); // "static" just to preserve stack // Dynamic Huffman tables @@ -538,8 +534,8 @@ JXG.Util.Unzip = function(barray) { document.write("<br>" + distanceTree[a].b0 + " " + distanceTree[a].b1 + " " + distanceTree[a].jump + " " + distanceTree[a].jumppos); /*if (distanceTree[a].jumppos!=-1) - document.write(" "+distanceTree[a].jump.b0+" "+distanceTree[a].jump.b1); - */ + document.write(" "+distanceTree[a].jump.b0+" "+distanceTree[a].jump.b1); + */ } } //document.write('<BR>tree created'); @@ -600,7 +596,7 @@ JXG.Util.Unzip = function(barray) { len = literalTree.length; for (i = 0; i < len; i++) distanceTree[i] = new HufNode(); - var ll2 = new Array(); + var ll2 = []; for (i = literalCodes; i < ll.length; i++) { ll2[i - literalCodes] = ll[i]; } @@ -613,9 +609,8 @@ JXG.Util.Unzip = function(barray) { outer: while (1) { j = DecodeValue(literalTree); if (j >= 256) { // In C64: if carry set - var len, dist; j -= 256; - if (j == 0) { + if (j === 0) { // EOF break; } @@ -634,7 +629,7 @@ JXG.Util.Unzip = function(barray) { if (bIdx - dist < 0) { break outer; } - var c = buf32k[(bIdx - dist) & 0x7fff]; + c = buf32k[(bIdx - dist) & 0x7fff]; addBuffer(c); } } else { @@ -647,7 +642,7 @@ JXG.Util.Unzip = function(barray) { byteAlign(); return 0; - }; + } JXG.Util.Unzip.prototype.unzipFile = function(name) { var i; @@ -658,7 +653,6 @@ JXG.Util.Unzip = function(barray) { return unzipped[i][0]; } } - }; JXG.Util.Unzip.prototype.deflate = function() { @@ -673,7 +667,7 @@ JXG.Util.Unzip = function(barray) { unzipped[files][1] = "DEFLATE"; files++; return unzipped; - } + }; JXG.Util.Unzip.prototype.unzip = function() { //convertToByteArray(input); @@ -798,8 +792,9 @@ JXG.Util.Unzip = function(barray) { alert("filelen " + filelen); i = 0; nameBuf = []; + var c; while (filelen--) { - var c = readByte(); + c = readByte(); if (c == "/" | c == ":") { i = 0; } else if (i < NAMEMAX - 1) @@ -821,7 +816,7 @@ JXG.Util.Unzip = function(barray) { CRC = 0xffffffff; SIZE = 0; - if (size == 0 && fileOut.charAt(fileout.length - 1) == "/") { + if (size === 0 && fileOut.charAt(fileout.length - 1) == "/") { //skipdir if (debug) alert("skipdir"); @@ -839,7 +834,7 @@ JXG.Util.Unzip = function(barray) { skipdir(); } } - }; + } function skipdir() { var crc, @@ -952,7 +947,7 @@ JXG.Util.Unzip = function(barray) { if (modeZIP) nextFile(); - }; + } }; @@ -1096,7 +1091,7 @@ JXG.Util.Base64 = { lineno, i, destripped = []; - if (wrap == null) + if (wrap === null) wrap = 76; stripped.replace(/ /g, ""); @@ -1251,7 +1246,7 @@ JXG.Util.utf8Decode = function(utftext) { string.push(String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63))); i += 3; } - }; + } return string.join(''); }; @@ -1308,7 +1303,7 @@ module.exports = JXG;
diff --git a/doc/key.js.html b/doc/key.js.html index 300d7691..80b1ddc0 100644 --- a/doc/key.js.html +++ b/doc/key.js.html @@ -155,11 +155,12 @@ Key.prototype.toPacketlist = function() { packetlist.push(this.primaryKey); packetlist.push(this.revocationSignature); packetlist.concat(this.directSignatures); - for (var i = 0; i < this.users.length; i++) { + var i; + for (i = 0; i < this.users.length; i++) { packetlist.concat(this.users[i].toPacketlist()); } if (this.subKeys) { - for (var i = 0; i < this.subKeys.length; i++) { + for (i = 0; i < this.subKeys.length; i++) { packetlist.concat(this.subKeys[i].toPacketlist()); } } @@ -284,16 +285,17 @@ Key.prototype.isPrivate = function() { Key.prototype.toPublic = function() { var packetlist = new packet.list(); var keyPackets = this.toPacketlist(); + var bytes; for (var i = 0; i < keyPackets.length; i++) { switch (keyPackets[i].tag) { case enums.packet.secret_key: - var bytes = keyPackets[i].writePublicKey(); + bytes = keyPackets[i].writePublicKey(); var pubKeyPacket = new packet.public_key(); pubKeyPacket.read(bytes); packetlist.push(pubKeyPacket); break; case enums.packet.secret_subkey: - var bytes = keyPackets[i].writePublicKey(); + bytes = keyPackets[i].writePublicKey(); var pubSubkeyPacket = new packet.public_subkey(); pubSubkeyPacket.read(bytes); packetlist.push(pubSubkeyPacket); @@ -355,7 +357,7 @@ function isValidEncryptionKeyPacket(keyPacket, signature) { ((signature.keyFlags & enums.keyFlags.encrypt_communication) !== 0 || (signature.keyFlags & enums.keyFlags.encrypt_storage) !== 0 || !signature.keyFlags); -}; +} function isValidSigningKeyPacket(keyPacket, signature) { return (keyPacket.algorithm == enums.read(enums.publicKey, enums.publicKey.dsa) || @@ -363,7 +365,7 @@ function isValidSigningKeyPacket(keyPacket, signature) { keyPacket.algorithm == enums.read(enums.publicKey, enums.publicKey.rsa_encrypt_sign)) && ((signature.keyFlags & enums.keyFlags.sign_data) !== 0 || !signature.keyFlags); -}; +} /** * Returns the first valid encryption key packet for this key @@ -496,7 +498,7 @@ Key.prototype.getPrimaryUser = function() { } } return user ? {user: user, selfCertificate: userSelfCert} : null; -} +}; // TODO Key.prototype.revoke = function() { @@ -512,7 +514,7 @@ function User(userPacket) { return new User(userPacket); } this.userId = userPacket.tag == enums.packet.userid ? userPacket : null; - this.userAttribute = userPacket.tag == enums.packet.user_attribute ? userPacket : null + this.userAttribute = userPacket.tag == enums.packet.user_attribute ? userPacket : null; this.selfCertifications = null; this.otherCertifications = null; this.revocationCertifications = null; @@ -710,8 +712,8 @@ function readArmored(armoredText) { var packetlist = new packet.list(); packetlist.read(input.data); var keyIndex = packetlist.indexOfTag(enums.packet.public_key, enums.packet.secret_key); - if (keyIndex.length == 0) { - throw new Error('No key packet found in armored text') + if (keyIndex.length === 0) { + throw new Error('No key packet found in armored text'); } for (var i = 0; i < keyIndex.length; i++) { var oneKeyList = packetlist.slice(keyIndex[i], keyIndex[i + 1]); @@ -807,7 +809,7 @@ exports.generate = generate;
diff --git a/doc/keyid.html b/doc/keyid.html index 4f6d1b15..6504fa99 100644 --- a/doc/keyid.html +++ b/doc/keyid.html @@ -311,7 +311,7 @@ formed.
diff --git a/doc/keyid.js.html b/doc/keyid.js.html index 8cf723c1..9eb2f42c 100644 --- a/doc/keyid.js.html +++ b/doc/keyid.js.html @@ -90,7 +90,7 @@ module.exports = function keyid() { module.exports.mapToHex = function(keyId) { return keyId.toHex(); -} +}; @@ -107,7 +107,7 @@ module.exports.mapToHex = function(keyId) {
diff --git a/doc/keyring.html b/doc/keyring.html index 561bada9..defc598a 100644 --- a/doc/keyring.html +++ b/doc/keyring.html @@ -2041,7 +2041,7 @@ keyring from HTML5 local storage and initializes this instance.
diff --git a/doc/keyring.js.html b/doc/keyring.js.html index a80c80ef..21303cda 100644 --- a/doc/keyring.js.html +++ b/doc/keyring.js.html @@ -231,7 +231,7 @@ module.exports = function(storeHandler) {
diff --git a/doc/literal.html b/doc/literal.html index 70fe457c..d125a445 100644 --- a/doc/literal.html +++ b/doc/literal.html @@ -966,7 +966,7 @@ will be normalized to \r\n and by default text is converted to UTF8
diff --git a/doc/literal.js.html b/doc/literal.js.html index 9fd3c59a..a3cc5e9f 100644 --- a/doc/literal.js.html +++ b/doc/literal.js.html @@ -74,7 +74,7 @@ module.exports = function literal() { text = text.replace(/\r/g, '').replace(/\n/g, '\r\n'); // encode UTF8 this.data = this.format == 'utf8' ? util.encode_utf8(text) : text; - } + }; /** * Returns literal data packets as native JavaScript string @@ -86,7 +86,7 @@ module.exports = function literal() { var text = util.decode_utf8(this.data); // normalize EOL to \n return text.replace(/\r\n/g, '\n'); - } + }; /** * Set the packet data to value represented by the provided string of bytes. @@ -96,7 +96,7 @@ module.exports = function literal() { this.setBytes = function (bytes, format) { this.format = format; this.data = bytes; - } + }; /** @@ -105,7 +105,7 @@ module.exports = function literal() { */ this.getBytes = function () { return this.data; - } + }; /** @@ -132,7 +132,7 @@ module.exports = function literal() { var data = bytes.substring(6 + filename_len); this.setBytes(data, format); - } + }; /** * Creates a string representation of the packet @@ -152,8 +152,8 @@ module.exports = function literal() { result += util.writeDate(this.date); result += data; return result; - } -} + }; +}; @@ -170,7 +170,7 @@ module.exports = function literal() {
diff --git a/doc/localStorage.html b/doc/localStorage.html index a66d2ac9..a237dd9f 100644 --- a/doc/localStorage.html +++ b/doc/localStorage.html @@ -323,7 +323,7 @@ if config is null the default config will be used
diff --git a/doc/localStorage.js.html b/doc/localStorage.js.html index b5df0561..77b14d78 100644 --- a/doc/localStorage.js.html +++ b/doc/localStorage.js.html @@ -47,15 +47,15 @@ module.exports = function localStorage() { this.write(); } else this.config = cf; - } + }; /** * Writes the config to HTML5 local storage */ this.write = function () { window.localStorage.setItem("config", JSON.stringify(this.config)); - } -} + }; +}; @@ -72,7 +72,7 @@ module.exports = function localStorage() {
diff --git a/doc/localstore.html b/doc/localstore.html index c41a639e..4fde3bd2 100644 --- a/doc/localstore.html +++ b/doc/localstore.html @@ -332,7 +332,7 @@ The privateKeys array and publicKeys array gets Stringified using JSON
diff --git a/doc/localstore.js.html b/doc/localstore.js.html index e2f1a9be..644c9b38 100644 --- a/doc/localstore.js.html +++ b/doc/localstore.js.html @@ -66,7 +66,7 @@ module.exports = function () { } } return keys; - } + }; /** * Saves the current state of the keyring to HTML5 local storage. @@ -79,7 +79,7 @@ module.exports = function () { armoredKeys.push(keys[i].armor()); } window.localStorage.setItem("armoredKeys", JSON.stringify(armoredKeys)); - } + }; }; @@ -97,7 +97,7 @@ module.exports = function () {
diff --git a/doc/marker.html b/doc/marker.html index de21e0d9..6056eec5 100644 --- a/doc/marker.html +++ b/doc/marker.html @@ -376,7 +376,7 @@ Such a packet MUST be ignored when received.
diff --git a/doc/marker.js.html b/doc/marker.js.html index 0d7d8d83..49938be3 100644 --- a/doc/marker.js.html +++ b/doc/marker.js.html @@ -77,8 +77,8 @@ module.exports = function marker() { return true; // marker packet does not contain "PGP" return false; - } -} + }; +}; @@ -95,7 +95,7 @@ module.exports = function marker() {
diff --git a/doc/md5.html b/doc/md5.html index 8c77e0ef..4c0ac4d6 100644 --- a/doc/md5.html +++ b/doc/md5.html @@ -235,7 +235,7 @@
diff --git a/doc/md5.js.html b/doc/md5.js.html index 596d8779..18e89261 100644 --- a/doc/md5.js.html +++ b/doc/md5.js.html @@ -54,7 +54,7 @@ module.exports = function (entree) { var hex = md5(entree); var bin = util.hex2bin(hex); return bin; -} +}; function md5cycle(x, k) { var a = x[0], @@ -258,7 +258,7 @@ if (md5('hello') != '5d41402abc4b2a76b9719d911017c592') {
diff --git a/doc/message.js.html b/doc/message.js.html index 8dd189e3..968ce459 100644 --- a/doc/message.js.html +++ b/doc/message.js.html @@ -211,10 +211,10 @@ Message.prototype.sign = function(privateKeys) { if (!literalDataPacket) throw new Error('No literal data packet to sign.'); var literalFormat = enums.write(enums.literal, literalDataPacket.format); - var signatureType = literalFormat == enums.literal.binary - ? enums.signature.binary : enums.signature.text; - - for (var i = 0; i < privateKeys.length; i++) { + var signatureType = literalFormat == enums.literal.binary ? + enums.signature.binary : enums.signature.text; + var i; + for (i = 0; i < privateKeys.length; i++) { var onePassSig = new packet.one_pass_signature(); onePassSig.type = signatureType; //TODO get preferred hashg algo from key signature @@ -230,7 +230,7 @@ Message.prototype.sign = function(privateKeys) { packetlist.push(literalDataPacket); - for (var i = privateKeys.length - 1; i >= 0; i--) { + for (i = privateKeys.length - 1; i >= 0; i--) { var signaturePacket = new packet.signature(); signaturePacket.signatureType = signatureType; signaturePacket.hashAlgorithm = config.prefer_hash_algorithm; @@ -357,7 +357,7 @@ exports.fromBinary = fromBinary;
diff --git a/doc/module-armor.html b/doc/module-armor.html index d5816512..234081be 100644 --- a/doc/module-armor.html +++ b/doc/module-armor.html @@ -118,7 +118,7 @@
diff --git a/doc/module-cleartext-CleartextMessage.html b/doc/module-cleartext-CleartextMessage.html index 700e6030..922f470c 100644 --- a/doc/module-cleartext-CleartextMessage.html +++ b/doc/module-cleartext-CleartextMessage.html @@ -747,7 +747,7 @@ See http://tools.ietf.org/html/rfc4880#section-7
diff --git a/doc/module-cleartext.html b/doc/module-cleartext.html index 8f66e4f8..766d2bcc 100644 --- a/doc/module-cleartext.html +++ b/doc/module-cleartext.html @@ -273,7 +273,7 @@
diff --git a/doc/module-config.html b/doc/module-config.html index c2381b1b..f2230251 100644 --- a/doc/module-config.html +++ b/doc/module-config.html @@ -118,7 +118,7 @@
diff --git a/doc/module-crypto.html b/doc/module-crypto.html index 39c1b5bf..9821b8c1 100644 --- a/doc/module-crypto.html +++ b/doc/module-crypto.html @@ -521,7 +521,7 @@
diff --git a/doc/module-enums.html b/doc/module-enums.html index 6d847f60..e91c229c 100644 --- a/doc/module-enums.html +++ b/doc/module-enums.html @@ -4533,7 +4533,7 @@ document) that cannot include a target subpacket.
diff --git a/doc/module-key-Key.html b/doc/module-key-Key.html index 2a4ec89c..c605bdfd 100644 --- a/doc/module-key-Key.html +++ b/doc/module-key-Key.html @@ -216,7 +216,7 @@ Can contain additional subkeys, signatures, user ids, user attributes.
Source:
@@ -355,7 +355,7 @@ Can contain additional subkeys, signatures, user ids, user attributes.
Source:
@@ -517,7 +517,7 @@ Can contain additional subkeys, signatures, user ids, user attributes.
Source:
@@ -608,7 +608,7 @@ Can contain additional subkeys, signatures, user ids, user attributes.
Source:
@@ -695,7 +695,7 @@ Can contain additional subkeys, signatures, user ids, user attributes.
Source:
@@ -798,7 +798,7 @@ Can contain additional subkeys, signatures, user ids, user attributes.
Source:
@@ -885,7 +885,7 @@ Can contain additional subkeys, signatures, user ids, user attributes.
Source:
@@ -978,7 +978,7 @@ Can contain additional subkeys, signatures, user ids, user attributes.
Source:
@@ -1067,7 +1067,7 @@ Can contain additional subkeys, signatures, user ids, user attributes.
Source:
@@ -1206,7 +1206,7 @@ Can contain additional subkeys, signatures, user ids, user attributes.
Source:
@@ -1347,7 +1347,7 @@ Can contain additional subkeys, signatures, user ids, user attributes.
Source:
@@ -1440,7 +1440,7 @@ Can contain additional subkeys, signatures, user ids, user attributes.
Source:
@@ -1537,7 +1537,7 @@ Can contain additional subkeys, signatures, user ids, user attributes.
Source:
@@ -1624,7 +1624,7 @@ Can contain additional subkeys, signatures, user ids, user attributes.
Source:
@@ -1715,7 +1715,7 @@ Can contain additional subkeys, signatures, user ids, user attributes.
Source:
@@ -1802,7 +1802,7 @@ Can contain additional subkeys, signatures, user ids, user attributes.
Source:
@@ -2097,7 +2097,7 @@ Can contain additional subkeys, signatures, user ids, user attributes.
Source:
@@ -2189,7 +2189,7 @@ and valid self signature
Source:
@@ -2258,7 +2258,7 @@ and valid self signature
diff --git a/doc/module-key-SubKey.html b/doc/module-key-SubKey.html index ca977352..a8a9137b 100644 --- a/doc/module-key-SubKey.html +++ b/doc/module-key-SubKey.html @@ -80,7 +80,7 @@
Source:
@@ -218,7 +218,7 @@
Source:
@@ -356,7 +356,7 @@
Source:
@@ -443,7 +443,7 @@
Source:
@@ -531,7 +531,7 @@ and valid binding signature
Source:
@@ -600,7 +600,7 @@ and valid binding signature
diff --git a/doc/module-key-User.html b/doc/module-key-User.html index cb0d7724..414fded8 100644 --- a/doc/module-key-User.html +++ b/doc/module-key-User.html @@ -80,7 +80,7 @@
Source:
@@ -218,7 +218,7 @@
Source:
@@ -383,7 +383,7 @@
Source:
@@ -474,7 +474,7 @@
Source:
@@ -613,7 +613,7 @@ and validity of self signature
Source:
@@ -682,7 +682,7 @@ and validity of self signature
diff --git a/doc/module-key.html b/doc/module-key.html index fde13d78..76e4e19f 100644 --- a/doc/module-key.html +++ b/doc/module-key.html @@ -281,7 +281,7 @@ Primary and subkey will be of same type.
Source:
@@ -416,7 +416,7 @@ Primary and subkey will be of same type.
Source:
@@ -485,7 +485,7 @@ Primary and subkey will be of same type.
diff --git a/doc/module-keyid.html b/doc/module-keyid.html index b9021d4d..4487745e 100644 --- a/doc/module-keyid.html +++ b/doc/module-keyid.html @@ -118,7 +118,7 @@
diff --git a/doc/module-message-Message.html b/doc/module-message-Message.html index 8dcfb4f7..b81645dd 100644 --- a/doc/module-message-Message.html +++ b/doc/module-message-Message.html @@ -1303,7 +1303,7 @@ See http://tools.ietf.org/html/rfc4880#section-11.3
diff --git a/doc/module-message.html b/doc/module-message.html index e44795a4..24ee518e 100644 --- a/doc/module-message.html +++ b/doc/module-message.html @@ -553,7 +553,7 @@
diff --git a/doc/module-mpi.html b/doc/module-mpi.html index 42165914..9ee11d03 100644 --- a/doc/module-mpi.html +++ b/doc/module-mpi.html @@ -118,7 +118,7 @@
diff --git a/doc/module-openpgp.html b/doc/module-openpgp.html index 6323cef8..805c6df5 100644 --- a/doc/module-openpgp.html +++ b/doc/module-openpgp.html @@ -1364,7 +1364,7 @@ Primary and subkey will be of same type.
diff --git a/doc/module-packet.html b/doc/module-packet.html index 951c331e..6a6c7a8e 100644 --- a/doc/module-packet.html +++ b/doc/module-packet.html @@ -1033,7 +1033,7 @@
diff --git a/doc/module-s2k.html b/doc/module-s2k.html index bc6723c3..ef97b27e 100644 --- a/doc/module-s2k.html +++ b/doc/module-s2k.html @@ -118,7 +118,7 @@
diff --git a/doc/module-util.html b/doc/module-util.html index 4b434820..14c67107 100644 --- a/doc/module-util.html +++ b/doc/module-util.html @@ -118,7 +118,7 @@
diff --git a/doc/mpi.html b/doc/mpi.html index 87d75ab4..d80d367b 100644 --- a/doc/mpi.html +++ b/doc/mpi.html @@ -486,7 +486,7 @@ actual integer.
diff --git a/doc/mpi.js.html b/doc/mpi.js.html index 757a7fe3..dd549b1d 100644 --- a/doc/mpi.js.html +++ b/doc/mpi.js.html @@ -84,11 +84,11 @@ module.exports = function mpi() { // The size of an MPI is ((MPI.length + 7) / 8) + 2 octets. // // The length field of an MPI describes the length starting from its - // most significant non-zero bit. Thus, the MPI [00 02 01] is not + // most significant non-zero bit. Thus, the MPI [00 02 01] is not // formed correctly. It should be [00 01 01]. // TODO: Verification of this size method! This size calculation as - // specified above is not applicable in JavaScript + // specified above is not applicable in JavaScript var bytelen = Math.ceil(bits / 8); var raw = bytes.substr(2, bytelen); @@ -124,7 +124,7 @@ module.exports = function mpi() { this.fromBigInteger = function (bn) { this.data = bn.clone(); }; -} +}; @@ -141,7 +141,7 @@ module.exports = function mpi() {
diff --git a/doc/one_pass_signature.html b/doc/one_pass_signature.html index 8171b98b..8720ecd8 100644 --- a/doc/one_pass_signature.html +++ b/doc/one_pass_signature.html @@ -428,7 +428,7 @@ can compute the entire signed message in one pass.
diff --git a/doc/one_pass_signature.js.html b/doc/one_pass_signature.js.html index df75b80d..abb09a50 100644 --- a/doc/one_pass_signature.js.html +++ b/doc/one_pass_signature.js.html @@ -101,7 +101,7 @@ module.exports = function one_pass_signature() { // signature to be applied to the same message data. this.flags = bytes.charCodeAt(mypos++); return this; - } + }; /** * creates a string representation of a one-pass signature packet @@ -118,7 +118,7 @@ module.exports = function one_pass_signature() { result += String.fromCharCode(this.flags); return result; - } + }; }; @@ -136,7 +136,7 @@ module.exports = function one_pass_signature() {
diff --git a/doc/openpgp.js.html b/doc/openpgp.js.html index 6a6462af..b81879d0 100644 --- a/doc/openpgp.js.html +++ b/doc/openpgp.js.html @@ -185,7 +185,7 @@ function generateKeyPair(keyType, numBits, userId, passphrase) { exports.encryptMessage = encryptMessage; exports.signAndEncryptMessage = signAndEncryptMessage; exports.decryptMessage = decryptMessage; -exports.decryptAndVerifyMessage = decryptAndVerifyMessage +exports.decryptAndVerifyMessage = decryptAndVerifyMessage; exports.signClearMessage = signClearMessage; exports.verifyClearSignedMessage = verifyClearSignedMessage; exports.generateKeyPair = generateKeyPair; @@ -205,7 +205,7 @@ exports.generateKeyPair = generateKeyPair;
diff --git a/doc/packet.html b/doc/packet.html index 63fc7f2f..60205715 100644 --- a/doc/packet.html +++ b/doc/packet.html @@ -774,7 +774,7 @@ string
diff --git a/doc/packet.js.html b/doc/packet.js.html index fbce2eff..4f04546d 100644 --- a/doc/packet.js.html +++ b/doc/packet.js.html @@ -150,8 +150,8 @@ module.exports = { */ read: function(input, position, len) { // some sanity checks - if (input == null || input.length <= position || input.substring(position).length < 2 || (input.charCodeAt(position) & - 0x80) == 0) { + if (input === null || input.length <= position || input.substring(position).length < 2 || (input.charCodeAt(position) & + 0x80) === 0) { throw new Error("Error during parsing. This message / key is probably not containing a valid OpenPGP format."); } var mypos = position; @@ -160,7 +160,7 @@ module.exports = { var packet_length; format = 0; // 0 = old format; 1 = new format - if ((input.charCodeAt(mypos) & 0x40) != 0) { + if ((input.charCodeAt(mypos) & 0x40) !== 0) { format = 1; } @@ -234,27 +234,28 @@ module.exports = { // EEEK, we're reading the full data here... var mypos2 = mypos + packet_length; bodydata = input.substring(mypos, mypos + packet_length); + var tmplen; while (true) { if (input.charCodeAt(mypos2) < 192) { - var tmplen = input.charCodeAt(mypos2++); + tmplen = input.charCodeAt(mypos2++); packet_length += tmplen; bodydata += input.substring(mypos2, mypos2 + tmplen); mypos2 += tmplen; break; } else if (input.charCodeAt(mypos2) >= 192 && input.charCodeAt(mypos2) < 224) { - var tmplen = ((input.charCodeAt(mypos2++) - 192) << 8) + (input.charCodeAt(mypos2++)) + 192; + tmplen = ((input.charCodeAt(mypos2++) - 192) << 8) + (input.charCodeAt(mypos2++)) + 192; packet_length += tmplen; bodydata += input.substring(mypos2, mypos2 + tmplen); mypos2 += tmplen; break; } else if (input.charCodeAt(mypos2) > 223 && input.charCodeAt(mypos2) < 255) { - var tmplen = 1 << (input.charCodeAt(mypos2++) & 0x1F); + tmplen = 1 << (input.charCodeAt(mypos2++) & 0x1F); packet_length += tmplen; bodydata += input.substring(mypos2, mypos2 + tmplen); mypos2 += tmplen; } else { mypos2++; - var tmplen = (input.charCodeAt(mypos2++) << 24) | (input.charCodeAt(mypos2++) << 16) | (input[mypos2++] + tmplen = (input.charCodeAt(mypos2++) << 24) | (input.charCodeAt(mypos2++) << 16) | (input[mypos2++] .charCodeAt() << 8) | input.charCodeAt(mypos2++); bodydata += input.substring(mypos2, mypos2 + tmplen); packet_length += tmplen; @@ -277,7 +278,7 @@ module.exports = { real_packet_length = packet_length; } - if (bodydata == null) { + if (bodydata === null) { bodydata = input.substring(mypos, mypos + real_packet_length); } @@ -287,7 +288,7 @@ module.exports = { offset: mypos + real_packet_length }; } -} +}; @@ -304,7 +305,7 @@ module.exports = {
diff --git a/doc/packetlist.html b/doc/packetlist.html index 6ba2a3fb..e905bb88 100644 --- a/doc/packetlist.html +++ b/doc/packetlist.html @@ -1094,7 +1094,7 @@ class instance.
diff --git a/doc/packetlist.js.html b/doc/packetlist.js.html index 55c8aaa0..b325fd93 100644 --- a/doc/packetlist.js.html +++ b/doc/packetlist.js.html @@ -66,7 +66,7 @@ module.exports = function packetlist() { packet.read(parsed.packet); } - } + }; /** * Creates a binary representation of openpgp objects contained within the @@ -83,7 +83,7 @@ module.exports = function packetlist() { } return bytes; - } + }; /** * Adds a packet to the list. This is the only supported method of doing so; @@ -96,7 +96,7 @@ module.exports = function packetlist() { this[this.length] = packet; this.length++; - } + }; /** * Creates a new packetList with all packets that pass the test implemented by the provided function. @@ -112,7 +112,7 @@ module.exports = function packetlist() { } return filtered; - } + }; /** * Creates a new packetList with all packets from the given types @@ -123,13 +123,13 @@ module.exports = function packetlist() { var that = this; for (var i = 0; i < this.length; i++) { - if (args.some(function(packetType) {return that[i].tag == packetType})) { + if (args.some(function(packetType) {return that[i].tag == packetType;})) { filtered.push(this[i]); } } return filtered; - } + }; /** * Executes the provided callback once for each element @@ -138,7 +138,7 @@ module.exports = function packetlist() { for (var i = 0; i < this.length; i++) { callback(this[i]); } - } + }; /** * Traverses packet tree and returns first matching packet @@ -159,7 +159,7 @@ module.exports = function packetlist() { } } return null; - } + }; /** * Returns array of found indices by tag @@ -169,26 +169,26 @@ module.exports = function packetlist() { var tagIndex = []; var that = this; for (var i = 0; i < this.length; i++) { - if (args.some(function(packetType) {return that[i].tag == packetType})) { + if (args.some(function(packetType) {return that[i].tag == packetType;})) { tagIndex.push(i); } } return tagIndex; - } + }; /** * Returns slice of packetlist */ this.slice = function (begin, end) { if (!end) { - end = this.length + end = this.length; } var part = new packetlist(); for (var i = begin; i < end; i++) { part.push(this[i]); } return part; - } + }; /** * Concatenates packetlist or array of packets @@ -199,9 +199,8 @@ module.exports = function packetlist() { this.push(packetlist[i]); } } - } - -} + }; +}; @@ -218,7 +217,7 @@ module.exports = function packetlist() {
diff --git a/doc/pkcs1.html b/doc/pkcs1.html index 6b427486..43d8efbc 100644 --- a/doc/pkcs1.html +++ b/doc/pkcs1.html @@ -185,7 +185,7 @@
diff --git a/doc/pkcs1.js.html b/doc/pkcs1.js.html index 8a7734d2..79fd6f9d 100644 --- a/doc/pkcs1.js.html +++ b/doc/pkcs1.js.html @@ -55,7 +55,7 @@ /** * ASN1 object identifiers for hashes (See RFC4880 5.2.2) */ -hash_headers = new Array(); +hash_headers = []; hash_headers[1] = [0x30, 0x20, 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x05, 0x05, 0x00, 0x04, 0x10 ]; @@ -110,10 +110,10 @@ module.exports = { decode: function(message, len) { if (message.length < len) message = String.fromCharCode(0) + message; - if (message.length < 12 || message.charCodeAt(0) != 0 || message.charCodeAt(1) != 2) + if (message.length < 12 || message.charCodeAt(0) !== 0 || message.charCodeAt(1) != 2) return -1; var i = 2; - while (message.charCodeAt(i) != 0 && message.length > i) + while (message.charCodeAt(i) !== 0 && message.length > i) i++; return message.substring(i + 1, message.length); } @@ -132,14 +132,15 @@ module.exports = { var data2 = ""; data2 += String.fromCharCode(0x00); data2 += String.fromCharCode(0x01); - for (var i = 0; i < (keylength - hash_headers[algo].length - 3 - + var i; + for (i = 0; i < (keylength - hash_headers[algo].length - 3 - hash.getHashByteLength(algo)); i++) data2 += String.fromCharCode(0xff); data2 += String.fromCharCode(0x00); - for (var i = 0; i < hash_headers[algo].length; i++) + for (i = 0; i < hash_headers[algo].length; i++) data2 += String.fromCharCode(hash_headers[algo][i]); data2 += hash.digest(algo, data); @@ -153,12 +154,12 @@ module.exports = { */ decode: function(algo, data) { var i = 0; - if (data.charCodeAt(0) == 0) i++; + if (data.charCodeAt(0) === 0) i++; else if (data.charCodeAt(0) != 1) return -1; else i++; while (data.charCodeAt(i) == 0xFF) i++; - if (data.charCodeAt(i++) != 0) return -1; + if (data.charCodeAt(i++) !== 0) return -1; var j = 0; for (j = 0; j < hash_headers[algo].length && j + i < data.length; j++) { if (data.charCodeAt(j + i) != hash_headers[algo][j]) return -1; @@ -168,7 +169,7 @@ module.exports = { return data.substring(i); } } -} +}; @@ -185,7 +186,7 @@ module.exports = {
diff --git a/doc/public_key.html b/doc/public_key.html index 3a2d20cd..d4630cea 100644 --- a/doc/public_key.html +++ b/doc/public_key.html @@ -296,7 +296,7 @@
diff --git a/doc/public_key.js.html b/doc/public_key.js.html index 7c71f987..b6d182be 100644 --- a/doc/public_key.js.html +++ b/doc/public_key.js.html @@ -118,7 +118,7 @@ module.exports = function public_key() { this.mpi[i] = new type_mpi(); - p += this.mpi[i].read(bmpi.substr(p)) + p += this.mpi[i].read(bmpi.substr(p)); if (p > bmpi.length) { throw new Error('Error reading MPI @:' + p); @@ -208,7 +208,7 @@ module.exports = function public_key() { for (var i = 0; i < mpicount; i++) { toHash += this.mpi[i].toBytes(); } - return crypto.hash.md5(toHash) + return crypto.hash.md5(toHash); } }; }; @@ -228,7 +228,7 @@ module.exports = function public_key() {
diff --git a/doc/public_key_.html b/doc/public_key_.html index dd604703..32746eb9 100644 --- a/doc/public_key_.html +++ b/doc/public_key_.html @@ -1035,7 +1035,7 @@ header: [string] OpenPGP packet header, string: [string] header+body}
diff --git a/doc/public_key_encrypted_session_key.html b/doc/public_key_encrypted_session_key.html index b5864e74..104a7c0f 100644 --- a/doc/public_key_encrypted_session_key.html +++ b/doc/public_key_encrypted_session_key.html @@ -833,7 +833,7 @@ packets (tag 1)
diff --git a/doc/public_key_encrypted_session_key.js.html b/doc/public_key_encrypted_session_key.js.html index 8f23c2da..91bfc855 100644 --- a/doc/public_key_encrypted_session_key.js.html +++ b/doc/public_key_encrypted_session_key.js.html @@ -151,7 +151,7 @@ module.exports = function public_key_encrypted_session_key() { enums.write(enums.publicKey, this.publicKeyAlgorithm)); for (var i = 0; i < this.encrypted.length; i++) { - result += this.encrypted[i].write() + result += this.encrypted[i].write(); } return result; @@ -196,7 +196,7 @@ module.exports = function public_key_encrypted_session_key() { result, key.mpi[0].byteLength()); - var key = decoded.substring(1, decoded.length - 2); + key = decoded.substring(1, decoded.length - 2); if (checksum != util.calc_checksum(key)) { throw new Error('Checksum mismatch'); @@ -223,7 +223,7 @@ module.exports = function public_key_encrypted_session_key() {
diff --git a/doc/public_subkey.html b/doc/public_subkey.html index 47434920..102818f5 100644 --- a/doc/public_subkey.html +++ b/doc/public_subkey.html @@ -1070,7 +1070,7 @@ header: [string] OpenPGP packet header, string: [string] header+body}
diff --git a/doc/public_subkey.js.html b/doc/public_subkey.js.html index 95da9223..d62cf500 100644 --- a/doc/public_subkey.js.html +++ b/doc/public_subkey.js.html @@ -55,7 +55,7 @@ var publicKey = require('./public_key.js'); */ module.exports = function public_subkey() { publicKey.call(this); -} +}; @@ -72,7 +72,7 @@ module.exports = function public_subkey() {
diff --git a/doc/random.html b/doc/random.html index c5543d9c..2ba5ce58 100644 --- a/doc/random.html +++ b/doc/random.html @@ -723,7 +723,7 @@
diff --git a/doc/random.js.html b/doc/random.js.html index bbe2c829..dc5da84d 100644 --- a/doc/random.js.html +++ b/doc/random.js.html @@ -150,7 +150,7 @@ module.exports = {
diff --git a/doc/ripe-md.html b/doc/ripe-md.html index 40e1b351..3daeb852 100644 --- a/doc/ripe-md.html +++ b/doc/ripe-md.html @@ -111,7 +111,7 @@
diff --git a/doc/ripe-md.js.html b/doc/ripe-md.js.html index a9e5d17b..e5ada1b5 100644 --- a/doc/ripe-md.js.html +++ b/doc/ripe-md.js.html @@ -52,7 +52,7 @@ */ var RMDsize = 160; -var X = new Array(); +var X = []; function ROL(x, n) { return new Number((x << n) | (x >>> (32 - n))); @@ -125,7 +125,7 @@ function mixOneRound(a, b, c, d, e, x, s, roundNumber) { d &= 0xffffffff; e &= 0xffffffff; - var retBlock = new Array(); + var retBlock = []; retBlock[0] = a; retBlock[1] = b; retBlock[2] = c; @@ -172,19 +172,21 @@ var indexes = [ ]; function compress(MDbuf, X) { - blockA = new Array(); - blockB = new Array(); + blockA = []; + blockB = []; var retBlock; - for (var i = 0; i < 5; i++) { + var i, j; + + for (i = 0; i < 5; i++) { blockA[i] = new Number(MDbuf[i]); blockB[i] = new Number(MDbuf[i]); } var step = 0; - for (var j = 0; j < 5; j++) { - for (var i = 0; i < 16; i++) { + for (j = 0; j < 5; j++) { + for (i = 0; i < 16; i++) { retBlock = mixOneRound( blockA[(step + 0) % 5], blockA[(step + 1) % 5], @@ -206,8 +208,8 @@ function compress(MDbuf, X) { } step = 0; - for (var j = 5; j < 10; j++) { - for (var i = 0; i < 16; i++) { + for (j = 5; j < 10; j++) { + for (i = 0; i < 16; i++) { retBlock = mixOneRound( blockB[(step + 0) % 5], blockB[(step + 1) % 5], @@ -255,7 +257,7 @@ function MDfinish(MDbuf, strptr, lswlen, mswlen) { if ((lswlen & 63) > 55) { compress(MDbuf, X); - var X = new Array(16); + X = new Array(16); zeroX(X); } @@ -286,9 +288,9 @@ function RMD(message) { var X = new Array(16); zeroX(X); - var j = 0; - for (var nbytes = length; nbytes > 63; nbytes -= 64) { - for (var i = 0; i < 16; i++) { + var i, j = 0; + for (nbytes = length; nbytes > 63; nbytes -= 64) { + for (i = 0; i < 16; i++) { X[i] = BYTES_TO_DWORD(message.substr(j, 4)); j += 4; } @@ -297,7 +299,7 @@ function RMD(message) { MDfinish(MDbuf, message.substr(j), length, 0); - for (var i = 0; i < RMDsize / 8; i += 4) { + for (i = 0; i < RMDsize / 8; i += 4) { hashcode[i] = MDbuf[i >>> 2] & 255; hashcode[i + 1] = (MDbuf[i >>> 2] >>> 8) & 255; hashcode[i + 2] = (MDbuf[i >>> 2] >>> 16) & 255; @@ -336,7 +338,7 @@ module.exports = RMDstring;
diff --git a/doc/rsa.html b/doc/rsa.html index e71cdc92..9651e799 100644 --- a/doc/rsa.html +++ b/doc/rsa.html @@ -121,7 +121,7 @@
diff --git a/doc/rsa.js.html b/doc/rsa.js.html index 08b16e34..ac4254b8 100644 --- a/doc/rsa.js.html +++ b/doc/rsa.js.html @@ -85,7 +85,7 @@ function RSA() { util.print_debug("rsa.js decrypt\nxpn:" + util.hexstrdump(xp.toMPI()) + "\nxqn:" + util.hexstrdump(xq.toMPI())); var t = xq.subtract(xp); - if (t[0] == 0) { + if (t[0] === 0) { t = xp.subtract(xq); t = t.multiply(u).mod(q); t = q.subtract(t); @@ -140,12 +140,12 @@ function RSA() { for (;;) { for (;;) { key.p = new BigInteger(B - qs, 1, rng); - if (key.p.subtract(BigInteger.ONE).gcd(key.ee).compareTo(BigInteger.ONE) == 0 && key.p.isProbablePrime(10)) + if (key.p.subtract(BigInteger.ONE).gcd(key.ee).compareTo(BigInteger.ONE) === 0 && key.p.isProbablePrime(10)) break; } for (;;) { key.q = new BigInteger(qs, 1, rng); - if (key.q.subtract(BigInteger.ONE).gcd(key.ee).compareTo(BigInteger.ONE) == 0 && key.q.isProbablePrime(10)) + if (key.q.subtract(BigInteger.ONE).gcd(key.ee).compareTo(BigInteger.ONE) === 0 && key.q.isProbablePrime(10)) break; } if (key.p.compareTo(key.q) <= 0) { @@ -156,7 +156,7 @@ function RSA() { var p1 = key.p.subtract(BigInteger.ONE); var q1 = key.q.subtract(BigInteger.ONE); var phi = p1.multiply(q1); - if (phi.gcd(key.ee).compareTo(BigInteger.ONE) == 0) { + if (phi.gcd(key.ee).compareTo(BigInteger.ONE) === 0) { key.n = key.p.multiply(key.q); key.d = key.ee.modInverse(phi); key.dmp1 = key.d.mod(p1); @@ -193,7 +193,7 @@ module.exports = RSA;
diff --git a/doc/s2k.html b/doc/s2k.html index dc10b2d5..7aa006d5 100644 --- a/doc/s2k.html +++ b/doc/s2k.html @@ -458,7 +458,7 @@ hashAlgorithm
Source:
@@ -689,7 +689,7 @@ hashAlgorithm hash length
Source:
@@ -758,7 +758,7 @@ hashAlgorithm hash length
diff --git a/doc/s2k.js.html b/doc/s2k.js.html index a3117f95..9a0711e4 100644 --- a/doc/s2k.js.html +++ b/doc/s2k.js.html @@ -126,7 +126,6 @@ module.exports = function s2k() { default: throw new Error("Unknown s2k type."); - break; } return i; @@ -221,7 +220,7 @@ module.exports = function s2k() {
diff --git a/doc/secret_key.html b/doc/secret_key.html index 59857a24..afbbc2a6 100644 --- a/doc/secret_key.html +++ b/doc/secret_key.html @@ -312,6 +312,75 @@ major versions. Consequently, this section is complex. + + + + + + + + +
+

mpi :module:type/mpi

+ + +
+
+ +
+ A list of multiprecision integers +
+ + + +
Type:
+ + + + +
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + +
Source:
+
+ + + + + + +
@@ -1241,7 +1310,7 @@ to key specifier
- Documentation generated by JSDoc 3.2.0 on Thu Jan 02 2014 13:02:44 GMT-0800 (PST) + Documentation generated by JSDoc 3.2.2 on Mon Jan 06 2014 16:27:54 GMT+0100 (MEZ)
diff --git a/doc/secret_key.js.html b/doc/secret_key.js.html index 9dd5a367..671da250 100644 --- a/doc/secret_key.js.html +++ b/doc/secret_key.js.html @@ -288,7 +288,7 @@ module.exports = function secret_key() { this.isDecrypted = true; }; -} +}; module.exports.prototype = new publicKey(); @@ -307,7 +307,7 @@ module.exports.prototype = new publicKey();
- Documentation generated by JSDoc 3.2.0 on Thu Jan 02 2014 13:02:39 GMT-0800 (PST) + Documentation generated by JSDoc 3.2.2 on Mon Jan 06 2014 16:27:49 GMT+0100 (MEZ)
diff --git a/doc/secret_subkey.html b/doc/secret_subkey.html index 4bbb38ec..8e38f799 100644 --- a/doc/secret_subkey.html +++ b/doc/secret_subkey.html @@ -200,7 +200,7 @@
Inherited From:
@@ -269,7 +269,7 @@
Inherited From:
@@ -295,6 +295,75 @@ + + + + + + + + +
+

mpi :module:type/mpi

+ + +
+
+ +
+ A list of multiprecision integers +
+ + + +
Type:
+ + + + +
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + +
Source:
+
+ + + + + + +
@@ -608,7 +677,7 @@ to key specifier
Inherited From:
@@ -704,7 +773,7 @@ to key specifier
Inherited From:
@@ -922,7 +991,7 @@ to key specifier
Inherited From:
@@ -1099,7 +1168,7 @@ to key specifier
Inherited From:
@@ -1173,7 +1242,7 @@ to key specifier
Inherited From:
@@ -1244,7 +1313,7 @@ to key specifier
diff --git a/doc/secret_subkey.js.html b/doc/secret_subkey.js.html index ed2be443..b727412f 100644 --- a/doc/secret_subkey.js.html +++ b/doc/secret_subkey.js.html @@ -55,7 +55,7 @@ var secretKey = require('./secret_key.js'); */ module.exports = function secret_subkey() { secretKey.call(this); -} +}; @@ -72,7 +72,7 @@ module.exports = function secret_subkey() {
diff --git a/doc/sha.html b/doc/sha.html index 820eddea..ace15ae3 100644 --- a/doc/sha.html +++ b/doc/sha.html @@ -460,7 +460,7 @@
diff --git a/doc/sha.js.html b/doc/sha.js.html index 1a78a0d6..16331fa5 100644 --- a/doc/sha.js.html +++ b/doc/sha.js.html @@ -126,7 +126,7 @@ var jsSHA = (function() { * * @private * @param {Array} binarray Array of integers to be converted to hexidecimal - * representation + * representation * @return Hexidecimal representation of the parameter in String form */ binb2hex = function(binarray) { @@ -149,7 +149,7 @@ var jsSHA = (function() { * * @private * @param {Array} binarray Array of integers to be converted to base-64 - * representation + * representation * @return Base-64 encoded representation of the parameter in String form */ binb2b64 = function(binarray) { @@ -589,7 +589,7 @@ var jsSHA = (function() { * * @private * @param {Array} message The binary array representation of the string to - * hash + * hash * @param {Number} messageLen The number of bits in the message * @return The array of integers representing the SHA-1 hash of message */ @@ -942,7 +942,7 @@ var jsSHA = (function() { * using the specified parameters * * @param {String} variant The desired SHA variant (SHA-1, SHA-224, - * SHA-256, SHA-384, or SHA-512) + * SHA-256, SHA-384, or SHA-512) * @param {String} format The desired output formatting (B64 or HEX) * @return The string representation of the hash in the format specified */ @@ -1002,9 +1002,9 @@ var jsSHA = (function() { * @param {String} key The key used to calculate the HMAC * @param {String} inputFormat The format of key, ASCII or HEX * @param {String} variant The desired SHA variant (SHA-1, SHA-224, - * SHA-256, SHA-384, or SHA-512) + * SHA-256, SHA-384, or SHA-512) * @param {String} outputFormat The desired output formatting - * (B64 or HEX) + * (B64 or HEX) * @return The string representation of the hash in the format specified */ getHMAC: function(key, inputFormat, variant, outputFormat) { @@ -1149,7 +1149,7 @@ module.exports = { var shaObj = new jsSHA(str, "ASCII"); return shaObj.getHash("SHA-512", "ASCII"); } -} +}; @@ -1166,7 +1166,7 @@ module.exports = {
diff --git a/doc/signature.html b/doc/signature.html index fd7e7186..1ae8d1be 100644 --- a/doc/signature.html +++ b/doc/signature.html @@ -581,7 +581,7 @@ integers which is used to sign the data
diff --git a/doc/signature.js.html b/doc/signature.js.html index d2f11bc7..4fe49a1d 100644 --- a/doc/signature.js.html +++ b/doc/signature.js.html @@ -47,6 +47,7 @@ module.exports = { */ verify: function(algo, hash_algo, msg_MPIs, publickey_MPIs, data) { var calc_hash = hashModule.digest(hash_algo, data); + var dopublic; switch (algo) { case 1: @@ -59,7 +60,7 @@ module.exports = { var n = publickey_MPIs[0].toBigInteger(); var e = publickey_MPIs[1].toBigInteger(); var x = msg_MPIs[0].toBigInteger(); - var dopublic = rsa.verify(x, e, n); + dopublic = rsa.verify(x, e, n); var hash = pkcs1.emsa.decode(hash_algo, dopublic.toMPI().substring(2)); if (hash == -1) { throw new Error('PKCS1 padding in message or key incorrect. Aborting...'); @@ -79,12 +80,11 @@ module.exports = { var g = publickey_MPIs[2].toBigInteger(); var y = publickey_MPIs[3].toBigInteger(); var m = data; - var dopublic = dsa.verify(hash_algo, s1, s2, m, p, q, g, y); - return dopublic.compareTo(s1) == 0; + dopublic = dsa.verify(hash_algo, s1, s2, m, p, q, g, y); + return dopublic.compareTo(s1) === 0; default: throw new Error('Invalid signature algorithm.'); } - }, /** @@ -100,6 +100,8 @@ module.exports = { */ sign: function(hash_algo, algo, keyIntegers, data) { + var m; + switch (algo) { case 1: // RSA (Encrypt or Sign) [HAC] @@ -110,7 +112,7 @@ module.exports = { var rsa = new publicKey.rsa(); var d = keyIntegers[2].toBigInteger(); var n = keyIntegers[0].toBigInteger(); - var m = pkcs1.emsa.encode(hash_algo, + m = pkcs1.emsa.encode(hash_algo, data, keyIntegers[0].byteLength()); return rsa.sign(m, d, n).toMPI(); @@ -124,7 +126,7 @@ module.exports = { var g = keyIntegers[2].toBigInteger(); var y = keyIntegers[3].toBigInteger(); var x = keyIntegers[4].toBigInteger(); - var m = data; + m = data; var result = dsa.sign(hash_algo, m, g, p, q, x); return result[0].toString() + result[1].toString(); @@ -135,7 +137,7 @@ module.exports = { throw new Error('Invalid signature algorithm.'); } } -} +}; @@ -152,7 +154,7 @@ module.exports = {
diff --git a/doc/signature.js_.html b/doc/signature.js_.html index f3a3d0ab..c45977c7 100644 --- a/doc/signature.js_.html +++ b/doc/signature.js_.html @@ -198,7 +198,6 @@ module.exports = function signature() { break; default: throw new Error('Version ' + version + ' of the signature is unsupported.'); - break; } // Two-octet field holding left 16 bits of signed hash value. @@ -390,6 +389,7 @@ module.exports = function signature() { // The leftwost bit denotes a "critical" packet, but we ignore it. var type = bytes.charCodeAt(mypos++) & 0x7F; + var seconds; // subpacket type switch (type) { @@ -399,9 +399,9 @@ module.exports = function signature() { break; case 3: // Signature Expiration Time in seconds - var seconds = util.readNumber(bytes.substr(mypos)); + seconds = util.readNumber(bytes.substr(mypos)); - this.signatureNeverExpires = seconds == 0; + this.signatureNeverExpires = seconds === 0; this.signatureExpirationTime = seconds; break; @@ -424,10 +424,10 @@ module.exports = function signature() { break; case 9: // Key Expiration Time in seconds - var seconds = util.readNumber(bytes.substr(mypos)); + seconds = util.readNumber(bytes.substr(mypos)); this.keyExpirationTime = seconds; - this.keyNeverExpires = seconds == 0; + this.keyNeverExpires = seconds === 0; break; case 11: @@ -462,9 +462,9 @@ module.exports = function signature() { // We extract key/value tuple from the byte stream. mypos += 4; var m = util.readNumber(bytes.substr(mypos, 2)); - mypos += 2 + mypos += 2; var n = util.readNumber(bytes.substr(mypos, 2)); - mypos += 2 + mypos += 2; var name = bytes.substr(mypos, m), value = bytes.substr(mypos + m, n); @@ -491,7 +491,7 @@ module.exports = function signature() { break; case 25: // Primary User ID - this.isPrimaryUserID = bytes[mypos++] != 0; + this.isPrimaryUserID = bytes[mypos++] !== 0; break; case 26: // Policy URI @@ -531,7 +531,6 @@ module.exports = function signature() { break; default: throw new Error("Unknown signature subpacket type " + type + " @:" + mypos); - break; } }; @@ -583,7 +582,7 @@ module.exports = function signature() { }); case t.key: - if (data.key == undefined) + if (data.key === undefined) throw new Error('Key packet is required for this sigtature.'); return data.key.writeOld(); @@ -595,11 +594,10 @@ module.exports = function signature() { return ''; case t.third_party: throw new Error('Not implemented'); - break; default: - throw new Error('Unknown signature type.') + throw new Error('Unknown signature type.'); } - } + }; this.calculateTrailer = function () { @@ -610,8 +608,8 @@ module.exports = function signature() { trailer += String.fromCharCode(4); // Version trailer += String.fromCharCode(0xFF); trailer += util.writeNumber(this.signatureData.length, 4); - return trailer - } + return trailer; + }; /** @@ -652,7 +650,7 @@ module.exports = function signature() { bytes + this.signatureData + trailer); return this.verified; - } + }; /** * Verifies signature expiration date @@ -663,8 +661,9 @@ module.exports = function signature() { return Date.now() > (this.created.getTime() + this.signatureExpirationTime*1000); } return false; - } -} + }; +}; + @@ -681,7 +680,7 @@ module.exports = function signature() {
diff --git a/doc/signature_.html b/doc/signature_.html index ddf712fe..20353cd9 100644 --- a/doc/signature_.html +++ b/doc/signature_.html @@ -226,7 +226,7 @@ block of text, and a signature that is a certification of a User ID.
Source:
@@ -573,7 +573,7 @@ block of text, and a signature that is a certification of a User ID.
Source:
@@ -719,7 +719,7 @@ block of text, and a signature that is a certification of a User ID.
Source:
@@ -810,7 +810,7 @@ block of text, and a signature that is a certification of a User ID.
Source:
@@ -973,7 +973,7 @@ in RFC4880 Section 5.2.3.2
Source:
@@ -1042,7 +1042,7 @@ in RFC4880 Section 5.2.3.2
diff --git a/doc/sym_encrypted_integrity_protected.html b/doc/sym_encrypted_integrity_protected.html index 80784815..dbf224f6 100644 --- a/doc/sym_encrypted_integrity_protected.html +++ b/doc/sym_encrypted_integrity_protected.html @@ -485,7 +485,7 @@ have been called before
diff --git a/doc/sym_encrypted_integrity_protected.js.html b/doc/sym_encrypted_integrity_protected.js.html index a83f5c41..e4d6569d 100644 --- a/doc/sym_encrypted_integrity_protected.js.html +++ b/doc/sym_encrypted_integrity_protected.js.html @@ -91,16 +91,16 @@ module.exports = function sym_encrypted_integrity_protected() { this.write = function () { - return String.fromCharCode(1) // Version - + this.encrypted; + // 1 = Version + return String.fromCharCode(1) + this.encrypted; }; this.encrypt = function (sessionKeyAlgorithm, key) { - var bytes = this.packets.write() + var bytes = this.packets.write(); var prefixrandom = crypto.getPrefixRandom(sessionKeyAlgorithm); var prefix = prefixrandom + prefixrandom.charAt(prefixrandom.length - 2) + prefixrandom.charAt(prefixrandom.length - - 1) + 1); var tohash = bytes; @@ -162,7 +162,7 @@ module.exports = function sym_encrypted_integrity_protected() {
diff --git a/doc/sym_encrypted_session_key.html b/doc/sym_encrypted_session_key.html index 82399392..a713f78b 100644 --- a/doc/sym_encrypted_session_key.html +++ b/doc/sym_encrypted_session_key.html @@ -483,7 +483,7 @@ packets (tag 1)
diff --git a/doc/sym_encrypted_session_key.js.html b/doc/sym_encrypted_session_key.js.html index 5fa2357c..f5d78f9d 100644 --- a/doc/sym_encrypted_session_key.js.html +++ b/doc/sym_encrypted_session_key.js.html @@ -102,13 +102,13 @@ module.exports = function sym_encrypted_session_key() { if (done < bytes.length) { this.encrypted = bytes.substr(done); - this.sessionKeyEncryptionAlgorithm = algo + this.sessionKeyEncryptionAlgorithm = algo; } else this.sessionKeyAlgorithm = algo; }; this.write = function() { - var algo = this.encrypted == null ? + var algo = this.encrypted === null ? this.sessionKeyAlgorithm : this.sessionKeyEncryptionAlgorithm; @@ -116,7 +116,7 @@ module.exports = function sym_encrypted_session_key() { String.fromCharCode(enums.write(enums.symmetric, algo)) + this.s2k.write(); - if (this.encrypted != null) + if (this.encrypted !== null) bytes += this.encrypted; return bytes; }; @@ -128,7 +128,7 @@ module.exports = function sym_encrypted_session_key() { * @return {String} The unencrypted session key */ this.decrypt = function(passphrase) { - var algo = this.sessionKeyEncryptionAlgorithm != null ? + var algo = this.sessionKeyEncryptionAlgorithm !== null ? this.sessionKeyEncryptionAlgorithm : this.sessionKeyAlgorithm; @@ -136,7 +136,7 @@ module.exports = function sym_encrypted_session_key() { var length = crypto.cipher[algo].keySize; var key = this.s2k.produce_key(passphrase, length); - if (this.encrypted == null) { + if (this.encrypted === null) { this.sessionKey = key; } else { @@ -181,7 +181,7 @@ module.exports = function sym_encrypted_session_key() {
diff --git a/doc/symmetrically_encrypted.html b/doc/symmetrically_encrypted.html index ad3006af..9b944889 100644 --- a/doc/symmetrically_encrypted.html +++ b/doc/symmetrically_encrypted.html @@ -404,7 +404,7 @@ that form whole OpenPGP messages).
diff --git a/doc/symmetrically_encrypted.js.html b/doc/symmetrically_encrypted.js.html index befbf8e1..c5a176e5 100644 --- a/doc/symmetrically_encrypted.js.html +++ b/doc/symmetrically_encrypted.js.html @@ -112,7 +112,7 @@ module.exports = function symmetrically_encrypted() {
diff --git a/doc/trust.html b/doc/trust.html index 4ab78f4c..0d8a52ab 100644 --- a/doc/trust.html +++ b/doc/trust.html @@ -177,7 +177,7 @@
diff --git a/doc/trust.js.html b/doc/trust.js.html index aa796bc7..902786ac 100644 --- a/doc/trust.js.html +++ b/doc/trust.js.html @@ -51,7 +51,7 @@ module.exports = function trust() {
diff --git a/doc/twofish.html b/doc/twofish.html index a13b1507..2a76fb05 100644 --- a/doc/twofish.html +++ b/doc/twofish.html @@ -111,7 +111,7 @@
diff --git a/doc/twofish.js.html b/doc/twofish.js.html index a4354261..f74eef85 100644 --- a/doc/twofish.js.html +++ b/doc/twofish.js.html @@ -400,7 +400,7 @@ function TF(key) { this.encrypt = function(block) { return this.tf.encrypt([].concat(block), 0); - } + }; } @@ -423,7 +423,7 @@ module.exports.blockSize = TF.prototype.blockSize = 16;
diff --git a/doc/user_attribute.html b/doc/user_attribute.html index 044cd0e1..9383369d 100644 --- a/doc/user_attribute.html +++ b/doc/user_attribute.html @@ -315,7 +315,7 @@ module packet/user_attribute
diff --git a/doc/user_attribute.js.html b/doc/user_attribute.js.html index 81e0c7cf..b7114362 100644 --- a/doc/user_attribute.js.html +++ b/doc/user_attribute.js.html @@ -103,7 +103,7 @@ module.exports = function user_attribute() {
diff --git a/doc/userid.html b/doc/userid.html index 577681ef..8cb0ecc9 100644 --- a/doc/userid.html +++ b/doc/userid.html @@ -472,7 +472,7 @@ John Doe
- Documentation generated by JSDoc 3.2.0 on Thu Jan 02 2014 13:02:44 GMT-0800 (PST) + Documentation generated by JSDoc 3.2.2 on Mon Jan 06 2014 16:27:55 GMT+0100 (MEZ)
diff --git a/doc/userid.js.html b/doc/userid.js.html index 25f1adf3..4f13b28b 100644 --- a/doc/userid.js.html +++ b/doc/userid.js.html @@ -82,7 +82,7 @@ module.exports = function userid() { this.write = function () { return util.encode_utf8(this.userid); }; -} +}; @@ -99,7 +99,7 @@ module.exports = function userid() {
- Documentation generated by JSDoc 3.2.0 on Thu Jan 02 2014 13:02:39 GMT-0800 (PST) + Documentation generated by JSDoc 3.2.2 on Mon Jan 06 2014 16:27:49 GMT+0100 (MEZ)
diff --git a/doc/util.html b/doc/util.html index bbbe6e34..8d42e510 100644 --- a/doc/util.html +++ b/doc/util.html @@ -2006,7 +2006,7 @@ the same as bin2str.
- Documentation generated by JSDoc 3.2.0 on Thu Jan 02 2014 13:02:45 GMT-0800 (PST) + Documentation generated by JSDoc 3.2.2 on Mon Jan 06 2014 16:27:55 GMT+0100 (MEZ)
diff --git a/doc/util.js.html b/doc/util.js.html index dac2954e..d35d1efa 100644 --- a/doc/util.js.html +++ b/doc/util.js.html @@ -97,7 +97,7 @@ module.exports = { while (h.length < 2) h = "0" + h; r.push(" " + h); i++; - if (i % 32 == 0) + if (i % 32 === 0) r.push("\n "); } return r.join(''); @@ -109,7 +109,7 @@ module.exports = { * @return {String} String containing the hexadecimal values */ hexstrdump: function (str) { - if (str == null) + if (str === null) return ""; var r = []; var e = str.length; @@ -277,7 +277,7 @@ module.exports = { getLeftNBits: function (string, bitcount) { var rest = bitcount % 8; - if (rest == 0) + if (rest === 0) return string.substring(0, bitcount / 8); var bytes = (bitcount - rest) / 8 + 1; var result = string.substring(0, bytes); @@ -293,7 +293,7 @@ module.exports = { */ shiftRight: function (value, bitcount) { var temp = util.str2bin(value); - if (bitcount % 8 != 0) { + if (bitcount % 8 !== 0) { for (var i = temp.length - 1; i >= 0; i--) { temp[i] >>= bitcount % 8; if (i > 0) @@ -345,7 +345,7 @@ module.exports = {
- Documentation generated by JSDoc 3.2.0 on Thu Jan 02 2014 13:02:39 GMT-0800 (PST) + Documentation generated by JSDoc 3.2.2 on Mon Jan 06 2014 16:27:49 GMT+0100 (MEZ)