Chromium Code Reviews| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 229 ContinueWithCertificate( | 229 ContinueWithCertificate( |
| 230 best_match_position->get(), | 230 best_match_position->get(), |
| 231 net::FetchClientCertPrivateKey(best_match_position->get()).get()); | 231 net::FetchClientCertPrivateKey(best_match_position->get()).get()); |
| 232 } | 232 } |
| 233 } | 233 } |
| 234 | 234 |
| 235 void TokenValidatorBase::ContinueWithCertificate( | 235 void TokenValidatorBase::ContinueWithCertificate( |
| 236 net::X509Certificate* client_cert, | 236 net::X509Certificate* client_cert, |
| 237 net::SSLPrivateKey* client_private_key) { | 237 net::SSLPrivateKey* client_private_key) { |
| 238 if (request_) { | 238 if (request_) { |
| 239 if (client_cert) { | |
| 240 LOG(INFO) << "Using certificate issued by: '" | |
|
Lambros
2017/01/25 22:39:31
Use HOST_LOG instead to avoid presubmit errors fro
joedow
2017/01/25 23:33:54
Done.
| |
| 241 << client_cert->issuer().common_name << "'"; | |
| 242 } | |
| 243 | |
| 239 request_->ContinueWithCertificate(client_cert, client_private_key); | 244 request_->ContinueWithCertificate(client_cert, client_private_key); |
| 240 } | 245 } |
| 241 } | 246 } |
| 242 | 247 |
| 243 bool TokenValidatorBase::IsValidScope(const std::string& token_scope) { | 248 bool TokenValidatorBase::IsValidScope(const std::string& token_scope) { |
| 244 // TODO(rmsousa): Deal with reordering/subsets/supersets/aliases/etc. | 249 // TODO(rmsousa): Deal with reordering/subsets/supersets/aliases/etc. |
| 245 return token_scope == token_scope_; | 250 return token_scope == token_scope_; |
| 246 } | 251 } |
| 247 | 252 |
| 248 std::string TokenValidatorBase::ProcessResponse(int net_result) { | 253 std::string TokenValidatorBase::ProcessResponse(int net_result) { |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 275 return std::string(); | 280 return std::string(); |
| 276 } | 281 } |
| 277 | 282 |
| 278 std::string shared_secret; | 283 std::string shared_secret; |
| 279 // Everything is valid, so return the shared secret to the caller. | 284 // Everything is valid, so return the shared secret to the caller. |
| 280 dict->GetStringWithoutPathExpansion("access_token", &shared_secret); | 285 dict->GetStringWithoutPathExpansion("access_token", &shared_secret); |
| 281 return shared_secret; | 286 return shared_secret; |
| 282 } | 287 } |
| 283 | 288 |
| 284 } // namespace remoting | 289 } // namespace remoting |
| OLD | NEW |