Commit 49f62ab5 authored by Amr Aboelkher's avatar Amr Aboelkher Committed by Chromium LUCI CQ

PSM: Consistently using PSM abbreviation instead of full name

It's preferred to use the common/well-known abbreviations directly
instead of its full name whenever it's possible in Chromium.

This CL is unifying the usage of PSM abbreviation everywhere PSM is
being used, instead of it's full name. That is going to make a lot
of PSM related tests more readable. Before that, it was
suffering from long tests names which made it difficult to read.

BUG=chromium:1168699

Change-Id: I4c8202800e9a896a63ca448917315eb8f57f6357
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2642617
Commit-Queue: Amr Aboelkher <amraboelkher@google.com>
Reviewed-by: default avatarMaksim Ivanov <emaxx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845973}
parent ec35b909
...@@ -387,14 +387,14 @@ bool AutoEnrollmentController::IsInitialEnrollmentEnabled() { ...@@ -387,14 +387,14 @@ bool AutoEnrollmentController::IsInitialEnrollmentEnabled() {
} }
// static // static
bool AutoEnrollmentController::IsPrivateSetMembershipEnabled() { bool AutoEnrollmentController::IsPsmEnabled() {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (!command_line->HasSwitch(switches::kEnterpriseEnablePrivateSetMembership)) if (!command_line->HasSwitch(switches::kEnterpriseEnablePsm))
return true; // Enabled by default. return true; // Enabled by default.
std::string command_line_mode = command_line->GetSwitchValueASCII( std::string command_line_mode =
switches::kEnterpriseEnablePrivateSetMembership); command_line->GetSwitchValueASCII(switches::kEnterpriseEnablePsm);
if (command_line_mode.empty() || command_line_mode == kEnablePsmAlways) if (command_line_mode.empty() || command_line_mode == kEnablePsmAlways)
return true; return true;
......
...@@ -45,7 +45,7 @@ class AutoEnrollmentController { ...@@ -45,7 +45,7 @@ class AutoEnrollmentController {
static const char kInitialEnrollmentNever[]; static const char kInitialEnrollmentNever[];
static const char kInitialEnrollmentOfficialBuild[]; static const char kInitialEnrollmentOfficialBuild[];
// Parameter values for the kEnterpriseEnablePrivateSetMembership flag. // Parameter values for the kEnterpriseEnablePsm flag.
static const char kEnablePsmAlways[]; static const char kEnablePsmAlways[];
static const char kEnablePsmNever[]; static const char kEnablePsmNever[];
...@@ -104,9 +104,9 @@ class AutoEnrollmentController { ...@@ -104,9 +104,9 @@ class AutoEnrollmentController {
// Returns true if any either FRE or initial enrollment are enabled. // Returns true if any either FRE or initial enrollment are enabled.
static bool IsEnabled(); static bool IsEnabled();
// Returns true if the use of private set membership is enabled based on // Returns true if the use of PSM (private set membership) is enabled based on
// command-line flags. // command-line flags.
static bool IsPrivateSetMembershipEnabled(); static bool IsPsmEnabled();
// Returns whether the FRE auto-enrollment check is required. When // Returns whether the FRE auto-enrollment check is required. When
// kCheckEnrollmentKey VPD entry is present, it is explicitly stating whether // kCheckEnrollmentKey VPD entry is present, it is explicitly stating whether
......
...@@ -35,21 +35,21 @@ class DeviceManagementResponse; ...@@ -35,21 +35,21 @@ class DeviceManagementResponse;
namespace policy { namespace policy {
// Construct the private set membership identifier. See // Construct the PSM (private set membership) identifier. See
// go/cros-enterprise-psm and go/cros-client-psm for more details. // go/cros-enterprise-psm and go/cros-client-psm for more details.
private_membership::rlwe::RlwePlaintextId ConstructDeviceRlweId( private_membership::rlwe::RlwePlaintextId ConstructDeviceRlweId(
const std::string& device_serial_number, const std::string& device_serial_number,
const std::string& device_rlz_brand_code); const std::string& device_rlz_brand_code);
// A class that handles all communications related to private set membership // A class that handles all communications related to PSM protocol with
// protocol with DMServer. Also, upon successful determination, it caches the // DMServer. Also, upon successful determination, it caches the membership state
// membership state of a given identifier in the local_state PrefService. // of a given identifier in the local_state PrefService. Upon a failed
// Upon a failed determination it won't allow another membership check. // determination it won't allow another membership check.
class PrivateSetMembershipHelper; class PsmHelper;
// These values are persisted to logs. Entries should not be renumbered and // These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused. // numeric values should never be reused.
enum class PrivateSetMembershipStatus { enum class PsmStatus {
kAttempt = 0, kAttempt = 0,
kSuccessfulDetermination = 1, kSuccessfulDetermination = 1,
kError = 2, kError = 2,
...@@ -59,7 +59,7 @@ enum class PrivateSetMembershipStatus { ...@@ -59,7 +59,7 @@ enum class PrivateSetMembershipStatus {
// These values are persisted to logs. Entries should not be renumbered and // These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused. // numeric values should never be reused.
enum class PrivateSetMembershipHashDanceComparison { enum class PsmHashDanceComparison {
kEqualResults = 0, kEqualResults = 0,
kDifferentResults = 1, kDifferentResults = 1,
kPSMErrorHashDanceSuccess = 2, kPSMErrorHashDanceSuccess = 2,
...@@ -127,12 +127,11 @@ class AutoEnrollmentClientImpl ...@@ -127,12 +127,11 @@ class AutoEnrollmentClientImpl
// network::NetworkConnectionTracker::NetworkConnectionObserver: // network::NetworkConnectionTracker::NetworkConnectionObserver:
void OnConnectionChanged(network::mojom::ConnectionType type) override; void OnConnectionChanged(network::mojom::ConnectionType type) override;
// Sets the private set membership RLWE client for testing through // Sets the PSM RLWE client for testing through |psm_helper_|, if the protocol
// |private_set_membership_helper_|, if the protocol is enabled. Also, the // is enabled. Also, the |psm_rlwe_client| has to be non-null.
// |private_set_membership_rlwe_client| has to be non-null. void SetPsmRlweClientForTesting(
void SetPrivateSetMembershipRlweClientForTesting(
std::unique_ptr<private_membership::rlwe::PrivateMembershipRlweClient> std::unique_ptr<private_membership::rlwe::PrivateMembershipRlweClient>
private_set_membership_rlwe_client, psm_rlwe_client,
const private_membership::rlwe::RlwePlaintextId& psm_rlwe_id); const private_membership::rlwe::RlwePlaintextId& psm_rlwe_id);
private: private:
...@@ -154,8 +153,7 @@ class AutoEnrollmentClientImpl ...@@ -154,8 +153,7 @@ class AutoEnrollmentClientImpl
int power_limit, int power_limit,
base::Optional<int> power_outdated_server_detect, base::Optional<int> power_outdated_server_detect,
std::string uma_suffix, std::string uma_suffix,
std::unique_ptr<PrivateSetMembershipHelper> std::unique_ptr<PsmHelper> psm_helper);
private_set_membership_helper);
// Tries to load the result of a previous execution of the protocol from // Tries to load the result of a previous execution of the protocol from
// local state. Returns true if that decision has been made and is valid. // local state. Returns true if that decision has been made and is valid.
...@@ -165,11 +163,11 @@ class AutoEnrollmentClientImpl ...@@ -165,11 +163,11 @@ class AutoEnrollmentClientImpl
// Returns true if progress has been made, false if the protocol is done. // Returns true if progress has been made, false if the protocol is done.
bool RetryStep(); bool RetryStep();
// Retries running private set membership protocol, if the protocol // Retries running PSM protocol, if the protocol
// is enabled and it is possible to start. Returns true if the protocol is // is enabled and it is possible to start. Returns true if the protocol is
// enabled or it's in progress, false if the protocol is done. Note that the // enabled or it's in progress, false if the protocol is done. Note that the
// PSM protocol is only performed once per OOBE flow. // PSM protocol is only performed once per OOBE flow.
bool PrivateSetMembershipRetryStep(); bool PsmRetryStep();
// Cleans up and invokes |progress_callback_|. // Cleans up and invokes |progress_callback_|.
void ReportProgress(AutoEnrollmentState state); void ReportProgress(AutoEnrollmentState state);
...@@ -218,10 +216,9 @@ class AutoEnrollmentClientImpl ...@@ -218,10 +216,9 @@ class AutoEnrollmentClientImpl
// Updates the UMA histogram for successful hash dance. // Updates the UMA histogram for successful hash dance.
void RecordHashDanceSuccessTimeHistogram(); void RecordHashDanceSuccessTimeHistogram();
// Records the UMA histogram comparing results of hash dance and private set // Records the UMA histogram comparing results of hash dance and PSM. This
// membership. This function should be called after PSM and hash dance // function should be called after PSM and hash dance requests finished.
// requests finished. void RecordPsmHashDanceComparison();
void RecordPrivateSetMembershipHashDanceComparison();
// Callback to invoke when the protocol generates a relevant event. This can // Callback to invoke when the protocol generates a relevant event. This can
// be either successful completion or an error that requires external action. // be either successful completion or an error that requires external action.
...@@ -260,7 +257,7 @@ class AutoEnrollmentClientImpl ...@@ -260,7 +257,7 @@ class AutoEnrollmentClientImpl
DeviceManagementService* device_management_service_; DeviceManagementService* device_management_service_;
// Indicates whether Hash dance i.e. DeviceAutoEnrollmentRequest or // Indicates whether Hash dance i.e. DeviceAutoEnrollmentRequest or
// DeviceStateRetrievalRequest is in progress. Note that is not affected by // DeviceStateRetrievalRequest is in progress. Note that is not affected by
// private set membership protocol, whether it's in progress or not. // PSM protocol, whether it's in progress or not.
std::unique_ptr<DeviceManagementService::Job> request_job_; std::unique_ptr<DeviceManagementService::Job> request_job_;
// PrefService where the protocol's results are cached. // PrefService where the protocol's results are cached.
...@@ -277,8 +274,8 @@ class AutoEnrollmentClientImpl ...@@ -277,8 +274,8 @@ class AutoEnrollmentClientImpl
std::unique_ptr<StateDownloadMessageProcessor> std::unique_ptr<StateDownloadMessageProcessor>
state_download_message_processor_; state_download_message_processor_;
// Obtains the device state using private set membership protocol. // Obtains the device state using PSM protocol.
std::unique_ptr<PrivateSetMembershipHelper> private_set_membership_helper_; std::unique_ptr<PsmHelper> psm_helper_;
// Times used to determine the duration of the protocol, and the extra time // Times used to determine the duration of the protocol, and the extra time
// needed to complete after the signin was complete. // needed to complete after the signin was complete.
...@@ -296,9 +293,9 @@ class AutoEnrollmentClientImpl ...@@ -296,9 +293,9 @@ class AutoEnrollmentClientImpl
// |AutoEnrollmentclient| used for initial enrollment. // |AutoEnrollmentclient| used for initial enrollment.
const std::string uma_suffix_; const std::string uma_suffix_;
// Whether this instance already recorded the comparison of private set // Whether this instance already recorded the comparison of PSM and hash
// membership and hash dance. This is required because we do not want to // dance. This is required because we do not want to record the result again
// record the result again on a hash dance retry. // on a hash dance retry.
bool recorded_psm_hash_dance_comparison_ = false; bool recorded_psm_hash_dance_comparison_ = false;
DISALLOW_COPY_AND_ASSIGN(AutoEnrollmentClientImpl); DISALLOW_COPY_AND_ASSIGN(AutoEnrollmentClientImpl);
......
...@@ -300,8 +300,8 @@ const char kEnterpriseEnableForcedReEnrollment[] = ...@@ -300,8 +300,8 @@ const char kEnterpriseEnableForcedReEnrollment[] =
const char kEnterpriseEnableInitialEnrollment[] = const char kEnterpriseEnableInitialEnrollment[] =
"enterprise-enable-initial-enrollment"; "enterprise-enable-initial-enrollment";
// Whether to enable private set membership queries. // Whether to enable PSM (private set membership) queries.
const char kEnterpriseEnablePrivateSetMembership[] = "enterprise-enable-psm"; const char kEnterpriseEnablePsm[] = "enterprise-enable-psm";
// Enables the zero-touch enterprise enrollment flow. // Enables the zero-touch enterprise enrollment flow.
const char kEnterpriseEnableZeroTouchEnrollment[] = const char kEnterpriseEnableZeroTouchEnrollment[] =
......
...@@ -122,7 +122,7 @@ extern const char kEnterpriseEnableForcedReEnrollment[]; ...@@ -122,7 +122,7 @@ extern const char kEnterpriseEnableForcedReEnrollment[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const char kEnterpriseEnableInitialEnrollment[]; extern const char kEnterpriseEnableInitialEnrollment[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const char kEnterpriseEnablePrivateSetMembership[]; extern const char kEnterpriseEnablePsm[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const char kEnterpriseEnableZeroTouchEnrollment[]; extern const char kEnterpriseEnableZeroTouchEnrollment[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
......
...@@ -183,11 +183,11 @@ const char kMetricCBCMRemoteCommandExecutedTemplate[] = ...@@ -183,11 +183,11 @@ const char kMetricCBCMRemoteCommandExecutedTemplate[] =
const char kMetricCBCMUnsignedRemoteCommandExecutedTemplate[] = const char kMetricCBCMUnsignedRemoteCommandExecutedTemplate[] =
"Enterprise.CBCMRemoteCommand.Executed.Unsigned.%s"; "Enterprise.CBCMRemoteCommand.Executed.Unsigned.%s";
const char kUMAPrivateSetMembershipHashDanceComparison[] = const char kUMAPsmHashDanceComparison[] =
"Enterprise.AutoEnrollmentPrivateSetMembershipHashDanceComparison"; "Enterprise.AutoEnrollmentPrivateSetMembershipHashDanceComparison";
const char kUMAPrivateSetMembershipSuccessTime[] = const char kUMAPsmSuccessTime[] =
"Enterprise.AutoEnrollmentPrivateSetMembershipSuccessTime"; "Enterprise.AutoEnrollmentPrivateSetMembershipSuccessTime";
const char kUMAPrivateSetMembershipRequestStatus[] = const char kUMAPsmRequestStatus[] =
"Enterprise.AutoEnrollmentPrivateSetMembershipRequestStatus"; "Enterprise.AutoEnrollmentPrivateSetMembershipRequestStatus";
const char kUMAHashDanceSuccessTime[] = const char kUMAHashDanceSuccessTime[] =
......
...@@ -258,13 +258,13 @@ POLICY_EXPORT extern const char ...@@ -258,13 +258,13 @@ POLICY_EXPORT extern const char
kMetricCBCMUnsignedRemoteCommandExecutedTemplate[]; kMetricCBCMUnsignedRemoteCommandExecutedTemplate[];
// Private set membership UMA histogram names. // Private set membership UMA histogram names.
POLICY_EXPORT extern const char kUMAPrivateSetMembershipHashDanceComparison[]; POLICY_EXPORT extern const char kUMAPsmHashDanceComparison[];
POLICY_EXPORT extern const char kUMAPrivateSetMembershipSuccessTime[]; POLICY_EXPORT extern const char kUMAPsmSuccessTime[];
POLICY_EXPORT extern const char kUMAPrivateSetMembershipRequestStatus[]; POLICY_EXPORT extern const char kUMAPsmRequestStatus[];
// DeviceAutoEnrollmentRequest i.e. hash dance request UMA histogram names. // DeviceAutoEnrollmentRequest i.e. hash dance request UMA histogram names.
POLICY_EXPORT extern const char kUMAHashDanceSuccessTime[]; POLICY_EXPORT extern const char kUMAHashDanceSuccessTime[];
// The following histogram names where added before private set membership // The following histogram names where added before PSM (private set membership)
// existed. They are only recorded for hash dance. // existed. They are only recorded for hash dance.
POLICY_EXPORT extern const char kUMAHashDanceProtocolTime[]; POLICY_EXPORT extern const char kUMAHashDanceProtocolTime[];
POLICY_EXPORT extern const char kUMAHashDanceBucketDownloadTime[]; POLICY_EXPORT extern const char kUMAHashDanceBucketDownloadTime[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment