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

Unified Diff: chrome/browser/chromeos/policy/enrollment_config.h

Issue 2186623002: Minimal attestation-based enrollment flow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased after 2265163002 so we can pass presubmit. Created 4 years, 4 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/policy/enrollment_config.h
diff --git a/chrome/browser/chromeos/policy/enrollment_config.h b/chrome/browser/chromeos/policy/enrollment_config.h
index 03788c1e3facd5a8a41f34e6e7550fef29759d7d..695c97775e46a3f13f7c0089b21732d48b0b7ae0 100644
--- a/chrome/browser/chromeos/policy/enrollment_config.h
+++ b/chrome/browser/chromeos/policy/enrollment_config.h
@@ -35,6 +35,10 @@ struct EnrollmentConfig {
MODE_SERVER_ADVERTISED,
// Recover from "spontaneous unenrollment", user can't skip.
MODE_RECOVERY,
+ // Start attestation-based enrollment.
+ MODE_ATTESTATION,
+ // Start attestation-based enrollment and only uses that.
+ MODE_ATTESTATION_FORCED,
};
// An enumeration of authentication mechanisms that can be used for
@@ -50,13 +54,29 @@ struct EnrollmentConfig {
};
// Whether enrollment should be triggered.
- bool should_enroll() const { return mode != MODE_NONE; }
+ bool should_enroll() const {
achuithb 2016/08/23 18:16:45 Why are these underscore_case? Shouldn't they be C
The one and only Dr. Crash 2016/08/23 21:24:19 Because is_forced() was and I am respecting the st
+ return should_enroll_with_attestation() || should_enroll_interactively();
+ }
+
+ // Whether attestation enrollment should be triggered.
+ bool should_enroll_with_attestation() const {
+ return auth_mechanism != AUTH_MECHANISM_INTERACTIVE;
+ }
+
+ // Whether interactive enrollment should be triggered.
+ bool should_enroll_interactively() const { return mode != MODE_NONE; }
// Whether enrollment is forced. The user can't skip the enrollment step
// during OOBE if this returns true.
bool is_forced() const {
return mode == MODE_LOCAL_FORCED || mode == MODE_SERVER_FORCED ||
- mode == MODE_RECOVERY;
+ mode == MODE_RECOVERY || is_attestation_forced();
+ }
+
+ // Whether attestation-based enrollment is forced. The user can't skip
+ // the enrollment step during OOBE if this returns true.
+ bool is_attestation_forced() const {
+ return auth_mechanism == AUTH_MECHANISM_ATTESTATION;
}
// Indicates the enrollment flow variant to trigger during OOBE.

Powered by Google App Engine
This is Rietveld 408576698