Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/chrome/content/code/HTTPS.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,6 @@ const HTTPS = {


cookiesCleanup: function(refCookie) {
var downgraded = [];

var ignored = this.secureCookiesExceptions;
var disabled = !this.secureCookies;
var bi = DOM.createBrowserIterator();
Expand Down
Empty file removed utils/downgrade-whitelist.txt
Empty file.
3 changes: 0 additions & 3 deletions utils/relaxng.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@
<param name="pattern">(https?://[^ \\]*/[^ \\]*|https:)</param>
</data>
</attribute>
<optional>
<attribute name="downgrade" />
</optional>
</element>
</oneOrMore>

Expand Down
2 changes: 0 additions & 2 deletions utils/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ def simple(f):
not tree.xpath("/ruleset/exclusion"),
# targets must not contain any wildcards
not any("*" in target for target in targets),
# ruleset must not contain any downgrade rules
not any("downgrade" in rule.attrib for rule in tree.xpath("/ruleset/rule")),
# and every rule must itself be simple according to the criteria below
all(simple_rule(rule, targets) for rule in tree.xpath("/ruleset/rule"))
])
Expand Down
2 changes: 0 additions & 2 deletions utils/single_rule_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ def find_redirect(to):
seen = []
for rule in tree.xpath('/ruleset/rule'):
to = rule.get('to')
if rule.get('downgrade') or to in seen:
continue
if back_ref.search(to):
continue
if not test_response_no_redirect(to):
Expand Down
19 changes: 3 additions & 16 deletions utils/trivial-validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@ def fail(s):
xpath_cookie_host_pattern = etree.XPath("/ruleset/securecookie/@host")
xpath_cookie_name_pattern = etree.XPath("/ruleset/securecookie/@name")

# Load lists of ruleset names whitelisted for downgrade & duplicate rules
# Load lists of ruleset names whitelisted for duplicate rules
thispath = os.path.dirname(os.path.realpath(__file__))
with open(thispath + '/downgrade-whitelist.txt') as downgrade_fh:
downgrade_allowed_list = [x.rstrip('\n') for x in downgrade_fh.readlines()]
with open(thispath + '/duplicate-whitelist.txt') as duplicate_fh:
duplicate_allowed_list = [x.rstrip('\n') for x in duplicate_fh.readlines()]

Expand Down Expand Up @@ -96,21 +94,10 @@ def test_unencrypted_to(tree, rulename, from_attrib, to):
# Rules that redirect to something other than https or http.
# This used to test for http: but testing for lack of https: will
# catch more kinds of mistakes.
# Now warn if the rule author indicates they intended it, with the
# downgrade attribute. Error if this attribute is not present.
"""Rule redirects to something other than https."""
for rule in xpath_rule(tree):
to, downgrade = rule.get("to"), rule.get("downgrade")
if to[:6] != "https:" and to[:5] != "http:":
return False
elif to[:5] == "http:" and downgrade:
if rulename in downgrade_allowed_list:
warn("whitelisted downgrade rule in %s redirects to http." % rulename)
else:
fail("non-whitelisted downgrade rule in %s redirects to http." % rulename)
return False
elif to[:5] == "http:":
fail("non-downgrade rule in %s redirects to http." % rulename)
to = rule.get("to")
if to[:6] != "https:":
return False
return True

Expand Down