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

Side by Side Diff: chromeos/network/client_cert_resolver.cc

Issue 36593002: crypto/nss_util: Get TPM slot id, do lookup by id instead of by name. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rename tpm_token_slot to tpm_token_slot_id, change InitializeTPMToken arg order Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chromeos/cert_loader.cc ('k') | chromeos/network/network_connection_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "chromeos/network/client_cert_resolver.h" 5 #include "chromeos/network/client_cert_resolver.h"
6 6
7 #include <cert.h> 7 #include <cert.h>
8 #include <certt.h> // for (SECCertUsageEnum) certUsageAnyCA 8 #include <certt.h> // for (SECCertUsageEnum) certUsageAnyCA
9 #include <pk11pub.h> 9 #include <pk11pub.h>
10 10
11 #include <algorithm> 11 #include <algorithm>
12 #include <string> 12 #include <string>
13 13
14 #include "base/stl_util.h" 14 #include "base/stl_util.h"
15 #include "base/strings/string_number_conversions.h"
15 #include "base/task_runner.h" 16 #include "base/task_runner.h"
16 #include "base/threading/worker_pool.h" 17 #include "base/threading/worker_pool.h"
17 #include "base/time/time.h" 18 #include "base/time/time.h"
18 #include "chromeos/cert_loader.h" 19 #include "chromeos/cert_loader.h"
19 #include "chromeos/dbus/dbus_thread_manager.h" 20 #include "chromeos/dbus/dbus_thread_manager.h"
20 #include "chromeos/dbus/shill_service_client.h" 21 #include "chromeos/dbus/shill_service_client.h"
21 #include "chromeos/network/certificate_pattern.h" 22 #include "chromeos/network/certificate_pattern.h"
22 #include "chromeos/network/client_cert_util.h" 23 #include "chromeos/network/client_cert_util.h"
23 #include "chromeos/network/favorite_state.h" 24 #include "chromeos/network/favorite_state.h"
24 #include "chromeos/network/managed_network_configuration_handler.h" 25 #include "chromeos/network/managed_network_configuration_handler.h"
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 weak_ptr_factory_.GetWeakPtr(), 425 weak_ptr_factory_.GetWeakPtr(),
425 base::Owned(matches))); 426 base::Owned(matches)));
426 } 427 }
427 428
428 void ClientCertResolver::ConfigureCertificates(NetworkCertMatches* matches) { 429 void ClientCertResolver::ConfigureCertificates(NetworkCertMatches* matches) {
429 for (NetworkCertMatches::const_iterator it = matches->begin(); 430 for (NetworkCertMatches::const_iterator it = matches->begin();
430 it != matches->end(); ++it) { 431 it != matches->end(); ++it) {
431 VLOG(1) << "Configuring certificate of network " << it->service_path; 432 VLOG(1) << "Configuring certificate of network " << it->service_path;
432 CertLoader* cert_loader = CertLoader::Get(); 433 CertLoader* cert_loader = CertLoader::Get();
433 base::DictionaryValue shill_properties; 434 base::DictionaryValue shill_properties;
434 client_cert::SetShillProperties(it->cert_config_type, 435 client_cert::SetShillProperties(
435 cert_loader->tpm_token_slot(), 436 it->cert_config_type,
436 cert_loader->tpm_user_pin(), 437 base::IntToString(cert_loader->tpm_token_slot_id()),
437 &it->pkcs11_id, 438 cert_loader->tpm_user_pin(),
438 &shill_properties); 439 &it->pkcs11_id,
440 &shill_properties);
439 DBusThreadManager::Get()->GetShillServiceClient()-> 441 DBusThreadManager::Get()->GetShillServiceClient()->
440 SetProperties(dbus::ObjectPath(it->service_path), 442 SetProperties(dbus::ObjectPath(it->service_path),
441 shill_properties, 443 shill_properties,
442 base::Bind(&base::DoNothing), 444 base::Bind(&base::DoNothing),
443 base::Bind(&LogError, it->service_path)); 445 base::Bind(&LogError, it->service_path));
444 network_state_handler_->RequestUpdateForNetwork(it->service_path); 446 network_state_handler_->RequestUpdateForNetwork(it->service_path);
445 } 447 }
446 } 448 }
447 449
448 } // namespace chromeos 450 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/cert_loader.cc ('k') | chromeos/network/network_connection_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698