Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Unified Diff: net/base/transport_security_state.cc

Issue 6805019: Move crypto files out of base, to a top level directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/base/transport_security_state.cc
===================================================================
--- net/base/transport_security_state.cc (revision 80572)
+++ net/base/transport_security_state.cc (working copy)
@@ -9,12 +9,12 @@
#include "base/json/json_writer.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
-#include "base/sha2.h"
#include "base/string_number_conversions.h"
#include "base/string_tokenizer.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"
+#include "crypto/sha2.h"
#include "googleurl/src/gurl.h"
#include "net/base/dns_util.h"
@@ -36,8 +36,8 @@
if (IsPreloadedSTS(canonicalized_host, &temp))
return;
- char hashed[base::SHA256_LENGTH];
- base::SHA256HashString(canonicalized_host, hashed, sizeof(hashed));
+ char hashed[crypto::SHA256_LENGTH];
+ crypto::SHA256HashString(canonicalized_host, hashed, sizeof(hashed));
// Use the original creation date if we already have this host.
DomainState state_copy(state);
@@ -58,8 +58,8 @@
if (canonicalized_host.empty())
return false;
- char hashed[base::SHA256_LENGTH];
- base::SHA256HashString(canonicalized_host, hashed, sizeof(hashed));
+ char hashed[crypto::SHA256_LENGTH];
+ crypto::SHA256HashString(canonicalized_host, hashed, sizeof(hashed));
std::map<std::string, DomainState>::iterator i = enabled_hosts_.find(
std::string(hashed, sizeof(hashed)));
@@ -98,10 +98,10 @@
base::Time current_time(base::Time::Now());
for (size_t i = 0; canonicalized_host[i]; i += canonicalized_host[i] + 1) {
- char hashed_domain[base::SHA256_LENGTH];
+ char hashed_domain[crypto::SHA256_LENGTH];
- base::SHA256HashString(IncludeNUL(&canonicalized_host[i]), &hashed_domain,
- sizeof(hashed_domain));
+ crypto::SHA256HashString(IncludeNUL(&canonicalized_host[i]), &hashed_domain,
+ sizeof(hashed_domain));
std::map<std::string, DomainState>::iterator j =
enabled_hosts_.find(std::string(hashed_domain, sizeof(hashed_domain)));
if (j == enabled_hosts_.end())
@@ -280,7 +280,7 @@
static std::string ExternalStringToHashedDomain(const std::string& external) {
std::string out;
if (!base::Base64Decode(external, &out) ||
- out.size() != base::SHA256_LENGTH) {
+ out.size() != crypto::SHA256_LENGTH) {
return std::string();
}

Powered by Google App Engine
This is Rietveld 408576698