diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-09 17:47:35 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-09 17:47:35 +0000 |
commit | 109ca1cf9b29865a0f99dc99f379784dc980ac46 (patch) | |
tree | 4c16d6b37502c63e06a39cebe065b48c26ced764 /chrome/browser/password_manager/encryptor_linux.cc | |
parent | 15a9b5d62a88c344af81ca28a393dc5c954162c6 (diff) | |
download | chromium_src-109ca1cf9b29865a0f99dc99f379784dc980ac46.zip chromium_src-109ca1cf9b29865a0f99dc99f379784dc980ac46.tar.gz chromium_src-109ca1cf9b29865a0f99dc99f379784dc980ac46.tar.bz2 |
Add dummy encryptor implementations for mac and linux.
Review URL: http://codereview.chromium.org/43095
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13435 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/password_manager/encryptor_linux.cc')
-rw-r--r-- | chrome/browser/password_manager/encryptor_linux.cc | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/chrome/browser/password_manager/encryptor_linux.cc b/chrome/browser/password_manager/encryptor_linux.cc new file mode 100644 index 0000000..9c40c37 --- /dev/null +++ b/chrome/browser/password_manager/encryptor_linux.cc @@ -0,0 +1,44 @@ +// Copyright (c) 2006-2008 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. + +#include "chrome/browser/password_manager/encryptor.h" + +#include "base/logging.h" +#include "base/string_util.h" + +bool Encryptor::EncryptString16(const string16& plaintext, + std::string* ciphertext) { + return EncryptString(UTF16ToUTF8(plaintext), ciphertext); +} + +bool Encryptor::DecryptString16(const std::string& ciphertext, + string16* plaintext) { + std::string utf8; + if (!DecryptString(ciphertext, &utf8)) + return false; + + *plaintext = UTF8ToUTF16(utf8); + return true; +} + +bool Encryptor::EncryptString(const std::string& plaintext, + std::string* ciphertext) { + // This doesn't actually encrypt, we need to work on the Encryptor API. + // http://code.google.com/p/chromium/issues/detail?id=8205 + NOTIMPLEMENTED(); + + // this does a copy + ciphertext->assign(plaintext.data(), plaintext.length()); + return true; +} + +bool Encryptor::DecryptString(const std::string& ciphertext, + std::string* plaintext) { + // This doesn't actually decrypt, we need to work on the Encryptor API. + // http://code.google.com/p/chromium/issues/detail?id=8205 + NOTIMPLEMENTED(); + + plaintext->assign(ciphertext.data(), ciphertext.length()); + return true; +} |