summaryrefslogtreecommitdiffstats
path: root/chrome/browser/safe_browsing/safe_browsing_util.cc
Commit message (Collapse)AuthorAgeFilesLines
* chrome/browser: Migrate from googleurl/ includes to url/ ones. Part 1tfarina@chromium.org2013-07-021-2/+2
| | | | | | | | | BUG=229660 TBR=darin@chromium.org Review URL: https://chromiumcodereview.appspot.com/18054023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209705 0039d316-1c4b-4281-b951-d872f2087c98
* Use a direct include of strings headers in chrome/browser/r*-s*/.avi@chromium.org2013-06-101-2/+2
| | | | | | | | | | BUG=247723 TEST=none TBR=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/15906011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205318 0039d316-1c4b-4281-b951-d872f2087c98
* Add support for the side-effect free whitelist in safe browsing.tburkard@chromium.org2013-05-151-0/+6
| | | | | | | | R=isherman@chromium.org, shess@chromium.org, shishir@chromium.org Review URL: https://codereview.chromium.org/14584002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200380 0039d316-1c4b-4281-b951-d872f2087c98
* Rewrite std::string("") to std::string(), Linux edition.dcheng@chromium.org2013-04-091-6/+9
| | | | | | | | | | | | | | | | | | | This patch was generated by running the empty_string clang tool across the Chromium Linux compilation database. Implicitly or explicitly constructing std::string() with a "" argument is inefficient as the caller needs to emit extra instructions to pass an argument, and the constructor needlessly copies a byte into internal storage. Rewriting these instances to simply call the default constructor appears to save ~14-18 kilobytes on an optimized release build. BUG=none Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=193020 Review URL: https://codereview.chromium.org/13145003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193040 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Rewrite std::string("") to std::string(), Linux edition."dcheng@chromium.org2013-04-091-9/+6
| | | | | | | | | | | | | | This reverts commit e59558b78e8c6a1b0bd916a724724b638c3c91b6. Revert "Fix build after r193020." This reverts commit 558a35897f6b3ffbcaefde927c1f150b815d140a. Revert "Really fix build after r193020." This reverts commit e3748a79b523a8d365d4a33ef986eebb4186fa78. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193030 0039d316-1c4b-4281-b951-d872f2087c98
* Rewrite std::string("") to std::string(), Linux edition.dcheng@chromium.org2013-04-091-6/+9
| | | | | | | | | | | | | | | | | This patch was generated by running the empty_string clang tool across the Chromium Linux compilation database. Implicitly or explicitly constructing std::string() with a "" argument is inefficient as the caller needs to emit extra instructions to pass an argument, and the constructor needlessly copies a byte into internal storage. Rewriting these instances to simply call the default constructor appears to save ~14-18 kilobytes on an optimized release build. BUG=none Review URL: https://codereview.chromium.org/13145003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193020 0039d316-1c4b-4281-b951-d872f2087c98
* Add an extension blacklist safebrowsing store and use it inkalman@chromium.org2013-02-021-0/+10
| | | | | | | | | | | extensions::Blacklist. BUG=154149 TBR=ben@chromium.org Review URL: https://codereview.chromium.org/11943016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180219 0039d316-1c4b-4281-b951-d872f2087c98
* Small modifications to safebrowsing code to make it simpler to add the extensionkalman@chromium.org2013-01-181-5/+8
| | | | | | | | | | | | blacklist, and clean up a few things. BUG=154149 TBR=cbentzel@chromium.org Review URL: https://chromiumcodereview.appspot.com/11615011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177719 0039d316-1c4b-4281-b951-d872f2087c98
* Stop including a continue URL for SafeBrowsing reports, to get the default ↵bryner@chromium.org2012-05-011-14/+1
| | | | | | | | | | | | confirmation page. BUG=125471 TEST=none Review URL: http://codereview.chromium.org/10268019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134647 0039d316-1c4b-4281-b951-d872f2087c98
* Replace SafeBrowsing MAC with downloads over SSL.bryner@chromium.org2012-04-161-37/+0
| | | | | | | | | | BUG=119662 TEST=updated unittests, ran Chrome and verified SB functionality on new profile Review URL: http://codereview.chromium.org/10069031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132456 0039d316-1c4b-4281-b951-d872f2087c98
* Stop updating SafeBrowsing download hash list.mattm@chromium.org2012-01-081-2/+4
| | | | | | | | | | BUG=108130 TEST=wireshark Review URL: http://codereview.chromium.org/9138003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116853 0039d316-1c4b-4281-b951-d872f2087c98
* net: Move UnescapeRule into the net namespace.tfarina@chromium.org2011-11-151-2/+2
| | | | | | | | | | | BUG=64263 TEST=None R=willchan@chromium.org Review URL: http://codereview.chromium.org/8552002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110085 0039d316-1c4b-4281-b951-d872f2087c98
* net: Move UnescapeURLComponent() functions into net namespace.tfarina@chromium.org2011-10-021-1/+1
| | | | | | | | | | | BUG=64263 TEST=None R=willchan@chromium.org Review URL: http://codereview.chromium.org/8109004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103677 0039d316-1c4b-4281-b951-d872f2087c98
* Convert SHA256_LENGTH from a constant-in-anonymous-enum to a static const. ↵pkasting@chromium.org2011-09-221-3/+3
| | | | | | | | | | | | | | This defines the constant where it's declared to preserve the existing readability. Normally this makes things like DCHECK_EQ() unhappy, but when I'd originally tested this I didn't seem to need to make any changes due to that. Will be watching the trybots... The original motiviation for this change was to find a way to eliminate some cases of passing anonymous-typed values as template arguments (which happens when you use a value from the enum in e.g. EXPECT_EQ()), which is technically illegal in C++03, though we don't warn about it. Simply naming the enum would have done this, but in general naming enums used to declare constants like this is bizarre ("enum Constants { ... }"?). BUG=92247 TEST=Compiles Review URL: http://codereview.chromium.org/7823004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102369 0039d316-1c4b-4281-b951-d872f2087c98
* net: Put more functions from escape.h into net namespace.tfarina@chromium.org2011-09-221-5/+6
| | | | | | | | | | | BUG=64263 TEST=None R=willchan@chromium.org Review URL: http://codereview.chromium.org/7978039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102271 0039d316-1c4b-4281-b951-d872f2087c98
* Add a whitelist for the new binary download protection.noelutz@google.com2011-09-211-0/+6
| | | | | | | | | | BUG=None TEST=SafeBrowsingDatabaseTest Review URL: http://codereview.chromium.org/7863006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102158 0039d316-1c4b-4281-b951-d872f2087c98
* Parse the whitelist expressions from the phishing verdict response ifnoelutz@google.com2011-08-311-13/+19
| | | | | | | | | | | | | there are any and check to see whether the current URL matches any of these whitelisted expressions. BUG= TEST=ClientSideDetectionServiceTest Review URL: http://codereview.chromium.org/7792004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98919 0039d316-1c4b-4281-b951-d872f2087c98
* Use a different tpl= parameter when reporting an error from client-side ↵bryner@chromium.org2011-05-261-1/+4
| | | | | | | | | | | | | phishing detection. This extends SafeBrowsingService::UrlCheckResult to add a new type for client-side phishing urls. BUG=83436 TEST=ClientSideDetectionHostTest Review URL: http://codereview.chromium.org/7076009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86915 0039d316-1c4b-4281-b951-d872f2087c98
* iwyu: Include stringprintf.h where appropriate, part 2.jhawkins@chromium.org2011-05-111-4/+7
| | | | | | | | | | | BUG=82098 TEST=none R=thakis@chromium.org Review URL: http://codereview.chromium.org/7004007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85048 0039d316-1c4b-4281-b951-d872f2087c98
* Change safe browsing download hash list name to real value.mattm@chromium.org2011-04-201-1/+1
| | | | | | | | | BUG=77943 TEST=with release build, download a malware binary, load about:histograms, SB2.DownloadChecks should have 4=1. Review URL: http://codereview.chromium.org/6879068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82230 0039d316-1c4b-4281-b951-d872f2087c98
* Move crypto files out of base, to a top level directory.rvargas@google.com2011-04-141-10/+10
| | | | | | | | | | | | | src/crypto is now an independent project that contains our cryptographic primitives (except md5 and sha1). This removes the base dependency from nss, openssl and sqlite. BUG=76996 TEST=none Review URL: http://codereview.chromium.org/6805019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81611 0039d316-1c4b-4281-b951-d872f2087c98
* Convert hash explicitly to string with the size of the char array. lzheng@chromium.org2011-03-141-0/+4
| | | | | | | | | TEST=safe_browsing_util_unittest BUG=76013 Review URL: http://codereview.chromium.org/6679046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78124 0039d316-1c4b-4281-b951-d872f2087c98
* Get rid of the xxxKey for safebrowsing lists. Looks to me we should be okay ↵lzheng@chromium.org2011-03-101-11/+4
| | | | | | | | | | | to use the full list name to figure out if a hash response if for a given list. TEST=safe_browsing_test stays green. BUG=none Review URL: http://codereview.chromium.org/6650008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77566 0039d316-1c4b-4281-b951-d872f2087c98
* Add a new SafeBrowsing list which contains a whitelist for the client-sidenoelutz@google.com2011-03-091-1/+7
| | | | | | | | | | | | | | | phishing detection. This whitelist will only contain full-length hashes and should be small (fewer than 1K entries). The whitelist is loaded in memory and is looked up on every page load before we start the client-side phishing detection. If the loaded URL is on the csd whitelist we won't start client-side phishing detection for that URL. BUG= TEST= Review URL: http://codereview.chromium.org/6592056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77494 0039d316-1c4b-4281-b951-d872f2087c98
* Lookup hash prefix in safebrowsing service.lzheng@chromium.org2011-02-161-11/+33
| | | | | | | | | | | | To achieve that, added an interface in safe browsing database and safe browsing service. TEST=safe_browsing_service_browsertest, safe_browsing_util_unittest, safe_browsing_database_unittest BUG=60822 Review URL: http://codereview.chromium.org/6299007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75049 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the unused enlarge.lzheng@chromium.org2011-01-141-10/+0
| | | | | | | | | TEST=none BUG=none Review URL: http://codereview.chromium.org/6151010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71462 0039d316-1c4b-4281-b951-d872f2087c98
* Handle download url list and binary hash list in safe browsing. Addedlzheng@chromium.org2010-12-151-7/+38
| | | | | | | | | | a switch to enable this feature on safebrowsing service level. TEST=safe_browsing_database_unittest.cc,safe_browsing_test.cc BUG=60822 Review URL: http://codereview.chromium.org/5209003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69275 0039d316-1c4b-4281-b951-d872f2087c98
* FBTF: Even more deinlining.erg@google.com2010-10-201-0/+25
| | | | | | | | | BUG=none TEST=compiles Review URL: http://codereview.chromium.org/3879002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63261 0039d316-1c4b-4281-b951-d872f2087c98
* Move Google-specific code under browser/ into browser/google/.evan@chromium.org2010-08-301-1/+1
| | | | | | | | | BUG=50548 TEST=compiles Review URL: http://codereview.chromium.org/3280008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57922 0039d316-1c4b-4281-b951-d872f2087c98
* Add ftp protocol to the safebrowsing checks. Fixed the crash with ↵inferno@chromium.org2010-06-021-1/+7
| | | | | | | | | | | canonicalization of non-standard urls in CanonicalizeUrl function. Add CanCheckUrl to a more central location. Added the null check in GeneratePathsToCheck. Remove redundant checks from resource dispatcher host. BUG=40605 TEST=SafeBrowsingUtilTest.CanonicalizeUrl Review URL: http://codereview.chromium.org/2471002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48720 0039d316-1c4b-4281-b951-d872f2087c98
* Canonicalize the url based on Section 6.1 Safe Browsing Spec.inferno@chromium.org2010-03-301-5/+147
| | | | | | | | BUG=7713 TEST=SafeBrowsingUtilTest.CanonicalizeUrl Review URL: http://codereview.chromium.org/1275002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43100 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor chunk ownership in SafeBrowsing code.shess@chromium.org2010-03-081-7/+16
| | | | | | | | | | | | | | | | | | | This attempts to clean up ownership so that it's more clear who creates and deletes the chunk data between parsing and storage in the database. SBChunkList replaces std::deque<SBChunk>, mostly to add correct cleanup in the destructor rather than requiring FreeChunks() to be called manually. Additionally remove deletion of chunk info from the database layer, now it processes const data. Additionally remove the need for SafeBrowsingDatabase to have a chunk-inserted callback by having the caller handle it directly. BUG=none TEST=none Review URL: http://codereview.chromium.org/668123 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40942 0039d316-1c4b-4281-b951-d872f2087c98
* Remove dead code from safe_browsing_util.h/cc.shess@chromium.org2010-02-181-327/+15
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/630012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39398 0039d316-1c4b-4281-b951-d872f2087c98
* The search terms are escaped using + or %20 for space depending on whether ↵avayvod@google.com2010-01-151-2/+2
| | | | | | | | | | | | replacement is in query part of the URL or not. Removed duplicate EscapeQueryParamValue functions without |use_plus| argument. BUG=24571 TEST=Verify that space is escaped as stated in description; see bug description for example with search on Wikipedia. Review URL: http://codereview.chromium.org/543077 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36398 0039d316-1c4b-4281-b951-d872f2087c98
* Adding product names to safe browsing report_error and report_phish URLs on ↵robertshield@chromium.org2009-12-031-2/+15
| | | | | | | | | | | | Windows. These names will be different for Google Chrome, Chromium and Chrome Frame. On Mac / Linux, leaving the name as "googlechrome" for all builds. BUG=None TEST=Verify that the safe browsing URLs are tagged with the correct product name for each product. Review URL: http://codereview.chromium.org/455035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33702 0039d316-1c4b-4281-b951-d872f2087c98
* Misc. cleanup of safe_browsing_util.cc:pkasting@chromium.org2009-12-031-167/+123
| | | | | | | | | | | | | | | | | | | | * Shorten code where easy to do so * Remove an unneeded line * Better function parameter names for one function * Be consistent about not using {} on one-line bodies (some places did, some didn't) * Be consistent about using "a" and "!a" instead of "a != 0" and "a == 0" (some places did one, some did the other) * No else after return/continue * Reduce duplicated code by reordering lines * Use for () instead of while () where doing so would shorten things * More comments in a few places * Use iterators in a few cases where doing so avoids more verbose or complex code * Name a few constants BUG=none TEST=none Review URL: http://codereview.chromium.org/452043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33695 0039d316-1c4b-4281-b951-d872f2087c98
* Make the safe_browsing_util.cc function definition order match the ↵pkasting@chromium.org2009-12-021-242/+252
| | | | | | | | | | declaration order. BUG=none TEST=none Review URL: http://codereview.chromium.org/460008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33545 0039d316-1c4b-4281-b951-d872f2087c98
* Clean up Safe Browsing code a little:pkasting@chromium.org2009-12-011-6/+3
| | | | | | | | | | | | | | * Update copyrights. * Remove unnecessary headers. * Remove useless functions. * Make declaration and definition order match (in at least the _database_bloom.* files). * Eliminate database_perftest.cc, since it seems to have been disabled entirely since before the public launch, and looks like it's perhaps irrelevant to the current code design. BUG=none TEST=none Review URL: http://codereview.chromium.org/457019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33479 0039d316-1c4b-4281-b951-d872f2087c98
* Move base64 from 'net/base' into 'base'.hayato@chromium.org2009-11-241-3/+3
| | | | | | | | | BUG=13572 TEST=none Review URL: http://codereview.chromium.org/399068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32918 0039d316-1c4b-4281-b951-d872f2087c98
* Change a phishing report URL param.paul@chromium.org2009-10-021-1/+1
| | | | | | | | | BUG=22542 TEST=None. Review URL: http://codereview.chromium.org/242110 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27804 0039d316-1c4b-4281-b951-d872f2087c98
* Use 'icu::' namespace explicitly throughout Chrome tree instead of relying ↵jshin@chromium.org2009-08-181-1/+1
| | | | | | | | | | | | | | | | | | | on 'using namespace icu'. This is Chrome's counterpart to the ICU header change that disables 'using namespace icu' (http://codereview.chromium.org/171010/show), which is required to avoid the name colission between Chrome's StringPiece (in base) and ICU's StringPiece. The webkit change (which is minor) will be dealt with in the webkit bugzilla. This can go in before the ICU change/upgrade without affecting anything. BUG=8198 TEST=All the targets are built without an error on all platforms. Review URL: http://codereview.chromium.org/171012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23613 0039d316-1c4b-4281-b951-d872f2087c98
* Separate the key setting code in the constructor of HMAC class into the Initwtc@chromium.org2009-05-051-3/+3
| | | | | | | | | | | | | | | | | | method. Overload the Init method for char* and std::string. Add DCHECKs to the destruction methods in ~HMAC in hmac_win.cc. The patch is written by Takeshi Yoshino <tyoshino@google.com>. Original code review: http://codereview.chromium.org/88062 R=wtc http://crbug.com/2297 TEST=base_unittests should pass. Safe browsing should continue to work. Review URL: http://codereview.chromium.org/113001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15353 0039d316-1c4b-4281-b951-d872f2087c98
* NO CODE CHANGE.maruel@google.com2009-03-051-1/+2
| | | | | | | Split the lines >80 cols. (Part 1) Review URL: http://codereview.chromium.org/39206 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11032 0039d316-1c4b-4281-b951-d872f2087c98
* Make safe_browsing_blocking_page.cc compile on Posix.jhawkins@chromium.org2009-02-191-3/+0
| | | | | | Review URL: http://codereview.chromium.org/21480 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9994 0039d316-1c4b-4281-b951-d872f2087c98
* Ignore GetHash results for lists that we don't support.paulg@google.com2009-01-081-0/+20
| | | | | | | BUG=5597 (http://crbug.com/5597) Review URL: http://codereview.chromium.org/16595 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7710 0039d316-1c4b-4281-b951-d872f2087c98
* Add support for 256 bit full hashes to the new implementation.paulg@google.com2008-11-111-0/+3
| | | | | | | | | This CL replaces the following, which seems to have become inaccessible: http://codereview.chromium.org/9202/ Review URL: http://codereview.chromium.org/10402 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5159 0039d316-1c4b-4281-b951-d872f2087c98
* Return without doing anything instead of dereferencing junk in unexpected cases.mark@chromium.org2008-10-161-0/+1
| | | | | | Review URL: http://codereview.chromium.org/7416 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3470 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup EOL and include guards, including fixing one guard that was not the ↵deanm@chromium.org2008-09-201-1/+0
| | | | | | | | correct path. Lack of EOL on bloom_filter.h had broken the Linux build, this is a fatal warning with GCC. Review URL: http://codereview.chromium.org/4007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2437 0039d316-1c4b-4281-b951-d872f2087c98
* Enable safe browsing tests exercising VerifyMAC. Reorder libraries to match ↵deanm@chromium.org2008-09-181-5/+0
| | | | | | | | | the dependency order required on Posix. Patch from Pawel Hajdan Jr. Review URL: http://codereview.chromium.org/3143 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2361 0039d316-1c4b-4281-b951-d872f2087c98
* Include chrome/browser/SConscript in Linux build.tc@google.com2008-09-171-1/+8
| | | | | | | | | | | | | | | In dns_host_info.cc there was probably a bug (hardcoded 1 instead of length. BUG=2333 R=mark,sgk Original patch by phajdan.jr@gmail.com at: http://codereview.chromium.org/2890 Review URL: http://codereview.chromium.org/3108 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2317 0039d316-1c4b-4281-b951-d872f2087c98