summaryrefslogtreecommitdiffstats
path: root/chrome/browser/safe_browsing/safe_browsing_database.cc
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-14 17:37:14 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-14 17:37:14 +0000
commit4b559b4ddffc0b7f688019bcb80658f05e063af7 (patch)
tree0be21d8914de707f5125d2cb66733cbcf088606c /chrome/browser/safe_browsing/safe_browsing_database.cc
parent056dd45d610de34312344445d7b078a31f4a1e20 (diff)
downloadchromium_src-4b559b4ddffc0b7f688019bcb80658f05e063af7.zip
chromium_src-4b559b4ddffc0b7f688019bcb80658f05e063af7.tar.gz
chromium_src-4b559b4ddffc0b7f688019bcb80658f05e063af7.tar.bz2
Move crypto files out of base, to a top level directory.
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
Diffstat (limited to 'chrome/browser/safe_browsing/safe_browsing_database.cc')
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_database.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/chrome/browser/safe_browsing/safe_browsing_database.cc b/chrome/browser/safe_browsing/safe_browsing_database.cc
index ecc208c..0f979d4 100644
--- a/chrome/browser/safe_browsing/safe_browsing_database.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_database.cc
@@ -13,7 +13,7 @@
#include "base/time.h"
#include "base/message_loop.h"
#include "base/process_util.h"
-#include "base/sha2.h"
+#include "crypto/sha2.h"
#include "chrome/browser/safe_browsing/bloom_filter.h"
#include "chrome/browser/safe_browsing/prefix_set.h"
#include "chrome/browser/safe_browsing/safe_browsing_store_file.h"
@@ -71,8 +71,8 @@ void GetDownloadUrlPrefix(const GURL& url, SBPrefix* prefix) {
safe_browsing_util::CanonicalizeUrl(url, &hostname, &path, &query);
SBFullHash full_hash;
- base::SHA256HashString(hostname + path + query, &full_hash,
- sizeof(full_hash));
+ crypto::SHA256HashString(hostname + path + query, &full_hash,
+ sizeof(full_hash));
*prefix = full_hash.prefix;
}
@@ -103,8 +103,8 @@ void BrowseFullHashesToCheck(const GURL& url,
for (size_t j = 0; j < paths.size(); ++j) {
const std::string& path = paths[j];
SBFullHash full_hash;
- base::SHA256HashString(hosts[i] + path, &full_hash,
- sizeof(full_hash));
+ crypto::SHA256HashString(hosts[i] + path, &full_hash,
+ sizeof(full_hash));
full_hashes->push_back(full_hash);
// We may have /foo as path-prefix in the whitelist which should
@@ -113,8 +113,8 @@ void BrowseFullHashesToCheck(const GURL& url,
if (include_whitelist_hashes &&
path.size() > 1 &&
path[path.size() - 1] == '/') {
- base::SHA256HashString(hosts[i] + path.substr(0, path.size() - 1),
- &full_hash, sizeof(full_hash));
+ crypto::SHA256HashString(hosts[i] + path.substr(0, path.size() - 1),
+ &full_hash, sizeof(full_hash));
full_hashes->push_back(full_hash);
}
}
@@ -1297,7 +1297,8 @@ void SafeBrowsingDatabaseNew::LoadCsdWhitelist(
std::sort(new_csd_whitelist.begin(), new_csd_whitelist.end());
SBFullHash kill_switch;
- base::SHA256HashString(kCsdKillSwitchUrl, &kill_switch, sizeof(kill_switch));
+ crypto::SHA256HashString(kCsdKillSwitchUrl, &kill_switch,
+ sizeof(kill_switch));
if (std::binary_search(new_csd_whitelist.begin(), new_csd_whitelist.end(),
kill_switch)) {
// The kill switch is whitelisted hence we whitelist all URLs.