Bug 1522182 - Add policies for SSL version max/min r=Felipe

Differential Revision: https://phabricator.services.mozilla.com/D17520

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Michael Kaply 2019-01-25 19:37:27 +00:00
Родитель 771297a51a
Коммит a211c8f731
3 изменённых файлов: 76 добавлений и 0 удалений

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

@ -896,6 +896,48 @@ var Policies = {
},
},
"SSLVersionMax": {
onBeforeAddons(manager, param) {
let tlsVersion;
switch (param) {
case "tls1":
tlsVersion = 1;
break;
case "tls1.1":
tlsVersion = 2;
break;
case "tls1.2":
tlsVersion = 3;
break;
case "tls1.3":
tlsVersion = 4;
break;
}
setAndLockPref("security.tls.version.max", tlsVersion);
},
},
"SSLVersionMin": {
onBeforeAddons(manager, param) {
let tlsVersion;
switch (param) {
case "tls1":
tlsVersion = 1;
break;
case "tls1.1":
tlsVersion = 2;
break;
case "tls1.2":
tlsVersion = 3;
break;
case "tls1.3":
tlsVersion = 4;
break;
}
setAndLockPref("security.tls.version.min", tlsVersion);
},
},
"WebsiteFilter": {
onBeforeUIStartup(manager, param) {
this.filter = new WebsiteFilter(param.Block || [], param.Exceptions || []);

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

@ -654,6 +654,16 @@
}
},
"SSLVersionMax": {
"type": "string",
"enum": ["tls1", "tls1.1", "tls1.2", "tls1.3"]
},
"SSLVersionMin": {
"type": "string",
"enum": ["tls1", "tls1.1", "tls1.2", "tls1.3"]
},
"WebsiteFilter": {
"type": "object",
"properties": {

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

@ -200,6 +200,30 @@ const POLICIES_TESTS = [
"network.trr.uri": "http://example.com/provider",
},
},
// POLICY: SSLVersionMin/SSLVersionMax (1)
{
policies: {
"SSLVersionMin": "tls1",
"SSLVersionMax": "tls1.1",
},
lockedPrefs: {
"security.tls.version.min": 1,
"security.tls.version.max": 2,
},
},
// POLICY: SSLVersionMin/SSLVersionMax (2)
{
policies: {
"SSLVersionMin": "tls1.2",
"SSLVersionMax": "tls1.3",
},
lockedPrefs: {
"security.tls.version.min": 3,
"security.tls.version.max": 4,
},
},
];
add_task(async function test_policy_remember_passwords() {