diff options
author | peter <peter@chromium.org> | 2015-07-24 06:16:40 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-24 13:17:24 +0000 |
commit | 8abc01b225df94c4f1b614319ae786623f328ef5 (patch) | |
tree | f5ea8e32373ef472aa77fbebd87d20386ae13d04 /components/gcm_driver/crypto/gcm_encryption_provider.cc | |
parent | ce1e328bfd82d2ecd3857302e33e62be7041cd60 (diff) | |
download | chromium_src-8abc01b225df94c4f1b614319ae786623f328ef5.zip chromium_src-8abc01b225df94c4f1b614319ae786623f328ef5.tar.gz chromium_src-8abc01b225df94c4f1b614319ae786623f328ef5.tar.bz2 |
Revert of Hook up the Push API with GCM's new ability to own encryption keys. (patchset #6 id:160001 of https://codereview.chromium.org/1231613005/)
Reason for revert:
I broke the build. Sorry!
http://build.chromium.org/p/chromium.linux/builders/Linux%20GN%20Clobber/builds/3129/steps/compile/logs/stdio#error1
Original issue's description:
> Hook up the Push API with GCM's new ability to own encryption keys.
>
> This CL finishes implementing propagation of the "curve25519dh" attribute
> of the PushSubscription interface of the Push API. The public key will be
> provided by the GCM Driver, which internally uses the (new) GCMKeyStore.
>
> Encrypted messages cannot yet be received by GCM - that work remains. The
> functionality introduced in this CL is also still guarded behind the
> "--enable-push-message-payload" command line flag.
>
> BUG=486040
>
> Committed: https://crrev.com/23695aaa72c3c7c5176456c5ca4d3f7617be42fd
> Cr-Commit-Position: refs/heads/master@{#340263}
TBR=fgorski@chromium.org,jianli@chromium.org,johnme@chromium.org,thakis@chromium.org,avi@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=486040
Review URL: https://codereview.chromium.org/1259613002
Cr-Commit-Position: refs/heads/master@{#340268}
Diffstat (limited to 'components/gcm_driver/crypto/gcm_encryption_provider.cc')
-rw-r--r-- | components/gcm_driver/crypto/gcm_encryption_provider.cc | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/components/gcm_driver/crypto/gcm_encryption_provider.cc b/components/gcm_driver/crypto/gcm_encryption_provider.cc deleted file mode 100644 index 675507a..0000000 --- a/components/gcm_driver/crypto/gcm_encryption_provider.cc +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2015 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 "components/gcm_driver/crypto/gcm_encryption_provider.h" - -#include "base/bind.h" -#include "base/logging.h" -#include "components/gcm_driver/crypto/gcm_key_store.h" -#include "components/gcm_driver/crypto/proto/gcm_encryption_data.pb.h" - -namespace gcm { - -// Directory in the GCM Store in which the encryption database will be stored. -const base::FilePath::CharType kEncryptionDirectoryName[] = - FILE_PATH_LITERAL("Encryption"); - -GCMEncryptionProvider::GCMEncryptionProvider() - : weak_ptr_factory_(this) { -} - -GCMEncryptionProvider::~GCMEncryptionProvider() { -} - -void GCMEncryptionProvider::Init( - const base::FilePath& store_path, - const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner) { - DCHECK(!key_store_); - - base::FilePath encryption_store_path = store_path; - - // |store_path| can be empty in tests, which means that the database should - // be created in memory rather than on-disk. - if (!store_path.empty()) - encryption_store_path = store_path.Append(kEncryptionDirectoryName); - - key_store_ = new GCMKeyStore(encryption_store_path, blocking_task_runner); -} - -void GCMEncryptionProvider::GetPublicKey(const std::string& app_id, - const PublicKeyCallback& callback) { - DCHECK(key_store_); - key_store_->GetKeys( - app_id, base::Bind(&GCMEncryptionProvider::DidGetPublicKey, - weak_ptr_factory_.GetWeakPtr(), app_id, callback)); -} - -void GCMEncryptionProvider::DidGetPublicKey(const std::string& app_id, - const PublicKeyCallback& callback, - const KeyPair& pair) { - if (!pair.IsInitialized()) { - key_store_->CreateKeys( - app_id, base::Bind(&GCMEncryptionProvider::DidCreatePublicKey, - weak_ptr_factory_.GetWeakPtr(), callback)); - return; - } - - DCHECK_EQ(KeyPair::ECDH_CURVE_25519, pair.type()); - callback.Run(pair.public_key()); -} - -void GCMEncryptionProvider::DidCreatePublicKey( - const PublicKeyCallback& callback, - const KeyPair& pair) { - if (!pair.IsInitialized()) { - callback.Run(std::string()); - return; - } - - DCHECK_EQ(KeyPair::ECDH_CURVE_25519, pair.type()); - callback.Run(pair.public_key()); -} - -} // namespace gcm |