mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 21:28:55 +00:00
Activating view button in download cert
bug# 81257, r=javi, sr=hewitt
This commit is contained in:
parent
27b9fc7d69
commit
c94863d20a
@ -22,14 +22,22 @@
|
||||
*/
|
||||
|
||||
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
|
||||
const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
|
||||
const nsIX509Cert = Components.interfaces.nsIX509Cert;
|
||||
|
||||
var pkiParams;
|
||||
var params;
|
||||
var caName;
|
||||
var cert;
|
||||
|
||||
function onLoad()
|
||||
{
|
||||
params = window.arguments[0].QueryInterface(nsIDialogParamBlock);
|
||||
caName = params.GetString(1);
|
||||
pkiParams = window.arguments[0].QueryInterface(nsIPKIParamBlock);
|
||||
params = pkiParams.QueryInterface(nsIDialogParamBlock);
|
||||
var isupport = pkiParams.getISupportAtIndex(1);
|
||||
cert = isupport.QueryInterface(nsIX509Cert);
|
||||
|
||||
caName = cert.commonName;
|
||||
|
||||
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
|
||||
|
||||
@ -53,10 +61,7 @@ function onLoad()
|
||||
|
||||
function viewCert()
|
||||
{
|
||||
}
|
||||
|
||||
function viewPolicy()
|
||||
{
|
||||
cert.view();
|
||||
}
|
||||
|
||||
function doOK()
|
||||
|
@ -83,13 +83,7 @@
|
||||
<button id="viewC-button" class="dialog"
|
||||
label="&downloadCert.viewCert.label;"
|
||||
oncommand="viewCert();"/>
|
||||
<html>&downloadCert.viewCert.text;</html>
|
||||
</row>
|
||||
<row>
|
||||
<button id="viewP-button" class="dialog"
|
||||
label="&downloadCert.viewPolicy.label;"
|
||||
oncommand="viewPolicy();"/>
|
||||
<html>&downloadCert.viewPolicy.text;</html>
|
||||
<html style="margin: 4px;">&downloadCert.viewCert.text;</html>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
@ -621,17 +621,14 @@ nsNSSDialogs::DownloadCACert(nsIInterfaceRequestor *ctx,
|
||||
// Get the parent window for the dialog
|
||||
nsCOMPtr<nsIDOMWindowInternal> parent = do_GetInterface(ctx);
|
||||
|
||||
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance("@mozilla.org/embedcomp/dialogparam;1"));
|
||||
if (!block) return NS_ERROR_FAILURE;
|
||||
nsCOMPtr<nsIPKIParamBlock> block = do_CreateInstance(kPKIParamBlockCID);
|
||||
if (!block)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsXPIDLString commonName;
|
||||
rv = cert->GetCommonName(getter_Copies(commonName));
|
||||
rv = block->SetISupportAtIndex(1, cert);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
rv = block->SetString(1, commonName);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = nsNSSDialogHelper::openDialog(parent,
|
||||
"chrome://pippki/content/downloadcert.xul",
|
||||
block);
|
||||
@ -640,13 +637,15 @@ nsNSSDialogs::DownloadCACert(nsIInterfaceRequestor *ctx,
|
||||
PRInt32 status;
|
||||
PRInt32 ssl, email, objsign;
|
||||
|
||||
rv = block->GetInt(1, &status);
|
||||
nsCOMPtr<nsIDialogParamBlock> dlgParamBlock = do_QueryInterface(block);
|
||||
|
||||
rv = dlgParamBlock->GetInt(1, &status);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = block->GetInt(2, &ssl);
|
||||
rv = dlgParamBlock->GetInt(2, &ssl);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = block->GetInt(3, &email);
|
||||
rv = dlgParamBlock->GetInt(3, &email);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = block->GetInt(4, &objsign);
|
||||
rv = dlgParamBlock->GetInt(4, &objsign);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
*_trust = nsIX509CertDB::UNTRUSTED;
|
||||
|
Loading…
x
Reference in New Issue
Block a user