group___fapi___nv_read.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.13"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  8. <title>tpm2-tss: Fapi_NvRead</title>
  9. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  10. <script type="text/javascript" src="jquery.js"></script>
  11. <script type="text/javascript" src="dynsections.js"></script>
  12. <link href="navtree.css" rel="stylesheet" type="text/css"/>
  13. <script type="text/javascript" src="resize.js"></script>
  14. <script type="text/javascript" src="navtreedata.js"></script>
  15. <script type="text/javascript" src="navtree.js"></script>
  16. <script type="text/javascript">
  17. $(document).ready(initResizable);
  18. </script>
  19. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  20. </head>
  21. <body>
  22. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  23. <div id="titlearea">
  24. <table cellspacing="0" cellpadding="0">
  25. <tbody>
  26. <tr style="height: 56px;">
  27. <td id="projectalign" style="padding-left: 0.5em;">
  28. <div id="projectname">tpm2-tss
  29. &#160;<span id="projectnumber">3.2.0</span>
  30. </div>
  31. <div id="projectbrief">TPM Software stack 2.0 TCG spec compliant implementation</div>
  32. </td>
  33. </tr>
  34. </tbody>
  35. </table>
  36. </div>
  37. <!-- end header part -->
  38. <!-- Generated by Doxygen 1.8.13 -->
  39. <script type="text/javascript" src="menudata.js"></script>
  40. <script type="text/javascript" src="menu.js"></script>
  41. <script type="text/javascript">
  42. $(function() {
  43. initMenu('',false,false,'search.php','Search');
  44. });
  45. </script>
  46. <div id="main-nav"></div>
  47. </div><!-- top -->
  48. <div id="side-nav" class="ui-resizable side-nav-resizable">
  49. <div id="nav-tree">
  50. <div id="nav-tree-contents">
  51. <div id="nav-sync" class="sync"></div>
  52. </div>
  53. </div>
  54. <div id="splitbar" style="-moz-user-select:none;"
  55. class="ui-resizable-handle">
  56. </div>
  57. </div>
  58. <script type="text/javascript">
  59. $(document).ready(function(){initNavTree('group___fapi___nv_read.html','');});
  60. </script>
  61. <div id="doc-content">
  62. <div class="header">
  63. <div class="summary">
  64. <a href="#func-members">Functions</a> </div>
  65. <div class="headertitle">
  66. <div class="title">Fapi_NvRead<div class="ingroups"><a class="el" href="group__fapi.html">Feature API</a></div></div> </div>
  67. </div><!--header-->
  68. <div class="contents">
  69. <table class="memberdecls">
  70. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
  71. Functions</h2></td></tr>
  72. <tr class="memitem:gaccc24da54a4e98b2f4a2b6a1adb67bf7"><td class="memItemLeft" align="right" valign="top">TSS2_RC&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___fapi___nv_read.html#gaccc24da54a4e98b2f4a2b6a1adb67bf7">Fapi_NvRead</a> (<a class="el" href="struct_f_a_p_i___c_o_n_t_e_x_t.html">FAPI_CONTEXT</a> *context, char const *path, uint8_t **data, size_t *size, char **logData)</td></tr>
  73. <tr class="separator:gaccc24da54a4e98b2f4a2b6a1adb67bf7"><td class="memSeparator" colspan="2">&#160;</td></tr>
  74. <tr class="memitem:ga6a1d867dc79e85a5aa3b04eedb480efa"><td class="memItemLeft" align="right" valign="top">TSS2_RC&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___fapi___nv_read.html#ga6a1d867dc79e85a5aa3b04eedb480efa">Fapi_NvRead_Async</a> (<a class="el" href="struct_f_a_p_i___c_o_n_t_e_x_t.html">FAPI_CONTEXT</a> *context, char const *path)</td></tr>
  75. <tr class="separator:ga6a1d867dc79e85a5aa3b04eedb480efa"><td class="memSeparator" colspan="2">&#160;</td></tr>
  76. <tr class="memitem:ga775744e499c19dbadb1cc844a0f8b38b"><td class="memItemLeft" align="right" valign="top">TSS2_RC&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___fapi___nv_read.html#ga775744e499c19dbadb1cc844a0f8b38b">Fapi_NvRead_Finish</a> (<a class="el" href="struct_f_a_p_i___c_o_n_t_e_x_t.html">FAPI_CONTEXT</a> *context, uint8_t **data, size_t *size, char **logData)</td></tr>
  77. <tr class="separator:ga775744e499c19dbadb1cc844a0f8b38b"><td class="memSeparator" colspan="2">&#160;</td></tr>
  78. </table>
  79. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  80. <p>FAPI functions to invoke NvRead either as one-call or in an asynchronous manner. </p>
  81. <h2 class="groupheader">Function Documentation</h2>
  82. <a id="gaccc24da54a4e98b2f4a2b6a1adb67bf7"></a>
  83. <h2 class="memtitle"><span class="permalink"><a href="#gaccc24da54a4e98b2f4a2b6a1adb67bf7">&#9670;&nbsp;</a></span>Fapi_NvRead()</h2>
  84. <div class="memitem">
  85. <div class="memproto">
  86. <table class="memname">
  87. <tr>
  88. <td class="memname">TSS2_RC Fapi_NvRead </td>
  89. <td>(</td>
  90. <td class="paramtype"><a class="el" href="struct_f_a_p_i___c_o_n_t_e_x_t.html">FAPI_CONTEXT</a> *&#160;</td>
  91. <td class="paramname"><em>context</em>, </td>
  92. </tr>
  93. <tr>
  94. <td class="paramkey"></td>
  95. <td></td>
  96. <td class="paramtype">char const *&#160;</td>
  97. <td class="paramname"><em>nvPath</em>, </td>
  98. </tr>
  99. <tr>
  100. <td class="paramkey"></td>
  101. <td></td>
  102. <td class="paramtype">uint8_t **&#160;</td>
  103. <td class="paramname"><em>data</em>, </td>
  104. </tr>
  105. <tr>
  106. <td class="paramkey"></td>
  107. <td></td>
  108. <td class="paramtype">size_t *&#160;</td>
  109. <td class="paramname"><em>size</em>, </td>
  110. </tr>
  111. <tr>
  112. <td class="paramkey"></td>
  113. <td></td>
  114. <td class="paramtype">char **&#160;</td>
  115. <td class="paramname"><em>logData</em>&#160;</td>
  116. </tr>
  117. <tr>
  118. <td></td>
  119. <td>)</td>
  120. <td></td><td></td>
  121. </tr>
  122. </table>
  123. </div><div class="memdoc">
  124. <p>One-Call function for Fapi_NvRead</p>
  125. <p>Reads data from an NV index within the TPM. The FAPI will automatically do the multiple reads if the NV index is larger than the TPM's TPM2_MAX_NV_BUFFER_SIZE.</p>
  126. <dl class="params"><dt>Parameters</dt><dd>
  127. <table class="params">
  128. <tr><td class="paramdir">[in,out]</td><td class="paramname">context</td><td>The <a class="el" href="struct_f_a_p_i___c_o_n_t_e_x_t.html">FAPI_CONTEXT</a> </td></tr>
  129. <tr><td class="paramdir">[in]</td><td class="paramname">nvPath</td><td>The path of the NV index to read </td></tr>
  130. <tr><td class="paramdir">[out]</td><td class="paramname">data</td><td>The data that was read from the NV index </td></tr>
  131. <tr><td class="paramdir">[out]</td><td class="paramname">size</td><td>The size of data in bytes. May be NULL </td></tr>
  132. <tr><td class="paramdir">[out]</td><td class="paramname">logData</td><td>The log data of the NV index if the index is of type "extend". May be NULL</td></tr>
  133. </table>
  134. </dd>
  135. </dl>
  136. <dl class="retval"><dt>Return values</dt><dd>
  137. <table class="retval">
  138. <tr><td class="paramname">TSS2_RC_SUCCESS</td><td>if the function call was a success. </td></tr>
  139. <tr><td class="paramname">TSS2_FAPI_RC_BAD_REFERENCE</td><td>if context, nvPath or data is NULL. </td></tr>
  140. <tr><td class="paramname">TSS2_FAPI_RC_BAD_CONTEXT</td><td>if context corruption is detected. </td></tr>
  141. <tr><td class="paramname">TSS2_FAPI_RC_BAD_PATH</td><td>if nvPath is not found. </td></tr>
  142. <tr><td class="paramname">TSS2_FAPI_RC_AUTHORIZATION_FAILED</td><td>if authorization fails. </td></tr>
  143. <tr><td class="paramname">TSS2_FAPI_RC_AUTHORIZATION_UNKNOWN</td><td>if don't know how to authenticate. </td></tr>
  144. <tr><td class="paramname">TSS2_FAPI_RC_NV_NOT_READABLE</td><td>if the NV is not a readable index. </td></tr>
  145. <tr><td class="paramname">TSS2_FAPI_RC_BAD_SEQUENCE</td><td>if the context has an asynchronous operation already pending. </td></tr>
  146. <tr><td class="paramname">TSS2_FAPI_RC_IO_ERROR</td><td>if the data cannot be saved. </td></tr>
  147. <tr><td class="paramname">TSS2_FAPI_RC_MEMORY</td><td>if the FAPI cannot allocate enough memory for internal operations or return parameters. </td></tr>
  148. <tr><td class="paramname">TSS2_FAPI_RC_NO_TPM</td><td>if FAPI was initialized in no-TPM-mode via its config file. </td></tr>
  149. <tr><td class="paramname">TSS2_FAPI_RC_PATH_NOT_FOUND</td><td>if a FAPI object path was not found during authorization. </td></tr>
  150. <tr><td class="paramname">TSS2_FAPI_RC_KEY_NOT_FOUND</td><td>if a key was not found. </td></tr>
  151. <tr><td class="paramname">TSS2_FAPI_RC_BAD_VALUE</td><td>if an invalid value was passed into the function. </td></tr>
  152. <tr><td class="paramname">TSS2_FAPI_RC_TRY_AGAIN</td><td>if an I/O operation is not finished yet and this function needs to be called again. </td></tr>
  153. <tr><td class="paramname">TSS2_FAPI_RC_GENERAL_FAILURE</td><td>if an internal error occurred. </td></tr>
  154. <tr><td class="paramname">TSS2_FAPI_RC_POLICY_UNKNOWN</td><td>if policy search for a certain policy digest was not successful. </td></tr>
  155. <tr><td class="paramname">TSS2_ESYS_RC_*</td><td>possible error codes of ESAPI. </td></tr>
  156. <tr><td class="paramname">TSS2_FAPI_RC_NOT_PROVISIONED</td><td>FAPI was not provisioned. </td></tr>
  157. </table>
  158. </dd>
  159. </dl>
  160. </div>
  161. </div>
  162. <a id="ga6a1d867dc79e85a5aa3b04eedb480efa"></a>
  163. <h2 class="memtitle"><span class="permalink"><a href="#ga6a1d867dc79e85a5aa3b04eedb480efa">&#9670;&nbsp;</a></span>Fapi_NvRead_Async()</h2>
  164. <div class="memitem">
  165. <div class="memproto">
  166. <table class="memname">
  167. <tr>
  168. <td class="memname">TSS2_RC Fapi_NvRead_Async </td>
  169. <td>(</td>
  170. <td class="paramtype"><a class="el" href="struct_f_a_p_i___c_o_n_t_e_x_t.html">FAPI_CONTEXT</a> *&#160;</td>
  171. <td class="paramname"><em>context</em>, </td>
  172. </tr>
  173. <tr>
  174. <td class="paramkey"></td>
  175. <td></td>
  176. <td class="paramtype">char const *&#160;</td>
  177. <td class="paramname"><em>nvPath</em>&#160;</td>
  178. </tr>
  179. <tr>
  180. <td></td>
  181. <td>)</td>
  182. <td></td><td></td>
  183. </tr>
  184. </table>
  185. </div><div class="memdoc">
  186. <p>Asynchronous function for Fapi_NvRead</p>
  187. <p>Reads data from an NV index within the TPM. The FAPI will automatically do the multiple reads if the NV index is larger than the TPM's TPM2_MAX_NV_BUFFER_SIZE.</p>
  188. <p>Call Fapi_NvRead_Finish to finish the execution of this command.</p>
  189. <dl class="params"><dt>Parameters</dt><dd>
  190. <table class="params">
  191. <tr><td class="paramdir">[in,out]</td><td class="paramname">context</td><td>The <a class="el" href="struct_f_a_p_i___c_o_n_t_e_x_t.html">FAPI_CONTEXT</a> </td></tr>
  192. <tr><td class="paramdir">[in]</td><td class="paramname">nvPath</td><td>The path of the NV index to read</td></tr>
  193. </table>
  194. </dd>
  195. </dl>
  196. <dl class="retval"><dt>Return values</dt><dd>
  197. <table class="retval">
  198. <tr><td class="paramname">TSS2_RC_SUCCESS</td><td>if the function call was a success. </td></tr>
  199. <tr><td class="paramname">TSS2_FAPI_RC_BAD_REFERENCE</td><td>if context or nvPath is NULL. * </td></tr>
  200. <tr><td class="paramname">TSS2_FAPI_RC_BAD_CONTEXT</td><td>if context corruption is detected. </td></tr>
  201. <tr><td class="paramname">TSS2_FAPI_RC_BAD_PATH</td><td>if nvPath is not found. </td></tr>
  202. <tr><td class="paramname">TSS2_FAPI_RC_AUTHORIZATION_FAILED</td><td>if authorization fails. </td></tr>
  203. <tr><td class="paramname">TSS2_FAPI_RC_AUTHORIZATION_UNKNOWN</td><td>if don't know how to authenticate. </td></tr>
  204. <tr><td class="paramname">TSS2_FAPI_RC_NV_NOT_READABLE</td><td>if the NV is not a readable index. </td></tr>
  205. <tr><td class="paramname">TSS2_FAPI_RC_BAD_SEQUENCE</td><td>if the context has an asynchronous operation already pending. </td></tr>
  206. <tr><td class="paramname">TSS2_FAPI_RC_IO_ERROR</td><td>if the data cannot be saved. </td></tr>
  207. <tr><td class="paramname">TSS2_FAPI_RC_MEMORY</td><td>if the FAPI cannot allocate enough memory for internal operations or return parameters. </td></tr>
  208. <tr><td class="paramname">TSS2_FAPI_RC_NO_TPM</td><td>if FAPI was initialized in no-TPM-mode via its config file. </td></tr>
  209. <tr><td class="paramname">TSS2_FAPI_RC_PATH_NOT_FOUND</td><td>if a FAPI object path was not found during authorization. </td></tr>
  210. <tr><td class="paramname">TSS2_FAPI_RC_KEY_NOT_FOUND</td><td>if a key was not found. </td></tr>
  211. <tr><td class="paramname">TSS2_FAPI_RC_BAD_VALUE</td><td>if an invalid value was passed into the function. </td></tr>
  212. <tr><td class="paramname">TSS2_FAPI_RC_NOT_PROVISIONED</td><td>FAPI was not provisioned. </td></tr>
  213. </table>
  214. </dd>
  215. </dl>
  216. </div>
  217. </div>
  218. <a id="ga775744e499c19dbadb1cc844a0f8b38b"></a>
  219. <h2 class="memtitle"><span class="permalink"><a href="#ga775744e499c19dbadb1cc844a0f8b38b">&#9670;&nbsp;</a></span>Fapi_NvRead_Finish()</h2>
  220. <div class="memitem">
  221. <div class="memproto">
  222. <table class="memname">
  223. <tr>
  224. <td class="memname">TSS2_RC Fapi_NvRead_Finish </td>
  225. <td>(</td>
  226. <td class="paramtype"><a class="el" href="struct_f_a_p_i___c_o_n_t_e_x_t.html">FAPI_CONTEXT</a> *&#160;</td>
  227. <td class="paramname"><em>context</em>, </td>
  228. </tr>
  229. <tr>
  230. <td class="paramkey"></td>
  231. <td></td>
  232. <td class="paramtype">uint8_t **&#160;</td>
  233. <td class="paramname"><em>data</em>, </td>
  234. </tr>
  235. <tr>
  236. <td class="paramkey"></td>
  237. <td></td>
  238. <td class="paramtype">size_t *&#160;</td>
  239. <td class="paramname"><em>size</em>, </td>
  240. </tr>
  241. <tr>
  242. <td class="paramkey"></td>
  243. <td></td>
  244. <td class="paramtype">char **&#160;</td>
  245. <td class="paramname"><em>logData</em>&#160;</td>
  246. </tr>
  247. <tr>
  248. <td></td>
  249. <td>)</td>
  250. <td></td><td></td>
  251. </tr>
  252. </table>
  253. </div><div class="memdoc">
  254. <p>Asynchronous finish function for Fapi_NvRead</p>
  255. <p>This function should be called after a previous Fapi_NvRead_Async.</p>
  256. <dl class="params"><dt>Parameters</dt><dd>
  257. <table class="params">
  258. <tr><td class="paramdir">[in,out]</td><td class="paramname">context</td><td>The <a class="el" href="struct_f_a_p_i___c_o_n_t_e_x_t.html">FAPI_CONTEXT</a> </td></tr>
  259. <tr><td class="paramdir">[out]</td><td class="paramname">data</td><td>The data that was read from the NV index </td></tr>
  260. <tr><td class="paramdir">[out]</td><td class="paramname">size</td><td>The size of data in bytes. May be NULL </td></tr>
  261. <tr><td class="paramdir">[out]</td><td class="paramname">logData</td><td>The log data of the NV index if the index is of type "extend". May be NULL</td></tr>
  262. </table>
  263. </dd>
  264. </dl>
  265. <dl class="retval"><dt>Return values</dt><dd>
  266. <table class="retval">
  267. <tr><td class="paramname">TSS2_RC_SUCCESS</td><td>if the function call was a success. </td></tr>
  268. <tr><td class="paramname">TSS2_FAPI_RC_BAD_REFERENCE</td><td>if context or data is NULL. </td></tr>
  269. <tr><td class="paramname">TSS2_FAPI_RC_BAD_CONTEXT</td><td>if context corruption is detected. </td></tr>
  270. <tr><td class="paramname">TSS2_FAPI_RC_BAD_SEQUENCE</td><td>if the context has an asynchronous operation already pending. </td></tr>
  271. <tr><td class="paramname">TSS2_FAPI_RC_IO_ERROR</td><td>if the data cannot be saved. </td></tr>
  272. <tr><td class="paramname">TSS2_FAPI_RC_MEMORY</td><td>if the FAPI cannot allocate enough memory for internal operations or return parameters. </td></tr>
  273. <tr><td class="paramname">TSS2_FAPI_RC_TRY_AGAIN</td><td>if the asynchronous operation is not yet complete. Call this function again later. </td></tr>
  274. <tr><td class="paramname">TSS2_FAPI_RC_BAD_PATH</td><td>if a path is used in inappropriate context or contains illegal characters. </td></tr>
  275. <tr><td class="paramname">TSS2_FAPI_RC_GENERAL_FAILURE</td><td>if an internal error occurred. </td></tr>
  276. <tr><td class="paramname">TSS2_FAPI_RC_BAD_VALUE</td><td>if an invalid value was passed into the function. </td></tr>
  277. <tr><td class="paramname">TSS2_FAPI_RC_PATH_NOT_FOUND</td><td>if a FAPI object path was not found during authorization. </td></tr>
  278. <tr><td class="paramname">TSS2_FAPI_RC_KEY_NOT_FOUND</td><td>if a key was not found. </td></tr>
  279. <tr><td class="paramname">TSS2_FAPI_RC_AUTHORIZATION_UNKNOWN</td><td>if a required authorization callback is not set. </td></tr>
  280. <tr><td class="paramname">TSS2_FAPI_RC_AUTHORIZATION_FAILED</td><td>if the authorization attempt fails. </td></tr>
  281. <tr><td class="paramname">TSS2_FAPI_RC_POLICY_UNKNOWN</td><td>if policy search for a certain policy digest was not successful. </td></tr>
  282. <tr><td class="paramname">TSS2_ESYS_RC_*</td><td>possible error codes of ESAPI. </td></tr>
  283. <tr><td class="paramname">TSS2_FAPI_RC_NOT_PROVISIONED</td><td>FAPI was not provisioned. </td></tr>
  284. </table>
  285. </dd>
  286. </dl>
  287. </div>
  288. </div>
  289. </div><!-- contents -->
  290. </div><!-- doc-content -->
  291. <!-- start footer part -->
  292. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  293. <ul>
  294. <li class="footer">Generated by
  295. <a href="http://www.doxygen.org/index.html">
  296. <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  297. </ul>
  298. </div>
  299. </body>
  300. </html>