tpm2-software / tpm2-abrmd

TPM2 Access Broker & Resource Management Daemon implementing the TCG spec.
https://github.com/tpm2-software/tpm2-abrmd
BSD 2-Clause "Simplified" License
115 stars 98 forks source link

abrmd crashes when a session is passed to GetCapacility #818

Closed whooo closed 1 year ago

whooo commented 1 year ago

tpm2-abrmd crashes with the following code:

from tpm2_pytss.ESAPI import ESAPI                                                                                                                                                                                                     
from tpm2_pytss.constants import ESYS_TR, TPM2_SE, TPM2_ALG, TPM2_CAP                                                                                                                                                                  
from tpm2_pytss.types import TPMT_SYM_DEF                                                                                                                                                                                              

ectx = ESAPI()                                                                                                                                                                                                                         
session = ectx.start_auth_session(                                                                                                                                                                                                     
    ESYS_TR.NONE,                                                                                                                                                                                                                      
    ESYS_TR.NONE,                                                                                                                                                                                                                      
    TPM2_SE.HMAC,                                                                                                                                                                                                                      
    TPMT_SYM_DEF(algorithm=TPM2_ALG.NULL),                                                                                                                                                                                             
    TPM2_ALG.SHA256,                                                                                                                                                                                                                   
)                                                                                                                                                                                                                                      

more = True                                                                                                                                                                                                                            
while more:                                                                                                                                                                                                                            
    more, capdata = ectx.get_capability(TPM2_CAP.PCRS, 0, session1=session)

The error:

ERROR:src/resource-manager.c:978:get_cap_post_process: assertion failed: (tpm2_response_get_code (resp) == TSS2_RC_SUCCESS)
Bail out! ERROR:src/resource-manager.c:978:get_cap_post_process: assertion failed: (tpm2_response_get_code (resp) == TSS2_RC_SUCCESS)
Aborted