Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(348)

Unified Diff: src/tlcl/tlcl.c

Issue 2663002: Add space redefinition test, early NV read test and early extend test. (Closed) Base URL: ssh://git@chromiumos-git/tpm_lite.git
Patch Set: Fix printf Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/tlcl/tlcl.c
diff --git a/src/tlcl/tlcl.c b/src/tlcl/tlcl.c
index 3d34d6c32b551dbf5b668b69258fd08d57ea9d0a..a932a36f3885d8b941a574e3b321c20988a6c6ea 100644
--- a/src/tlcl/tlcl.c
+++ b/src/tlcl/tlcl.c
@@ -251,6 +251,10 @@ void TlclSelftestfull(void) {
Send(tpm_selftestfull_cmd.buffer);
}
+void TlclContinueSelfTest(void) {
+ Send(tpm_continueselftest_cmd.buffer);
+}
+
void TlclDefineSpace(uint32_t index, uint32_t perm, uint32_t size) {
ToTpmUint32(tpm_nv_definespace_cmd.index, index);
ToTpmUint32(tpm_nv_definespace_cmd.perm, perm);
@@ -258,6 +262,15 @@ void TlclDefineSpace(uint32_t index, uint32_t perm, uint32_t size) {
Send(tpm_nv_definespace_cmd.buffer);
}
+uint32_t TlclDefineSpaceResult(uint32_t index, uint32_t perm, uint32_t size) {
+ uint8_t response[TPM_LARGE_ENOUGH_COMMAND_SIZE];
+ ToTpmUint32(tpm_nv_definespace_cmd.index, index);
+ ToTpmUint32(tpm_nv_definespace_cmd.perm, perm);
+ ToTpmUint32(tpm_nv_definespace_cmd.size, size);
+ SendReceive(tpm_nv_definespace_cmd.buffer, response, sizeof(response));
+ return TpmReturnCode(response);
+}
+
uint32_t TlclWrite(uint32_t index, uint8_t* data, uint32_t length) {
uint8_t response[TPM_LARGE_ENOUGH_COMMAND_SIZE];
const int total_length =
@@ -312,6 +325,12 @@ void TlclAssertPhysicalPresence(void) {
Send(tpm_ppassert_cmd.buffer);
}
+uint32_t TlclAssertPhysicalPresenceResult(void) {
+ uint8_t response[TPM_LARGE_ENOUGH_COMMAND_SIZE];
+ SendReceive(tpm_ppassert_cmd.buffer, response, sizeof(response));
+ return TpmReturnCode(response);
+}
+
uint32_t TlclLockPhysicalPresence(void) {
uint8_t response[TPM_LARGE_ENOUGH_COMMAND_SIZE];
SendReceive(tpm_pplock_cmd.buffer, response, sizeof(response));
@@ -378,3 +397,12 @@ uint32_t TlclSetGlobalLock(void) {
uint32_t x;
return TlclWrite(TPM_NV_INDEX0, (uint8_t*) &x, 0);
}
+
+uint32_t TlclExtend(int pcr_num, uint8_t* in_digest, uint8_t* out_digest) {
+ uint8_t response[kTpmResponseHeaderLength + kPcrDigestLength];
+ ToTpmUint32(tpm_extend_cmd.pcrNum, pcr_num);
+ memcpy(tpm_extend_cmd.inDigest, in_digest, kPcrDigestLength);
+ SendReceive(tpm_extend_cmd.buffer, response, sizeof(response));
+ memcpy(out_digest, response + kTpmResponseHeaderLength, kPcrDigestLength);
+ return TpmReturnCode(response);
+}
« src/testsuite/earlyextend.c ('K') | « src/tlcl/tlcl.h ('k') | src/tlcl/tlcl_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698