summaryrefslogtreecommitdiffstats
path: root/sync/util/data_encryption_win.cc
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-25 04:28:42 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-25 04:28:42 +0000
commitb6df29d526292b9c98948f5794f22450b3c5be91 (patch)
tree393ae8b9e97f2ae8382b1d025737c7482838588a /sync/util/data_encryption_win.cc
parent233a6cceddb7c3446959ac6d590901f0a6365949 (diff)
downloadchromium_src-b6df29d526292b9c98948f5794f22450b3c5be91.zip
chromium_src-b6df29d526292b9c98948f5794f22450b3c5be91.tar.gz
chromium_src-b6df29d526292b9c98948f5794f22450b3c5be91.tar.bz2
sync: Move data_encryption_win.h into syncer namespace.
R=akalin@chromium.org TBR=dhollowa@chromium.org # for autofill Review URL: https://chromiumcodereview.appspot.com/11421047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169392 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/util/data_encryption_win.cc')
-rw-r--r--sync/util/data_encryption_win.cc17
1 files changed, 7 insertions, 10 deletions
diff --git a/sync/util/data_encryption_win.cc b/sync/util/data_encryption_win.cc
index bdc1e9d..943f849 100644
--- a/sync/util/data_encryption_win.cc
+++ b/sync/util/data_encryption_win.cc
@@ -1,8 +1,6 @@
// Copyright (c) 2012 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.
-//
-// NOTE: this file is Winodws specific.
#include "sync/util/data_encryption_win.h"
@@ -10,8 +8,6 @@
#include <wincrypt.h>
#include <cstddef>
-#include <string>
-#include <vector>
#include "base/logging.h"
@@ -21,10 +17,9 @@
// chrome/browser/password_manager/encryptor_win.cc. Preferably, all
// this stuff would live in crypto/.
-using std::string;
-using std::vector;
+namespace syncer {
-vector<uint8> EncryptData(const string& data) {
+std::vector<uint8> EncryptData(const std::string& data) {
DATA_BLOB unencrypted_data = { 0 };
unencrypted_data.pbData = (BYTE*)(data.data());
unencrypted_data.cbData = data.size();
@@ -34,13 +29,13 @@ vector<uint8> EncryptData(const string& data) {
&encrypted_data))
LOG(ERROR) << "Encryption fails: " << data;
- vector<uint8> result(encrypted_data.pbData,
- encrypted_data.pbData + encrypted_data.cbData);
+ std::vector<uint8> result(encrypted_data.pbData,
+ encrypted_data.pbData + encrypted_data.cbData);
LocalFree(encrypted_data.pbData);
return result;
}
-bool DecryptData(const vector<uint8>& in_data, string* out_data) {
+bool DecryptData(const std::vector<uint8>& in_data, std::string* out_data) {
DATA_BLOB encrypted_data, decrypted_data;
encrypted_data.pbData =
(in_data.empty() ? NULL : const_cast<BYTE*>(&in_data[0]));
@@ -58,3 +53,5 @@ bool DecryptData(const vector<uint8>& in_data, string* out_data) {
return true;
}
}
+
+} // namespace syncer