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

Unified Diff: google_apis/cup/client_update_protocol_openssl.cc

Issue 15793005: Per discussion, implement the Omaha Client Update Protocol (CUP) in src/crypto. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 6 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
Index: google_apis/cup/client_update_protocol_openssl.cc
===================================================================
--- google_apis/cup/client_update_protocol_openssl.cc (revision 0)
+++ google_apis/cup/client_update_protocol_openssl.cc (revision 0)
@@ -0,0 +1,58 @@
+
+// Copyright (c) 2013 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 "google_apis/cup/client_update_protocol.h"
+
+#include "base/logging.h"
+
+class OpenSSLCupKeyImpl : public ClientUpdateProtocol::CupKeyImpl {
+ public:
+ OpenSSLCupKeyImpl();
+ virtual ~OpenSSLCupKeyImpl();
+
+ virtual size_t PublicKeyLength() const OVERRIDE;
+ virtual std::vector<uint8> EncryptKeySource(
+ const std::vector<uint8>& key_source) OVERRIDE;
+
+ bool LoadPublicKey(const base::StringPiece& public_key);
+};
+
+OpenSSLCupKeyImpl::OpenSSLCupKeyImpl() {
+ NOTIMPLEMENTED();
+}
+
+OpenSSLCupKeyImpl::~OpenSSLCupKeyImpl() {
+ NOTIMPLEMENTED();
+}
+
+bool OpenSSLCupKeyImpl::LoadPublicKey(
+ const base::StringPiece& public_key) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+size_t OpenSSLCupKeyImpl::PublicKeyLength() const {
+ NOTIMPLEMENTED();
+ return 0;
+}
+
+std::vector<uint8> OpenSSLCupKeyImpl::EncryptKeySource(
+ const std::vector<uint8>& key_source) {
+ NOTIMPLEMENTED();
+ return std::vector<uint8>();
+}
+
+ClientUpdateProtocol::CupKeyImpl* ClientUpdateProtocol::GetCupKeyImpl(
+ const base::StringPiece& public_key) {
+ scoped_ptr<OpenSSLCupKeyImpl> result(new OpenSSLCupKeyImpl());
+ if (!result.get())
+ return NULL;
+
+ if (!result->LoadPublicKey(public_key))
+ return NULL;
+
+ return result.release();
+}
+

Powered by Google App Engine
This is Rietveld 408576698