Commit Graph

62 Commits

Author SHA1 Message Date
DimiL
1d55a14848 Bug 1407879 - Add testcase for login reputation service. r=francois
MozReview-Commit-ID: HhvPqTTz7pg
2018-01-04 09:14:15 +08:00
Jonathan Kingston
6a9e88511d Bug 1419007 - ensure errors FireOnLocationChange after documentURI has changed in docshell. r=sawang r=francois
MozReview-Commit-ID: AaZEIOI4sW1
2017-11-21 11:40:01 +00:00
Nicholas Nethercote
b627e2c831 Bug 1410794 (attempt 2) - Change some |string| occurrences in nsIPrefBranch.idl to |ACString|. r=erahm.
This makes the code nicer. In particular, it removes many getter_Copies()
calls. The patch also converts a lot of nsCStrings to nsAutoCString, which will
avoid heap allocation in the common case.

The patch also renames PREF_CopyCharPref() as PREF_GetCStringPref(), because
it's actually getting a string, not a char, and that matches the existing
GetCString() and GetDefaultCString() methods. Correspondingly, it also renames
PREF_SetCharPref() as PREF_SetCStringPref().

The |aPrefName| arguments in nsIPrefBranch.idl remain as |string| because they
almost always involve passing in C string literals, and passing "foo" is much
nicer than passing NS_LITERAL_CSTRING("foo").

It's worth noting that early versions of this patch used |AUTF8String| instead
of |ACString|. But it turns out that libpref stores prefs internally as Latin1.
And |ACString| is compatible with Latin1 but |AUTF8String| isn't, because
non-ASCII Latin1 strings are not valid UTF-8!

MozReview-Commit-ID: D3f7a1Vl1oE
2017-10-27 10:30:33 +11:00
Francois Marier
d682ea8c54 Bug 1385461 - Move URL Classifier protobuf files to match other components. r=dimi
MozReview-Commit-ID: 5N1iOpocVd8
2017-10-12 17:27:36 -07:00
Thomas Nguyen
da894bb42f Bug 1351147 - Support ThreatHit requests in SafeBrowsing V4 r=francois
MozReview-Commit-ID: 3ifQtdOTulE
2017-08-24 11:13:12 +08:00
Chris Peterson
11b00c1394 Bug 870698 - Part 5: Replace Assign(NS_LITERAL_CSTRING("")) with AssignLiteral(""). r=erahm
The NS_LITERAL_CSTRING macro creates a temporary nsLiteralCString to encapsulate the string literal and its length, but AssignLiteral() can determine the string literal's length at compile-time without nsLiteralCString.

MozReview-Commit-ID: KXJM13VRTB7
2017-09-06 01:35:56 -07:00
Henry Chang
0d7d639fec Bug 1392204 - Disable goog-badbinurl-proto and goog-downloadwhite-proto on Fennec. r=francois
Version 4 of the Google Safe Browsing server will return a 404 if any of the
application reputation lists are requested on Android. As a result, we should
avoid these threat types from being sent along with ANDROID_PLATFORM.

MozReview-Commit-ID: 6TUBVxe455y
2017-08-22 12:20:57 +08:00
Francois Marier
3fb9813b89 Bug 1385484 - Add the login reputation whitelist behind a pref. r=hchang
MozReview-Commit-ID: Dbtl3WL5tMJ
2017-08-08 16:23:10 -07:00
Francois Marier
366ae48b73 Bug 1385484 - Cleanup Safe Browsing prefs and sync the download protection setting. r=hchang
MozReview-Commit-ID: B42p2Gw8y9i
2017-08-08 15:52:29 -07:00
Wes Kocher
ee18e318e9 Backed out 4 changesets (bug 1385484) for build failures a=backout
Backed out changeset 401c2744f16b (bug 1385484)
Backed out changeset 2ff443a0c744 (bug 1385484)
Backed out changeset 1a1c476a9aaa (bug 1385484)
Backed out changeset 87ec064a3681 (bug 1385484)

MozReview-Commit-ID: D9WGXiXaNoZ
2017-08-22 17:22:41 -07:00
Francois Marier
b4f1a9b65e Bug 1385484 - Add the login reputation whitelist behind a pref. r=hchang
MozReview-Commit-ID: Dbtl3WL5tMJ
2017-08-08 16:23:10 -07:00
Francois Marier
0bdc6213e0 Bug 1385484 - Cleanup Safe Browsing prefs and sync the download protection setting. r=hchang
MozReview-Commit-ID: B42p2Gw8y9i
2017-08-08 15:52:29 -07:00
Nicholas Nethercote
42d8740878 Bug 1390428 (part 2, attempt 2) - Remove more nsXPIDLCString local variables. r=erahm. 2017-08-21 20:01:27 +10:00
Henry Chang
d022ca7e9b Bug 1388582 - Skip unsupported threat types on current platform while making v4 request. r=francois
MozReview-Commit-ID: FTmOMQ339ZL
2017-08-16 15:30:20 +08:00
Nicholas Nethercote
b7346a7502 Bug 1390428 (part 1) - Remove many nsXPIDLCString local variables. r=erahm.
These are all easy cases where an nsXPIDLCString local variable is set via
getter_Copies() and then is only used in ways that nsCStrings can also be used
(i.e. no null checks or implicit conversions to |char*|).

In every case the patch trivially replaces the nsXPIDLCString with an
nsCString. (Also, there are a couple of unused nsXPIDLCString variables that
the patch simply removes.)
2017-08-16 13:58:35 +10:00
Henry Chang
3ddce6c31d Bug 1375277 - New safebrowsing threat type "POTENTIALLY_HARMFUL_APPLICATION" introduced by v4. r=francois
As our threattype-listname conversion design, "goog-harmful-proto" is allocated
for this new threat type. This threat type is mainly for mobile.

MozReview-Commit-ID: G9GbgmHHHfp
2017-07-27 15:37:57 +08:00
Masatoshi Kimura
c0943e4f30 Bug 1326520 - Rename nsIURI.path to pathQueryRef. r=valentin.gosu
MozReview-Commit-ID: DqJdTGopR9G
2017-07-29 20:50:21 +09:00
Sylvestre Ledru
576cac5ec7 Bug 1381253 - Remove redundant control flow declarations rs=ehsan
MozReview-Commit-ID: FFxP4aMCbOL
2017-07-15 19:03:04 +02:00
Nathan Froyd
8953d05316 Bug 1378387 - use dependent strings in the url-classifier where possible; r=gcp
Doing this makes various operations more efficient, as we don't have to
allocate, copy strings, and deallocate needlessly.  The remaining
instances of nsCString temporaries are in logging code, which didn't
seem worthwhile to deal with here.
2017-07-06 15:26:12 -04:00
Francois Marier
f37e04a87d Bug 1376024 - Whitelist more known Safe Browsing providers for telemetry purposes. r=dimi
MozReview-Commit-ID: 6Dd1eDSJlzT
2017-06-23 17:00:45 -07:00
Francois Marier
566f4c2a55 Bug 1362501 - Use LINUX_PLATFORM for Safe Browsing on non-Windows and non-OSX platforms. r=gcp
MozReview-Commit-ID: 58059M8IhL
2017-05-05 11:38:38 -07:00
DimiL
11fae5a35a Bug 1357207 - Caching duration recorded to telemetry should be milli-second . r=francois
In Bug 1311935, We change positive/negative cache duration from milli-second to second.
But the value doesn't covert back to milli-second when store to telemetry(telemetry use
milli-second).

MozReview-Commit-ID: KR6xn9pwhUd
2017-04-18 12:01:09 +08:00
dimi
5b1a0ff5b5 Bug 1311935 - P2. Process fullHashes.find response. r=francois
This patch includes following changes:

1. nsUrlClassifierHashCompleter.js
   nsUrlClassifierHashCompleter.idl
   - Add completionV4 interface for hashCompleter to pass response data to
     DB service.
   - Process response data includes negative cache duration, matched full
     hashes and cache duration for each match. Full matches are passed through
     nsIFullHashMatch interface.
   - Change _requests.responses from array contains matched fullhashes to
     dictionary so that it can store additional information likes negative cache
     duration.
2. nsUrlClassifierDBService.cpp
   - Implement CompletionV4 interface, store response data to CacheResultV4
     object. Expired duration to expired time is handled here.
   - Add CacheResultToTableUpdate function to convert V2 & V4 cache result
     to TableUpdate object.
3. LookupCache.h
   - Extend CacheResult to CacheResultV2 and CacheResultV4 so we can store
     response data in CompletionV2 and CompletionV4.
4. HashStore.h
   - Add API and member variable in TableUpdateV4 to store response data.
     TableUpdate object is used by DB service to pass update data or gethash
     response to Classifier, so we need to extend TableUpdateV4 to be able
     to store fullHashes.find response.
6. Entry.h
   - Define the structure about how we cache fullHashes.find response.

MozReview-Commit-ID: FV4yAl2SAc6
2017-04-11 11:50:48 +08:00
Iris Hsiao
cd018fd494 Backed out 4 changesets (bug 1311935) for causing assertion crash by developer's request
Backed out changeset 27e624cd9479 (bug 1311935)
Backed out changeset 4c0381ab0990 (bug 1311935)
Backed out changeset 73587838ef16 (bug 1311935)
Backed out changeset a5a6c0f79733 (bug 1311935)
2017-04-11 11:04:54 +08:00
dimi
5856f89d1f Bug 1311935 - P2. Process fullHashes.find response. r=francois
This patch includes following changes:

1. nsUrlClassifierHashCompleter.js
   nsUrlClassifierHashCompleter.idl
   - Add completionV4 interface for hashCompleter to pass response data to
     DB service.
   - Process response data includes negative cache duration, matched full
     hashes and cache duration for each match. Full matches are passed through
     nsIFullHashMatch interface.
   - Change _requests.responses from array contains matched fullhashes to
     dictionary so that it can store additional information likes negative cache
     duration.
2. nsUrlClassifierDBService.cpp
   - Implement CompletionV4 interface, store response data to CacheResultV4
     object. Expired duration to expired time is handled here.
   - Add CacheResultToTableUpdate function to convert V2 & V4 cache result
     to TableUpdate object.
3. LookupCache.h
   - Extend CacheResult to CacheResultV2 and CacheResultV4 so we can store
     response data in CompletionV2 and CompletionV4.
4. HashStore.h
   - Add API and member variable in TableUpdateV4 to store response data.
     TableUpdate object is used by DB service to pass update data or gethash
     response to Classifier, so we need to extend TableUpdateV4 to be able
     to store fullHashes.find response.
6. Entry.h
   - Define the structure about how we cache fullHashes.find response.

MozReview-Commit-ID: KgR1NASl7GC
2017-04-10 16:20:09 +08:00
Thomas Nguyen
d107e3566b Bug 1331139 - Enable download protection for V4 lists. r=francois
MozReview-Commit-ID: 8IHKGvXQjPt
2017-02-27 12:18:33 +08:00
dimi
9052d78921 Bug 1338082 - Add telemetry probes to track the positive and negative cache durations in V4. r=francois
MozReview-Commit-ID: 43Nf5bS2Uo
2017-02-20 10:25:18 +08:00
Nathan Froyd
a7d8bdb5d3 Bug 1339556 - remove nsUrlClassifierUtils::Charmap; r=gcp
The current code doesn't use Charmap.
2017-02-15 09:29:42 -05:00
Thomas Nguyen
96756deadd Bug 1329558 - Implement Minimum wait duration for V4 gethash r=francois
MozReview-Commit-ID: 7i9Wz7pq0yJ
2017-02-09 16:56:44 +08:00
DimiL
845ddf7f2d Bug 1331881 - Minimum wait duration and negative cache duration should be passed even if there is no match. r=francois,henry
MozReview-Commit-ID: K5RcpmiXFYR
2017-01-18 17:34:03 +08:00
Dimi Lee
1859178ca5 Bug 1332770 - Fix the google4 provider is showing up as other in some telemetry pings. r=francois
MozReview-Commit-ID: KbpYAnf6qxd
2017-01-27 18:02:36 +08:00
Henry Chang
eff83f87c8 Bug 1276826 - Part 2. Send gethash request and handle gethash response for v4. r=francois
MozReview-Commit-ID: 6fIbN6a6gHI
2016-11-28 14:55:36 +08:00
Henry Chang
405c70faa9 Bug 1276826 - Part 1. Implement function to build FindFullHash request for v4. r=francois
MozReview-Commit-ID: 6hi97T9Jk7s
2016-11-28 14:54:49 +08:00
Thomas Nguyen
6b8c52c162 Bug 1315893 - Add telemetry to measure update time for V2 and V4. r=francois
MozReview-Commit-ID: KtrVJXHXMo
2016-11-24 11:13:54 +08:00
Henry Chang
7f94b8915f Bug 1315097 - Build the provider dictionary on the main thread to be used everywhere. r=francois,gcp
MozReview-Commit-ID: Ft1deSNKuVB
2016-11-04 17:54:05 +08:00
Henry Chang
ea02e6b8bd Bug 1285848 - Part 2: Request and parse RICE encoded prefix by default. r=francois
MozReview-Commit-ID: Cd0lT5VTM7t
2016-10-05 14:59:53 +08:00
Henry
6fd66a6613 Bug 1305567 - Use base64url encoding and avoid cutting the state. r=francois 2016-09-30 10:36:40 -07:00
Sebastian Hengst
4ad6c96678 Backed out changeset d46155cc719e (bug 1305567) for various failures in browser-chrome, devtools, and xpcshell (e.g. test_streamupdater.js) tests. r=backout on a CLOSED TREE 2016-09-29 20:54:50 +02:00
Henry
285154b77e Bug 1305567 - Use base64url encoding, avoid cutting the state and dump download error message. r=francois.
MozReview-Commit-ID: 1umDhxY5eKl
2016-09-27 11:48:11 -07:00
Henry Chang
13ce085b08 Bug 1302044 - Init tableArray with only enabled tables. r=francois.
MozReview-Commit-ID: KMp8oLkBXwb
2016-09-12 17:30:06 +08:00
Henry Chang
889e160c68 Bug 1301008 - Pass safebrowsing v4 list state in base64 format to avoid truncation. r=francois
MozReview-Commit-ID: 6oVdQvEoMm2
2016-09-07 17:45:15 +08:00
Henry
dab0bfeabc Bug 1287059 - Part 1: Return all possible list names while converting from threat type. r=francois.
MozReview-Commit-ID: KgT4CrBzvu0
2016-08-16 17:30:11 +08:00
Igor
9c81c3c1ee Bug 1293384 - Part 2: Rename Snprintf.h header to Sprintf.h. r=froydnj 2016-08-14 23:43:21 -07:00
Igor
972b8460e2 Bug 1293384 - Part 1: Rename snprintf_literal to SprintfLiteral. r=froydnj 2016-08-14 23:44:00 -07:00
Henry Chang
9708a23b7f Bug 1274112 - Part 1: Make update request v4. r=francois
MozReview-Commit-ID: NgV4QYbDll
2016-08-04 18:10:06 +08:00
Igor
27c926c49e Bug 1197331 - remove PR_snprintf calls in miscellaneous directories. r=nfroyd 2016-08-04 16:41:00 +02:00
Henry Chang
85fe597557 Bug 1288840 - Use the private phishing site list in official build. r=francois
MozReview-Commit-ID: 3SYoP2z1jWb
2016-07-25 09:18:25 +08:00
Jan Beich
d0174f165b Bug 1288825 - Unbreak build on Unix after bug 1275507. r=francois
MozReview-Commit-ID: nYNiYjuq8A
2016-07-22 20:48:26 +00:00
Henry Chang
41a80ccf3f Bug 1275507 - XPCOM API to create SB v4 update request. r=francois
MozReview-Commit-ID: RfM3KFe6kG
2016-07-19 18:09:53 +08:00
Nicholas Nethercote
a14f636d12 Bug 1278439 - Adding a missing prefs service null check in url-classifier/. r=gcp. 2016-07-14 13:47:54 +10:00