Changes to allow compilation of CommandCodeAttributes.c

CommandAttributesData.c is an include file, does not need to be
included in Makefile on its own.

BUG=none
TEST=compilation succeeds:
   cc -Wall -Werror -c -o /dev/null CommandCodeAttributes.c

Change-Id: I91b5032721755de85c3df7aa0f9815e2d00d6e3a
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/274093
Reviewed-by: Utkarsh Sanghi <usanghi@chromium.org>
diff --git a/CommandCodeAttributes.c b/CommandCodeAttributes.c
index bf50bbc..45cf17e 100644
--- a/CommandCodeAttributes.c
+++ b/CommandCodeAttributes.c
@@ -47,8 +47,8 @@
        if(properties & HANDLE_1_DUP) return AUTH_DUP;
        return AUTH_NONE;
    }
-   if(s_commandAttributes[commandCode - TPM_CC_FIRST] & HANDLE_2_USER) return
-//     AUTH_USER;
+   if(s_commandAttributes[commandCode - TPM_CC_FIRST] & HANDLE_2_USER)
+           return AUTH_USER;
    return AUTH_NONE;
 }
 //
@@ -94,6 +94,8 @@
     // This function should be called in the way that the command code
     // attribute is available.
     FAIL(FATAL_ERROR_INTERNAL);
+
+    return s_ccAttr[0]; // Just to appease the compiler, never reached.
 }
 //
 //
diff --git a/Makefile b/Makefile
index 400f90c..2871d6d 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,6 @@
 SOURCES += Clock.c
 SOURCES += ClockRateAdjust.c
 SOURCES += ClockSet.c
-SOURCES += CommandAttributeData.c
 SOURCES += CommandAudit.c
 SOURCES += CommandCodeAttributes.c
 SOURCES += Commit.c
diff --git a/TPM_Types.h b/TPM_Types.h
index 9475aaf..921833d 100644
--- a/TPM_Types.h
+++ b/TPM_Types.h
@@ -258,6 +258,19 @@
   UINT8 Extended : 3;
 } TPMA_LOCALITY;
 
+// Table 36 - TPMA_CC Bits
+typedef struct {
+  UINT32 commandIndex  : 16;
+  UINT32 reserved16_21 : 6;
+  UINT32 nv            : 1;
+  UINT32 extensive     : 1;
+  UINT32 flushed       : 1;
+  UINT32 cHandles      : 3;
+  UINT32 rHandle       : 1;
+  UINT32 V             : 1;
+  UINT32 Res           : 2;
+} TPMA_CC;
+
 // Table 37 - TPMI_YES_NO Type
 typedef BYTE TPMI_YES_NO;
 
@@ -359,6 +372,12 @@
   TPM_CC commandCodes[MAX_CAP_CC];
 } TPML_CC;
 
+// Table 92 - TPML_CCA Structure
+typedef struct {
+  UINT32  count;
+  TPMA_CC commandAttributes[MAX_CAP_CC];
+} TPML_CCA;
+
 // Table 98 - TPML_PCR_SELECTION Structure
 typedef struct {
   UINT32             count;