summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-18 16:54:58 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-18 16:54:58 +0000
commit0ad1d2d6eb6f1e4edff72dabb8e2b2f9ba051f88 (patch)
tree34d232d10e6415100d5b660317c23a14e157ba83 /net
parentdac096590a0f00f124eb71b12ff6a32cee439fca (diff)
downloadchromium_src-0ad1d2d6eb6f1e4edff72dabb8e2b2f9ba051f88.zip
chromium_src-0ad1d2d6eb6f1e4edff72dabb8e2b2f9ba051f88.tar.gz
chromium_src-0ad1d2d6eb6f1e4edff72dabb8e2b2f9ba051f88.tar.bz2
base: Put md5.* into base namespace.
BUG=89274 TEST=None R=evan@chromium.org Review URL: http://codereview.chromium.org/7395021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92861 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/http/http_auth_handler_digest.cc12
-rw-r--r--net/http/http_auth_handler_ntlm_portable.cc6
-rw-r--r--net/http/http_vary_data.cc10
-rw-r--r--net/http/http_vary_data.h10
-rw-r--r--net/server/http_server.cc4
-rw-r--r--net/websockets/websocket_handshake.cc4
-rw-r--r--net/websockets/websocket_handshake_handler.cc8
7 files changed, 27 insertions, 27 deletions
diff --git a/net/http/http_auth_handler_digest.cc b/net/http/http_auth_handler_digest.cc
index 28d2f58..da7a601 100644
--- a/net/http/http_auth_handler_digest.cc
+++ b/net/http/http_auth_handler_digest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -321,21 +321,21 @@ std::string HttpAuthHandlerDigest::AssembleResponseDigest(
const std::string& nc) const {
// ha1 = MD5(A1)
// TODO(eroman): is this the right encoding?
- std::string ha1 = MD5String(UTF16ToUTF8(username) + ":" + realm_ + ":" +
- UTF16ToUTF8(password));
+ std::string ha1 = base::MD5String(UTF16ToUTF8(username) + ":" + realm_ + ":" +
+ UTF16ToUTF8(password));
if (algorithm_ == HttpAuthHandlerDigest::ALGORITHM_MD5_SESS)
- ha1 = MD5String(ha1 + ":" + nonce_ + ":" + cnonce);
+ ha1 = base::MD5String(ha1 + ":" + nonce_ + ":" + cnonce);
// ha2 = MD5(A2)
// TODO(eroman): need to add MD5(req-entity-body) for qop=auth-int.
- std::string ha2 = MD5String(method + ":" + path);
+ std::string ha2 = base::MD5String(method + ":" + path);
std::string nc_part;
if (qop_ != HttpAuthHandlerDigest::QOP_UNSPECIFIED) {
nc_part = nc + ":" + cnonce + ":" + QopToString(qop_) + ":";
}
- return MD5String(ha1 + ":" + nonce_ + ":" + nc_part + ha2);
+ return base::MD5String(ha1 + ":" + nonce_ + ":" + nc_part + ha2);
}
std::string HttpAuthHandlerDigest::AssembleCredentials(
diff --git a/net/http/http_auth_handler_ntlm_portable.cc b/net/http/http_auth_handler_ntlm_portable.cc
index fac37c8..92b3e5b 100644
--- a/net/http/http_auth_handler_ntlm_portable.cc
+++ b/net/http/http_auth_handler_ntlm_portable.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -555,7 +555,7 @@ static int GenerateType3Msg(const string16& domain,
uint8 ntlm_hash[NTLM_HASH_LEN];
if (msg.flags & NTLM_NegotiateNTLM2Key) {
// compute NTLM2 session response
- MD5Digest session_hash;
+ base::MD5Digest session_hash;
uint8 temp[16];
memcpy(lm_resp, rand_8_bytes, 8);
@@ -563,7 +563,7 @@ static int GenerateType3Msg(const string16& domain,
memcpy(temp, msg.challenge, 8);
memcpy(temp + 8, lm_resp, 8);
- MD5Sum(temp, 16, &session_hash);
+ base::MD5Sum(temp, 16, &session_hash);
NTLM_Hash(password, ntlm_hash);
LM_Response(ntlm_hash, session_hash.a, ntlm_resp);
diff --git a/net/http/http_vary_data.cc b/net/http/http_vary_data.cc
index 09aab9d..cb41a36 100644
--- a/net/http/http_vary_data.cc
+++ b/net/http/http_vary_data.cc
@@ -20,8 +20,8 @@ HttpVaryData::HttpVaryData() : is_valid_(false) {
bool HttpVaryData::Init(const HttpRequestInfo& request_info,
const HttpResponseHeaders& response_headers) {
- MD5Context ctx;
- MD5Init(&ctx);
+ base::MD5Context ctx;
+ base::MD5Init(&ctx);
is_valid_ = false;
bool processed_header = false;
@@ -60,7 +60,7 @@ bool HttpVaryData::Init(const HttpRequestInfo& request_info,
if (!processed_header)
return false;
- MD5Final(&request_digest_, &ctx);
+ base::MD5Final(&request_digest_, &ctx);
return is_valid_ = true;
}
@@ -111,7 +111,7 @@ std::string HttpVaryData::GetRequestValue(
// static
void HttpVaryData::AddField(const HttpRequestInfo& request_info,
const std::string& request_header,
- MD5Context* ctx) {
+ base::MD5Context* ctx) {
std::string request_value = GetRequestValue(request_info, request_header);
// Append a character that cannot appear in the request header line so that we
@@ -120,7 +120,7 @@ void HttpVaryData::AddField(const HttpRequestInfo& request_info,
// For example, "foo: 12\nbar: 3" looks like "foo: 1\nbar: 23" otherwise.
request_value.append(1, '\n');
- MD5Update(ctx, request_value.data(), request_value.size());
+ base::MD5Update(ctx, request_value.data(), request_value.size());
}
} // namespace net
diff --git a/net/http/http_vary_data.h b/net/http/http_vary_data.h
index 876d867..5bc2c70 100644
--- a/net/http/http_vary_data.h
+++ b/net/http/http_vary_data.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef NET_HTTP_HTTP_VARY_DATA_H__
-#define NET_HTTP_HTTP_VARY_DATA_H__
+#ifndef NET_HTTP_HTTP_VARY_DATA_H_
+#define NET_HTTP_HTTP_VARY_DATA_H_
#pragma once
#include "base/md5.h"
@@ -72,10 +72,10 @@ class NET_TEST HttpVaryData {
// Append to the MD5 context for the given request header.
static void AddField(const HttpRequestInfo& request_info,
const std::string& request_header,
- MD5Context* context);
+ base::MD5Context* context);
// A digested version of the request headers corresponding to the Vary header.
- MD5Digest request_digest_;
+ base::MD5Digest request_digest_;
// True when request_digest_ contains meaningful data.
bool is_valid_;
@@ -83,4 +83,4 @@ class NET_TEST HttpVaryData {
} // namespace net
-#endif // NET_HTTP_HTTP_VARY_DATA_H__
+#endif // NET_HTTP_HTTP_VARY_DATA_H_
diff --git a/net/server/http_server.cc b/net/server/http_server.cc
index 9c18490..061731a 100644
--- a/net/server/http_server.cc
+++ b/net/server/http_server.cc
@@ -85,8 +85,8 @@ void HttpServer::AcceptWebSocket(
memcpy(data + 4, &fp2, 4);
memcpy(data + 8, &request.data[0], 8);
- MD5Digest digest;
- MD5Sum(data, 16, &digest);
+ base::MD5Digest digest;
+ base::MD5Sum(data, 16, &digest);
std::string origin = GetHeaderValue(request, "Origin");
std::string host = GetHeaderValue(request, "Host");
diff --git a/net/websockets/websocket_handshake.cc b/net/websockets/websocket_handshake.cc
index 07c7a85..789c6df 100644
--- a/net/websockets/websocket_handshake.cc
+++ b/net/websockets/websocket_handshake.cc
@@ -260,8 +260,8 @@ void WebSocketHandshake::Parameter::GetExpectedResponse(uint8 *expected) const {
SetChallengeNumber(&challenge[0], number_1_);
SetChallengeNumber(&challenge[4], number_2_);
memcpy(&challenge[8], key_3_.data(), kKey3Size);
- MD5Digest digest;
- MD5Sum(challenge, kExpectedResponseSize, &digest);
+ base::MD5Digest digest;
+ base::MD5Sum(challenge, kExpectedResponseSize, &digest);
memcpy(expected, digest.a, kExpectedResponseSize);
}
diff --git a/net/websockets/websocket_handshake_handler.cc b/net/websockets/websocket_handshake_handler.cc
index 4a424ca..398e084 100644
--- a/net/websockets/websocket_handshake_handler.cc
+++ b/net/websockets/websocket_handshake_handler.cc
@@ -435,8 +435,8 @@ bool WebSocketHandshakeResponseHandler::ParseResponseInfo(
response_message += "\r\n";
if (protocol_version_ < kMinVersionOfHybiNewHandshake) {
- MD5Digest digest;
- MD5Sum(challenge.data(), challenge.size(), &digest);
+ base::MD5Digest digest;
+ base::MD5Sum(challenge.data(), challenge.size(), &digest);
const char* digest_data = reinterpret_cast<char*>(digest.a);
response_message.append(digest_data, sizeof(digest.a));
@@ -490,8 +490,8 @@ bool WebSocketHandshakeResponseHandler::ParseResponseHeaderBlock(
response_message += "\r\n";
if (protocol_version_ < kMinVersionOfHybiNewHandshake) {
- MD5Digest digest;
- MD5Sum(challenge.data(), challenge.size(), &digest);
+ base::MD5Digest digest;
+ base::MD5Sum(challenge.data(), challenge.size(), &digest);
const char* digest_data = reinterpret_cast<char*>(digest.a);
response_message.append(digest_data, sizeof(digest.a));