зеркало из https://github.com/mozilla/gecko-dev.git
Enhancing edit cert feature
bug# 77431 ; r=javi ; sr=hewitt
This commit is contained in:
Родитель
547c3157ac
Коммит
f5a43e4f78
|
@ -261,11 +261,11 @@ function editCerts()
|
||||||
var certkey = cert.dbKey;
|
var certkey = cert.dbKey;
|
||||||
var ca_tab = document.getElementById("ca_tab");
|
var ca_tab = document.getElementById("ca_tab");
|
||||||
if (ca_tab.selected) {
|
if (ca_tab.selected) {
|
||||||
window.open('chrome://pippki/content/editcacert.xul', certkey,
|
window.openDialog('chrome://pippki/content/editcacert.xul', certkey,
|
||||||
'chrome,width=500,height=400,resizable=1');
|
'chrome,width=100,resizable=1,modal');
|
||||||
} else {
|
} else {
|
||||||
window.open('chrome://pippki/content/editsslcert.xul', certkey,
|
window.openDialog('chrome://pippki/content/editsslcert.xul', certkey,
|
||||||
'chrome,width=500,height=400,resizable=1');
|
'chrome,width=100,resizable=1,modal');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,8 +42,8 @@
|
||||||
<vbox flex="1">
|
<vbox flex="1">
|
||||||
<html id="certmsg"/>
|
<html id="certmsg"/>
|
||||||
<separator />
|
<separator />
|
||||||
<html>&certmgr.editcert.edittrust;</html>
|
<html flex="100%">&certmgr.editcert.edittrust;</html>
|
||||||
<vbox>
|
<vbox flex="100%">
|
||||||
<checkbox label="&certmgr.editcert.trustssl;" checked="false"
|
<checkbox label="&certmgr.editcert.trustssl;" checked="false"
|
||||||
id="trustSSL"/>
|
id="trustSSL"/>
|
||||||
<checkbox label="&certmgr.editcert.trustemail;" checked="false"
|
<checkbox label="&certmgr.editcert.trustemail;" checked="false"
|
||||||
|
@ -58,7 +58,7 @@
|
||||||
<key id="esc-key" keycode="VK_ESCAPE" oncommand="window.close();"/>
|
<key id="esc-key" keycode="VK_ESCAPE" oncommand="window.close();"/>
|
||||||
</keyset>
|
</keyset>
|
||||||
|
|
||||||
<hbox align="center">
|
<hbox>
|
||||||
<button id="ok-button" class="dialog" label="&certmgr.ok.label;"
|
<button id="ok-button" class="dialog" label="&certmgr.ok.label;"
|
||||||
oncommand="doOK();"/>
|
oncommand="doOK();"/>
|
||||||
<button id="cancel-button" class="dialog" label="&certmgr.cancel.label;"
|
<button id="cancel-button" class="dialog" label="&certmgr.cancel.label;"
|
||||||
|
|
|
@ -71,6 +71,16 @@ function setWindowName()
|
||||||
} else {
|
} else {
|
||||||
objsign.setAttribute("checked", "false");
|
objsign.setAttribute("checked", "false");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var xulWindow = document.getElementById("editCert");
|
||||||
|
var wdth = window.innerWidth; // THIS IS NEEDED,
|
||||||
|
window.sizeToContent();
|
||||||
|
xulWindow.setAttribute("width",window.innerWidth + 30);
|
||||||
|
var hght = window.innerHeight; // THIS IS NEEDED,
|
||||||
|
window.sizeToContent();
|
||||||
|
xulWindow.setAttribute("height",window.innerHeight + 70);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function doOK()
|
function doOK()
|
||||||
|
@ -109,6 +119,27 @@ function doLoadForSSLCert()
|
||||||
|
|
||||||
setText("issuer", cert.issuerName);
|
setText("issuer", cert.issuerName);
|
||||||
|
|
||||||
|
var cacert = getCaCertForServerCert(cert);
|
||||||
|
if(cacert == null)
|
||||||
|
{
|
||||||
|
setText("explainations",bundle.GetStringFromName("issuerNotKnown"));
|
||||||
|
}
|
||||||
|
else if(certdb.getCertTrust(cacert, nsIX509Cert.CA_CERT,
|
||||||
|
nsIX509CertDB.TRUSTED_SSL))
|
||||||
|
{
|
||||||
|
setText("explainations",bundle.GetStringFromName("issuerTrusted"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setText("explainations",bundle.GetStringFromName("issuerNotTrusted"));
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
if(cacert == null)
|
||||||
|
{
|
||||||
|
var editButton = document.getElementById('editca-button');
|
||||||
|
editButton.setAttribute("disabled","true");
|
||||||
|
}
|
||||||
|
*/
|
||||||
var trustssl = document.getElementById("trustSSLCert");
|
var trustssl = document.getElementById("trustSSLCert");
|
||||||
var notrustssl = document.getElementById("dontTrustSSLCert");
|
var notrustssl = document.getElementById("dontTrustSSLCert");
|
||||||
if (certdb.getCertTrust(cert, nsIX509Cert.SERVER_CERT,
|
if (certdb.getCertTrust(cert, nsIX509Cert.SERVER_CERT,
|
||||||
|
@ -117,6 +148,15 @@ function doLoadForSSLCert()
|
||||||
} else {
|
} else {
|
||||||
notrustssl.setAttribute("checked", "true");
|
notrustssl.setAttribute("checked", "true");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var xulWindow = document.getElementById("editSSLCert");
|
||||||
|
var wdth = window.innerWidth; // THIS IS NEEDED,
|
||||||
|
window.sizeToContent();
|
||||||
|
xulWindow.setAttribute("width",window.innerWidth + 30);
|
||||||
|
var hght = window.innerHeight; // THIS IS NEEDED,
|
||||||
|
window.sizeToContent();
|
||||||
|
xulWindow.setAttribute("height",window.innerHeight + 70);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function doSSLOK()
|
function doSSLOK()
|
||||||
|
@ -131,3 +171,44 @@ function doSSLOK()
|
||||||
certdb.setCertTrust(cert, nsIX509Cert.SERVER_CERT, trustssl);
|
certdb.setCertTrust(cert, nsIX509Cert.SERVER_CERT, trustssl);
|
||||||
window.close();
|
window.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function editCaTrust()
|
||||||
|
{
|
||||||
|
var cacert = getCaCertForServerCert(cert);
|
||||||
|
if(cacert != null)
|
||||||
|
{
|
||||||
|
window.openDialog('chrome://pippki/content/editcacert.xul', cacert.dbKey,
|
||||||
|
'chrome,resizable=1,modal');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
|
||||||
|
alert(bundle.GetStringFromName("issuerCertNotFound"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getCaCertForServerCert(cert)
|
||||||
|
{
|
||||||
|
var i=1;
|
||||||
|
var nextCertInChain;
|
||||||
|
nextCertInChain = cert;
|
||||||
|
var lastSubjectName="";
|
||||||
|
while(true)
|
||||||
|
{
|
||||||
|
if(nextCertInChain == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if((nextCertInChain.type == nsIX509Cert.CA_CERT) ||
|
||||||
|
(nextCertInChain.subjectName = lastSubjectName))
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
lastSubjectName = nextCertInChain.subjectName;
|
||||||
|
nextCertInChain = nextCertInChain.issuer;
|
||||||
|
}
|
||||||
|
|
||||||
|
return nextCertInChain;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,8 @@
|
||||||
<html id="certmsg"/>
|
<html id="certmsg"/>
|
||||||
<html id="issuer"/>
|
<html id="issuer"/>
|
||||||
<separator/>
|
<separator/>
|
||||||
|
<html id="explainations"/>
|
||||||
|
<separator />
|
||||||
<html>&certmgr.editsslcert.edittrust;</html>
|
<html>&certmgr.editsslcert.edittrust;</html>
|
||||||
<vbox>
|
<vbox>
|
||||||
<radiogroup id="sslTrustGroup" orient="vertical" flex="1">
|
<radiogroup id="sslTrustGroup" orient="vertical" flex="1">
|
||||||
|
@ -51,7 +53,12 @@
|
||||||
id="dontTrustSSLCert" group="sslTrustGroup"/>
|
id="dontTrustSSLCert" group="sslTrustGroup"/>
|
||||||
</radiogroup>
|
</radiogroup>
|
||||||
</vbox>
|
</vbox>
|
||||||
<hbox align="center">
|
<hbox>
|
||||||
|
<button id="editca-button" class="dialog" label="&certmgr.editca.label;"
|
||||||
|
oncommand="editCaTrust();"/>
|
||||||
|
</hbox>
|
||||||
|
|
||||||
|
<hbox>
|
||||||
<button id="ok-button" class="dialog" label="&certmgr.ok.label;"
|
<button id="ok-button" class="dialog" label="&certmgr.ok.label;"
|
||||||
oncommand="doSSLOK();"/>
|
oncommand="doSSLOK();"/>
|
||||||
<button id="cancel-button" class="dialog" label="&certmgr.cancel.label;"
|
<button id="cancel-button" class="dialog" label="&certmgr.cancel.label;"
|
||||||
|
|
|
@ -74,11 +74,12 @@
|
||||||
<!ENTITY certmgr.expires "Expires On">
|
<!ENTITY certmgr.expires "Expires On">
|
||||||
|
|
||||||
<!ENTITY certmgr.help.label "Help">
|
<!ENTITY certmgr.help.label "Help">
|
||||||
<!ENTITY certmgr.ok.label "Ok">
|
<!ENTITY certmgr.ok.label "OK">
|
||||||
<!ENTITY certmgr.close.label "Close">
|
<!ENTITY certmgr.close.label "Close">
|
||||||
<!ENTITY certmgr.cancel.label "Cancel">
|
<!ENTITY certmgr.cancel.label "Cancel">
|
||||||
<!ENTITY certmgr.view.label "View">
|
<!ENTITY certmgr.view.label "View">
|
||||||
<!ENTITY certmgr.edit.label "Edit">
|
<!ENTITY certmgr.edit.label "Edit">
|
||||||
|
<!ENTITY certmgr.editca.label "Edit CA Trust">
|
||||||
<!ENTITY certmgr.add.label "Add">
|
<!ENTITY certmgr.add.label "Add">
|
||||||
<!ENTITY certmgr.delete.label "Delete">
|
<!ENTITY certmgr.delete.label "Delete">
|
||||||
<!ENTITY certmgr.backup.label "Backup">
|
<!ENTITY certmgr.backup.label "Backup">
|
||||||
|
|
|
@ -31,6 +31,11 @@ unnamedCA=Certificate Authority (unnamed)
|
||||||
editTrustWindowTitle=Edit certificate trust
|
editTrustWindowTitle=Edit certificate trust
|
||||||
editTrustCA=The certificate "%S" represents a Certificate Authority.
|
editTrustCA=The certificate "%S" represents a Certificate Authority.
|
||||||
editTrustSSL=The certificate "%S" was issued by:
|
editTrustSSL=The certificate "%S" was issued by:
|
||||||
|
issuerNotTrusted=Because you do not trust the certificate authority that issued this certificate, you do not trust the authenticity of this certificate unless otherwise indicated here.
|
||||||
|
issuerTrusted=Because you trust the certificate authority that issued this certificate, you trust the authenticity of this certificate unless otherwise indicated here.
|
||||||
|
issuerNotKnown=Because you do not know the certificate authority that issued this certificate, you do not trust the authenticity of this certificate unless otherwise indicated here.
|
||||||
|
issuerCertNotFound=Certificate for this certificate authority was not found
|
||||||
|
|
||||||
|
|
||||||
#PKCS#12 file dialogs
|
#PKCS#12 file dialogs
|
||||||
chooseP12RestoreFileDialog=File Name to Restore
|
chooseP12RestoreFileDialog=File Name to Restore
|
||||||
|
|
Загрузка…
Ссылка в новой задаче