Add -DTHIRD_PARTY to CFLAGS so as to configure system headers.

EC includes such as common.h are required for CONFIG_* defines,
which configure system headers, e.g. assert.h includes "common.h".
This means that third_party code would need broader include paths
beyond -Ibuiltin.  This is not desirable.

This change adds a -DTHIRD_PARTY to the tpm2 library and works
in tandem with a corresponding change to builtin/ that
guards against inclusion of platform headers.

The build environment will have to pass appropriate
-DCONFIG_* via CFLAGS to third_party libraries in order
to get the desired platform behavior.

BRANCH=none
BUG=chrome-os-partner:43025,chrome-os-partner:47524,chrome-os-partner:53782
TEST=compilation succeeds

Change-Id: If291dabf7cbb825ea625c8e37f81d6c95737430b
Signed-off-by: nagendra modadugu <ngm@google.com>
Reviewed-on: https://chromium-review.googlesource.com/347382
Commit-Ready: Nagendra Modadugu <ngm@google.com>
Tested-by: Nagendra Modadugu <ngm@google.com>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
1 file changed
tree: e641aef9c79c04410afc91aefb5f6d1b5fd84d94
  1. generator/
  2. .gitignore
  3. _TPM_Hash_Data.c
  4. _TPM_Hash_Data_fp.h
  5. _TPM_Hash_End.c
  6. _TPM_Hash_End_fp.h
  7. _TPM_Hash_Start.c
  8. _TPM_Hash_Start_fp.h
  9. _TPM_Init.c
  10. _TPM_Init_fp.h
  11. ActivateCredential.c
  12. ActivateCredential_fp.h
  13. AlgorithmCap.c
  14. AlgorithmCap_fp.h
  15. Attest_spt.c
  16. Attest_spt_fp.h
  17. BaseTypes.h
  18. Bits.c
  19. bits.h
  20. Bits_fp.h
  21. bool.h
  22. Cancel.c
  23. Capabilities.h
  24. Certify.c
  25. Certify_fp.h
  26. CertifyCreation.c
  27. CertifyCreation_fp.h
  28. ChangeEPS.c
  29. ChangeEPS_fp.h
  30. ChangePPS.c
  31. ChangePPS_fp.h
  32. Clear.c
  33. Clear_fp.h
  34. ClearControl.c
  35. ClearControl_fp.h
  36. Clock.c
  37. ClockRateAdjust.c
  38. ClockRateAdjust_fp.h
  39. ClockSet.c
  40. ClockSet_fp.h
  41. CommandAttributeData.c
  42. CommandAudit.c
  43. CommandAudit_fp.h
  44. CommandCodeAttributes.c
  45. CommandCodeAttributes_fp.h
  46. CommandDispatcher.c
  47. CommandDispatcher_fp.h
  48. Commands_fp.h
  49. COMMIT-QUEUE.ini
  50. Commit.c
  51. Commit_fp.h
  52. Context_spt.c
  53. Context_spt_fp.h
  54. ContextLoad.c
  55. ContextLoad_fp.h
  56. ContextSave.c
  57. ContextSave_fp.h
  58. CpriCryptPri.c
  59. CpriCryptPri_fp.h
  60. CpriDataEcc.c
  61. CpriDataEcc.h
  62. CpriECC.c
  63. CpriECC_fp.h
  64. CpriHash.c
  65. CpriHash_fp.h
  66. CpriHashData.c
  67. CpriMisc.c
  68. CpriMisc_fp.h
  69. CpriRNG.c
  70. CpriRNG_fp.h
  71. CpriRSA.c
  72. CpriRSA_fp.h
  73. CpriSym.c
  74. CpriSym_fp.h
  75. Create.c
  76. Create_fp.h
  77. CreatePrimary.c
  78. CreatePrimary_fp.h
  79. CryptoEngine.h
  80. CryptSelfTest.c
  81. CryptSelfTest_fp.h
  82. CryptUtil.c
  83. CryptUtil_fp.h
  84. DA.c
  85. DA_fp.h
  86. DictionaryAttackLockReset.c
  87. DictionaryAttackLockReset_fp.h
  88. DictionaryAttackParameters.c
  89. DictionaryAttackParameters_fp.h
  90. DRTM.c
  91. Duplicate.c
  92. Duplicate_fp.h
  93. EC_Ephemeral.c
  94. EC_Ephemeral_fp.h
  95. ECC_Parameters.c
  96. ECC_Parameters_fp.h
  97. ECDH_KeyGen.c
  98. ECDH_KeyGen_fp.h
  99. ECDH_ZGen.c
  100. ECDH_ZGen_fp.h
  101. EncryptDecrypt.c
  102. EncryptDecrypt_fp.h
  103. Entity.c
  104. Entity_fp.h
  105. Entropy.c
  106. EventSequenceComplete.c
  107. EventSequenceComplete_fp.h
  108. EvictControl.c
  109. EvictControl_fp.h
  110. ExecCommand.c
  111. ExecCommand_fp.h
  112. FieldUpgradeData.c
  113. FieldUpgradeData_fp.h
  114. FieldUpgradeStart.c
  115. FieldUpgradeStart_fp.h
  116. FirmwareRead.c
  117. FirmwareRead_fp.h
  118. FlushContext.c
  119. FlushContext_fp.h
  120. GetCapability.c
  121. GetCapability_fp.h
  122. GetCommandAuditDigest.c
  123. GetCommandAuditDigest_fp.h
  124. GetCommandCodeString.c
  125. GetCommandCodeString_fp.h
  126. GetRandom.c
  127. GetRandom_fp.h
  128. GetSessionAuditDigest.c
  129. GetSessionAuditDigest_fp.h
  130. GetTestResult.c
  131. GetTestResult_fp.h
  132. GetTime.c
  133. GetTime_fp.h
  134. Global.c
  135. Global.h
  136. Handle.c
  137. Handle_fp.h
  138. HandleProcess.c
  139. HandleProcess_fp.h
  140. Hash.c
  141. Hash_fp.h
  142. HashSequenceStart.c
  143. HashSequenceStart_fp.h
  144. Hierarchy.c
  145. Hierarchy_fp.h
  146. HierarchyChangeAuth.c
  147. HierarchyChangeAuth_fp.h
  148. HierarchyControl.c
  149. HierarchyControl_fp.h
  150. HMAC.c
  151. HMAC_fp.h
  152. HMAC_Start.c
  153. HMAC_Start_fp.h
  154. Implementation.h
  155. Import.c
  156. Import_fp.h
  157. IncrementalSelfTest.c
  158. IncrementalSelfTest_fp.h
  159. InternalRoutines.h
  160. LICENSE
  161. Load.c
  162. Load_fp.h
  163. LoadExternal.c
  164. LoadExternal_fp.h
  165. Locality.c
  166. Locality_fp.h
  167. LocalityPlat.c
  168. MakeCredential.c
  169. MakeCredential_fp.h
  170. Makefile
  171. Manufacture.c
  172. Manufacture_fp.h
  173. Marshal_ActivateCredential.c
  174. Marshal_Certify.c
  175. Marshal_CertifyCreation.c
  176. Marshal_ChangeEPS.c
  177. Marshal_ChangePPS.c
  178. Marshal_Clear.c
  179. Marshal_ClearControl.c
  180. Marshal_ClockRateAdjust.c
  181. Marshal_ClockSet.c
  182. Marshal_Commit.c
  183. Marshal_ContextLoad.c
  184. Marshal_ContextSave.c
  185. Marshal_Create.c
  186. Marshal_CreatePrimary.c
  187. Marshal_DictionaryAttackLockReset.c
  188. Marshal_DictionaryAttackParameters.c
  189. Marshal_Duplicate.c
  190. Marshal_EC_Ephemeral.c
  191. Marshal_ECC_Parameters.c
  192. Marshal_ECDH_KeyGen.c
  193. Marshal_ECDH_ZGen.c
  194. Marshal_EncryptDecrypt.c
  195. Marshal_EventSequenceComplete.c
  196. Marshal_EvictControl.c
  197. Marshal_FieldUpgradeData.c
  198. Marshal_FieldUpgradeStart.c
  199. Marshal_FirmwareRead.c
  200. Marshal_FlushContext.c
  201. marshal_fp.h
  202. Marshal_GetCapability.c
  203. Marshal_GetCommandAuditDigest.c
  204. Marshal_GetRandom.c
  205. Marshal_GetSessionAuditDigest.c
  206. Marshal_GetTestResult.c
  207. Marshal_GetTime.c
  208. Marshal_Hash.c
  209. Marshal_HashSequenceStart.c
  210. Marshal_HierarchyChangeAuth.c
  211. Marshal_HierarchyControl.c
  212. Marshal_HMAC.c
  213. Marshal_HMAC_Start.c
  214. Marshal_Import.c
  215. Marshal_IncrementalSelfTest.c
  216. Marshal_Load.c
  217. Marshal_LoadExternal.c
  218. Marshal_MakeCredential.c
  219. Marshal_NV_Certify.c
  220. Marshal_NV_ChangeAuth.c
  221. Marshal_NV_DefineSpace.c
  222. Marshal_NV_Extend.c
  223. Marshal_NV_GlobalWriteLock.c
  224. Marshal_NV_Increment.c
  225. Marshal_NV_Read.c
  226. Marshal_NV_ReadLock.c
  227. Marshal_NV_ReadPublic.c
  228. Marshal_NV_SetBits.c
  229. Marshal_NV_UndefineSpace.c
  230. Marshal_NV_UndefineSpaceSpecial.c
  231. Marshal_NV_Write.c
  232. Marshal_NV_WriteLock.c
  233. Marshal_ObjectChangeAuth.c
  234. Marshal_PCR_Allocate.c
  235. Marshal_PCR_Event.c
  236. Marshal_PCR_Extend.c
  237. Marshal_PCR_Read.c
  238. Marshal_PCR_Reset.c
  239. Marshal_PCR_SetAuthPolicy.c
  240. Marshal_PCR_SetAuthValue.c
  241. Marshal_PolicyAuthorize.c
  242. Marshal_PolicyAuthValue.c
  243. Marshal_PolicyCommandCode.c
  244. Marshal_PolicyCounterTimer.c
  245. Marshal_PolicyCpHash.c
  246. Marshal_PolicyDuplicationSelect.c
  247. Marshal_PolicyGetDigest.c
  248. Marshal_PolicyLocality.c
  249. Marshal_PolicyNameHash.c
  250. Marshal_PolicyNV.c
  251. Marshal_PolicyNvWritten.c
  252. Marshal_PolicyOR.c
  253. Marshal_PolicyPassword.c
  254. Marshal_PolicyPCR.c
  255. Marshal_PolicyPhysicalPresence.c
  256. Marshal_PolicyRestart.c
  257. Marshal_PolicySecret.c
  258. Marshal_PolicySigned.c
  259. Marshal_PolicyTicket.c
  260. Marshal_PP_Commands.c
  261. Marshal_Quote.c
  262. Marshal_ReadClock.c
  263. Marshal_ReadPublic.c
  264. Marshal_Rewrap.c
  265. Marshal_RSA_Decrypt.c
  266. Marshal_RSA_Encrypt.c
  267. Marshal_SelfTest.c
  268. Marshal_SequenceComplete.c
  269. Marshal_SequenceUpdate.c
  270. Marshal_SetAlgorithmSet.c
  271. Marshal_SetCommandCodeAuditStatus.c
  272. Marshal_SetPrimaryPolicy.c
  273. Marshal_Shutdown.c
  274. Marshal_Sign.c
  275. Marshal_StartAuthSession.c
  276. Marshal_Startup.c
  277. Marshal_StirRandom.c
  278. marshal_test.c
  279. Marshal_TestParms.c
  280. Marshal_Unseal.c
  281. Marshal_VerifySignature.c
  282. Marshal_ZGen_2Phase.c
  283. MathFunctions.c
  284. MathFunctions_fp.h
  285. MemoryLib.c
  286. MemoryLib_fp.h
  287. NV.c
  288. NV_Certify.c
  289. NV_Certify_fp.h
  290. NV_ChangeAuth.c
  291. NV_ChangeAuth_fp.h
  292. NV_DefineSpace.c
  293. NV_DefineSpace_fp.h
  294. NV_Extend.c
  295. NV_Extend_fp.h
  296. NV_fp.h
  297. NV_GlobalWriteLock.c
  298. NV_GlobalWriteLock_fp.h
  299. NV_Increment.c
  300. NV_Increment_fp.h
  301. NV_Read.c
  302. NV_Read_fp.h
  303. NV_ReadLock.c
  304. NV_ReadLock_fp.h
  305. NV_ReadPublic.c
  306. NV_ReadPublic_fp.h
  307. NV_SetBits.c
  308. NV_SetBits_fp.h
  309. NV_spt.c
  310. NV_spt_fp.h
  311. NV_UndefineSpace.c
  312. NV_UndefineSpace_fp.h
  313. NV_UndefineSpaceSpecial.c
  314. NV_UndefineSpaceSpecial_fp.h
  315. NV_Write.c
  316. NV_Write_fp.h
  317. NV_WriteLock.c
  318. NV_WriteLock_fp.h
  319. NVMem.c
  320. Object.c
  321. Object_fp.h
  322. Object_spt.c
  323. Object_spt_fp.h
  324. ObjectChangeAuth.c
  325. ObjectChangeAuth_fp.h
  326. OsslCryptoEngine.h
  327. parsep3
  328. parsep4
  329. PCR.c
  330. PCR_Allocate.c
  331. PCR_Allocate_fp.h
  332. PCR_Event.c
  333. PCR_Event_fp.h
  334. PCR_Extend.c
  335. PCR_Extend_fp.h
  336. PCR_fp.h
  337. PCR_Read.c
  338. PCR_Read_fp.h
  339. PCR_Reset.c
  340. PCR_Reset_fp.h
  341. PCR_SetAuthPolicy.c
  342. PCR_SetAuthPolicy_fp.h
  343. PCR_SetAuthValue.c
  344. PCR_SetAuthValue_fp.h
  345. Platform.h
  346. PlatformData.c
  347. PlatformData.h
  348. Policy_spt.c
  349. Policy_spt_fp.h
  350. PolicyAuthorize.c
  351. PolicyAuthorize_fp.h
  352. PolicyAuthValue.c
  353. PolicyAuthValue_fp.h
  354. PolicyCommandCode.c
  355. PolicyCommandCode_fp.h
  356. PolicyCounterTimer.c
  357. PolicyCounterTimer_fp.h
  358. PolicyCpHash.c
  359. PolicyCpHash_fp.h
  360. PolicyDuplicationSelect.c
  361. PolicyDuplicationSelect_fp.h
  362. PolicyGetDigest.c
  363. PolicyGetDigest_fp.h
  364. PolicyLocality.c
  365. PolicyLocality_fp.h
  366. PolicyNameHash.c
  367. PolicyNameHash_fp.h
  368. PolicyNV.c
  369. PolicyNV_fp.h
  370. PolicyNvWritten.c
  371. PolicyNvWritten_fp.h
  372. PolicyOR.c
  373. PolicyOR_fp.h
  374. PolicyPassword.c
  375. PolicyPassword_fp.h
  376. PolicyPCR.c
  377. PolicyPCR_fp.h
  378. PolicyPhysicalPresence.c
  379. PolicyPhysicalPresence_fp.h
  380. PolicyRestart.c
  381. PolicyRestart_fp.h
  382. PolicySecret.c
  383. PolicySecret_fp.h
  384. PolicySigned.c
  385. PolicySigned_fp.h
  386. PolicyTicket.c
  387. PolicyTicket_fp.h
  388. Power.c
  389. Power_fp.h
  390. PowerPlat.c
  391. PP.c
  392. PP_Commands.c
  393. PP_Commands_fp.h
  394. PP_fp.h
  395. PPPlat.c
  396. PRESUBMIT.cfg
  397. PropertyCap.c
  398. PropertyCap_fp.h
  399. Quote.c
  400. Quote_fp.h
  401. ReadClock.c
  402. ReadClock_fp.h
  403. README
  404. ReadPublic.c
  405. ReadPublic_fp.h
  406. Rewrap.c
  407. Rewrap_fp.h
  408. RSA_Decrypt.c
  409. RSA_Decrypt_fp.h
  410. RSA_Encrypt.c
  411. RSA_Encrypt_fp.h
  412. RSAData.c
  413. RSAKeySieve.c
  414. RSAKeySieve.h
  415. RSAKeySieve_fp.h
  416. SelfTest.c
  417. SelfTest_fp.h
  418. SequenceComplete.c
  419. SequenceComplete_fp.h
  420. SequenceUpdate.c
  421. SequenceUpdate_fp.h
  422. Session.c
  423. Session_fp.h
  424. SessionProcess.c
  425. SessionProcess_fp.h
  426. SetAlgorithmSet.c
  427. SetAlgorithmSet_fp.h
  428. SetCommandCodeAuditStatus.c
  429. SetCommandCodeAuditStatus_fp.h
  430. SetPrimaryPolicy.c
  431. SetPrimaryPolicy_fp.h
  432. Shutdown.c
  433. Shutdown_fp.h
  434. Sign.c
  435. Sign_fp.h
  436. StartAuthSession.c
  437. StartAuthSession_fp.h
  438. Startup.c
  439. Startup_fp.h
  440. StirRandom.c
  441. StirRandom_fp.h
  442. stubs_ecc.c
  443. stubs_hash.c
  444. stubs_sym.c
  445. swap.h
  446. TcpServer.c
  447. TestParms.c
  448. TestParms_fp.h
  449. Ticket.c
  450. Ticket_fp.h
  451. Time.c
  452. Time_fp.h
  453. Tpm.h
  454. tpm_generated.c
  455. tpm_generated.h
  456. TPM_Types.h
  457. tpm_types.h
  458. TPMB.h
  459. TpmBuildSwitches.h
  460. TPMCmdp.c
  461. TPMCmds.c
  462. TpmError.h
  463. TpmFail.c
  464. TpmFail_fp.h
  465. TpmTcpProtocol.h
  466. Unique.c
  467. Unique_fp.h
  468. Unseal.c
  469. Unseal_fp.h
  470. VendorString.h
  471. VerifySignature.c
  472. VerifySignature_fp.h
  473. ZGen_2Phase.c
  474. ZGen_2Phase_fp.h