Bug 883682: Enable EV test cert only in debug builds. r=bsmith

--HG--
extra : rebase_source : 0f14273c6f6d4da4164d7beeb3fd21bd6def1fd0
This commit is contained in:
Camilo Viecco 2013-07-03 08:24:09 -07:00
parent be31237f1a
commit 2d31d4e2d3
2 changed files with 10 additions and 1 deletions

View File

@ -110,6 +110,7 @@ static struct nsMyTrustedEVInfo myTrustedEVInfos[] = {
* In other words, if you add another list, that uses the same dotted_oid
* as an existing entry, then please use the same oid_name.
*/
#ifdef DEBUG
{
// This is the testing EV signature.
// C=US, ST=CA, L=Mountain View, O=Mozilla - EV debug test CA, OU=Security Engineering, CN=EV Testing (untrustworthy) CA/name=ev-test-ca/emailAddress=charlatan@testing.example.com
@ -125,6 +126,7 @@ static struct nsMyTrustedEVInfo myTrustedEVInfos[] = {
"AK/FPSJmJkky",
nullptr
},
#endif
{
// OU=Security Communication EV RootCA1,O="SECOM Trust Systems CO.,LTD.",C=JP
"1.2.392.200091.100.721.1",
@ -1008,10 +1010,12 @@ nsNSSComponent::IdentityInfoInit()
entry.cert = CERT_FindCertByIssuerAndSN(nullptr, &ias);
#ifdef DEBUG
// The debug CA info is at position 0, and is NOT on the NSS root db
if (iEV != 0) {
NS_ASSERTION(entry.cert, "Could not find EV root in NSS storage");
}
#endif
SECITEM_FreeItem(&ias.derIssuer, false);
SECITEM_FreeItem(&ias.serialNumber, false);

View File

@ -25,7 +25,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=813418
var wnd = window.open("https://ev-valid.example.com/tests/security/manager/ssl/tests/mochitest/bugs/test_ev_validation_child.html");
window.addEventListener("message", function(event) {
if (event.origin == "https://ev-valid.example.com") {
is(event.data, "EV", "Child was EV valid.");
if (SpecialPowers.isDebugBuild) {
is(event.data, "EV", "Child was EV valid (debug build).");
}
else {
is(event.data, "secure", "Child was just secure (NO EV) no ev flags present (non -debug build).");
}
wnd.close();
wnd = window.open("https://example.com/tests/security/manager/ssl/tests/mochitest/bugs/test_ev_validation_child.html");
}