renamed GPG4Browsers to OpenPGP.js
This commit is contained in:
parent
f7b505fa0b
commit
7475437d5a
|
@ -1,16 +1,16 @@
|
||||||
// GPG4Browsers - An OpenPGP implementation in javascript
|
// GPG4Browsers - An OpenPGP implementation in javascript
|
||||||
// Copyright (C) 2011 Recurity Labs GmbH
|
// Copyright (C) 2011 Recurity Labs GmbH
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
// License as published by the Free Software Foundation; either
|
// License as published by the Free Software Foundation; either
|
||||||
// version 2.1 of the License, or (at your option) any later version.
|
// 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,
|
// This library is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
// Lesser General Public License for more details.
|
// Lesser General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License along with this library; if not, write to the Free Software
|
// License along with this library; if not, write to the Free Software
|
||||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
// 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 {
|
} else {
|
||||||
// we are running in the normal interface
|
// we are running in the normal interface
|
||||||
chrome.extension.sendRequest({account: document.getElementsByTagName("script")[4].text.split(",")[10].replace(/"/g,"").trim()}, function(response) {});
|
chrome.extension.sendRequest({account: document.getElementsByTagName("script")[4].text.split(",")[10].replace(/"/g,"").trim()}, function(response) {});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var current_message_type = -1;
|
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 = text.substring(text.indexOf("-----BEGIN PGP MESSAGE-----"), text.indexOf("-----END PGP MESSAGE-----")+25);
|
||||||
current_pgp_block = current_pgp_block.replace(/\n/g,"").replace(/<br>/g,"\n").replace(/<wbr>/g,"");
|
current_pgp_block = current_pgp_block.replace(/\n/g,"").replace(/<br>/g,"\n").replace(/<wbr>/g,"");
|
||||||
if (pgp_verifyCheckSum(current_pgp_block))
|
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)) {
|
} else if (/-----BEGIN PGP SIGNED MESSAGE-----/.test(text) && /-----END PGP SIGNATURE-----/.test(text)) {
|
||||||
current_message= document.location.hash;
|
current_message= document.location.hash;
|
||||||
current_message_type = 1;
|
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 does not provide a generic way. to get message data out of the HTML interface so we parse the DOM
|
||||||
Gmail.getMail(function(msg) {
|
Gmail.getMail(function(msg) {
|
||||||
msg.action = 1;
|
msg.action = 1;
|
||||||
chrome.extension.sendRequest(msg, function(response) {
|
chrome.extension.sendRequest(msg, function(response) {
|
||||||
// hide_pgp_alert(); // hide pgp alert after opening the openpgp window
|
// 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("id", "gpg4browsers_alert");
|
||||||
div.setAttribute("style","position: fixed; top: 0px; width: 100%; background-color: #eeeeff; border-bottom: 1px solid #aaa;");
|
div.setAttribute("style","position: fixed; top: 0px; width: 100%; background-color: #eeeeff; border-bottom: 1px solid #aaa;");
|
||||||
if (current_message_type == 0)
|
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)
|
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(buttonyes);
|
||||||
div.appendChild(buttonno);
|
div.appendChild(buttonno);
|
||||||
document.body.appendChild(div);
|
document.body.appendChild(div);
|
||||||
|
@ -123,7 +123,7 @@ window.setInterval(function() {
|
||||||
* @param text containing the base64 block and the base64 encoded checksum
|
* @param text containing the base64 block and the base64 encoded checksum
|
||||||
* @return true if the checksum was correct, false otherwise
|
* @return true if the checksum was correct, false otherwise
|
||||||
*/
|
*/
|
||||||
function pgp_verifyCheckSum(text) {
|
function pgp_verifyCheckSum(text) {
|
||||||
var splittedtext = text.split('-----');
|
var splittedtext = text.split('-----');
|
||||||
var data = r2s(splittedtext[2].split('\n\n')[1].split("\n=")[0]);
|
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,"");
|
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
|
* calculation routine for a CRC-24 checksum
|
||||||
* @param data
|
* @param data
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
function createcrc24 (data) {
|
function createcrc24 (data) {
|
||||||
var crc = 0xB704CE;
|
var crc = 0xB704CE;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name" : "GPG4Browsers",
|
"name" : "OpenPGP.js",
|
||||||
"version" : "0.1",
|
"version" : "0.1",
|
||||||
"description" : "An OpenPGP implementation in javascript",
|
"description" : "OpenPGP.js integration for Google Mail",
|
||||||
"background_page" : "background.html",
|
"background_page" : "background.html",
|
||||||
"options_page": "options.html",
|
"options_page": "options.html",
|
||||||
"page_action" :
|
"page_action" :
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
"incoginto": "split",
|
"incoginto": "split",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"https://mail.google.com/*",
|
"https://mail.google.com/*",
|
||||||
"http://keyserver.linux.it/*",
|
"http://keyserver.linux.it/*",
|
||||||
"unlimitedStorage"
|
"unlimitedStorage"
|
||||||
],
|
],
|
||||||
"icons" : {
|
"icons" : {
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<script type="text/javascript" src="js/ciphers/hash/md5.js"></script>
|
<script type="text/javascript" src="js/ciphers/hash/md5.js"></script>
|
||||||
<script type="text/javascript" src="js/ciphers/hash/ripe-md.js"></script>
|
<script type="text/javascript" src="js/ciphers/hash/ripe-md.js"></script>
|
||||||
|
|
||||||
<!-- crypto libs -->
|
<!-- crypto libs -->
|
||||||
<script type="text/javascript" src="js/ciphers/symmetricencryption/aes.js"></script>
|
<script type="text/javascript" src="js/ciphers/symmetricencryption/aes.js"></script>
|
||||||
<script type="text/javascript" src="js/ciphers/symmetricencryption/cast5.js"></script>
|
<script type="text/javascript" src="js/ciphers/symmetricencryption/cast5.js"></script>
|
||||||
<script type="text/javascript" src="js/ciphers/symmetricencryption/dessrc.js"></script>
|
<script type="text/javascript" src="js/ciphers/symmetricencryption/dessrc.js"></script>
|
||||||
|
@ -59,7 +59,7 @@
|
||||||
<script type="text/javascript" src="js/openpgp.msg.publickey.js"></script>
|
<script type="text/javascript" src="js/openpgp.msg.publickey.js"></script>
|
||||||
<script type="text/javascript" src="js/util.js"></script>
|
<script type="text/javascript" src="js/util.js"></script>
|
||||||
|
|
||||||
<title>GPG4Browsers</title>
|
<title>OpenPGP.js</title>
|
||||||
</head>
|
</head>
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@
|
||||||
margin-top: -10px;
|
margin-top: -10px;
|
||||||
margin-left: -300px;
|
margin-left: -300px;
|
||||||
background-color: #8888FF;
|
background-color: #8888FF;
|
||||||
z-index:4;
|
z-index:4;
|
||||||
border: 2px solid white;
|
border: 2px solid white;
|
||||||
box-shadow: 0px 0px 4px 4px #666;
|
box-shadow: 0px 0px 4px 4px #666;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
@ -88,7 +88,7 @@
|
||||||
margin-top: -235px;
|
margin-top: -235px;
|
||||||
margin-left: -300px;
|
margin-left: -300px;
|
||||||
background-color: #8888FF;
|
background-color: #8888FF;
|
||||||
z-index:4;
|
z-index:4;
|
||||||
border: 2px solid white;
|
border: 2px solid white;
|
||||||
box-shadow: 0px 0px 4px 4px #666;
|
box-shadow: 0px 0px 4px 4px #666;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
@ -98,19 +98,19 @@
|
||||||
#keyselecttable {
|
#keyselecttable {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#keyselecttable th {
|
#keyselecttable th {
|
||||||
background-color: #eee;
|
background-color: #eee;
|
||||||
border-bottom: 1px solid #000;
|
border-bottom: 1px solid #000;
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
#keyselecttable td {
|
#keyselecttable td {
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
border-bottom: 1px solid #aaa;
|
border-bottom: 1px solid #aaa;
|
||||||
}
|
}
|
||||||
|
|
||||||
#reciepientTable {
|
#reciepientTable {
|
||||||
border: none;
|
border: none;
|
||||||
border-spacing: 2px;
|
border-spacing: 2px;
|
||||||
|
@ -141,15 +141,15 @@
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
width: 670px;
|
width: 670px;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
background-color: #EFEFEF;
|
background-color: #EFEFEF;
|
||||||
}
|
}
|
||||||
|
|
||||||
#keyselecttable tbody {
|
#keyselecttable tbody {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
#displaySender, #displayCC,
|
#displaySender, #displayCC,
|
||||||
</style>
|
</style>
|
||||||
<script language="javascript">
|
<script language="javascript">
|
||||||
|
|
||||||
|
@ -159,7 +159,7 @@ var account_email = null;
|
||||||
|
|
||||||
function start() {
|
function start() {
|
||||||
openpgp.init();
|
openpgp.init();
|
||||||
chrome.extension.sendRequest({},
|
chrome.extension.sendRequest({},
|
||||||
function(response) {
|
function(response) {
|
||||||
request = response;
|
request = response;
|
||||||
if (request.action == 0) { // compose message
|
if (request.action == 0) { // compose message
|
||||||
|
@ -178,7 +178,7 @@ function start() {
|
||||||
|
|
||||||
function show_compose_window() {
|
function show_compose_window() {
|
||||||
$("#composerAddress").html(openpgp_encoding_html_encode(account_email));
|
$("#composerAddress").html(openpgp_encoding_html_encode(account_email));
|
||||||
$("#displayWindow").hide();
|
$("#displayWindow").hide();
|
||||||
$("#composeWindow").show();
|
$("#composeWindow").show();
|
||||||
if (openpgp.config.config.composition_behavior == 0) {
|
if (openpgp.config.config.composition_behavior == 0) {
|
||||||
$('#sign_message').attr("checked","checked");
|
$('#sign_message').attr("checked","checked");
|
||||||
|
@ -202,7 +202,7 @@ function rfn(result) {
|
||||||
else {
|
else {
|
||||||
current_message.decrypted = result;
|
current_message.decrypted = result;
|
||||||
$("#displayMessage").html(openpgp_encoding_html_encode(result));
|
$("#displayMessage").html(openpgp_encoding_html_encode(result));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_message_window(request) {
|
function show_message_window(request) {
|
||||||
|
@ -269,7 +269,7 @@ function add_reciepient() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function add_reciepient(method, name, isdisabled) {
|
function add_reciepient(method, name, isdisabled) {
|
||||||
|
|
||||||
$("#reciepientTable").append("<tr class=\"reciepientsRow\"><td><select class=\"reciepientSelect\" "+((isdisabled != null) ? "disabled=\"disabled\" ":"")+"id=\"reciepient_method_"+reciepient_count+"\">"+
|
$("#reciepientTable").append("<tr class=\"reciepientsRow\"><td><select class=\"reciepientSelect\" "+((isdisabled != null) ? "disabled=\"disabled\" ":"")+"id=\"reciepient_method_"+reciepient_count+"\">"+
|
||||||
"<option value=\"0\""+((method == 0) ? " selected=\"selected\"" : "")+">To:</option>"+
|
"<option value=\"0\""+((method == 0) ? " selected=\"selected\"" : "")+">To:</option>"+
|
||||||
"<option value=\"1\""+((method == 1) ? " selected=\"selected\"" : "")+">Cc:</option>"+
|
"<option value=\"1\""+((method == 1) ? " selected=\"selected\"" : "")+">Cc:</option>"+
|
||||||
|
@ -277,7 +277,7 @@ function add_reciepient(method, name, isdisabled) {
|
||||||
"</select></td><td>"+
|
"</select></td><td>"+
|
||||||
"<input name=\"recepient_"+reciepient_count+"\" type=\"text\" value=\""+((name != null) ? name : "")+"\"></input>"+
|
"<input name=\"recepient_"+reciepient_count+"\" type=\"text\" value=\""+((name != null) ? name : "")+"\"></input>"+
|
||||||
"</td><td><input class=\"reciepientAdd\" id=\"reciepientAdd_"+reciepient_count+"\" type=\"button\" value=\"+\" onmousedown=\"add_reciepient();\"></input></td></tr>");
|
"</td><td><input class=\"reciepientAdd\" id=\"reciepientAdd_"+reciepient_count+"\" type=\"button\" value=\"+\" onmousedown=\"add_reciepient();\"></input></td></tr>");
|
||||||
|
|
||||||
for (var i =1; i < reciepient_count; i++) $("#reciepientAdd_"+i).remove();
|
for (var i =1; i < reciepient_count; i++) $("#reciepientAdd_"+i).remove();
|
||||||
reciepient_count++;
|
reciepient_count++;
|
||||||
}
|
}
|
||||||
|
@ -291,7 +291,7 @@ function prepare_send_mail() {
|
||||||
}
|
}
|
||||||
if ($('#encrypt_message').attr('checked') != null)
|
if ($('#encrypt_message').attr('checked') != null)
|
||||||
showKeySelection(addr);
|
showKeySelection(addr);
|
||||||
else
|
else
|
||||||
showEncryptionConfirmation();
|
showEncryptionConfirmation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -299,7 +299,7 @@ function show_reply(reply_all) {
|
||||||
if (reply_all) {
|
if (reply_all) {
|
||||||
// adding replys "To"
|
// adding replys "To"
|
||||||
if (current_message.to.length < 2)
|
if (current_message.to.length < 2)
|
||||||
add_reciepient(0,current_message.to[0], null);
|
add_reciepient(0,current_message.to[0], null);
|
||||||
else for (var i = 0; i < request.to.length; i++)
|
else for (var i = 0; i < request.to.length; i++)
|
||||||
if (!getEmailAddress(request.to[i]).match(account_email)) {
|
if (!getEmailAddress(request.to[i]).match(account_email)) {
|
||||||
add_reciepient(0,current_message.to[i], null);
|
add_reciepient(0,current_message.to[i], null);
|
||||||
|
@ -316,7 +316,7 @@ function show_reply(reply_all) {
|
||||||
$("#messageBody").html(openpgp_encoding_html_encode(quote_message(current_message.from, new Date(current_message.date), current_message.decrypted)));
|
$("#messageBody").html(openpgp_encoding_html_encode(quote_message(current_message.from, new Date(current_message.date), current_message.decrypted)));
|
||||||
$("#firstto").val(current_message.from);
|
$("#firstto").val(current_message.from);
|
||||||
$("#displayWindow").hide();
|
$("#displayWindow").hide();
|
||||||
show_compose_window();
|
show_compose_window();
|
||||||
}
|
}
|
||||||
|
|
||||||
function quote_message (sender, date, msg) {
|
function quote_message (sender, date, msg) {
|
||||||
|
@ -331,7 +331,7 @@ function get_password(key, msg, sessionkey, successfn) {
|
||||||
var count = 0;
|
var count = 0;
|
||||||
$("#enterPasswordText").html("Please enter password for keyID: 0x"+util.hexstrdump(key.key.obj.getKeyId()));
|
$("#enterPasswordText").html("Please enter password for keyID: 0x"+util.hexstrdump(key.key.obj.getKeyId()));
|
||||||
$("#enterPasswordKeyId").html(key.key.obj.userIds[0]);
|
$("#enterPasswordKeyId").html(key.key.obj.userIds[0]);
|
||||||
|
|
||||||
$("#enterPasswordSubmit").click(function() {
|
$("#enterPasswordSubmit").click(function() {
|
||||||
$("#enterPassword").fadeOut(100);
|
$("#enterPassword").fadeOut(100);
|
||||||
$("#enterPasswordSubmit").attr("disabled","disabled");
|
$("#enterPasswordSubmit").attr("disabled","disabled");
|
||||||
|
@ -354,15 +354,15 @@ function get_password(key, msg, sessionkey, successfn) {
|
||||||
$("#enterPasswordSubmit").removeAttr("disabled");
|
$("#enterPasswordSubmit").removeAttr("disabled");
|
||||||
$("#enterPasswordInput").removeAttr("disabled");
|
$("#enterPasswordInput").removeAttr("disabled");
|
||||||
$("#enterPasswordText").html("enterered Password was wrong. try again for keyID: 0x"+util.hexstrdump(key.key.keyId));
|
$("#enterPasswordText").html("enterered Password was wrong. try again for keyID: 0x"+util.hexstrdump(key.key.keyId));
|
||||||
|
|
||||||
$('#enterPasswordInput').focus();
|
$('#enterPasswordInput').focus();
|
||||||
$('#enterPassword').fadeIn(100);
|
$('#enterPassword').fadeIn(100);
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
$("#block-bg").show();
|
$("#block-bg").show();
|
||||||
$("#enterPassword").show();
|
$("#enterPassword").show();
|
||||||
$('#enterPasswordInput').focus();
|
$('#enterPasswordInput').focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -447,12 +447,12 @@ function showKeySelection(emailaddresses) {
|
||||||
showEncryptionConfirmation();
|
showEncryptionConfirmation();
|
||||||
}
|
}
|
||||||
$('#keyselecttext').empty();
|
$('#keyselecttext').empty();
|
||||||
|
|
||||||
$('#keyselecttext').append("Select keys for the following email addresses:<br>");
|
$('#keyselecttext').append("Select keys for the following email addresses:<br>");
|
||||||
for (var i= 0; i < emailaddresses.length; i++) {
|
for (var i= 0; i < emailaddresses.length; i++) {
|
||||||
$('#keyselecttext').append("<i>"+openpgp_encoding_html_encode(emailaddresses[i])+"</i>, ");
|
$('#keyselecttext').append("<i>"+openpgp_encoding_html_encode(emailaddresses[i])+"</i>, ");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i=0; i < encryptionkeys.length; i++)
|
for (var i=0; i < encryptionkeys.length; i++)
|
||||||
$('#keyselecttable').append('<tr class="validkey"><td><input class="keys" value="'+i+'" type="checkbox" checked="checked"></input></td><td></td>'+
|
$('#keyselecttable').append('<tr class="validkey"><td><input class="keys" value="'+i+'" type="checkbox" checked="checked"></input></td><td></td>'+
|
||||||
openpgp_encoding_html_encode(encryptionkeys[i].obj.userIds[0].text)+'<td>valid</td><td>0x'+openpgp_encoding_html_encode(util.hexstrdump(encryptionkeys[i].obj.getKeyId()).substring(8))+'</td></tr>');
|
openpgp_encoding_html_encode(encryptionkeys[i].obj.userIds[0].text)+'<td>valid</td><td>0x'+openpgp_encoding_html_encode(util.hexstrdump(encryptionkeys[i].obj.getKeyId()).substring(8))+'</td></tr>');
|
||||||
|
@ -490,7 +490,7 @@ function showEncryptionConfirmation() {
|
||||||
alert("no private key found! Go to options and import or create one.");
|
alert("no private key found! Go to options and import or create one.");
|
||||||
showEncryptioncancel();
|
showEncryptioncancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
get_password({ key: privatekey[0], keymaterial: privatekey[0].obj.privateKeyPacket},null,null, function(ret) {
|
get_password({ key: privatekey[0], keymaterial: privatekey[0].obj.privateKeyPacket},null,null, function(ret) {
|
||||||
if (!(ret < 0))
|
if (!(ret < 0))
|
||||||
send_mail(openpgp.write_signed_and_encrypted_message(privatekey[0].obj, keys, $('#messageBody').val()));
|
send_mail(openpgp.write_signed_and_encrypted_message(privatekey[0].obj, keys, $('#messageBody').val()));
|
||||||
|
@ -513,7 +513,7 @@ function showEncryptionConfirmation() {
|
||||||
|
|
||||||
function showEncryptionCancel() {
|
function showEncryptionCancel() {
|
||||||
$('#keyselect').hide();
|
$('#keyselect').hide();
|
||||||
$('#block-bg').hide();
|
$('#block-bg').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -558,7 +558,7 @@ function showEncryptionCancel() {
|
||||||
<button type="submit" onmousedown="showEncryptionCancel();">Cancel</button>
|
<button type="submit" onmousedown="showEncryptionCancel();">Cancel</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="encryptionConfirmation">
|
<div id="encryptionConfirmation">
|
||||||
</div>
|
</div>
|
||||||
<div id="block-bg" style=" width: 100%; height: 100%; z-index: 2; display: none; position: fixed; top: 0px; background-color: black; opacity: 0.5;"></div>
|
<div id="block-bg" style=" width: 100%; height: 100%; z-index: 2; display: none; position: fixed; top: 0px; background-color: black; opacity: 0.5;"></div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>GPG4Browsers - PGP Message Options</title>
|
<title>OpenPGP.js - PGP Message Options</title>
|
||||||
</head>
|
</head>
|
||||||
<script type="text/javascript" src="jquery.min.js"></script>
|
<script type="text/javascript" src="jquery.min.js"></script>
|
||||||
<script type="text/javascript" src="js/ciphers/hash/sha.js"></script>
|
<script type="text/javascript" src="js/ciphers/hash/sha.js"></script>
|
||||||
<script type="text/javascript" src="js/ciphers/hash/md5.js"></script>
|
<script type="text/javascript" src="js/ciphers/hash/md5.js"></script>
|
||||||
<script type="text/javascript" src="js/ciphers/hash/ripe-md.js"></script>
|
<script type="text/javascript" src="js/ciphers/hash/ripe-md.js"></script>
|
||||||
|
|
||||||
<!-- crypto libs -->
|
<!-- crypto libs -->
|
||||||
<script type="text/javascript" src="js/ciphers/symmetricencryption/aes.js"></script>
|
<script type="text/javascript" src="js/ciphers/symmetricencryption/aes.js"></script>
|
||||||
<script type="text/javascript" src="js/ciphers/symmetricencryption/cast5.js"></script>
|
<script type="text/javascript" src="js/ciphers/symmetricencryption/cast5.js"></script>
|
||||||
<script type="text/javascript" src="js/ciphers/symmetricencryption/dessrc.js"></script>
|
<script type="text/javascript" src="js/ciphers/symmetricencryption/dessrc.js"></script>
|
||||||
|
@ -68,7 +68,7 @@ function save_options() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAlgorithmString(publicKey) {
|
function getAlgorithmString(publicKey) {
|
||||||
var result = publicKey.publicKeyPacket.MPIs[0].mpiByteLength*8+"/";
|
var result = publicKey.publicKeyPacket.MPIs[0].mpiByteLength*8+"/";
|
||||||
switch (publicKey.publicKeyPacket.publicKeyAlgorithm) {
|
switch (publicKey.publicKeyPacket.publicKeyAlgorithm) {
|
||||||
case 1:
|
case 1:
|
||||||
result += "RSA(S/E)";
|
result += "RSA(S/E)";
|
||||||
|
@ -106,7 +106,7 @@ function getAlgorithmString(publicKey) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
function encodeForHtml(text) {
|
function encodeForHtml(text) {
|
||||||
if (text == null)
|
if (text == null)
|
||||||
|
@ -130,7 +130,7 @@ function importPrivateKey(key) {
|
||||||
function restore_options() {
|
function restore_options() {
|
||||||
openpgp.init();
|
openpgp.init();
|
||||||
update_tables();
|
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);
|
$('#hash_alg_select').val(""+openpgp.config.config.prefer_hash_algorithm);
|
||||||
$('#compression_alg_select').val(""+openpgp.config.config.compression);
|
$('#compression_alg_select').val(""+openpgp.config.config.compression);
|
||||||
$('#integrity').attr("checked", openpgp.config.config.integrity_protect);
|
$('#integrity').attr("checked", openpgp.config.config.integrity_protect);
|
||||||
|
@ -148,7 +148,7 @@ function show_userIds(k) {
|
||||||
$('#show_ids_'+k).append("<tr style=\"background-color: #fdd\"><td>rev</td><td class=\"uid_revoked\" colspan=\"2\"><s>"+encodeForHtml(publicKey.obj.userIds[i].text)+"</s></td></tr>");
|
$('#show_ids_'+k).append("<tr style=\"background-color: #fdd\"><td>rev</td><td class=\"uid_revoked\" colspan=\"2\"><s>"+encodeForHtml(publicKey.obj.userIds[i].text)+"</s></td></tr>");
|
||||||
else if (certsigs[i].indexOf(5) != -1)
|
else if (certsigs[i].indexOf(5) != -1)
|
||||||
$('#show_ids_'+k).append("<tr style=\"background-color: #ffd\"><td>exp</td><td class=\"uid_expired\" colspan=\"2\"><i>"+encodeForHtml(publicKey.obj.userIds[i].text)+"</i></td></tr>");
|
$('#show_ids_'+k).append("<tr style=\"background-color: #ffd\"><td>exp</td><td class=\"uid_expired\" colspan=\"2\"><i>"+encodeForHtml(publicKey.obj.userIds[i].text)+"</i></td></tr>");
|
||||||
else
|
else
|
||||||
$('#show_ids_'+k).append("<tr style=\"background-color: #dfd\"><td>uid</td><td class=\"uid_normal\" colspan=\"2\"><b>"+encodeForHtml(publicKey.obj.userIds[i].text)+"</b></td></tr>");
|
$('#show_ids_'+k).append("<tr style=\"background-color: #dfd\"><td>uid</td><td class=\"uid_normal\" colspan=\"2\"><b>"+encodeForHtml(publicKey.obj.userIds[i].text)+"</b></td></tr>");
|
||||||
for (var j = 0; j < publicKey.obj.userIds[i].certificationSignatures.length; j++) {
|
for (var j = 0; j < publicKey.obj.userIds[i].certificationSignatures.length; j++) {
|
||||||
var istr = util.hexstrdump(publicKey.obj.userIds[i].certificationSignatures[j].getIssuer());
|
var istr = util.hexstrdump(publicKey.obj.userIds[i].certificationSignatures[j].getIssuer());
|
||||||
|
@ -160,12 +160,12 @@ function show_userIds(k) {
|
||||||
$('#show_ids_'+k).append("<tr><td>sig"+(sigclass == 0 ? "" : sigclass)+"</td><td>BAD</td><td class=\"sig_bad\">"+encodeForHtml(istr)+"</td></tr>");
|
$('#show_ids_'+k).append("<tr><td>sig"+(sigclass == 0 ? "" : sigclass)+"</td><td>BAD</td><td class=\"sig_bad\">"+encodeForHtml(istr)+"</td></tr>");
|
||||||
if (certsigs[i][j] == 1)
|
if (certsigs[i][j] == 1)
|
||||||
$('#show_ids_'+k).append("<tr><td>sig"+(sigclass == 0 ? "" : sigclass)+"</td><td>exp</td><td class=\"sig_exp\"><i>"+encodeForHtml(istr)+"</i></td></tr>");
|
$('#show_ids_'+k).append("<tr><td>sig"+(sigclass == 0 ? "" : sigclass)+"</td><td>exp</td><td class=\"sig_exp\"><i>"+encodeForHtml(istr)+"</i></td></tr>");
|
||||||
if (certsigs[i][j] == 2)
|
if (certsigs[i][j] == 2)
|
||||||
$('#show_ids_'+k).append("<tr><td>sig"+(sigclass == 0 ? "" : sigclass)+"</td><td>unk</td><td class=\"sig_unk\">"+encodeForHtml(istr)+"</td></tr>");
|
$('#show_ids_'+k).append("<tr><td>sig"+(sigclass == 0 ? "" : sigclass)+"</td><td>unk</td><td class=\"sig_unk\">"+encodeForHtml(istr)+"</td></tr>");
|
||||||
if (certsigs[i][j] == 3)
|
if (certsigs[i][j] == 3)
|
||||||
$('#show_ids_'+k).append("<tr><td>sig"+(sigclass == 0 ? "" : sigclass)+"</td><td>rev</td><td class=\"sig_unk\"><s>"+encodeForHtml(istr)+"</s></td></tr>");
|
$('#show_ids_'+k).append("<tr><td>sig"+(sigclass == 0 ? "" : sigclass)+"</td><td>rev</td><td class=\"sig_unk\"><s>"+encodeForHtml(istr)+"</s></td></tr>");
|
||||||
if (certsigs[i][j] == 4)
|
if (certsigs[i][j] == 4)
|
||||||
$('#show_ids_'+k).append("<tr><td>sig"+(sigclass == 0 ? "" : sigclass)+"</td><td></td><td class=\"sig_normal\">"+encodeForHtml(istr)+"</td></tr>");
|
$('#show_ids_'+k).append("<tr><td>sig"+(sigclass == 0 ? "" : sigclass)+"</td><td></td><td class=\"sig_normal\">"+encodeForHtml(istr)+"</td></tr>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$('#show_ids_'+k).toggle();
|
$('#show_ids_'+k).toggle();
|
||||||
|
@ -289,11 +289,11 @@ function show_search_results() {
|
||||||
margin-bottom: 0px;
|
margin-bottom: 0px;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
th {
|
th {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabref {
|
.tabref {
|
||||||
background-color: #eee;
|
background-color: #eee;
|
||||||
border: 1px solid #aaa;
|
border: 1px solid #aaa;
|
||||||
|
@ -301,7 +301,7 @@ function show_search_results() {
|
||||||
#options_header {
|
#options_header {
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#publicKeyTable, #privateKeyTable, #searchKeyResults {
|
#publicKeyTable, #privateKeyTable, #searchKeyResults {
|
||||||
border: 1px solid #aaa;
|
border: 1px solid #aaa;
|
||||||
}
|
}
|
||||||
|
@ -311,30 +311,30 @@ function show_search_results() {
|
||||||
border-bottom: 1px solid #000;
|
border-bottom: 1px solid #000;
|
||||||
padding: 3px;
|
padding: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#publicKeyTable td, #privateKeyTable td, #searchKeyResults td {
|
#publicKeyTable td, #privateKeyTable td, #searchKeyResults td {
|
||||||
padding: 3px;
|
padding: 3px;
|
||||||
border-bottom: 1px solid #aaa;
|
border-bottom: 1px solid #aaa;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabref-select {
|
.tabref-select {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-bottom: 1px solid #fff;
|
border-bottom: 1px solid #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
|
|
||||||
font: 1.5em;
|
font: 1.5em;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-bottom: 1px solid #888;
|
border-bottom: 1px solid #888;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1, h2 {
|
h1, h2 {
|
||||||
font: 1.5em "Impact";
|
font: 1.5em "Impact";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#tab_1, #tab_2, #tab_3, #tab_0 {
|
#tab_1, #tab_2, #tab_3, #tab_0 {
|
||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
border: 1px solid #aaa;
|
border: 1px solid #aaa;
|
||||||
|
@ -346,7 +346,7 @@ function show_search_results() {
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
<body onload="restore_options()">
|
<body onload="restore_options()">
|
||||||
<div id="options_header">
|
<div id="options_header">
|
||||||
|
@ -435,7 +435,7 @@ function show_search_results() {
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<b><a href="#" onclick="$('#pastePrivateKey').toggle();">Paste a private key</a></b><br>
|
<b><a href="#" onclick="$('#pastePrivateKey').toggle();">Paste a private key</a></b><br>
|
||||||
<div id="pastePrivateKey" style="display: none; margin-left: 5px; border-left: 1px solid #aaa; padding-left: 5px;">
|
<div id="pastePrivateKey" style="display: none; margin-left: 5px; border-left: 1px solid #aaa; padding-left: 5px;">
|
||||||
<textarea rows="30" cols="80" id="importPrivateKeyTextfield"></textarea>
|
<textarea rows="30" cols="80" id="importPrivateKeyTextfield"></textarea>
|
||||||
<button onclick="importPrivateKey($('#importPrivateKeyTextfield').val()); $('#generatePrivateKey').toggle();">Import Key</button>
|
<button onclick="importPrivateKey($('#importPrivateKeyTextfield').val()); $('#generatePrivateKey').toggle();">Import Key</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user