From 09f34eb4d090677e107650f3b2405c83aef9b8c2 Mon Sep 17 00:00:00 2001 From: Sansar Choinyambuu Date: Fri, 30 Sep 2011 14:56:25 +0200 Subject: [PATCH] Implemented functions for reading and extending TPM PCR Made hash_file function a member of pts object --- src/libpts/pts/pts.h | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/src/libpts/pts/pts.h b/src/libpts/pts/pts.h index 864e92d53..314b8a607 100644 --- a/src/libpts/pts/pts.h +++ b/src/libpts/pts/pts.h @@ -270,7 +270,7 @@ struct pts_t { bool (*is_path_valid)(pts_t *this, char *path, pts_error_code_t *error_code); /** - * Compute a hash over a file + * Compute a hash over a file * @param hasher Hasher to be used * @param pathname Absolute path of a file * @param hash Buffer to keep hash output @@ -361,6 +361,34 @@ struct pts_t { */ bool (*verify_quote_signature)(pts_t *this, chunk_t data, chunk_t signature); + /** + * Reads given PCR value and returns it + * + * @param pcr_num Number of PCR to read + * @param pcr_value Chunk to save pcr read output + * @return NULL in case of TSS error, PCR value otherwise + */ + bool (*read_pcr)(pts_t *this, u_int32_t pcr_num, chunk_t *pcr_value); + + /** + * Extends given PCR with given value + * + * @param pcr_num Number of PCR to extend + * @param input Value to extend + * @param output Chunk to save PCR value after extension + * @return FALSE in case of TSS error, TRUE otherwise + */ + bool (*extend_pcr)(pts_t *this, u_int32_t pcr_num, chunk_t input, chunk_t *output); + + /** + * Quote over PCR's + * + * @param pcrs Set of PCR's to make quotation over + * @param quote Chunk to save quote operation output + * @return FALSE in case of TSS error, TRUE otherwise + */ + bool (*quote_tpm)(pts_t *this, u_int32_t pcrs, chunk_t *quote); + /** * Destroys a pts_t object. */