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

Side by Side Diff: chrome/browser/chromeos/attestation/attestation_policy_observer.h

Issue 1511793004: attestation: Fix policy observer expiry check. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nit Created 5 years 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/attestation/attestation_policy_observer.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 (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 #ifndef CHROME_BROWSER_CHROMEOS_ATTESTATION_ATTESTATION_POLICY_OBSERVER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_ATTESTATION_ATTESTATION_POLICY_OBSERVER_H_
6 #define CHROME_BROWSER_CHROMEOS_ATTESTATION_ATTESTATION_POLICY_OBSERVER_H_ 6 #define CHROME_BROWSER_CHROMEOS_ATTESTATION_ATTESTATION_POLICY_OBSERVER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 // Checks attestation policy and starts any necessary work. 57 // Checks attestation policy and starts any necessary work.
58 void Start(); 58 void Start();
59 59
60 // Gets a new certificate for the Enterprise Machine Key (EMK). 60 // Gets a new certificate for the Enterprise Machine Key (EMK).
61 void GetNewCertificate(); 61 void GetNewCertificate();
62 62
63 // Gets the existing EMK certificate and sends it to CheckCertificateExpiry. 63 // Gets the existing EMK certificate and sends it to CheckCertificateExpiry.
64 void GetExistingCertificate(); 64 void GetExistingCertificate();
65 65
66 // Checks if the given certificate is expired and, if so, get a new one. 66 // Checks if any certificate in the given pem_certificate_chain is expired
67 void CheckCertificateExpiry(const std::string& certificate); 67 // and, if so, gets a new one. If not renewing, calls CheckIfUploaded.
68 void CheckCertificateExpiry(const std::string& pem_certificate_chain);
68 69
69 // Uploads a certificate to the policy server. 70 // Uploads a certificate to the policy server.
70 void UploadCertificate(const std::string& certificate); 71 void UploadCertificate(const std::string& pem_certificate_chain);
71 72
72 // Checks if a certificate has already been uploaded and, if not, upload. 73 // Checks if a certificate has already been uploaded and, if not, upload.
73 void CheckIfUploaded(const std::string& certificate, 74 void CheckIfUploaded(const std::string& pem_certificate_chain,
74 const std::string& key_payload); 75 const std::string& key_payload);
75 76
76 // Gets the payload associated with the EMK and sends it to |callback|. 77 // Gets the payload associated with the EMK and sends it to |callback|.
77 void GetKeyPayload(base::Callback<void(const std::string&)> callback); 78 void GetKeyPayload(base::Callback<void(const std::string&)> callback);
78 79
79 // Called when a certificate upload operation completes. On success, |status| 80 // Called when a certificate upload operation completes. On success, |status|
80 // will be true. 81 // will be true.
81 void OnUploadComplete(bool status); 82 void OnUploadComplete(bool status);
82 83
83 // Marks a key as uploaded in the payload proto. 84 // Marks a key as uploaded in the payload proto.
(...skipping 18 matching lines...) Expand all
102 // invalidate the weak pointers before any other members are destroyed. 103 // invalidate the weak pointers before any other members are destroyed.
103 base::WeakPtrFactory<AttestationPolicyObserver> weak_factory_; 104 base::WeakPtrFactory<AttestationPolicyObserver> weak_factory_;
104 105
105 DISALLOW_COPY_AND_ASSIGN(AttestationPolicyObserver); 106 DISALLOW_COPY_AND_ASSIGN(AttestationPolicyObserver);
106 }; 107 };
107 108
108 } // namespace attestation 109 } // namespace attestation
109 } // namespace chromeos 110 } // namespace chromeos
110 111
111 #endif // CHROME_BROWSER_CHROMEOS_ATTESTATION_ATTESTATION_POLICY_OBSERVER_H_ 112 #endif // CHROME_BROWSER_CHROMEOS_ATTESTATION_ATTESTATION_POLICY_OBSERVER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/attestation/attestation_policy_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698