Commit 5cc49de2 authored by Pavol Marko's avatar Pavol Marko Committed by Commit Bot

Do not include 'domain' for EMK challenge

Since CL:2193900, attestation service ignores the 'domain' in EMK
challenge signing requests.
Instead, attestation relies on 'customer id' which is extracted from
device policy by the daemon.
Consequently, stop sending 'domain' in EMK.

Bug: 1073974
Change-Id: I08592ea2674071e68400761d911f0b6358a1b917
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2543393Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Reviewed-by: default avatarMichael Ershov <miersh@google.com>
Commit-Queue: Pavol Marko <pmarko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#830185}
parent cbc6df82
...@@ -279,7 +279,7 @@ std::string TpmChallengeKeySubtleImpl::GetEmail() const { ...@@ -279,7 +279,7 @@ std::string TpmChallengeKeySubtleImpl::GetEmail() const {
switch (key_type_) { switch (key_type_) {
case KEY_DEVICE: case KEY_DEVICE:
return InstallAttributes::Get()->GetDomain(); return std::string();
case KEY_USER: case KEY_USER:
return GetAccountId().GetUserEmail(); return GetAccountId().GetUserEmail();
} }
......
...@@ -167,7 +167,7 @@ class TpmChallengeKeySubtleImpl final : public TpmChallengeKeySubtle { ...@@ -167,7 +167,7 @@ class TpmChallengeKeySubtleImpl final : public TpmChallengeKeySubtle {
// Returns true if remote attestation is allowed and the setting is managed. // Returns true if remote attestation is allowed and the setting is managed.
bool IsRemoteAttestationEnabledForUser() const; bool IsRemoteAttestationEnabledForUser() const;
// Returns the enterprise domain the device is enrolled to or user email. // Returns the user email (for user key) or an empty string (for machine key).
std::string GetEmail() const; std::string GetEmail() const;
AttestationCertificateProfile GetCertificateProfile() const; AttestationCertificateProfile GetCertificateProfile() const;
// Returns the User* associated with |profile_|. May return nullptr (if there // Returns the User* associated with |profile_|. May return nullptr (if there
......
...@@ -44,7 +44,6 @@ namespace attestation { ...@@ -44,7 +44,6 @@ namespace attestation {
namespace { namespace {
constexpr char kTestUserEmail[] = "test@google.com"; constexpr char kTestUserEmail[] = "test@google.com";
constexpr char kTestUserDomain[] = "google.com";
constexpr char kTestUserGaiaId[] = "test_gaia_id"; constexpr char kTestUserGaiaId[] = "test_gaia_id";
constexpr char kEmptyKeyName[] = ""; constexpr char kEmptyKeyName[] = "";
constexpr char kNonDefaultKeyName[] = "key_name_123"; constexpr char kNonDefaultKeyName[] = "key_name_123";
...@@ -516,7 +515,7 @@ TEST_F(TpmChallengeKeySubtleTest, DeviceKeyNotRegisteredSuccess) { ...@@ -516,7 +515,7 @@ TEST_F(TpmChallengeKeySubtleTest, DeviceKeyNotRegisteredSuccess) {
::attestation::SignEnterpriseChallengeRequest expected_request; ::attestation::SignEnterpriseChallengeRequest expected_request;
expected_request.set_key_label(key_name); expected_request.set_key_label(key_name);
expected_request.set_domain(kTestUserDomain); expected_request.set_domain(std::string());
expected_request.set_device_id(GetInstallAttributes()->GetDeviceId()); expected_request.set_device_id(GetInstallAttributes()->GetDeviceId());
AttestationClient::Get() AttestationClient::Get()
->GetTestInterface() ->GetTestInterface()
...@@ -537,7 +536,7 @@ TEST_F(TpmChallengeKeySubtleTest, DeviceKeyRegisteredSuccess) { ...@@ -537,7 +536,7 @@ TEST_F(TpmChallengeKeySubtleTest, DeviceKeyRegisteredSuccess) {
::attestation::SignEnterpriseChallengeRequest expected_request; ::attestation::SignEnterpriseChallengeRequest expected_request;
expected_request.set_key_label(GetDefaultKeyName(key_type)); expected_request.set_key_label(GetDefaultKeyName(key_type));
expected_request.set_key_name_for_spkac(key_name); expected_request.set_key_name_for_spkac(key_name);
expected_request.set_domain(kTestUserDomain); expected_request.set_domain(std::string());
expected_request.set_device_id(GetInstallAttributes()->GetDeviceId()); expected_request.set_device_id(GetInstallAttributes()->GetDeviceId());
AttestationClient::Get() AttestationClient::Get()
->GetTestInterface() ->GetTestInterface()
......
...@@ -645,7 +645,6 @@ class SamlTest : public OobeBaseTest { ...@@ -645,7 +645,6 @@ class SamlTest : public OobeBaseTest {
sign_enterprise_challenge_request.set_username(""); sign_enterprise_challenge_request.set_username("");
sign_enterprise_challenge_request.set_key_label( sign_enterprise_challenge_request.set_key_label(
attestation::kEnterpriseMachineKey); attestation::kEnterpriseMachineKey);
sign_enterprise_challenge_request.set_domain("google.com");
sign_enterprise_challenge_request.set_device_id("device_id"); sign_enterprise_challenge_request.set_device_id("device_id");
AttestationClient::Get() AttestationClient::Get()
->GetTestInterface() ->GetTestInterface()
......
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