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

Unified Diff: chrome/browser/ssl/ssl_add_certificate.cc

Issue 11266008: Fix certificate and keychain installation on Android. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: separate android and openssl CertDatabase implementations Created 8 years 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/ssl/ssl_add_certificate.h ('k') | chrome/browser/ssl/ssl_add_certificate_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ssl/ssl_add_certificate.cc
diff --git a/chrome/browser/ssl/ssl_add_certificate.cc b/chrome/browser/ssl/ssl_add_certificate.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a21c843f26129ee2e73c826ec77dae1992a6beb4
--- /dev/null
+++ b/chrome/browser/ssl/ssl_add_certificate.cc
@@ -0,0 +1,37 @@
+// 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.
+
+#include "chrome/browser/ssl/ssl_add_certificate.h"
+
+#include "chrome/browser/ssl/ssl_add_cert_handler.h"
+#include "net/base/x509_certificate.h"
+
+namespace chrome {
+
+void SSLAddCertificate(
+ net::URLRequest* request,
+ net::CertificateMimeType cert_type,
+ const void* cert_data,
+ size_t cert_size,
+ int render_process_id,
+ int render_view_id) {
+ // Chromium only supports X.509 User certificates on non-Android
+ // platforms. Note that this method should not be called for other
+ // certificate mime types.
+ if (cert_type != net::CERTIFICATE_MIME_TYPE_X509_USER_CERT)
+ return;
+
+ scoped_refptr<net::X509Certificate> cert;
+ if (cert_data != NULL) {
+ cert = net::X509Certificate::CreateFromBytes(
+ reinterpret_cast<const char*>(cert_data), cert_size);
+ }
+ // NOTE: Passing a NULL cert pointer if |cert_data| was NULL is
+ // intentional here.
+
+ // The handler will run the UI and delete itself when it's finished.
+ new SSLAddCertHandler(request, cert, render_process_id, render_view_id);
+}
+
+} // namespace chrome
« no previous file with comments | « chrome/browser/ssl/ssl_add_certificate.h ('k') | chrome/browser/ssl/ssl_add_certificate_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698