InstallAttributesIsReady: Wait for Attestation blob preparation

On some hardware, attestation blob preparation may take a noticably
longer time. In those cases, a user may have completely all the UI steps
needed to trigger an enterprise enrollment.  While enterprise enrollment
waits on TPM ownership, it does not wait for the TPM to be free and
clear.  It appears that in some instances, it is possible to create
enough TPM contention to delay a response to
InstallAttributesFinalize().

This change avoids the possibility of that contention by forcing Chrome
to serialize enrollment commitment with Attestation preparation.  Chrome
will wait for up to 10 minutes for InstallAttributesIsReady() to return
true.  This change relies on that logic to keep Chrome from making a
TPM-contention InstallAttributesFinalize call while the TPM is busy.

At the very least, this change will remove one variable from the DBus
timeout behavior we see sometimes with InstallAttributesFinalize.

TEST=Tested on ToT lumpy through dev-switch to clear then boot.
BUG=chromium:189681

Change-Id: I7adc871ac7dbb60e90f3d131318384ae42f8e074
Reviewed-on: https://gerrit.chromium.org/gerrit/59707
Reviewed-by: Will Drewry <wad@chromium.org>
Tested-by: Will Drewry <wad@chromium.org>
Commit-Queue: Will Drewry <wad@chromium.org>
Reviewed-by: Darren Krahn <dkrahn@chromium.org>
1 file changed
tree: db29f6564cf6d96bb9513b8289483f11d6f37ebb
  1. etc/
  2. share/
  3. attestation.cc
  4. attestation.h
  5. attestation.proto
  6. attestation_task.cc
  7. attestation_task.h
  8. attestation_unittest.cc
  9. common.mk
  10. credentials.h
  11. crypto.cc
  12. crypto.h
  13. crypto_unittest.cc
  14. cryptohome-path.cc
  15. cryptohome.cc
  16. cryptohome.xml
  17. cryptohome_common.h
  18. cryptohome_event_source.cc
  19. cryptohome_event_source.h
  20. cryptohome_event_source_unittest.cc
  21. cryptohome_testrunner.cc
  22. cryptohomed.cc
  23. cryptolib.cc
  24. cryptolib.h
  25. email_to_image
  26. homedirs.cc
  27. homedirs.h
  28. homedirs_unittest.cc
  29. inherit-review-settings-ok
  30. install_attributes.cc
  31. install_attributes.h
  32. install_attributes.proto
  33. install_attributes_unittest.cc
  34. interface.cc
  35. interface.h
  36. keystore.h
  37. LICENSE
  38. lockbox-cache-main.cc
  39. lockbox-cache-tpm.cc
  40. lockbox-cache-tpm.h
  41. lockbox-cache.cc
  42. lockbox-cache.h
  43. lockbox.cc
  44. lockbox.h
  45. lockbox_unittest.cc
  46. make_tests.cc
  47. make_tests.h
  48. make_tests.sh
  49. Makefile
  50. marshal.list
  51. mock_homedirs.cc
  52. mock_homedirs.h
  53. mock_install_attributes.cc
  54. mock_install_attributes.h
  55. mock_keystore.cc
  56. mock_keystore.h
  57. mock_lockbox.cc
  58. mock_lockbox.h
  59. mock_mount.cc
  60. mock_mount.h
  61. mock_mount_factory.h
  62. mock_platform.cc
  63. mock_platform.h
  64. mock_service.cc
  65. mock_service.h
  66. mock_tpm.cc
  67. mock_tpm.h
  68. mock_user_oldest_activity_timestamp_cache.cc
  69. mock_user_oldest_activity_timestamp_cache.h
  70. mock_user_session.cc
  71. mock_user_session.h
  72. mock_vault_keyset.cc
  73. mock_vault_keyset.h
  74. mock_vault_keyset_factory.h
  75. mount-encrypted.c
  76. mount-encrypted.h
  77. mount-helpers.c
  78. mount-helpers.h
  79. mount.cc
  80. mount.h
  81. mount_factory.cc
  82. mount_factory.h
  83. mount_stack.cc
  84. mount_stack.h
  85. mount_stack_unittest.cc
  86. mount_task.cc
  87. mount_task.h
  88. mount_task_unittest.cc
  89. mount_unittest.cc
  90. OWNERS
  91. pam_mount.conf.xml
  92. pkcs11_init.cc
  93. pkcs11_init.h
  94. pkcs11_keystore.cc
  95. pkcs11_keystore.h
  96. pkcs11_keystore_unittest.cc
  97. platform.cc
  98. platform.h
  99. README
  100. README.dbus
  101. README.homedirs
  102. README.lockbox
  103. README.tpm
  104. service.cc
  105. service.h
  106. service_unittest.cc
  107. stateful_recovery.cc
  108. stateful_recovery.h
  109. stateful_recovery_unittest.cc
  110. stub_tpm.h
  111. tpm.cc
  112. tpm.h
  113. tpm_init.cc
  114. tpm_init.h
  115. tpm_status.proto
  116. user_oldest_activity_timestamp_cache.cc
  117. user_oldest_activity_timestamp_cache.h
  118. user_oldest_activity_timestamp_cache_unittest.cc
  119. user_session.cc
  120. user_session.h
  121. user_session_unittest.cc
  122. username_passkey.cc
  123. username_passkey.h
  124. username_passkey_unittest.cc
  125. vault_keyset.cc
  126. vault_keyset.h
  127. vault_keyset.proto
  128. vault_keyset_factory.cc
  129. vault_keyset_factory.h
  130. vault_keyset_unittest.cc
  131. WATCHLISTS