| 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/chromeos/attestation/attestation_policy_observer.h" | 5 #include "chrome/browser/chromeos/attestation/attestation_policy_observer.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/location.h" | 11 #include "base/location.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "chrome/browser/chrome_notification_types.h" | 13 #include "chrome/browser/chrome_notification_types.h" |
| 14 #include "chrome/browser/chromeos/attestation/attestation_ca_client.h" | 14 #include "chrome/browser/chromeos/attestation/attestation_ca_client.h" |
| 15 #include "chrome/browser/chromeos/attestation/attestation_key_payload.pb.h" | 15 #include "chrome/browser/chromeos/attestation/attestation_key_payload.pb.h" |
| 16 #include "chrome/browser/chromeos/settings/cros_settings.h" | 16 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 17 #include "chrome/browser/policy/cloud/cloud_policy_client.h" | 17 #include "chrome/browser/policy/cloud/cloud_policy_client.h" |
| 18 #include "chrome/browser/policy/cloud/cloud_policy_manager.h" | 18 #include "chrome/browser/policy/cloud/cloud_policy_manager.h" |
| 19 #include "chromeos/attestation/attestation_flow.h" | 19 #include "chromeos/attestation/attestation_flow.h" |
| 20 #include "chromeos/cryptohome/async_method_caller.h" | 20 #include "chromeos/cryptohome/async_method_caller.h" |
| 21 #include "chromeos/dbus/cryptohome_client.h" | 21 #include "chromeos/dbus/cryptohome_client.h" |
| 22 #include "chromeos/dbus/dbus_method_call_status.h" | 22 #include "chromeos/dbus/dbus_method_call_status.h" |
| 23 #include "chromeos/dbus/dbus_thread_manager.h" | 23 #include "chromeos/dbus/dbus_thread_manager.h" |
| 24 #include "content/public/browser/browser_thread.h" | 24 #include "content/public/browser/browser_thread.h" |
| 25 #include "content/public/browser/notification_details.h" | 25 #include "content/public/browser/notification_details.h" |
| 26 #include "net/cert/x509_certificate.h" | 26 #include "net/cert/x509_certificate.h" |
| 27 | 27 |
| 28 namespace { | 28 namespace { |
| 29 | 29 |
| 30 const char kEnterpriseMachineKey[] = "attest-ent-machine"; | |
| 31 | |
| 32 // The number of days before a certificate expires during which it is | 30 // The number of days before a certificate expires during which it is |
| 33 // considered 'expiring soon' and replacement is initiated. The Chrome OS CA | 31 // considered 'expiring soon' and replacement is initiated. The Chrome OS CA |
| 34 // issues certificates with an expiry of at least two years. This value has | 32 // issues certificates with an expiry of at least two years. This value has |
| 35 // been set large enough so that the majority of users will have gone through | 33 // been set large enough so that the majority of users will have gone through |
| 36 // a full sign-in during the period. | 34 // a full sign-in during the period. |
| 37 const int kExpiryThresholdInDays = 30; | 35 const int kExpiryThresholdInDays = 30; |
| 38 const int kRetryDelay = 5; // Seconds. | 36 const int kRetryDelay = 5; // Seconds. |
| 39 const int kRetryLimit = 100; | 37 const int kRetryLimit = 100; |
| 40 | 38 |
| 41 // A dbus callback which handles a boolean result. | 39 // A dbus callback which handles a boolean result. |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 base::Bind(&AttestationPolicyObserver::Start, | 299 base::Bind(&AttestationPolicyObserver::Start, |
| 302 weak_factory_.GetWeakPtr()), | 300 weak_factory_.GetWeakPtr()), |
| 303 base::TimeDelta::FromSeconds(retry_delay_)); | 301 base::TimeDelta::FromSeconds(retry_delay_)); |
| 304 } else { | 302 } else { |
| 305 LOG(WARNING) << "AttestationPolicyObserver: Retry limit exceeded."; | 303 LOG(WARNING) << "AttestationPolicyObserver: Retry limit exceeded."; |
| 306 } | 304 } |
| 307 } | 305 } |
| 308 | 306 |
| 309 } // namespace attestation | 307 } // namespace attestation |
| 310 } // namespace chromeos | 308 } // namespace chromeos |
| OLD | NEW |