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

Unified Diff: chrome/browser/sync/util/data_encryption.cc

Issue 9699057: [Sync] Move 'sync' target to sync/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Tim's comments Created 8 years, 9 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
« no previous file with comments | « chrome/browser/sync/util/data_encryption.h ('k') | chrome/browser/sync/util/data_encryption_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/util/data_encryption.cc
diff --git a/chrome/browser/sync/util/data_encryption.cc b/chrome/browser/sync/util/data_encryption.cc
deleted file mode 100644
index 10f19ec40e9b36304fd4e46ded8ea6130404f8fd..0000000000000000000000000000000000000000
--- a/chrome/browser/sync/util/data_encryption.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright (c) 2010 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 "chrome/browser/sync/util/data_encryption.h"
-
-#include <windows.h>
-#include <wincrypt.h>
-
-#include <cstddef>
-#include <string>
-#include <vector>
-
-#include "base/logging.h"
-
-using std::string;
-using std::vector;
-
-vector<uint8> EncryptData(const string& data) {
- DATA_BLOB unencrypted_data = { 0 };
- unencrypted_data.pbData = (BYTE*)(data.data());
- unencrypted_data.cbData = data.size();
- DATA_BLOB encrypted_data = { 0 };
-
- if (!CryptProtectData(&unencrypted_data, L"", NULL, NULL, NULL, 0,
- &encrypted_data))
- LOG(ERROR) << "Encryption fails: " << data;
-
- 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) {
- DATA_BLOB encrypted_data, decrypted_data;
- encrypted_data.pbData =
- (in_data.empty() ? NULL : const_cast<BYTE*>(&in_data[0]));
- encrypted_data.cbData = in_data.size();
- LPWSTR descrip = L"";
-
- if (!CryptUnprotectData(&encrypted_data, &descrip, NULL, NULL, NULL, 0,
- &decrypted_data)) {
- LOG(ERROR) << "Decryption fails: ";
- return false;
- } else {
- out_data->assign(reinterpret_cast<const char*>(decrypted_data.pbData),
- decrypted_data.cbData);
- LocalFree(decrypted_data.pbData);
- return true;
- }
-}
« no previous file with comments | « chrome/browser/sync/util/data_encryption.h ('k') | chrome/browser/sync/util/data_encryption_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698