OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/android/ssl_client_certificate_request.h" | 5 #include "chrome/browser/ui/android/ssl_client_certificate_request.h" |
6 | 6 |
7 #include "base/android/jni_array.h" | 7 #include "base/android/jni_array.h" |
8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
9 #include "base/android/scoped_java_ref.h" | 9 #include "base/android/scoped_java_ref.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/callback_helpers.h" | 12 #include "base/callback_helpers.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "chrome/browser/ssl/ssl_client_certificate_selector.h" | 15 #include "chrome/browser/ssl/ssl_client_certificate_selector.h" |
16 #include "chrome/browser/ui/android/window_android_helper.h" | 16 #include "chrome/browser/ui/android/window_android_helper.h" |
17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
18 #include "crypto/scoped_openssl_types.h" | 18 #include "crypto/scoped_openssl_types.h" |
19 #include "jni/SSLClientCertificateRequest_jni.h" | 19 #include "jni/SSLClientCertificateRequest_jni.h" |
20 #include "net/android/keystore_openssl.h" | 20 #include "net/android/keystore_openssl.h" |
21 #include "net/base/host_port_pair.h" | 21 #include "net/base/host_port_pair.h" |
22 #include "net/cert/cert_database.h" | 22 #include "net/cert/cert_database.h" |
23 #include "net/cert/x509_certificate.h" | 23 #include "net/cert/x509_certificate.h" |
24 #include "net/ssl/openssl_client_key_store.h" | 24 #include "net/ssl/openssl_client_key_store.h" |
25 #include "net/ssl/ssl_cert_request_info.h" | 25 #include "net/ssl/ssl_cert_request_info.h" |
26 #include "net/ssl/ssl_client_cert_type.h" | 26 #include "net/ssl/ssl_client_cert_type.h" |
27 #include "ui/base/android/window_android.h" | 27 #include "ui/android/window_android.h" |
28 | |
29 | 28 |
30 namespace chrome { | 29 namespace chrome { |
31 | 30 |
32 namespace { | 31 namespace { |
33 | 32 |
34 // Must be called on the I/O thread to record a client certificate | 33 // Must be called on the I/O thread to record a client certificate |
35 // and its private key in the OpenSSLClientKeyStore. | 34 // and its private key in the OpenSSLClientKeyStore. |
36 void RecordClientCertificateKey( | 35 void RecordClientCertificateKey( |
37 const scoped_refptr<net::X509Certificate>& client_cert, | 36 const scoped_refptr<net::X509Certificate>& client_cert, |
38 crypto::ScopedEVP_PKEY private_key) { | 37 crypto::ScopedEVP_PKEY private_key) { |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 net::SSLCertRequestInfo* cert_request_info, | 228 net::SSLCertRequestInfo* cert_request_info, |
230 const chrome::SelectCertificateCallback& callback) { | 229 const chrome::SelectCertificateCallback& callback) { |
231 ui::WindowAndroid* window = | 230 ui::WindowAndroid* window = |
232 WindowAndroidHelper::FromWebContents(contents)->GetWindowAndroid(); | 231 WindowAndroidHelper::FromWebContents(contents)->GetWindowAndroid(); |
233 DCHECK(window); | 232 DCHECK(window); |
234 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 233 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
235 StartClientCertificateRequest(cert_request_info, window, callback); | 234 StartClientCertificateRequest(cert_request_info, window, callback); |
236 } | 235 } |
237 | 236 |
238 } // namespace chrome | 237 } // namespace chrome |
OLD | NEW |