Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esys: close TR handle for input persistent handle in EvictControl_Finish #2667

Merged
merged 1 commit into from
Jul 26, 2023

Commits on Jul 20, 2023

  1. esys: close TR handle for input persistent handle in EvictControl_Finish

    The TSS ESAPI spec (1.00 rev 14) says:
    
    > If the ESYS_TR object on input was a persistent object, [the ESYS_TR
    > output] parameter will not return a ESYS_TR object but instead will
    > return ESYS_TR_NULL. Also the metadata in the ESYS_CONTEXT regarding
    > the ESYS_TR object will be removed and the ESYS_TR object will be
    > marked as invalid.
    
    However, currently although the output parameter is set to
    ESYS_TR_NONE, the input ESYS_TR object isn't closed. Other than the
    obvious leak, this can cause an error when Esys_TR_FromTPMPublic is
    called twice, with the object having been recreated with different
    public data and persisted with Esys_EvictControl in between, since
    Esys_TR_FromTPMPublic now verifies that the public data hasn't changed
    for the ESYS_TR object (which it now has).
    
    Address this by closing the input ESYS_TR handle in the case that it
    referred to a persistent object.
    
    Signed-off-by: Rob Shearman <rob@graphiant.com>
    rshearman committed Jul 20, 2023
    Configuration menu
    Copy the full SHA
    d8e82e3 View commit details
    Browse the repository at this point in the history