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; | |
126 #else | 123 #else |
127 #error Unknown platform. | 124 #error Unknown platform. |
128 #endif | 125 #endif |
129 // The callback is uncancellable, and GetClientCert requires selected_certs | 126 // The callback is uncancellable, and GetClientCert requires selected_certs |
130 // and client_cert_store to stay alive until the callback is called. So we | 127 // and client_cert_store to stay alive until the callback is called. So we |
131 // must give it a WeakPtr for |this|, and ownership of the other parameters. | 128 // must give it a WeakPtr for |this|, and ownership of the other parameters. |
132 net::CertificateList* selected_certs(new net::CertificateList()); | 129 net::CertificateList* selected_certs(new net::CertificateList()); |
133 client_cert_store->GetClientCerts( | 130 client_cert_store->GetClientCerts( |
134 *cert_request_info, selected_certs, | 131 *cert_request_info, selected_certs, |
135 base::Bind(&TokenValidatorBase::OnCertificatesSelected, | 132 base::Bind(&TokenValidatorBase::OnCertificatesSelected, |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 return std::string(); | 189 return std::string(); |
193 } | 190 } |
194 | 191 |
195 std::string shared_secret; | 192 std::string shared_secret; |
196 // Everything is valid, so return the shared secret to the caller. | 193 // Everything is valid, so return the shared secret to the caller. |
197 dict->GetStringWithoutPathExpansion("access_token", &shared_secret); | 194 dict->GetStringWithoutPathExpansion("access_token", &shared_secret); |
198 return shared_secret; | 195 return shared_secret; |
199 } | 196 } |
200 | 197 |
201 } // namespace remoting | 198 } // namespace remoting |
OLD | NEW |