From 7475437d5a21702018b37d4d86d788eab945ef44 Mon Sep 17 00:00:00 2001 From: Alexander Willner Date: Sun, 15 Jan 2012 00:22:14 +0100 Subject: [PATCH] renamed GPG4Browsers to OpenPGP.js --- plugins/chrome/contentscripts.js | 24 +++++++------- plugins/chrome/manifest.json | 6 ++-- plugins/chrome/openpgp.html | 56 ++++++++++++++++---------------- plugins/chrome/options.html | 44 ++++++++++++------------- 4 files changed, 65 insertions(+), 65 deletions(-) diff --git a/plugins/chrome/contentscripts.js b/plugins/chrome/contentscripts.js index 25101533..8f244488 100644 --- a/plugins/chrome/contentscripts.js +++ b/plugins/chrome/contentscripts.js @@ -1,16 +1,16 @@ // GPG4Browsers - An OpenPGP implementation in javascript // Copyright (C) 2011 Recurity Labs GmbH -// +// // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. -// +// // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. -// +// // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA @@ -21,7 +21,7 @@ if (window.location.href.indexOf("https://mail.google.com/mail/?view=cm") == 0) } else { // we are running in the normal interface chrome.extension.sendRequest({account: document.getElementsByTagName("script")[4].text.split(",")[10].replace(/"/g,"").trim()}, function(response) {}); - + } var current_message_type = -1; @@ -40,8 +40,8 @@ function find_openpgp(text) { current_pgp_block = text.substring(text.indexOf("-----BEGIN PGP MESSAGE-----"), text.indexOf("-----END PGP MESSAGE-----")+25); current_pgp_block = current_pgp_block.replace(/\n/g,"").replace(/
/g,"\n").replace(//g,""); if (pgp_verifyCheckSum(current_pgp_block)) - show_pgp_alert(); - + show_pgp_alert(); + } else if (/-----BEGIN PGP SIGNED MESSAGE-----/.test(text) && /-----END PGP SIGNATURE-----/.test(text)) { current_message= document.location.hash; current_message_type = 1; @@ -65,8 +65,8 @@ function start_pgp_dialog() { //Gmail does not provide a generic way. to get message data out of the HTML interface so we parse the DOM Gmail.getMail(function(msg) { msg.action = 1; - chrome.extension.sendRequest(msg, function(response) { - // hide_pgp_alert(); // hide pgp alert after opening the openpgp window + chrome.extension.sendRequest(msg, function(response) { + // hide_pgp_alert(); // hide pgp alert after opening the openpgp window }); }); } @@ -90,9 +90,9 @@ function show_pgp_alert() { div.setAttribute("id", "gpg4browsers_alert"); div.setAttribute("style","position: fixed; top: 0px; width: 100%; background-color: #eeeeff; border-bottom: 1px solid #aaa;"); if (current_message_type == 0) - div.appendChild(document.createTextNode("This mail is encrypted. Do you want to open it with GPG4Browsers?")); + div.appendChild(document.createTextNode("This mail is encrypted. Do you want to open it with OpenPGP.js?")); else if (current_message_type == 1) - div.appendChild(document.createTextNode("This mail is signed. Do you want to open it with GPG4Browsers?")); + div.appendChild(document.createTextNode("This mail is signed. Do you want to open it with OpenPGP.js?")); div.appendChild(buttonyes); div.appendChild(buttonno); document.body.appendChild(div); @@ -123,7 +123,7 @@ window.setInterval(function() { * @param text containing the base64 block and the base64 encoded checksum * @return true if the checksum was correct, false otherwise */ -function pgp_verifyCheckSum(text) { +function pgp_verifyCheckSum(text) { var splittedtext = text.split('-----'); var data = r2s(splittedtext[2].split('\n\n')[1].split("\n=")[0]); var checksum = splittedtext[2].split('\n\n')[1].split("\n=")[1].replace(/\n/g,""); @@ -149,7 +149,7 @@ function getCheckSum(data) { /** * calculation routine for a CRC-24 checksum * @param data - * @return + * @return */ function createcrc24 (data) { var crc = 0xB704CE; diff --git a/plugins/chrome/manifest.json b/plugins/chrome/manifest.json index 9640f4e7..688a290f 100644 --- a/plugins/chrome/manifest.json +++ b/plugins/chrome/manifest.json @@ -1,7 +1,7 @@ { - "name" : "GPG4Browsers", + "name" : "OpenPGP.js", "version" : "0.1", - "description" : "An OpenPGP implementation in javascript", + "description" : "OpenPGP.js integration for Google Mail", "background_page" : "background.html", "options_page": "options.html", "page_action" : @@ -22,7 +22,7 @@ "incoginto": "split", "permissions": [ "https://mail.google.com/*", - "http://keyserver.linux.it/*", + "http://keyserver.linux.it/*", "unlimitedStorage" ], "icons" : { diff --git a/plugins/chrome/openpgp.html b/plugins/chrome/openpgp.html index e194e171..5466ffb2 100644 --- a/plugins/chrome/openpgp.html +++ b/plugins/chrome/openpgp.html @@ -7,7 +7,7 @@ - + @@ -59,7 +59,7 @@ -GPG4Browsers +OpenPGP.js @@ -558,7 +558,7 @@ function showEncryptionCancel() { -
+
diff --git a/plugins/chrome/options.html b/plugins/chrome/options.html index ab6161f8..242aa183 100644 --- a/plugins/chrome/options.html +++ b/plugins/chrome/options.html @@ -1,14 +1,14 @@ - GPG4Browsers - PGP Message Options + OpenPGP.js - PGP Message Options - + @@ -68,7 +68,7 @@ function save_options() { } function getAlgorithmString(publicKey) { - var result = publicKey.publicKeyPacket.MPIs[0].mpiByteLength*8+"/"; + var result = publicKey.publicKeyPacket.MPIs[0].mpiByteLength*8+"/"; switch (publicKey.publicKeyPacket.publicKeyAlgorithm) { case 1: result += "RSA(S/E)"; @@ -106,7 +106,7 @@ function getAlgorithmString(publicKey) { break; } } - return result; + return result; } function encodeForHtml(text) { if (text == null) @@ -130,7 +130,7 @@ function importPrivateKey(key) { function restore_options() { openpgp.init(); update_tables(); - $('#cipher_alg_select').val(""+openpgp.config.config.encryption_cipher); + $('#cipher_alg_select').val(""+openpgp.config.config.encryption_cipher); $('#hash_alg_select').val(""+openpgp.config.config.prefer_hash_algorithm); $('#compression_alg_select').val(""+openpgp.config.config.compression); $('#integrity').attr("checked", openpgp.config.config.integrity_protect); @@ -148,7 +148,7 @@ function show_userIds(k) { $('#show_ids_'+k).append("rev"+encodeForHtml(publicKey.obj.userIds[i].text)+""); else if (certsigs[i].indexOf(5) != -1) $('#show_ids_'+k).append("exp"+encodeForHtml(publicKey.obj.userIds[i].text)+""); - else + else $('#show_ids_'+k).append("uid"+encodeForHtml(publicKey.obj.userIds[i].text)+""); for (var j = 0; j < publicKey.obj.userIds[i].certificationSignatures.length; j++) { var istr = util.hexstrdump(publicKey.obj.userIds[i].certificationSignatures[j].getIssuer()); @@ -160,12 +160,12 @@ function show_userIds(k) { $('#show_ids_'+k).append("sig"+(sigclass == 0 ? "" : sigclass)+"BAD"+encodeForHtml(istr)+""); if (certsigs[i][j] == 1) $('#show_ids_'+k).append("sig"+(sigclass == 0 ? "" : sigclass)+"exp"+encodeForHtml(istr)+""); - if (certsigs[i][j] == 2) + if (certsigs[i][j] == 2) $('#show_ids_'+k).append("sig"+(sigclass == 0 ? "" : sigclass)+"unk"+encodeForHtml(istr)+""); - if (certsigs[i][j] == 3) + if (certsigs[i][j] == 3) $('#show_ids_'+k).append("sig"+(sigclass == 0 ? "" : sigclass)+"rev"+encodeForHtml(istr)+""); - if (certsigs[i][j] == 4) - $('#show_ids_'+k).append("sig"+(sigclass == 0 ? "" : sigclass)+""+encodeForHtml(istr)+""); + if (certsigs[i][j] == 4) + $('#show_ids_'+k).append("sig"+(sigclass == 0 ? "" : sigclass)+""+encodeForHtml(istr)+""); } } $('#show_ids_'+k).toggle(); @@ -289,11 +289,11 @@ function show_search_results() { margin-bottom: 0px; z-index: 1; } - + th { text-align: left; } - + .tabref { background-color: #eee; border: 1px solid #aaa; @@ -301,7 +301,7 @@ function show_search_results() { #options_header { margin-left: 5px; } - + #publicKeyTable, #privateKeyTable, #searchKeyResults { border: 1px solid #aaa; } @@ -311,30 +311,30 @@ function show_search_results() { border-bottom: 1px solid #000; padding: 3px; } - + #publicKeyTable td, #privateKeyTable td, #searchKeyResults td { padding: 3px; border-bottom: 1px solid #aaa; vertical-align: top; } - + .tabref-select { background-color: #fff; border-bottom: 1px solid #fff; } - + h2 { - + font: 1.5em; width: 100%; border-bottom: 1px solid #888; } - + h1, h2 { font: 1.5em "Impact"; - + } - + #tab_1, #tab_2, #tab_3, #tab_0 { margin-top: 2px; border: 1px solid #aaa; @@ -346,7 +346,7 @@ function show_search_results() { padding-bottom: 10px; border-radius: 5px; } - +
@@ -435,7 +435,7 @@ function show_search_results() {
Paste a private key
-