Bug 1288840 - Use the private phishing site list in official build. r=francois

MozReview-Commit-ID: 3SYoP2z1jWb

--HG--
extra : rebase_source : 3db67147f6fc4ae0533636b9ce2b12c579302005
This commit is contained in:
Henry Chang 2016-07-25 09:18:25 +08:00
Родитель 8c814c34a8
Коммит b4c6cfd89b
3 изменённых файлов: 18 добавлений и 5 удалений

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

@ -5059,7 +5059,14 @@ pref("dom.mapped_arraybuffer.enabled", true);
// The tables used for Safebrowsing phishing and malware checks. // The tables used for Safebrowsing phishing and malware checks.
pref("urlclassifier.malwareTable", "goog-malware-shavar,goog-unwanted-shavar,test-malware-simple,test-unwanted-simple"); pref("urlclassifier.malwareTable", "goog-malware-shavar,goog-unwanted-shavar,test-malware-simple,test-unwanted-simple");
#ifdef MOZILLA_OFFICIAL
// In the official build, we are allowed to use google's private
// phishing list "goog-phish-shavar". See Bug 1288840.
pref("urlclassifier.phishTable", "goog-phish-shavar,test-phish-simple"); pref("urlclassifier.phishTable", "goog-phish-shavar,test-phish-simple");
#else
pref("urlclassifier.phishTable", "googpub-phish-shavar,test-phish-simple");
#endif
// Tables for application reputation. // Tables for application reputation.
pref("urlclassifier.downloadBlockTable", "goog-badbinurl-shavar"); pref("urlclassifier.downloadBlockTable", "goog-badbinurl-shavar");
@ -5113,14 +5120,14 @@ pref("browser.safebrowsing.debug", false);
// The protocol version we communicate with google server. // The protocol version we communicate with google server.
pref("browser.safebrowsing.provider.google.pver", "2.2"); pref("browser.safebrowsing.provider.google.pver", "2.2");
pref("browser.safebrowsing.provider.google.lists", "goog-badbinurl-shavar,goog-downloadwhite-digest256,goog-phish-shavar,goog-malware-shavar,goog-unwanted-shavar"); pref("browser.safebrowsing.provider.google.lists", "goog-badbinurl-shavar,goog-downloadwhite-digest256,goog-phish-shavar,googpub-phish-shavar,goog-malware-shavar,goog-unwanted-shavar");
pref("browser.safebrowsing.provider.google.updateURL", "https://safebrowsing.google.com/safebrowsing/downloads?client=SAFEBROWSING_ID&appver=%MAJOR_VERSION%&pver=2.2&key=%GOOGLE_API_KEY%"); pref("browser.safebrowsing.provider.google.updateURL", "https://safebrowsing.google.com/safebrowsing/downloads?client=SAFEBROWSING_ID&appver=%MAJOR_VERSION%&pver=2.2&key=%GOOGLE_API_KEY%");
pref("browser.safebrowsing.provider.google.gethashURL", "https://safebrowsing.google.com/safebrowsing/gethash?client=SAFEBROWSING_ID&appver=%MAJOR_VERSION%&pver=2.2"); pref("browser.safebrowsing.provider.google.gethashURL", "https://safebrowsing.google.com/safebrowsing/gethash?client=SAFEBROWSING_ID&appver=%MAJOR_VERSION%&pver=2.2");
pref("browser.safebrowsing.provider.google.reportURL", "https://safebrowsing.google.com/safebrowsing/diagnostic?client=%NAME%&hl=%LOCALE%&site="); pref("browser.safebrowsing.provider.google.reportURL", "https://safebrowsing.google.com/safebrowsing/diagnostic?client=%NAME%&hl=%LOCALE%&site=");
// Prefs for v4. // Prefs for v4.
pref("browser.safebrowsing.provider.google4.pver", "4"); pref("browser.safebrowsing.provider.google4.pver", "4");
pref("browser.safebrowsing.provider.google4.lists", "goog-phish-proto,goog-malware-proto,goog-unwanted-proto"); pref("browser.safebrowsing.provider.google4.lists", "goog-phish-proto,googpub-phish-proto,goog-malware-proto,goog-unwanted-proto");
pref("browser.safebrowsing.provider.google4.updateURL", "https://safebrowsing.googleapis.com/v4/threatListUpdates:fetch?$req=%REQUEST_BASE64%&$ct=application/x-protobuf&key=%GOOGLE_API_KEY%"); pref("browser.safebrowsing.provider.google4.updateURL", "https://safebrowsing.googleapis.com/v4/threatListUpdates:fetch?$req=%REQUEST_BASE64%&$ct=application/x-protobuf&key=%GOOGLE_API_KEY%");
pref("browser.safebrowsing.provider.google4.gethashURL", "https://safebrowsing.googleapis.com/v4/fullHashes:find?$req=%REQUEST_BASE64%&$ct=application/x-protobuf&key=%GOOGLE_API_KEY%"); pref("browser.safebrowsing.provider.google4.gethashURL", "https://safebrowsing.googleapis.com/v4/fullHashes:find?$req=%REQUEST_BASE64%&$ct=application/x-protobuf&key=%GOOGLE_API_KEY%");
pref("browser.safebrowsing.provider.google4.reportURL", "https://safebrowsing.google.com/safebrowsing/diagnostic?client=%NAME%&hl=%LOCALE%&site="); pref("browser.safebrowsing.provider.google4.reportURL", "https://safebrowsing.google.com/safebrowsing/diagnostic?client=%NAME%&hl=%LOCALE%&site=");

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

@ -200,13 +200,17 @@ nsUrlClassifierUtils::GetKeyForURI(nsIURI * uri, nsACString & _retval)
// We use "goog-*-proto" as the list name for v4, where "proto" indicates // We use "goog-*-proto" as the list name for v4, where "proto" indicates
// it's updated (as well as hash completion) via protobuf. // it's updated (as well as hash completion) via protobuf.
//
// In the mozilla official build, we are allowed to use the
// private phishing list (goog-phish-proto). See Bug 1288840.
static const struct { static const struct {
const char* mListName; const char* mListName;
uint32_t mThreatType; uint32_t mThreatType;
} THREAT_TYPE_CONV_TABLE[] = { } THREAT_TYPE_CONV_TABLE[] = {
{ "goog-malware-proto", MALWARE_THREAT}, // 1 { "goog-malware-proto", MALWARE_THREAT}, // 1
{ "goog-phish-proto", SOCIAL_ENGINEERING_PUBLIC}, // 2 { "googpub-phish-proto", SOCIAL_ENGINEERING_PUBLIC}, // 2
{ "goog-unwanted-proto", UNWANTED_SOFTWARE}, // 3 { "goog-unwanted-proto", UNWANTED_SOFTWARE}, // 3
{ "goog-phish-proto", SOCIAL_ENGINEERING}, // 5
}; };
NS_IMETHODIMP NS_IMETHODIMP

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

@ -5,8 +5,9 @@ function run_test() {
// Test list name to threat type conversion. // Test list name to threat type conversion.
equal(urlUtils.convertListNameToThreatType("goog-malware-proto"), 1); equal(urlUtils.convertListNameToThreatType("goog-malware-proto"), 1);
equal(urlUtils.convertListNameToThreatType("goog-phish-proto"), 2); equal(urlUtils.convertListNameToThreatType("googpub-phish-proto"), 2);
equal(urlUtils.convertListNameToThreatType("goog-unwanted-proto"), 3); equal(urlUtils.convertListNameToThreatType("goog-unwanted-proto"), 3);
equal(urlUtils.convertListNameToThreatType("goog-phish-proto"), 5);
try { try {
urlUtils.convertListNameToThreatType("bad-list-name"); urlUtils.convertListNameToThreatType("bad-list-name");
@ -20,8 +21,9 @@ function run_test() {
// Test threat type to list name conversion. // Test threat type to list name conversion.
equal(urlUtils.convertThreatTypeToListName(1), "goog-malware-proto"); equal(urlUtils.convertThreatTypeToListName(1), "goog-malware-proto");
equal(urlUtils.convertThreatTypeToListName(2), "goog-phish-proto"); equal(urlUtils.convertThreatTypeToListName(2), "googpub-phish-proto");
equal(urlUtils.convertThreatTypeToListName(3), "goog-unwanted-proto"); equal(urlUtils.convertThreatTypeToListName(3), "goog-unwanted-proto");
equal(urlUtils.convertThreatTypeToListName(5), "goog-phish-proto");
try { try {
urlUtils.convertThreatTypeToListName(0); urlUtils.convertThreatTypeToListName(0);