esys_int.3 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. .TH "esys_int" 3 "Fri Oct 7 2022" "Version 3.2.0" "tpm2-tss" \" -*- nroff -*-
  2. .ad l
  3. .nh
  4. .SH NAME
  5. esys_int
  6. .SH SYNOPSIS
  7. .br
  8. .PP
  9. .SS "Data Structures"
  10. .in +1c
  11. .ti -1c
  12. .RI "struct \fBRSRC_NODE_T\fP"
  13. .br
  14. .ti -1c
  15. .RI "struct \fBESYS_CONTEXT\fP"
  16. .br
  17. .ti -1c
  18. .RI "struct \fBIESYS_SESSION\fP"
  19. .br
  20. .ti -1c
  21. .RI "union \fBIESYS_RSRC_UNION\fP"
  22. .br
  23. .ti -1c
  24. .RI "struct \fBIESYS_RESOURCE\fP"
  25. .br
  26. .ti -1c
  27. .RI "struct \fBIESYS_METADATA\fP"
  28. .br
  29. .ti -1c
  30. .RI "struct \fBIESYS_CONTEXT_DATA\fP"
  31. .br
  32. .in -1c
  33. .SS "Macros"
  34. .in +1c
  35. .ti -1c
  36. .RI "#define \fB_ESYS_MAX_SUBMISSIONS\fP 5"
  37. .br
  38. .ti -1c
  39. .RI "#define \fB_ESYS_ASSERT_NON_NULL\fP(x)"
  40. .br
  41. .ti -1c
  42. .RI "#define \fBIESYSC_KEY_RSRC\fP 1"
  43. .br
  44. .ti -1c
  45. .RI "#define \fBIESYSC_NV_RSRC\fP 2"
  46. .br
  47. .ti -1c
  48. .RI "#define \fBIESYSC_SESSION_RSRC\fP 3"
  49. .br
  50. .ti -1c
  51. .RI "#define \fBIESYSC_WITHOUT_MISC_RSRC\fP 0"
  52. .br
  53. .ti -1c
  54. .RI "#define \fBENCRYPT\fP 1"
  55. .br
  56. .ti -1c
  57. .RI "#define \fBNO_ENCRYPT\fP 0"
  58. .br
  59. .ti -1c
  60. .RI "#define \fBDECRYPT\fP 1"
  61. .br
  62. .ti -1c
  63. .RI "#define \fBNO_DECRYPT\fP 0"
  64. .br
  65. .ti -1c
  66. .RI "#define \fBPOLICY_PASSWORD\fP 2"
  67. .br
  68. .ti -1c
  69. .RI "#define \fBPOLICY_AUTH\fP 1"
  70. .br
  71. .ti -1c
  72. .RI "#define \fBNO_POLICY_AUTH\fP 0"
  73. .br
  74. .in -1c
  75. .SS "Typedefs"
  76. .in +1c
  77. .ti -1c
  78. .RI "typedef struct \fBRSRC_NODE_T\fP \fBRSRC_NODE_T\fP"
  79. .br
  80. .ti -1c
  81. .RI "typedef UINT32 \fBIESYSC_RESOURCE_TYPE_CONSTANT\fP"
  82. .br
  83. .ti -1c
  84. .RI "typedef UINT32 \fBIESYSC_PARAM_ENCRYPT\fP"
  85. .br
  86. .ti -1c
  87. .RI "typedef UINT32 \fBIESYSC_PARAM_DECRYPT\fP"
  88. .br
  89. .ti -1c
  90. .RI "typedef UINT32 \fBIESYSC_TYPE_POLICY_AUTH\fP"
  91. .br
  92. .ti -1c
  93. .RI "typedef UINT32 \fBIESYSC_RESOURCE_TYPE\fP"
  94. .br
  95. .in -1c
  96. .SS "Enumerations"
  97. .in +1c
  98. .ti -1c
  99. .RI "enum \fB_ESYS_STATE\fP { \fB_ESYS_STATE_INIT\fP = 0, \fB_ESYS_STATE_SENT\fP, \fB_ESYS_STATE_RESUBMISSION\fP, \fB_ESYS_STATE_INTERNALERROR\fP }"
  100. .br
  101. .in -1c
  102. .SH "Detailed Description"
  103. .PP
  104. The ESAPI implementation requires a set of internal type definitions\&.
  105. .SH "Data Structure Documentation"
  106. .PP
  107. .SH "struct RSRC_NODE_T"
  108. .PP
  109. Linked list type for object meta data\&.
  110. .PP
  111. This structure represents a linked list to store meta data information of type \fBIESYS_RESOURCE\fP\&.
  112. .PP
  113. .in -1c
  114. .RI "\fBData Fields\fP"
  115. .in +1c
  116. .in +1c
  117. .ti -1c
  118. .RI "\fBESYS_TR\fP \fBesys_handle\fP"
  119. .br
  120. .ti -1c
  121. .RI "TPM2B_AUTH \fBauth\fP"
  122. .br
  123. .ti -1c
  124. .RI "\fBIESYS_RESOURCE\fP \fBrsrc\fP"
  125. .br
  126. .ti -1c
  127. .RI "struct \fBRSRC_NODE_T\fP * \fBnext\fP"
  128. .br
  129. .in -1c
  130. .SH "Field Documentation"
  131. .PP
  132. .SS "TPM2B_AUTH auth"
  133. The authValue for this resource object\&.
  134. .SS "\fBESYS_TR\fP esys_handle"
  135. The ESYS_TR handle used by the application to reference this entry\&.
  136. .SS "struct \fBRSRC_NODE_T\fP* next"
  137. The next object in the linked list\&.
  138. .SS "\fBIESYS_RESOURCE\fP rsrc"
  139. The meta data for this resource object\&.
  140. .SH "struct ESYS_CONTEXT"
  141. .PP
  142. The data structure holding internal state information\&.
  143. .PP
  144. Each \fBESYS_CONTEXT\fP respresents a logically independent connection to the TPM\&. It stores meta data information about object in order to calculate session auths and similar things\&.
  145. .PP
  146. .in -1c
  147. .RI "\fBData Fields\fP"
  148. .in +1c
  149. .in +1c
  150. .ti -1c
  151. .RI "enum \fB_ESYS_STATE\fP \fBstate\fP"
  152. .br
  153. .ti -1c
  154. .RI "TSS2_SYS_CONTEXT * \fBsys\fP"
  155. .br
  156. .ti -1c
  157. .RI "\fBESYS_TR\fP \fBesys_handle_cnt\fP"
  158. .br
  159. .ti -1c
  160. .RI "\fBRSRC_NODE_T\fP * \fBrsrc_list\fP"
  161. .br
  162. .ti -1c
  163. .RI "int32_t \fBtimeout\fP"
  164. .br
  165. .ti -1c
  166. .RI "\fBESYS_TR\fP \fBsession_type\fP [3]"
  167. .br
  168. .ti -1c
  169. .RI "\fBRSRC_NODE_T\fP * \fBsession_tab\fP [3]"
  170. .br
  171. .ti -1c
  172. .RI "int \fBencryptNonceIdx\fP"
  173. .br
  174. .ti -1c
  175. .RI "TPM2B_NONCE * \fBencryptNonce\fP"
  176. .br
  177. .ti -1c
  178. .RI "int \fBauthsCount\fP"
  179. .br
  180. .ti -1c
  181. .RI "int \fBsubmissionCount\fP"
  182. .br
  183. .ti -1c
  184. .RI "TPM2B_DATA \fBsalt\fP"
  185. .br
  186. .ti -1c
  187. .RI "IESYS_CMD_IN_PARAM \fBin\fP"
  188. .br
  189. .ti -1c
  190. .RI "\fBESYS_TR\fP \fBesys_handle\fP"
  191. .br
  192. .ti -1c
  193. .RI "TSS2_TCTI_CONTEXT * \fBtcti_app_param\fP"
  194. .br
  195. .ti -1c
  196. .RI "void * \fBdlhandle\fP"
  197. .br
  198. .ti -1c
  199. .RI "\fBIESYS_SESSION\fP * \fBenc_session\fP"
  200. .br
  201. .in -1c
  202. .SH "Field Documentation"
  203. .PP
  204. .SS "int authsCount"
  205. The number of session provided during the command\&.
  206. .SS "void* dlhandle"
  207. The handle of dlopen if the tcti was automatically loaded\&.
  208. .SS "\fBIESYS_SESSION\fP* enc_session"
  209. Ptr to the enc param session\&. Used to restore session attributes
  210. .SS "TPM2B_NONCE* encryptNonce"
  211. The nonce of the encrypt session, or NULL if no encrypt session exists\&.
  212. .SS "int encryptNonceIdx"
  213. The index of the encrypt session\&.
  214. .SS "\fBESYS_TR\fP esys_handle"
  215. Temporary storage for the object's TPM handle during Esys_TR_FromTPMPublic\&.
  216. .SS "\fBESYS_TR\fP esys_handle_cnt"
  217. The next free ESYS_TR number\&.
  218. .SS "IESYS_CMD_IN_PARAM in"
  219. Temporary storage for Input parameters needed in corresponding _Finish function
  220. .SS "\fBRSRC_NODE_T\fP* rsrc_list"
  221. The linked list of all ESYS_TR objects\&.
  222. .SS "TPM2B_DATA salt"
  223. The salt used during a StartAuthSession\&.
  224. .SS "\fBRSRC_NODE_T\fP* session_tab[3]"
  225. The list of TPM session meta data in the current command execution\&.
  226. .SS "\fBESYS_TR\fP session_type[3]"
  227. The list of TPM session handles in the current command execution\&.
  228. .SS "enum \fB_ESYS_STATE\fP state"
  229. The current state of the ESAPI context\&.
  230. .SS "int submissionCount"
  231. The current number of submissions of this command to the TPM\&.
  232. .SS "TSS2_SYS_CONTEXT* sys"
  233. The SYS context used internally to talk to the TPM\&.
  234. .SS "TSS2_TCTI_CONTEXT* tcti_app_param"
  235. The TCTI context provided by the application during \fBEsys_Initialize()\fP to be returned from \fBEsys_GetTcti()\fP\&.
  236. .SS "int32_t timeout"
  237. The timeout to be used during Tss2_Sys_ExecuteFinish\&.
  238. .SH "struct IESYS_SESSION"
  239. .PP
  240. Type for representing TPM-Session
  241. .PP
  242. .in -1c
  243. .RI "\fBData Fields\fP"
  244. .in +1c
  245. .in +1c
  246. .ti -1c
  247. .RI "TPM2B_NAME \fBbound_entity\fP"
  248. .br
  249. .ti -1c
  250. .RI "TPM2B_ENCRYPTED_SECRET \fBencryptedSalt\fP"
  251. .br
  252. .ti -1c
  253. .RI "TPM2B_DATA \fBsalt\fP"
  254. .br
  255. .ti -1c
  256. .RI "TPMT_SYM_DEF \fBsymmetric\fP"
  257. .br
  258. .ti -1c
  259. .RI "TPMI_ALG_HASH \fBauthHash\fP"
  260. .br
  261. .ti -1c
  262. .RI "TPM2B_DIGEST \fBsessionKey\fP"
  263. .br
  264. .ti -1c
  265. .RI "TPM2_SE \fBsessionType\fP"
  266. .br
  267. .ti -1c
  268. .RI "TPMA_SESSION \fBsessionAttributes\fP"
  269. .br
  270. .ti -1c
  271. .RI "TPMA_SESSION \fBorigSessionAttributes\fP"
  272. .br
  273. .ti -1c
  274. .RI "TPM2B_NONCE \fBnonceCaller\fP"
  275. .br
  276. .ti -1c
  277. .RI "TPM2B_NONCE \fBnonceTPM\fP"
  278. .br
  279. .ti -1c
  280. .RI "\fBIESYSC_PARAM_ENCRYPT\fP \fBencrypt\fP"
  281. .br
  282. .ti -1c
  283. .RI "\fBIESYSC_PARAM_DECRYPT\fP \fBdecrypt\fP"
  284. .br
  285. .ti -1c
  286. .RI "\fBIESYSC_TYPE_POLICY_AUTH\fP \fBtype_policy_session\fP"
  287. .br
  288. .ti -1c
  289. .RI "UINT16 \fBsizeSessionValue\fP"
  290. .br
  291. .ti -1c
  292. .RI "BYTE \fBsessionValue\fP [2 *sizeof(TPMU_HA)]"
  293. .br
  294. .ti -1c
  295. .RI "UINT16 \fBsizeHmacValue\fP"
  296. .br
  297. .in -1c
  298. .SH "Field Documentation"
  299. .PP
  300. .SS "TPMI_ALG_HASH authHash"
  301. Hashalg used for authorization
  302. .SS "TPM2B_NAME bound_entity"
  303. Entity to which the session is bound
  304. .SS "\fBIESYSC_PARAM_DECRYPT\fP decrypt"
  305. Indicate parameter decryption by the TPM
  306. .SS "\fBIESYSC_PARAM_ENCRYPT\fP encrypt"
  307. Indicate parameter encryption by the TPM
  308. .SS "TPM2B_ENCRYPTED_SECRET encryptedSalt"
  309. Encrypted salt which can be provided by application
  310. .SS "TPM2B_NONCE nonceCaller"
  311. Nonce computed by the ESAPI for every session call
  312. .SS "TPM2B_NONCE nonceTPM"
  313. Nonce which is returned by the TPM for every session call
  314. .SS "TPMA_SESSION origSessionAttributes"
  315. Copy of flags which define the session behaviour
  316. .SS "TPM2B_DATA salt"
  317. Salt computed if no encrypted salt is provided
  318. .SS "TPMA_SESSION sessionAttributes"
  319. Flags which define the session behaviour
  320. .SS "TPM2B_DIGEST sessionKey"
  321. sessionKey used for KDFa to compute symKey
  322. .SS "TPM2_SE sessionType"
  323. Type of the session (HMAC, Policy)
  324. .SS "BYTE sessionValue[2 *sizeof(TPMU_HA)]"
  325. sessionKey || AuthValue
  326. .SS "UINT16 sizeHmacValue"
  327. Size of sessionKey plus optionally authValue
  328. .SS "UINT16 sizeSessionValue"
  329. Size of sessionKey plus optionally authValue
  330. .SS "TPMT_SYM_DEF symmetric"
  331. Algorithm selection for parameter encryption
  332. .SS "\fBIESYSC_TYPE_POLICY_AUTH\fP type_policy_session"
  333. Field to store markers for policy sessions
  334. .SH "union IESYS_RSRC_UNION"
  335. .PP
  336. Type for representing public info of a TPM-Resource
  337. .PP
  338. .in -1c
  339. .RI "\fBData Fields\fP"
  340. .in +1c
  341. .in +1c
  342. .ti -1c
  343. .RI "TPM2B_PUBLIC \fBrsrc_key_pub\fP"
  344. .br
  345. .ti -1c
  346. .RI "TPM2B_NV_PUBLIC \fBrsrc_nv_pub\fP"
  347. .br
  348. .ti -1c
  349. .RI "\fBIESYS_SESSION\fP \fBrsrc_session\fP"
  350. .br
  351. .ti -1c
  352. .RI "TPMS_EMPTY \fBrsrc_empty\fP"
  353. .br
  354. .in -1c
  355. .SH "Field Documentation"
  356. .PP
  357. .SS "TPMS_EMPTY rsrc_empty"
  358. no specialized date for resource
  359. .SS "TPM2B_PUBLIC rsrc_key_pub"
  360. Public info for key objects
  361. .SS "TPM2B_NV_PUBLIC rsrc_nv_pub"
  362. Public info for NV ram objects
  363. .SS "\fBIESYS_SESSION\fP rsrc_session"
  364. Internal esapi session information
  365. .SH "struct IESYS_RESOURCE"
  366. .PP
  367. Type for representing TPM-Resource
  368. .PP
  369. .in -1c
  370. .RI "\fBData Fields\fP"
  371. .in +1c
  372. .in +1c
  373. .ti -1c
  374. .RI "TPM2_HANDLE \fBhandle\fP"
  375. .br
  376. .ti -1c
  377. .RI "TPM2B_NAME \fBname\fP"
  378. .br
  379. .ti -1c
  380. .RI "\fBIESYSC_RESOURCE_TYPE\fP \fBrsrcType\fP"
  381. .br
  382. .ti -1c
  383. .RI "\fBIESYS_RSRC_UNION\fP \fBmisc\fP"
  384. .br
  385. .in -1c
  386. .SH "Field Documentation"
  387. .PP
  388. .SS "TPM2_HANDLE handle"
  389. Handle used by TPM
  390. .SS "\fBIESYS_RSRC_UNION\fP misc"
  391. Resource specific information
  392. .SS "TPM2B_NAME name"
  393. TPM name of the object
  394. .SS "\fBIESYSC_RESOURCE_TYPE\fP rsrcType"
  395. Selector for resource type
  396. .SH "struct IESYS_METADATA"
  397. .PP
  398. Esys resource with size field
  399. .PP
  400. .in -1c
  401. .RI "\fBData Fields\fP"
  402. .in +1c
  403. .in +1c
  404. .ti -1c
  405. .RI "UINT16 \fBsize\fP"
  406. .br
  407. .ti -1c
  408. .RI "\fBIESYS_RESOURCE\fP \fBdata\fP"
  409. .br
  410. .in -1c
  411. .SH "Field Documentation"
  412. .PP
  413. .SS "\fBIESYS_RESOURCE\fP data"
  414. Esys resource data
  415. .SS "UINT16 size"
  416. size of the operand buffer
  417. .SH "struct IESYS_CONTEXT_DATA"
  418. .PP
  419. Type for representing ESYS metadata
  420. .PP
  421. .in -1c
  422. .RI "\fBData Fields\fP"
  423. .in +1c
  424. .in +1c
  425. .ti -1c
  426. .RI "UINT32 \fBreserved\fP"
  427. .br
  428. .ti -1c
  429. .RI "TPM2B_CONTEXT_DATA \fBtpmContext\fP"
  430. .br
  431. .ti -1c
  432. .RI "\fBIESYS_METADATA\fP \fBesysMetadata\fP"
  433. .br
  434. .in -1c
  435. .SH "Field Documentation"
  436. .PP
  437. .SS "\fBIESYS_METADATA\fP esysMetadata"
  438. Meta data of the ESY_TR object
  439. .SS "UINT32 reserved"
  440. Must allways be zero
  441. .SS "TPM2B_CONTEXT_DATA tpmContext"
  442. Context information computed by tpm
  443. .SH "Macro Definition Documentation"
  444. .PP
  445. .SS "#define _ESYS_ASSERT_NON_NULL(x)"
  446. \fBValue:\fP
  447. .PP
  448. .nf
  449. if (x == NULL) { \
  450. LOG_ERROR(str(x) " == NULL\&."); \
  451. return TSS2_ESYS_RC_BAD_REFERENCE; \
  452. }
  453. .fi
  454. Makro testing parameters against null\&.
  455. .SS "#define _ESYS_MAX_SUBMISSIONS 5"
  456. The number of authomatic resubmissions\&.
  457. .PP
  458. The number of resubmissions before a TPM's TPM2_RC_YIELDED is forwarded to the application\&.
  459. .SS "#define DECRYPT 1"
  460. Parameter decryption by TPM
  461. .SS "#define ENCRYPT 1"
  462. Parameter encryption by TPM
  463. .SS "#define IESYSC_KEY_RSRC 1"
  464. Tag for key resource
  465. .SS "#define IESYSC_NV_RSRC 2"
  466. Tag for NV Ram resource
  467. .SS "#define IESYSC_SESSION_RSRC 3"
  468. Tag for session resources
  469. .SS "#define IESYSC_WITHOUT_MISC_RSRC 0"
  470. Tag for other resources, e\&.g\&. PCR register, hierarchies
  471. .SS "#define NO_DECRYPT 0"
  472. No parameter decryption by TPM
  473. .SS "#define NO_ENCRYPT 0"
  474. No parameter encryption by TPM
  475. .SS "#define NO_POLICY_AUTH 0"
  476. no special handling
  477. .SS "#define POLICY_AUTH 1"
  478. Marker to include the auth value in the HMAC key
  479. .SS "#define POLICY_PASSWORD 2"
  480. Marker to include auth value of the authorized object
  481. .SH "Typedef Documentation"
  482. .PP
  483. .SS "\fBIESYSC_PARAM_DECRYPT\fP"
  484. Type to indicate parameter decryption (by TPM)
  485. .SS "\fBIESYSC_PARAM_ENCRYPT\fP"
  486. Type to indicate parameter encryption (by TPM)
  487. .SS "\fBIESYSC_RESOURCE_TYPE\fP"
  488. Selector type for esys resources
  489. .SS "\fBIESYSC_RESOURCE_TYPE_CONSTANT\fP"
  490. Type of resource
  491. .SS "\fBIESYSC_TYPE_POLICY_AUTH\fP"
  492. Type of policy authorization
  493. .SS "\fBRSRC_NODE_T\fP"
  494. Linked list type for object meta data\&.
  495. .PP
  496. This structure represents a linked list to store meta data information of type \fBIESYS_RESOURCE\fP\&.
  497. .SH "Enumeration Type Documentation"
  498. .PP
  499. .SS "enum \fB_ESYS_STATE\fP"
  500. The states for the ESAPI's internal state machine
  501. .SH "Author"
  502. .PP
  503. Generated automatically by Doxygen for tpm2-tss from the source code\&.