Bug 1229013 - Cannot verify sender cert in smime signed received email since nsIPKIParamBlock went away. r=rkent

This commit is contained in:
Magnus Melin 2016-01-19 22:02:26 +02:00
Родитель 3a9739cbbc
Коммит 980ae747d0
2 изменённых файлов: 24 добавлений и 27 удалений

Просмотреть файл

@ -51,20 +51,20 @@ function showMessageReadSecurityInfo()
return;
}
let pkiParams = Components.classes["@mozilla.org/security/pkiparamblock;1"]
.createInstance(Components.interfaces.nsIPKIParamBlock);
let params = Components.classes["@mozilla.org/embedcomp/dialogparam;1"]
.createInstance(Components.interfaces.nsIDialogParamBlock);
params.objects = Components.classes["@mozilla.org/array;1"]
.createInstance(Components.interfaces.nsIMutableArray);
// Append even if null... the receiver must handle that.
params.objects.appendElement(gSignerCert, false);
params.objects.appendElement(gEncryptionCert, false);
// isupport array starts with index 1
pkiParams.setISupportAtIndex(1, gSignerCert);
pkiParams.setISupportAtIndex(2, gEncryptionCert);
var params = pkiParams.QueryInterface(Components.interfaces.nsIDialogParamBlock);
// int array starts with index 0, but that is used for window exit status
params.SetInt(1, gSignatureStatus);
params.SetInt(2, gEncryptionStatus);
window.openDialog("chrome://messenger-smime/content/msgReadSecurityInfo.xul",
"", "chrome,resizable=1,modal=1,dialog=1", pkiParams);
"", "chrome,resizable,modal,dialog,centerscreen", params);
}
var SecurityController =

Просмотреть файл

@ -3,7 +3,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
var nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
var nsIX509Cert = Components.interfaces.nsIX509Cert;
var nsICMSMessageErrors = Components.interfaces.nsICMSMessageErrors;
@ -16,8 +15,6 @@ var gEncryptionCert = null;
var gSignatureStatus = -1;
var gEncryptionStatus = -1;
var params = null;
function setText(id, value) {
var element = document.getElementById(id);
if (!element)
@ -30,20 +27,17 @@ function setText(id, value) {
function onLoad()
{
var pkiParams = window.arguments[0].QueryInterface(nsIPKIParamBlock);
var isupport = pkiParams.getISupportAtIndex(1);
if (isupport) {
gSignerCert = isupport.QueryInterface(nsIX509Cert);
}
isupport = pkiParams.getISupportAtIndex(2);
if (isupport) {
gEncryptionCert = isupport.QueryInterface(nsIX509Cert);
}
var paramBlock = window.arguments[0].QueryInterface(nsIDialogParamBlock);
paramBlock.objects.QueryInterface(Components.interfaces.nsIMutableArray);
try {
gSignerCert = paramBlock.objects.queryElementAt(0, nsIX509Cert);
} catch(e) { } // maybe null
try {
gEncryptionCert = paramBlock.objects.queryElementAt(1, nsIX509Cert);
} catch(e) { } // maybe null
params = pkiParams.QueryInterface(nsIDialogParamBlock);
gSignatureStatus = params.GetInt(1);
gEncryptionStatus = params.GetInt(2);
gSignatureStatus = paramBlock.GetInt(1);
gEncryptionStatus = paramBlock.GetInt(2);
var bundle = document.getElementById("bundle_smime_read_info");
@ -113,9 +107,11 @@ function onLoad()
sigInfoHeader = "SIInvalidHeader";
sigInfo_clueless = true;
break;
default:
Components.utils.reportError("Unexpected gSignatureStatus: " +
gSignatureStatus);
}
document.getElementById("signatureLabel").value =
bundle.getString(sigInfoLabel);
@ -134,7 +130,6 @@ function onLoad()
str = bundle.getString("SIClueless") + " (" + gSignatureStatus + ")";
}
setText("signatureExplanation", str);
var encInfoLabel = null;
var encInfoHeader = null;
@ -162,9 +157,11 @@ function onLoad()
encInfoHeader = "EIInvalidHeader";
encInfo_clueless = 1;
break;
default:
Components.utils.reportError("Unexpected gEncryptionStatus: " +
gEncryptionStatus);
}
document.getElementById("encryptionLabel").value =
bundle.getString(encInfoLabel);