OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "remoting/host/token_validator_base.h" | 5 #include "remoting/host/token_validator_base.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 DCHECK_EQ(request_.get(), source); | 113 DCHECK_EQ(request_.get(), source); |
114 | 114 |
115 net::ClientCertStore* client_cert_store; | 115 net::ClientCertStore* client_cert_store; |
116 #if defined(USE_NSS) | 116 #if defined(USE_NSS) |
117 client_cert_store = new net::ClientCertStoreNSS( | 117 client_cert_store = new net::ClientCertStoreNSS( |
118 net::ClientCertStoreNSS::PasswordDelegateFactory()); | 118 net::ClientCertStoreNSS::PasswordDelegateFactory()); |
119 #elif defined(OS_WIN) | 119 #elif defined(OS_WIN) |
120 client_cert_store = new net::ClientCertStoreWin(); | 120 client_cert_store = new net::ClientCertStoreWin(); |
121 #elif defined(OS_MACOSX) | 121 #elif defined(OS_MACOSX) |
122 client_cert_store = new net::ClientCertStoreMac(); | 122 client_cert_store = new net::ClientCertStoreMac(); |
| 123 #elif defined(USE_OPENSSL) |
| 124 // OpenSSL does not use the ClientCertStore infrastructure. |
| 125 client_cert_store = NULL; |
123 #else | 126 #else |
124 #error Unknown platform. | 127 #error Unknown platform. |
125 #endif | 128 #endif |
126 // The callback is uncancellable, and GetClientCert requires selected_certs | 129 // The callback is uncancellable, and GetClientCert requires selected_certs |
127 // and client_cert_store to stay alive until the callback is called. So we | 130 // and client_cert_store to stay alive until the callback is called. So we |
128 // must give it a WeakPtr for |this|, and ownership of the other parameters. | 131 // must give it a WeakPtr for |this|, and ownership of the other parameters. |
129 net::CertificateList* selected_certs(new net::CertificateList()); | 132 net::CertificateList* selected_certs(new net::CertificateList()); |
130 client_cert_store->GetClientCerts( | 133 client_cert_store->GetClientCerts( |
131 *cert_request_info, selected_certs, | 134 *cert_request_info, selected_certs, |
132 base::Bind(&TokenValidatorBase::OnCertificatesSelected, | 135 base::Bind(&TokenValidatorBase::OnCertificatesSelected, |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 return std::string(); | 192 return std::string(); |
190 } | 193 } |
191 | 194 |
192 std::string shared_secret; | 195 std::string shared_secret; |
193 // Everything is valid, so return the shared secret to the caller. | 196 // Everything is valid, so return the shared secret to the caller. |
194 dict->GetStringWithoutPathExpansion("access_token", &shared_secret); | 197 dict->GetStringWithoutPathExpansion("access_token", &shared_secret); |
195 return shared_secret; | 198 return shared_secret; |
196 } | 199 } |
197 | 200 |
198 } // namespace remoting | 201 } // namespace remoting |
OLD | NEW |