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

Unified Diff: src/tlcl/tlcl.c

Issue 2719006: Added TPM command to read space permissions, and a correctness test. (Closed) Base URL: ssh://git@chromiumos-git/tpm_lite.git
Patch Set: Alphabetize. 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
« no previous file with comments | « src/tlcl/tlcl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/tlcl/tlcl.c
diff --git a/src/tlcl/tlcl.c b/src/tlcl/tlcl.c
index 524cf2e544c4d35ba273975d7adf85ab60657450..4ef5e40b5b5b068d71076f58e71780ef68aa1687 100644
--- a/src/tlcl/tlcl.c
+++ b/src/tlcl/tlcl.c
@@ -350,7 +350,7 @@ uint32_t TlclGetFlags(uint8_t* disable, uint8_t* deactivated) {
uint32_t result;
uint32_t size;
- SendReceive(tpm_getcapability_cmd.buffer, response, sizeof(response));
+ SendReceive(tpm_getflags_cmd.buffer, response, sizeof(response));
result = TpmReturnCode(response);
if (result != TPM_SUCCESS) {
return result;
@@ -377,3 +377,20 @@ uint32_t TlclExtend(int pcr_num, uint8_t* in_digest, uint8_t* out_digest) {
memcpy(out_digest, response + kTpmResponseHeaderLength, kPcrDigestLength);
return TpmReturnCode(response);
}
+
+uint32_t TlclGetPermissions(uint32_t index, uint32_t* permissions) {
+ uint8_t response[TPM_LARGE_ENOUGH_COMMAND_SIZE];
+ uint8_t* nvdata;
+ uint32_t result;
+ uint32_t size;
+
+ ToTpmUint32(tpm_getpermissions_cmd.index, index);
+ SendReceive(tpm_getpermissions_cmd.buffer, response, sizeof(response));
+ result = TpmReturnCode(response);
+ if (result != TPM_SUCCESS) {
+ return result;
+ }
+ nvdata = response + kTpmResponseHeaderLength + sizeof(size);
+ FromTpmUint32(nvdata + kNvDataPublicPermissionsOffset, permissions);
+ return result;
+}
« no previous file with comments | « src/tlcl/tlcl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698