Skip to content

Commit 625f7a5

Browse files
committed
Backed out changeset 4f793a75cd93 (bug 1724072) for geckoview failures . CLOSED TREE
1 parent 12bf02b commit 625f7a5

File tree

11 files changed

+52
-107
lines changed

11 files changed

+52
-107
lines changed

browser/base/content/test/about/browser_aboutNetError.js

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
const SSL3_PAGE = "https://ssl3.example.com/";
77
const TLS10_PAGE = "https://tls1.example.com/";
88
const TLS12_PAGE = "https://tls12.example.com/";
9-
const TRIPLEDES_PAGE = "https://3des.example.com/";
109

1110
// This includes all the cipher suite prefs we have.
1211
const CIPHER_SUITE_PREFS = [
@@ -26,7 +25,7 @@ const CIPHER_SUITE_PREFS = [
2625
"security.ssl3.rsa_aes_256_sha",
2726
"security.ssl3.rsa_aes_128_gcm_sha256",
2827
"security.ssl3.rsa_aes_256_gcm_sha384",
29-
"security.ssl3.deprecated.rsa_des_ede3_sha",
28+
"security.ssl3.rsa_des_ede3_sha",
3029
"security.tls13.aes_128_gcm_sha256",
3130
"security.tls13.aes_256_gcm_sha384",
3231
"security.tls13.chacha20_poly1305_sha256",
@@ -37,9 +36,6 @@ function resetPrefs() {
3736
Services.prefs.clearUserPref("security.tls.version.max");
3837
Services.prefs.clearUserPref("security.tls.version.enable-deprecated");
3938
Services.prefs.clearUserPref("security.certerrors.tls.version.show-override");
40-
CIPHER_SUITE_PREFS.forEach(suitePref => {
41-
Services.prefs.clearUserPref(suitePref);
42-
});
4339
}
4440

4541
add_task(async function resetToDefaultConfig() {
@@ -321,41 +317,3 @@ add_task(async function overrideUIPref() {
321317
resetPrefs();
322318
BrowserTestUtils.removeTab(gBrowser.selectedTab);
323319
});
324-
325-
// Test that ciphersuites that use 3DES (namely, TLS_RSA_WITH_3DES_EDE_CBC_SHA)
326-
// can only be enabled when deprecated TLS is enabled.
327-
add_task(async function onlyAllow3DESWithDeprecatedTLS() {
328-
// By default, connecting to a server that only uses 3DES should fail.
329-
await BrowserTestUtils.withNewTab(
330-
{ gBrowser, url: "about:blank" },
331-
async browser => {
332-
BrowserTestUtils.loadURI(browser, TRIPLEDES_PAGE);
333-
await BrowserTestUtils.waitForErrorPage(browser);
334-
}
335-
);
336-
337-
// Enabling deprecated TLS should also enable 3DES.
338-
Services.prefs.setBoolPref("security.tls.version.enable-deprecated", true);
339-
await BrowserTestUtils.withNewTab(
340-
{ gBrowser, url: "about:blank" },
341-
async browser => {
342-
BrowserTestUtils.loadURI(browser, TRIPLEDES_PAGE);
343-
await BrowserTestUtils.browserLoaded(browser, false, TRIPLEDES_PAGE);
344-
}
345-
);
346-
347-
// 3DES can be disabled separately.
348-
Services.prefs.setBoolPref(
349-
"security.ssl3.deprecated.rsa_des_ede3_sha",
350-
false
351-
);
352-
await BrowserTestUtils.withNewTab(
353-
{ gBrowser, url: "about:blank" },
354-
async browser => {
355-
BrowserTestUtils.loadURI(browser, TRIPLEDES_PAGE);
356-
await BrowserTestUtils.waitForErrorPage(browser);
357-
}
358-
);
359-
360-
resetPrefs();
361-
});

browser/components/enterprisepolicies/Policies.jsm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ var Policies = {
554554
}
555555
if ("TLS_RSA_WITH_3DES_EDE_CBC_SHA" in param) {
556556
setAndLockPref(
557-
"security.ssl3.deprecated.rsa_des_ede3_sha",
557+
"security.ssl3.rsa_des_ede3_sha",
558558
!param.TLS_RSA_WITH_3DES_EDE_CBC_SHA
559559
);
560560
}

browser/components/enterprisepolicies/tests/xpcshell/test_simple_pref_policies.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ const POLICIES_TESTS = [
755755
"security.ssl3.ecdhe_ecdsa_aes_128_gcm_sha256": true,
756756
"security.ssl3.rsa_aes_128_sha": true,
757757
"security.ssl3.rsa_aes_256_sha": true,
758-
"security.ssl3.deprecated.rsa_des_ede3_sha": true,
758+
"security.ssl3.rsa_des_ede3_sha": true,
759759
"security.ssl3.rsa_aes_128_gcm_sha256": true,
760760
"security.ssl3.rsa_aes_256_gcm_sha384": true,
761761
},
@@ -786,7 +786,7 @@ const POLICIES_TESTS = [
786786
"security.ssl3.ecdhe_ecdsa_aes_128_gcm_sha256": false,
787787
"security.ssl3.rsa_aes_128_sha": false,
788788
"security.ssl3.rsa_aes_256_sha": false,
789-
"security.ssl3.deprecated.rsa_des_ede3_sha": false,
789+
"security.ssl3.rsa_des_ede3_sha": false,
790790
"security.ssl3.rsa_aes_128_gcm_sha256": false,
791791
"security.ssl3.rsa_aes_256_gcm_sha384": false,
792792
},

build/pgo/certs/cert9.db

0 Bytes
Binary file not shown.

build/pgo/certs/key4.db

0 Bytes
Binary file not shown.

build/pgo/certs/mochitest.client

0 Bytes
Binary file not shown.

build/pgo/server-locations.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,10 @@ https://sha256ee.example.com:443 privileged,cer
317317
# Hosts for imminent distrust warning tests
318318
https://imminently-distrusted.example.com:443 privileged,cert=imminently_distrusted
319319

320-
# Hosts for ssl3/3des/tls1 warning tests
320+
# Hosts for ssl3/rc4/tls1 warning tests
321321
https://ssl3.example.com:443 privileged,ssl3
322-
https://3des.example.com:443 privileged,3des,tls1,tls1_2
322+
https://rc4.example.com:443 privileged,rc4
323+
https://ssl3rc4.example.com:443 privileged,ssl3,rc4
323324
https://tls1.example.com:443 privileged,tls1
324325
https://tls11.example.com:443 privileged,tls1_1
325326
https://tls12.example.com:443 privileged,tls1_2

modules/libpref/init/all.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pref("security.ssl3.rsa_aes_128_sha", true);
5353
pref("security.ssl3.rsa_aes_256_sha", true);
5454
pref("security.ssl3.rsa_aes_128_gcm_sha256", true);
5555
pref("security.ssl3.rsa_aes_256_gcm_sha384", true);
56-
pref("security.ssl3.deprecated.rsa_des_ede3_sha", true);
56+
pref("security.ssl3.rsa_des_ede3_sha", true);
5757

5858
pref("security.content.signature.root_hash",
5959
"97:E8:BA:9C:F1:2F:B3:DE:53:CC:42:A4:E6:57:7E:D6:4D:F4:93:C2:47:B4:14:FE:A0:36:81:8D:38:23:56:0E");

security/manager/ssl/nsNSSComponent.cpp

Lines changed: 16 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ nsresult LoadLoadableCertsTask::LoadLoadableRoots() {
10241024
// Table of pref names and SSL cipher ID
10251025
typedef struct {
10261026
const char* pref;
1027-
int32_t id;
1027+
long id;
10281028
bool enabledByDefault;
10291029
} CipherPref;
10301030

@@ -1075,13 +1075,12 @@ static const CipherPref sCipherPrefs[] = {
10751075
true}, // deprecated (RSA key exchange)
10761076
{"security.ssl3.rsa_aes_256_sha", TLS_RSA_WITH_AES_256_CBC_SHA,
10771077
true}, // deprecated (RSA key exchange)
1078-
};
1078+
{"security.ssl3.rsa_des_ede3_sha", TLS_RSA_WITH_3DES_EDE_CBC_SHA,
1079+
true}, // deprecated (RSA key exchange, 3DES)
10791080

1080-
// These ciphersuites can only be enabled if deprecated versions of TLS are
1081-
// also enabled (via the preference "security.tls.version.enable-deprecated").
1082-
static const CipherPref sDeprecatedTLS1CipherPrefs[] = {
1083-
{"security.ssl3.deprecated.rsa_des_ede3_sha", TLS_RSA_WITH_3DES_EDE_CBC_SHA,
1084-
true},
1081+
// All the rest are disabled
1082+
1083+
{nullptr, 0} // end marker
10851084
};
10861085

10871086
// This function will convert from pref values like 1, 2, ...
@@ -1358,25 +1357,6 @@ nsresult CipherSuiteChangeObserver::StartObserve() {
13581357
return NS_OK;
13591358
}
13601359

1361-
// Enables or disabled ciphersuites from deprecated versions of TLS as
1362-
// appropriate. If security.tls.version.enable-deprecated is true, these
1363-
// ciphersuites may be enabled, if the corresponding preference is true.
1364-
// Otherwise, these ciphersuites will be disabled.
1365-
void SetDeprecatedTLS1CipherPrefs() {
1366-
if (Preferences::GetBool("security.tls.version.enable-deprecated", false)) {
1367-
for (const auto& deprecatedTLS1CipherPref : sDeprecatedTLS1CipherPrefs) {
1368-
bool cipherEnabled =
1369-
Preferences::GetBool(deprecatedTLS1CipherPref.pref,
1370-
deprecatedTLS1CipherPref.enabledByDefault);
1371-
SSL_CipherPrefSetDefault(deprecatedTLS1CipherPref.id, cipherEnabled);
1372-
}
1373-
} else {
1374-
for (const auto& deprecatedTLS1CipherPref : sDeprecatedTLS1CipherPrefs) {
1375-
SSL_CipherPrefSetDefault(deprecatedTLS1CipherPref.id, false);
1376-
}
1377-
}
1378-
}
1379-
13801360
nsresult CipherSuiteChangeObserver::Observe(nsISupports* /*aSubject*/,
13811361
const char* aTopic,
13821362
const char16_t* someData) {
@@ -1386,16 +1366,16 @@ nsresult CipherSuiteChangeObserver::Observe(nsISupports* /*aSubject*/,
13861366
if (nsCRT::strcmp(aTopic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID) == 0) {
13871367
NS_ConvertUTF16toUTF8 prefName(someData);
13881368
// Look through the cipher table and set according to pref setting
1389-
for (const auto& cipherPref : sCipherPrefs) {
1390-
if (prefName.Equals(cipherPref.pref)) {
1369+
const CipherPref* const cp = sCipherPrefs;
1370+
for (size_t i = 0; cp[i].pref; ++i) {
1371+
if (prefName.Equals(cp[i].pref)) {
13911372
bool cipherEnabled =
1392-
Preferences::GetBool(cipherPref.pref, cipherPref.enabledByDefault);
1393-
SSL_CipherPrefSetDefault(cipherPref.id, cipherEnabled);
1373+
Preferences::GetBool(cp[i].pref, cp[i].enabledByDefault);
1374+
SSL_CipherPrefSetDefault(cp[i].id, cipherEnabled);
1375+
nsNSSComponent::DoClearSSLExternalAndInternalSessionCache();
13941376
break;
13951377
}
13961378
}
1397-
SetDeprecatedTLS1CipherPrefs();
1398-
nsNSSComponent::DoClearSSLExternalAndInternalSessionCache();
13991379
} else if (nsCRT::strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID) == 0) {
14001380
Preferences::RemoveObserver(this, "security.");
14011381
MOZ_ASSERT(sObserver.get() == this);
@@ -2749,14 +2729,13 @@ nsresult InitializeCipherSuite() {
27492729
}
27502730

27512731
// Now only set SSL/TLS ciphers we knew about at compile time
2752-
for (const auto& cipherPref : sCipherPrefs) {
2732+
const CipherPref* const cp = sCipherPrefs;
2733+
for (size_t i = 0; cp[i].pref; ++i) {
27532734
bool cipherEnabled =
2754-
Preferences::GetBool(cipherPref.pref, cipherPref.enabledByDefault);
2755-
SSL_CipherPrefSetDefault(cipherPref.id, cipherEnabled);
2735+
Preferences::GetBool(cp[i].pref, cp[i].enabledByDefault);
2736+
SSL_CipherPrefSetDefault(cp[i].id, cipherEnabled);
27562737
}
27572738

2758-
SetDeprecatedTLS1CipherPrefs();
2759-
27602739
// Enable ciphers for PKCS#12
27612740
SEC_PKCS12EnableCipher(PKCS12_RC4_40, 1);
27622741
SEC_PKCS12EnableCipher(PKCS12_RC4_128, 1);

testing/mochitest/runtests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ def writeLocation(self, config, loc):
684684
"tls1_2",
685685
"tls1_3",
686686
"ssl3",
687-
"3des",
687+
"rc4",
688688
"failHandshake",
689689
):
690690
config.write(

0 commit comments

Comments
 (0)