Commit Graph

76 Commits

Author SHA1 Message Date
dlee
f59bb40e5d Bug 1531354 - P5. Safe Browsing test entries are directly stored in LookupCache. r=gcp
Create test entries via update introduces performance overhead.
We can store them directly in LookupCache and do not save test entries
to disk.

Differential Revision: https://phabricator.services.mozilla.com/D34576
2019-06-29 19:05:41 +00:00
Boris Zbarsky
cae135dd3f Bug 1557501. Stop using [array] in nsIPrefBranch. r=njn
Differential Revision: https://phabricator.services.mozilla.com/D34032
2019-06-07 01:01:12 +00:00
Boris Zbarsky
a9b6918cce Bug 1551399 part 2. Stop using [array] in url-classifier's makeFindFullHashRequestV4. r=dimi,gcp
Differential Revision: https://phabricator.services.mozilla.com/D31022
2019-05-14 09:57:16 +00:00
Boris Zbarsky
d288f51dc3 Bug 1551399 part 1. Stop using [array] in url-classifier's makeUpdateRequestV4. r=dimi,gcp
Differential Revision: https://phabricator.services.mozilla.com/D31020
2019-05-14 09:50:42 +00:00
Thomas Nguyen
2b9a6d0f8d Bug 1532318 - Part 2 : update changes of nsIHttpChannel in codebase r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D22786
2019-05-02 12:33:55 +00:00
Dimi Lee
2fb0cffa81 Bug 1531034 - Changing of the guard for URLClassifier and ApplicationReputation. r=chutten
Differential Revision: https://phabricator.services.mozilla.com/D22283
2019-03-18 14:26:00 +00:00
Christoph Kerschbaumer
1a72eb2a6b Bug 1528677: Remove nullchecks for loadinfo since we have loadinfo on all channels. r=baku 2019-02-20 13:27:25 +01:00
Andrea Marchesini
0fd63f6e02 Bug 1528596 - Devirtualize accesses to nsUrlClassifierUtils, r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D20086
2019-02-19 14:35:57 +00:00
Ehsan Akhgari
5119fb0fff Bug 1509112 - Consider the content frame sitting directly beneath a moz-extension frame that has a host permission granting access to that frame as a top-level frame; r=kmag,baku
Differential Revision: https://phabricator.services.mozilla.com/D14832
2019-01-23 14:55:49 +00:00
Andrea Marchesini
a5aa66ee92 Bug 1511436 - Cleanup URL-Classifier code - part 1 - nsIUrlClassifierFeature, r=dimi 2018-12-14 12:40:16 +01:00
Sylvestre Ledru
e5a134f73a Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset
2018-11-30 11:46:48 +01:00
Francois Marier
225086a87e Bug 1441345 - Force the use of the Linux phishing list on Android. r=dimi
Reviewers: dimi

Reviewed By: dimi

Subscribers: dveditz, francois, dimi

Bug #: 1441345

Differential Revision: https://phabricator.services.mozilla.com/D5479
2018-09-12 18:07:26 +03:00
Henri Sivonen
89f220ee63 Bug 1485342 - Avoid isdigit() and isxdigit() in URL classifier. r=francois
MozReview-Commit-ID: IvadP10PFEZ

Differential Revision: https://phabricator.services.mozilla.com/D4312
2018-08-27 15:55:13 +00:00
Valentin Gosu
b9160f5ce8 Bug 1433958 - Change code that sets nsIURI.userPass to use nsIURIMutator r=mayhemer
* Code in XMLHttpRequestMainThread is converted to set the username and password individually. This is because when the parameters are empty, it ended up calling SetUserPass(":") which always returns an error.

MozReview-Commit-ID: 3cK5HeyzjFE
2018-02-26 20:43:46 +01:00
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