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() {
}
// static
bool AutoEnrollmentController::IsPrivateSetMembershipEnabled() {
bool AutoEnrollmentController::IsPsmEnabled() {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (!command_line->HasSwitch(switches::kEnterpriseEnablePrivateSetMembership))
if (!command_line->HasSwitch(switches::kEnterpriseEnablePsm))
return true; // Enabled by default.
std::string command_line_mode = command_line->GetSwitchValueASCII(
switches::kEnterpriseEnablePrivateSetMembership);
std::string command_line_mode =
command_line->GetSwitchValueASCII(switches::kEnterpriseEnablePsm);
if (command_line_mode.empty() || command_line_mode == kEnablePsmAlways)
return true;
......
......@@ -45,7 +45,7 @@ class AutoEnrollmentController {
static const char kInitialEnrollmentNever[];
static const char kInitialEnrollmentOfficialBuild[];
// Parameter values for the kEnterpriseEnablePrivateSetMembership flag.
// Parameter values for the kEnterpriseEnablePsm flag.
static const char kEnablePsmAlways[];
static const char kEnablePsmNever[];
......@@ -104,9 +104,9 @@ class AutoEnrollmentController {
// Returns true if any either FRE or initial enrollment are enabled.
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.
static bool IsPrivateSetMembershipEnabled();
static bool IsPsmEnabled();
// Returns whether the FRE auto-enrollment check is required. When
// kCheckEnrollmentKey VPD entry is present, it is explicitly stating whether
......
......@@ -35,21 +35,21 @@ class DeviceManagementResponse;
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.
private_membership::rlwe::RlwePlaintextId ConstructDeviceRlweId(
const std::string& device_serial_number,
const std::string& device_rlz_brand_code);
// A class that handles all communications related to private set membership
// protocol with DMServer. Also, upon successful determination, it caches the
// membership state of a given identifier in the local_state PrefService.
// Upon a failed determination it won't allow another membership check.
class PrivateSetMembershipHelper;
// A class that handles all communications related to PSM protocol with
// DMServer. Also, upon successful determination, it caches the membership state
// of a given identifier in the local_state PrefService. Upon a failed
// determination it won't allow another membership check.
class PsmHelper;
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class PrivateSetMembershipStatus {
enum class PsmStatus {
kAttempt = 0,
kSuccessfulDetermination = 1,
kError = 2,
......@@ -59,7 +59,7 @@ enum class PrivateSetMembershipStatus {
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class PrivateSetMembershipHashDanceComparison {
enum class PsmHashDanceComparison {
kEqualResults = 0,
kDifferentResults = 1,
kPSMErrorHashDanceSuccess = 2,
......@@ -127,12 +127,11 @@ class AutoEnrollmentClientImpl
// network::NetworkConnectionTracker::NetworkConnectionObserver:
void OnConnectionChanged(network::mojom::ConnectionType type) override;
// Sets the private set membership RLWE client for testing through
// |private_set_membership_helper_|, if the protocol is enabled. Also, the
// |private_set_membership_rlwe_client| has to be non-null.
void SetPrivateSetMembershipRlweClientForTesting(
// Sets the PSM RLWE client for testing through |psm_helper_|, if the protocol
// is enabled. Also, the |psm_rlwe_client| has to be non-null.
void SetPsmRlweClientForTesting(
std::unique_ptr<private_membership::rlwe::PrivateMembershipRlweClient>
private_set_membership_rlwe_client,
psm_rlwe_client,
const private_membership::rlwe::RlwePlaintextId& psm_rlwe_id);
private:
......@@ -154,8 +153,7 @@ class AutoEnrollmentClientImpl
int power_limit,
base::Optional<int> power_outdated_server_detect,
std::string uma_suffix,
std::unique_ptr<PrivateSetMembershipHelper>
private_set_membership_helper);
std::unique_ptr<PsmHelper> psm_helper);
// 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.
......@@ -165,11 +163,11 @@ class AutoEnrollmentClientImpl
// Returns true if progress has been made, false if the protocol is done.
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
// enabled or it's in progress, false if the protocol is done. Note that the
// PSM protocol is only performed once per OOBE flow.
bool PrivateSetMembershipRetryStep();
bool PsmRetryStep();
// Cleans up and invokes |progress_callback_|.
void ReportProgress(AutoEnrollmentState state);
......@@ -218,10 +216,9 @@ class AutoEnrollmentClientImpl
// Updates the UMA histogram for successful hash dance.
void RecordHashDanceSuccessTimeHistogram();
// Records the UMA histogram comparing results of hash dance and private set
// membership. This function should be called after PSM and hash dance
// requests finished.
void RecordPrivateSetMembershipHashDanceComparison();
// Records the UMA histogram comparing results of hash dance and PSM. This
// function should be called after PSM and hash dance requests finished.
void RecordPsmHashDanceComparison();
// Callback to invoke when the protocol generates a relevant event. This can
// be either successful completion or an error that requires external action.
......@@ -260,7 +257,7 @@ class AutoEnrollmentClientImpl
DeviceManagementService* device_management_service_;
// Indicates whether Hash dance i.e. DeviceAutoEnrollmentRequest or
// 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_;
// PrefService where the protocol's results are cached.
......@@ -277,8 +274,8 @@ class AutoEnrollmentClientImpl
std::unique_ptr<StateDownloadMessageProcessor>
state_download_message_processor_;
// Obtains the device state using private set membership protocol.
std::unique_ptr<PrivateSetMembershipHelper> private_set_membership_helper_;
// Obtains the device state using PSM protocol.
std::unique_ptr<PsmHelper> psm_helper_;
// Times used to determine the duration of the protocol, and the extra time
// needed to complete after the signin was complete.
......@@ -296,9 +293,9 @@ class AutoEnrollmentClientImpl
// |AutoEnrollmentclient| used for initial enrollment.
const std::string uma_suffix_;
// Whether this instance already recorded the comparison of private set
// membership and hash dance. This is required because we do not want to
// record the result again on a hash dance retry.
// Whether this instance already recorded the comparison of PSM and hash
// dance. This is required because we do not want to record the result again
// on a hash dance retry.
bool recorded_psm_hash_dance_comparison_ = false;
DISALLOW_COPY_AND_ASSIGN(AutoEnrollmentClientImpl);
......
......@@ -300,8 +300,8 @@ const char kEnterpriseEnableForcedReEnrollment[] =
const char kEnterpriseEnableInitialEnrollment[] =
"enterprise-enable-initial-enrollment";
// Whether to enable private set membership queries.
const char kEnterpriseEnablePrivateSetMembership[] = "enterprise-enable-psm";
// Whether to enable PSM (private set membership) queries.
const char kEnterpriseEnablePsm[] = "enterprise-enable-psm";
// Enables the zero-touch enterprise enrollment flow.
const char kEnterpriseEnableZeroTouchEnrollment[] =
......
......@@ -122,7 +122,7 @@ extern const char kEnterpriseEnableForcedReEnrollment[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const char kEnterpriseEnableInitialEnrollment[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const char kEnterpriseEnablePrivateSetMembership[];
extern const char kEnterpriseEnablePsm[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const char kEnterpriseEnableZeroTouchEnrollment[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
......
......@@ -183,11 +183,11 @@ const char kMetricCBCMRemoteCommandExecutedTemplate[] =
const char kMetricCBCMUnsignedRemoteCommandExecutedTemplate[] =
"Enterprise.CBCMRemoteCommand.Executed.Unsigned.%s";
const char kUMAPrivateSetMembershipHashDanceComparison[] =
const char kUMAPsmHashDanceComparison[] =
"Enterprise.AutoEnrollmentPrivateSetMembershipHashDanceComparison";
const char kUMAPrivateSetMembershipSuccessTime[] =
const char kUMAPsmSuccessTime[] =
"Enterprise.AutoEnrollmentPrivateSetMembershipSuccessTime";
const char kUMAPrivateSetMembershipRequestStatus[] =
const char kUMAPsmRequestStatus[] =
"Enterprise.AutoEnrollmentPrivateSetMembershipRequestStatus";
const char kUMAHashDanceSuccessTime[] =
......
......@@ -258,13 +258,13 @@ POLICY_EXPORT extern const char
kMetricCBCMUnsignedRemoteCommandExecutedTemplate[];
// Private set membership UMA histogram names.
POLICY_EXPORT extern const char kUMAPrivateSetMembershipHashDanceComparison[];
POLICY_EXPORT extern const char kUMAPrivateSetMembershipSuccessTime[];
POLICY_EXPORT extern const char kUMAPrivateSetMembershipRequestStatus[];
POLICY_EXPORT extern const char kUMAPsmHashDanceComparison[];
POLICY_EXPORT extern const char kUMAPsmSuccessTime[];
POLICY_EXPORT extern const char kUMAPsmRequestStatus[];
// DeviceAutoEnrollmentRequest i.e. hash dance request UMA histogram names.
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.
POLICY_EXPORT extern const char kUMAHashDanceProtocolTime[];
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