• Leo Lai's avatar
    UserSessionManager use TpmmanagerClient to prepare TPM device. · 15d43aa6
    Leo Lai authored
    We are replacing tpm status APis by cryptohome with tpm manager service.
    
    Though the change to the workflow is implemented UserSessionManager is
    supposed to operate almost the same way, before and after this CL.
    Below the behavioral changes are highlighted:
    
    1. TpmIsBeingOwned is removed as a factor from the state machine.
    TpmIsBeingOwned is no longer supported and always returns `false` now.
    Removing it is a trivial change.
    2. As for execution order, `PrepareFinalizeProfile()` is separated
    totally from the preparation of TPM device. The justification comes from
    the fact that `CryptohomeClient::CanAttemptOwnership()` only triggers
    TPM initialization by tpm manager w/o waiting for it to complete; it
    doesn't make sense to just wait for a trigger w/o checking its result.
    Clearing owner password is in best effort and the result is not checked
    even in cases where any remaining owner password dependencies stops the
    password from being cleared.
    3. TPM status checking is made asynchronous after this CL to make sure
    UI thread doesn't get blocked.
    4. Upon failure of calling tpm_manager, `DCHECK` is replaced by logging
    error message. It doesn't make sense to just crash upon the error, and
    in production it doesn't make any difference anyway.
    
    BUG=b:172748724
    BUG=b:172775884
    TEST=unit_tests (filter: *UserSessionManager*)
    TEST=browser_tests (filter: *ExistingUserController*)
    TEST=asan + msan builder trybot passes.
    TEST= perform first login, check if the password exists/gets wiped
    before/after the login.
    
    Change-Id: I66c5ef3faae8c78d9f2cb304ccf59ca7a8f80c01
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2560087
    Commit-Queue: Leo Lai <cylai@google.com>
    Reviewed-by: default avatarAchuith Bhandarkar <achuith@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#836026}
    15d43aa6
user_session_manager.h 25.3 KB