1
0
mirror of https://github.com/moparisthebest/mail synced 2024-11-27 03:12:23 -05:00

shorten long var names

This commit is contained in:
Tankred Hase 2013-10-13 01:30:56 +02:00
parent 445428be26
commit 7a939db5a3

View File

@ -110,15 +110,15 @@ define(function(require) {
/** /**
* Encrypt and sign a pgp message for a list of receivers * Encrypt and sign a pgp message for a list of receivers
*/ */
PGP.prototype.encrypt = function(plaintext, receiverPublicKeys, callback) { PGP.prototype.encrypt = function(plaintext, receiverKeys, callback) {
var ct, i, var ct, i,
privateKey = openpgp.keyring.exportPrivateKey(0).obj; privateKey = openpgp.keyring.exportPrivateKey(0).obj;
for (i = 0; i < receiverPublicKeys.length; i++) { for (i = 0; i < receiverKeys.length; i++) {
receiverPublicKeys[i] = openpgp.read_publicKey(receiverPublicKeys[i])[0]; receiverKeys[i] = openpgp.read_publicKey(receiverKeys[i])[0];
} }
ct = openpgp.write_signed_and_encrypted_message(privateKey, receiverPublicKeys, plaintext); ct = openpgp.write_signed_and_encrypted_message(privateKey, receiverKeys, plaintext);
callback(null, ct); callback(null, ct);
}; };
@ -126,9 +126,9 @@ define(function(require) {
/** /**
* Decrypt and verify a pgp message for a single sender * Decrypt and verify a pgp message for a single sender
*/ */
PGP.prototype.decrypt = function(ciphertext, senderPublicKey, callback) { PGP.prototype.decrypt = function(ciphertext, senderKey, callback) {
var privateKey = openpgp.keyring.exportPrivateKey(0).obj; var privateKey = openpgp.keyring.exportPrivateKey(0).obj;
senderPublicKey = openpgp.read_publicKey(senderPublicKey)[0]; senderKey = openpgp.read_publicKey(senderKey)[0];
var msg = openpgp.read_message(ciphertext)[0]; var msg = openpgp.read_message(ciphertext)[0];
var keymat = null; var keymat = null;
@ -156,7 +156,7 @@ define(function(require) {
} }
} }
if (keymat !== null) { if (keymat !== null) {
var decrypted = msg.decryptAndVerifySignature(keymat, sesskey, senderPublicKey); var decrypted = msg.decryptAndVerifySignature(keymat, sesskey, senderKey);
callback(null, decrypted.text); callback(null, decrypted.text);
} else { } else {