Skip to content

Commit

Permalink
pcr.py: add initial support for Google vTPM (#128)
Browse files Browse the repository at this point in the history
Signed-off-by: Linda <bluewishken@163.com>
  • Loading branch information
lindaO0O authored May 29, 2024
1 parent d58732d commit adbbe84
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/python/cctrusted_base/tcg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions common/python/cctrusted_base/tpm/pcr.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@
"""

from cctrusted_base.imr import TcgIMR
from cctrusted_base.tcg import TcgAlgorithmRegistry

class TpmPCR(TcgIMR):
"""PCR class defined for TPM"""

@property
def max_index(self):
return 23

def __init__(self, index, digest_hash):
super().__init__(index, TcgAlgorithmRegistry.TPM_ALG_SHA256,
digest_hash)

0 comments on commit adbbe84

Please sign in to comment.