Make more functions return a status.
Review URL: http://codereview.chromium.org/2289002
diff --git a/src/tlcl/tlcl.c b/src/tlcl/tlcl.c
index 5afe83e..3d34d6c 100644
--- a/src/tlcl/tlcl.c
+++ b/src/tlcl/tlcl.c
@@ -312,8 +312,10 @@
Send(tpm_ppassert_cmd.buffer);
}
-void TlclLockPhysicalPresence(void) {
- Send(tpm_pplock_cmd.buffer);
+uint32_t TlclLockPhysicalPresence(void) {
+ uint8_t response[TPM_LARGE_ENOUGH_COMMAND_SIZE];
+ SendReceive(tpm_pplock_cmd.buffer, response, sizeof(response));
+ return TpmReturnCode(response);
}
void TlclSetNvLocked(void) {
@@ -372,8 +374,7 @@
return result;
}
-void TlclSetGlobalLock(void) {
+uint32_t TlclSetGlobalLock(void) {
uint32_t x;
- uint32_t result = TlclWrite(TPM_NV_INDEX0, (uint8_t*) &x, 0);
- assert(result == TPM_SUCCESS);
+ return TlclWrite(TPM_NV_INDEX0, (uint8_t*) &x, 0);
}
diff --git a/src/tlcl/tlcl.h b/src/tlcl/tlcl.h
index 420bf41..6344756 100644
--- a/src/tlcl/tlcl.h
+++ b/src/tlcl/tlcl.h
@@ -102,7 +102,7 @@
/* Turns off physical presence and locks it off until next reboot.
*/
-void TlclLockPhysicalPresence(void);
+uint32_t TlclLockPhysicalPresence(void);
/* Sets the nvLocked bit.
*/
@@ -130,6 +130,6 @@
/* Sets the bGlobalLock flag, which only a reboot can clear.
*/
-void TlclSetGlobalLock(void);
+uint32_t TlclSetGlobalLock(void);
#endif /* TPM_LITE_TLCL_H_ */