mirror of
https://github.com/classilla/tenfourfox.git
synced 2024-12-28 11:32:05 +00:00
closes #401: implement conversion script for STS preloads and update from ESR52
This commit is contained in:
parent
6251e903f7
commit
abdf0d5a60
51
104fx_import_esr52_stspreload.pl
Executable file
51
104fx_import_esr52_stspreload.pl
Executable file
@ -0,0 +1,51 @@
|
||||
#!/usr/bin/perl -s
|
||||
|
||||
$source ||= "../esr52/security/manager/ssl/nsSTSPreloadList.inc";
|
||||
open(W, $source) || die("unable to open $source: $!\nspecify -source=/path ?\n");
|
||||
print <<'EOF';
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/*****************************************************************************/
|
||||
/* This is an automatically generated file. If you're not */
|
||||
/* nsSiteSecurityService.cpp, you shouldn't be #including it. */
|
||||
/*****************************************************************************/
|
||||
|
||||
/* imported from ESR52 by TenFourFox conversion script */
|
||||
|
||||
#include <stdint.h>
|
||||
EOF
|
||||
|
||||
# let's have a little paranoia.
|
||||
while(<W>) {
|
||||
if (/^const PRTime gPreloadListExpirationTime = INT64_C/) {
|
||||
print;
|
||||
$got_time = 1;
|
||||
}
|
||||
if (/kSTSHostTable/) {
|
||||
$got_host = 1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
die("unexpected format of $source\n") if (!$got_time || !$got_host);
|
||||
print <<'EOF';
|
||||
|
||||
class nsSTSPreload
|
||||
{
|
||||
public:
|
||||
const char *mHost;
|
||||
const bool mIncludeSubdomains;
|
||||
};
|
||||
|
||||
static const nsSTSPreload kSTSPreloadList[] = {
|
||||
EOF
|
||||
|
||||
while(<W>) {
|
||||
if (/^\s*\/\* ("[^"]+", )(true|false)\s\*\//) {
|
||||
print " { $1$2 },\n";
|
||||
}
|
||||
}
|
||||
|
||||
print "};\n";
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user