mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 04:45:45 +00:00
b=143532 Only allow toggling FIPS when it is safe to
r=javi sr=alecf
This commit is contained in:
parent
2ddfea8f86
commit
11c622dd7c
@ -80,10 +80,10 @@ function LoadModules()
|
||||
} catch (e) { done = true; }
|
||||
}
|
||||
/* Set the text on the fips button */
|
||||
SetFIPSButtonText();
|
||||
SetFIPSButton();
|
||||
}
|
||||
|
||||
function SetFIPSButtonText()
|
||||
function SetFIPSButton()
|
||||
{
|
||||
var fipsButton = document.getElementById("fipsbutton");
|
||||
var label;
|
||||
@ -93,6 +93,13 @@ function SetFIPSButtonText()
|
||||
label = bundle.GetStringFromName("enable_fips");
|
||||
}
|
||||
fipsButton.setAttribute("label", label);
|
||||
|
||||
var can_toggle = secmoddb.canToggleFIPS;
|
||||
if (can_toggle) {
|
||||
fipsButton.removeAttribute("disabled");
|
||||
} else {
|
||||
fipsButton.setAttribute("disabled", "true");
|
||||
}
|
||||
}
|
||||
|
||||
/* Add a module to the tree. slots is the array of slots in the module,
|
||||
|
@ -96,6 +96,8 @@ interface nsIPKCS11ModuleDB : nsISupports
|
||||
|
||||
nsIEnumerator listModules();
|
||||
|
||||
readonly attribute boolean canToggleFIPS;
|
||||
|
||||
void toggleFIPSMode();
|
||||
|
||||
readonly attribute boolean isFIPSEnabled;
|
||||
|
@ -375,6 +375,13 @@ nsPKCS11ModuleDB::ListModules(nsIEnumerator **_retval)
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsPKCS11ModuleDB::GetCanToggleFIPS(PRBool *aCanToggleFIPS)
|
||||
{
|
||||
*aCanToggleFIPS = SECMOD_CanDeleteInternalModule();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
/* void toggleFIPSMode (); */
|
||||
NS_IMETHODIMP nsPKCS11ModuleDB::ToggleFIPSMode()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user