diff --git a/common/python/cctrusted_base/tcg.py b/common/python/cctrusted_base/tcg.py index 919fcca4..5e03feaf 100644 --- a/common/python/cctrusted_base/tcg.py +++ b/common/python/cctrusted_base/tcg.py @@ -52,8 +52,8 @@ def get_algorithm_string(alg_id: int) -> str: return "UNKNOWN" def __init__(self, alg_id: int) -> None: - assert alg_id in TcgAlgorithmRegistry.TPM_ALG_TABLE, \ - "invalid parameter alg_id" + #assert alg_id in TcgAlgorithmRegistry.TPM_ALG_TABLE, \ + # "invalid parameter alg_id" self._alg_id = alg_id @property diff --git a/common/python/cctrusted_base/tpm/pcr.py b/common/python/cctrusted_base/tpm/pcr.py index e33d61c2..e29c1a21 100644 --- a/common/python/cctrusted_base/tpm/pcr.py +++ b/common/python/cctrusted_base/tpm/pcr.py @@ -3,6 +3,7 @@ """ from cctrusted_base.imr import TcgIMR +from cctrusted_base.tcg import TcgAlgorithmRegistry class TpmPCR(TcgIMR): """PCR class defined for TPM""" @@ -10,3 +11,7 @@ class TpmPCR(TcgIMR): @property def max_index(self): return 23 + + def __init__(self, index, digest_hash): + super().__init__(index, TcgAlgorithmRegistry.TPM_ALG_SHA256, + digest_hash)