| 1 |
/* Microsoft Reference Implementation for TPM 2.0 |
| 2 |
* |
| 3 |
* The copyright in this software is being made available under the BSD License, |
| 4 |
* included below. This software may be subject to other third party and |
| 5 |
* contributor rights, including patent rights, and no such rights are granted |
| 6 |
* under this license. |
| 7 |
* |
| 8 |
* Copyright (c) Microsoft Corporation |
| 9 |
* |
| 10 |
* All rights reserved. |
| 11 |
* |
| 12 |
* BSD License |
| 13 |
* |
| 14 |
* Redistribution and use in source and binary forms, with or without modification, |
| 15 |
* are permitted provided that the following conditions are met: |
| 16 |
* |
| 17 |
* Redistributions of source code must retain the above copyright notice, this list |
| 18 |
* of conditions and the following disclaimer. |
| 19 |
* |
| 20 |
* Redistributions in binary form must reproduce the above copyright notice, this |
| 21 |
* list of conditions and the following disclaimer in the documentation and/or |
| 22 |
* other materials provided with the distribution. |
| 23 |
* |
| 24 |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ""AS IS"" |
| 25 |
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 26 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 27 |
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
| 28 |
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 29 |
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 30 |
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
| 31 |
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 32 |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 33 |
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 34 |
*/ |
| 35 |
/*(Auto-generated) |
| 36 |
* Created by TpmDispatch; Version 4.0 July 8,2017 |
| 37 |
* Date: Oct 9, 2018 Time: 07:25:19PM |
| 38 |
*/ |
| 39 |
#if CC_Startup |
| 40 |
case TPM_CC_Startup: |
| 41 |
break; |
| 42 |
#endif // CC_Startup |
| 43 |
#if CC_Shutdown |
| 44 |
case TPM_CC_Shutdown: |
| 45 |
break; |
| 46 |
#endif // CC_Shutdown |
| 47 |
#if CC_SelfTest |
| 48 |
case TPM_CC_SelfTest: |
| 49 |
break; |
| 50 |
#endif // CC_SelfTest |
| 51 |
#if CC_IncrementalSelfTest |
| 52 |
case TPM_CC_IncrementalSelfTest: |
| 53 |
break; |
| 54 |
#endif // CC_IncrementalSelfTest |
| 55 |
#if CC_GetTestResult |
| 56 |
case TPM_CC_GetTestResult: |
| 57 |
break; |
| 58 |
#endif // CC_GetTestResult |
| 59 |
#if CC_StartAuthSession |
| 60 |
case TPM_CC_StartAuthSession: |
| 61 |
*handleCount = 2; |
| 62 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 63 |
bufferRemainingSize, TRUE); |
| 64 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 65 |
result = TPMI_DH_ENTITY_Unmarshal(&handles[1], handleBufferStart, |
| 66 |
bufferRemainingSize, TRUE); |
| 67 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2; |
| 68 |
break; |
| 69 |
#endif // CC_StartAuthSession |
| 70 |
#if CC_PolicyRestart |
| 71 |
case TPM_CC_PolicyRestart: |
| 72 |
*handleCount = 1; |
| 73 |
result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart, |
| 74 |
bufferRemainingSize); |
| 75 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 76 |
break; |
| 77 |
#endif // CC_PolicyRestart |
| 78 |
#if CC_Create |
| 79 |
case TPM_CC_Create: |
| 80 |
*handleCount = 1; |
| 81 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 82 |
bufferRemainingSize, FALSE); |
| 83 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 84 |
break; |
| 85 |
#endif // CC_Create |
| 86 |
#if CC_Load |
| 87 |
case TPM_CC_Load: |
| 88 |
*handleCount = 1; |
| 89 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 90 |
bufferRemainingSize, FALSE); |
| 91 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 92 |
break; |
| 93 |
#endif // CC_Load |
| 94 |
#if CC_LoadExternal |
| 95 |
case TPM_CC_LoadExternal: |
| 96 |
break; |
| 97 |
#endif // CC_LoadExternal |
| 98 |
#if CC_ReadPublic |
| 99 |
case TPM_CC_ReadPublic: |
| 100 |
*handleCount = 1; |
| 101 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 102 |
bufferRemainingSize, FALSE); |
| 103 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 104 |
break; |
| 105 |
#endif // CC_ReadPublic |
| 106 |
#if CC_ActivateCredential |
| 107 |
case TPM_CC_ActivateCredential: |
| 108 |
*handleCount = 2; |
| 109 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 110 |
bufferRemainingSize, FALSE); |
| 111 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 112 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[1], handleBufferStart, |
| 113 |
bufferRemainingSize, FALSE); |
| 114 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2; |
| 115 |
break; |
| 116 |
#endif // CC_ActivateCredential |
| 117 |
#if CC_MakeCredential |
| 118 |
case TPM_CC_MakeCredential: |
| 119 |
*handleCount = 1; |
| 120 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 121 |
bufferRemainingSize, FALSE); |
| 122 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 123 |
break; |
| 124 |
#endif // CC_MakeCredential |
| 125 |
#if CC_Unseal |
| 126 |
case TPM_CC_Unseal: |
| 127 |
*handleCount = 1; |
| 128 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 129 |
bufferRemainingSize, FALSE); |
| 130 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 131 |
break; |
| 132 |
#endif // CC_Unseal |
| 133 |
#if CC_ObjectChangeAuth |
| 134 |
case TPM_CC_ObjectChangeAuth: |
| 135 |
*handleCount = 2; |
| 136 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 137 |
bufferRemainingSize, FALSE); |
| 138 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 139 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[1], handleBufferStart, |
| 140 |
bufferRemainingSize, FALSE); |
| 141 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2; |
| 142 |
break; |
| 143 |
#endif // CC_ObjectChangeAuth |
| 144 |
#if CC_CreateLoaded |
| 145 |
case TPM_CC_CreateLoaded: |
| 146 |
*handleCount = 1; |
| 147 |
result = TPMI_DH_PARENT_Unmarshal(&handles[0], handleBufferStart, |
| 148 |
bufferRemainingSize, TRUE); |
| 149 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 150 |
break; |
| 151 |
#endif // CC_CreateLoaded |
| 152 |
#if CC_Duplicate |
| 153 |
case TPM_CC_Duplicate: |
| 154 |
*handleCount = 2; |
| 155 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 156 |
bufferRemainingSize, FALSE); |
| 157 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 158 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[1], handleBufferStart, |
| 159 |
bufferRemainingSize, TRUE); |
| 160 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2; |
| 161 |
break; |
| 162 |
#endif // CC_Duplicate |
| 163 |
#if CC_Rewrap |
| 164 |
case TPM_CC_Rewrap: |
| 165 |
*handleCount = 2; |
| 166 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 167 |
bufferRemainingSize, TRUE); |
| 168 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 169 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[1], handleBufferStart, |
| 170 |
bufferRemainingSize, TRUE); |
| 171 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2; |
| 172 |
break; |
| 173 |
#endif // CC_Rewrap |
| 174 |
#if CC_Import |
| 175 |
case TPM_CC_Import: |
| 176 |
*handleCount = 1; |
| 177 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 178 |
bufferRemainingSize, FALSE); |
| 179 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 180 |
break; |
| 181 |
#endif // CC_Import |
| 182 |
#if CC_RSA_Encrypt |
| 183 |
case TPM_CC_RSA_Encrypt: |
| 184 |
*handleCount = 1; |
| 185 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 186 |
bufferRemainingSize, FALSE); |
| 187 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 188 |
break; |
| 189 |
#endif // CC_RSA_Encrypt |
| 190 |
#if CC_RSA_Decrypt |
| 191 |
case TPM_CC_RSA_Decrypt: |
| 192 |
*handleCount = 1; |
| 193 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 194 |
bufferRemainingSize, FALSE); |
| 195 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 196 |
break; |
| 197 |
#endif // CC_RSA_Decrypt |
| 198 |
#if CC_ECDH_KeyGen |
| 199 |
case TPM_CC_ECDH_KeyGen: |
| 200 |
*handleCount = 1; |
| 201 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 202 |
bufferRemainingSize, FALSE); |
| 203 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 204 |
break; |
| 205 |
#endif // CC_ECDH_KeyGen |
| 206 |
#if CC_ECDH_ZGen |
| 207 |
case TPM_CC_ECDH_ZGen: |
| 208 |
*handleCount = 1; |
| 209 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 210 |
bufferRemainingSize, FALSE); |
| 211 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 212 |
break; |
| 213 |
#endif // CC_ECDH_ZGen |
| 214 |
#if CC_ECC_Parameters |
| 215 |
case TPM_CC_ECC_Parameters: |
| 216 |
break; |
| 217 |
#endif // CC_ECC_Parameters |
| 218 |
#if CC_ZGen_2Phase |
| 219 |
case TPM_CC_ZGen_2Phase: |
| 220 |
*handleCount = 1; |
| 221 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 222 |
bufferRemainingSize, FALSE); |
| 223 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 224 |
break; |
| 225 |
#endif // CC_ZGen_2Phase |
| 226 |
#if CC_EncryptDecrypt |
| 227 |
case TPM_CC_EncryptDecrypt: |
| 228 |
*handleCount = 1; |
| 229 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 230 |
bufferRemainingSize, FALSE); |
| 231 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 232 |
break; |
| 233 |
#endif // CC_EncryptDecrypt |
| 234 |
#if CC_EncryptDecrypt2 |
| 235 |
case TPM_CC_EncryptDecrypt2: |
| 236 |
*handleCount = 1; |
| 237 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 238 |
bufferRemainingSize, FALSE); |
| 239 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 240 |
break; |
| 241 |
#endif // CC_EncryptDecrypt2 |
| 242 |
#if CC_Hash |
| 243 |
case TPM_CC_Hash: |
| 244 |
break; |
| 245 |
#endif // CC_Hash |
| 246 |
#if CC_HMAC |
| 247 |
case TPM_CC_HMAC: |
| 248 |
*handleCount = 1; |
| 249 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 250 |
bufferRemainingSize, FALSE); |
| 251 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 252 |
break; |
| 253 |
#endif // CC_HMAC |
| 254 |
#if CC_MAC |
| 255 |
case TPM_CC_MAC: |
| 256 |
*handleCount = 1; |
| 257 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 258 |
bufferRemainingSize, FALSE); |
| 259 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 260 |
break; |
| 261 |
#endif // CC_MAC |
| 262 |
#if CC_GetRandom |
| 263 |
case TPM_CC_GetRandom: |
| 264 |
break; |
| 265 |
#endif // CC_GetRandom |
| 266 |
#if CC_StirRandom |
| 267 |
case TPM_CC_StirRandom: |
| 268 |
break; |
| 269 |
#endif // CC_StirRandom |
| 270 |
#if CC_HMAC_Start |
| 271 |
case TPM_CC_HMAC_Start: |
| 272 |
*handleCount = 1; |
| 273 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 274 |
bufferRemainingSize, FALSE); |
| 275 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 276 |
break; |
| 277 |
#endif // CC_HMAC_Start |
| 278 |
#if CC_MAC_Start |
| 279 |
case TPM_CC_MAC_Start: |
| 280 |
*handleCount = 1; |
| 281 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 282 |
bufferRemainingSize, FALSE); |
| 283 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 284 |
break; |
| 285 |
#endif // CC_MAC_Start |
| 286 |
#if CC_HashSequenceStart |
| 287 |
case TPM_CC_HashSequenceStart: |
| 288 |
break; |
| 289 |
#endif // CC_HashSequenceStart |
| 290 |
#if CC_SequenceUpdate |
| 291 |
case TPM_CC_SequenceUpdate: |
| 292 |
*handleCount = 1; |
| 293 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 294 |
bufferRemainingSize, FALSE); |
| 295 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 296 |
break; |
| 297 |
#endif // CC_SequenceUpdate |
| 298 |
#if CC_SequenceComplete |
| 299 |
case TPM_CC_SequenceComplete: |
| 300 |
*handleCount = 1; |
| 301 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 302 |
bufferRemainingSize, FALSE); |
| 303 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 304 |
break; |
| 305 |
#endif // CC_SequenceComplete |
| 306 |
#if CC_EventSequenceComplete |
| 307 |
case TPM_CC_EventSequenceComplete: |
| 308 |
*handleCount = 2; |
| 309 |
result = TPMI_DH_PCR_Unmarshal(&handles[0], handleBufferStart, |
| 310 |
bufferRemainingSize, TRUE); |
| 311 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 312 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[1], handleBufferStart, |
| 313 |
bufferRemainingSize, FALSE); |
| 314 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2; |
| 315 |
break; |
| 316 |
#endif // CC_EventSequenceComplete |
| 317 |
#if CC_Certify |
| 318 |
case TPM_CC_Certify: |
| 319 |
*handleCount = 2; |
| 320 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 321 |
bufferRemainingSize, FALSE); |
| 322 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 323 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[1], handleBufferStart, |
| 324 |
bufferRemainingSize, TRUE); |
| 325 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2; |
| 326 |
break; |
| 327 |
#endif // CC_Certify |
| 328 |
#if CC_CertifyCreation |
| 329 |
case TPM_CC_CertifyCreation: |
| 330 |
*handleCount = 2; |
| 331 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 332 |
bufferRemainingSize, TRUE); |
| 333 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 334 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[1], handleBufferStart, |
| 335 |
bufferRemainingSize, FALSE); |
| 336 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2; |
| 337 |
break; |
| 338 |
#endif // CC_CertifyCreation |
| 339 |
#if CC_Quote |
| 340 |
case TPM_CC_Quote: |
| 341 |
*handleCount = 1; |
| 342 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 343 |
bufferRemainingSize, TRUE); |
| 344 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 345 |
break; |
| 346 |
#endif // CC_Quote |
| 347 |
#if CC_GetSessionAuditDigest |
| 348 |
case TPM_CC_GetSessionAuditDigest: |
| 349 |
*handleCount = 3; |
| 350 |
result = TPMI_RH_ENDORSEMENT_Unmarshal(&handles[0], handleBufferStart, |
| 351 |
bufferRemainingSize, FALSE); |
| 352 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 353 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[1], handleBufferStart, |
| 354 |
bufferRemainingSize, TRUE); |
| 355 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2; |
| 356 |
result = TPMI_SH_HMAC_Unmarshal(&handles[2], handleBufferStart, |
| 357 |
bufferRemainingSize); |
| 358 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_3; |
| 359 |
break; |
| 360 |
#endif // CC_GetSessionAuditDigest |
| 361 |
#if CC_GetCommandAuditDigest |
| 362 |
case TPM_CC_GetCommandAuditDigest: |
| 363 |
*handleCount = 2; |
| 364 |
result = TPMI_RH_ENDORSEMENT_Unmarshal(&handles[0], handleBufferStart, |
| 365 |
bufferRemainingSize, FALSE); |
| 366 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 367 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[1], handleBufferStart, |
| 368 |
bufferRemainingSize, TRUE); |
| 369 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2; |
| 370 |
break; |
| 371 |
#endif // CC_GetCommandAuditDigest |
| 372 |
#if CC_GetTime |
| 373 |
case TPM_CC_GetTime: |
| 374 |
*handleCount = 2; |
| 375 |
result = TPMI_RH_ENDORSEMENT_Unmarshal(&handles[0], handleBufferStart, |
| 376 |
bufferRemainingSize, FALSE); |
| 377 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 378 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[1], handleBufferStart, |
| 379 |
bufferRemainingSize, TRUE); |
| 380 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2; |
| 381 |
break; |
| 382 |
#endif // CC_GetTime |
| 383 |
#if CC_CertifyX509 |
| 384 |
case TPM_CC_CertifyX509: |
| 385 |
*handleCount = 2; |
| 386 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 387 |
bufferRemainingSize, FALSE); |
| 388 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 389 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[1], handleBufferStart, |
| 390 |
bufferRemainingSize, TRUE); |
| 391 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2; |
| 392 |
break; |
| 393 |
#endif // CC_CertifyX509 |
| 394 |
#if CC_Commit |
| 395 |
case TPM_CC_Commit: |
| 396 |
*handleCount = 1; |
| 397 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 398 |
bufferRemainingSize, FALSE); |
| 399 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 400 |
break; |
| 401 |
#endif // CC_Commit |
| 402 |
#if CC_EC_Ephemeral |
| 403 |
case TPM_CC_EC_Ephemeral: |
| 404 |
break; |
| 405 |
#endif // CC_EC_Ephemeral |
| 406 |
#if CC_VerifySignature |
| 407 |
case TPM_CC_VerifySignature: |
| 408 |
*handleCount = 1; |
| 409 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 410 |
bufferRemainingSize, FALSE); |
| 411 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 412 |
break; |
| 413 |
#endif // CC_VerifySignature |
| 414 |
#if CC_Sign |
| 415 |
case TPM_CC_Sign: |
| 416 |
*handleCount = 1; |
| 417 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 418 |
bufferRemainingSize, FALSE); |
| 419 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 420 |
break; |
| 421 |
#endif // CC_Sign |
| 422 |
#if CC_SetCommandCodeAuditStatus |
| 423 |
case TPM_CC_SetCommandCodeAuditStatus: |
| 424 |
*handleCount = 1; |
| 425 |
result = TPMI_RH_PROVISION_Unmarshal(&handles[0], handleBufferStart, |
| 426 |
bufferRemainingSize); |
| 427 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 428 |
break; |
| 429 |
#endif // CC_SetCommandCodeAuditStatus |
| 430 |
#if CC_PCR_Extend |
| 431 |
case TPM_CC_PCR_Extend: |
| 432 |
*handleCount = 1; |
| 433 |
result = TPMI_DH_PCR_Unmarshal(&handles[0], handleBufferStart, |
| 434 |
bufferRemainingSize, TRUE); |
| 435 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 436 |
break; |
| 437 |
#endif // CC_PCR_Extend |
| 438 |
#if CC_PCR_Event |
| 439 |
case TPM_CC_PCR_Event: |
| 440 |
*handleCount = 1; |
| 441 |
result = TPMI_DH_PCR_Unmarshal(&handles[0], handleBufferStart, |
| 442 |
bufferRemainingSize, TRUE); |
| 443 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 444 |
break; |
| 445 |
#endif // CC_PCR_Event |
| 446 |
#if CC_PCR_Read |
| 447 |
case TPM_CC_PCR_Read: |
| 448 |
break; |
| 449 |
#endif // CC_PCR_Read |
| 450 |
#if CC_PCR_Allocate |
| 451 |
case TPM_CC_PCR_Allocate: |
| 452 |
*handleCount = 1; |
| 453 |
result = TPMI_RH_PLATFORM_Unmarshal(&handles[0], handleBufferStart, |
| 454 |
bufferRemainingSize); |
| 455 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 456 |
break; |
| 457 |
#endif // CC_PCR_Allocate |
| 458 |
#if CC_PCR_SetAuthPolicy |
| 459 |
case TPM_CC_PCR_SetAuthPolicy: |
| 460 |
*handleCount = 1; |
| 461 |
result = TPMI_RH_PLATFORM_Unmarshal(&handles[0], handleBufferStart, |
| 462 |
bufferRemainingSize); |
| 463 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 464 |
break; |
| 465 |
#endif // CC_PCR_SetAuthPolicy |
| 466 |
#if CC_PCR_SetAuthValue |
| 467 |
case TPM_CC_PCR_SetAuthValue: |
| 468 |
*handleCount = 1; |
| 469 |
result = TPMI_DH_PCR_Unmarshal(&handles[0], handleBufferStart, |
| 470 |
bufferRemainingSize, FALSE); |
| 471 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 472 |
break; |
| 473 |
#endif // CC_PCR_SetAuthValue |
| 474 |
#if CC_PCR_Reset |
| 475 |
case TPM_CC_PCR_Reset: |
| 476 |
*handleCount = 1; |
| 477 |
result = TPMI_DH_PCR_Unmarshal(&handles[0], handleBufferStart, |
| 478 |
bufferRemainingSize, FALSE); |
| 479 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 480 |
break; |
| 481 |
#endif // CC_PCR_Reset |
| 482 |
#if CC_PolicySigned |
| 483 |
case TPM_CC_PolicySigned: |
| 484 |
*handleCount = 2; |
| 485 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 486 |
bufferRemainingSize, FALSE); |
| 487 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 488 |
result = TPMI_SH_POLICY_Unmarshal(&handles[1], handleBufferStart, |
| 489 |
bufferRemainingSize); |
| 490 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2; |
| 491 |
break; |
| 492 |
#endif // CC_PolicySigned |
| 493 |
#if CC_PolicySecret |
| 494 |
case TPM_CC_PolicySecret: |
| 495 |
*handleCount = 2; |
| 496 |
result = TPMI_DH_ENTITY_Unmarshal(&handles[0], handleBufferStart, |
| 497 |
bufferRemainingSize, FALSE); |
| 498 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 499 |
result = TPMI_SH_POLICY_Unmarshal(&handles[1], handleBufferStart, |
| 500 |
bufferRemainingSize); |
| 501 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2; |
| 502 |
break; |
| 503 |
#endif // CC_PolicySecret |
| 504 |
#if CC_PolicyTicket |
| 505 |
case TPM_CC_PolicyTicket: |
| 506 |
*handleCount = 1; |
| 507 |
result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart, |
| 508 |
bufferRemainingSize); |
| 509 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 510 |
break; |
| 511 |
#endif // CC_PolicyTicket |
| 512 |
#if CC_PolicyOR |
| 513 |
case TPM_CC_PolicyOR: |
| 514 |
*handleCount = 1; |
| 515 |
result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart, |
| 516 |
bufferRemainingSize); |
| 517 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 518 |
break; |
| 519 |
#endif // CC_PolicyOR |
| 520 |
#if CC_PolicyPCR |
| 521 |
case TPM_CC_PolicyPCR: |
| 522 |
*handleCount = 1; |
| 523 |
result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart, |
| 524 |
bufferRemainingSize); |
| 525 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 526 |
break; |
| 527 |
#endif // CC_PolicyPCR |
| 528 |
#if CC_PolicyLocality |
| 529 |
case TPM_CC_PolicyLocality: |
| 530 |
*handleCount = 1; |
| 531 |
result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart, |
| 532 |
bufferRemainingSize); |
| 533 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 534 |
break; |
| 535 |
#endif // CC_PolicyLocality |
| 536 |
#if CC_PolicyNV |
| 537 |
case TPM_CC_PolicyNV: |
| 538 |
*handleCount = 3; |
| 539 |
result = TPMI_RH_NV_AUTH_Unmarshal(&handles[0], handleBufferStart, |
| 540 |
bufferRemainingSize); |
| 541 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 542 |
result = TPMI_RH_NV_INDEX_Unmarshal(&handles[1], handleBufferStart, |
| 543 |
bufferRemainingSize); |
| 544 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2; |
| 545 |
result = TPMI_SH_POLICY_Unmarshal(&handles[2], handleBufferStart, |
| 546 |
bufferRemainingSize); |
| 547 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_3; |
| 548 |
break; |
| 549 |
#endif // CC_PolicyNV |
| 550 |
#if CC_PolicyCounterTimer |
| 551 |
case TPM_CC_PolicyCounterTimer: |
| 552 |
*handleCount = 1; |
| 553 |
result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart, |
| 554 |
bufferRemainingSize); |
| 555 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 556 |
break; |
| 557 |
#endif // CC_PolicyCounterTimer |
| 558 |
#if CC_PolicyCommandCode |
| 559 |
case TPM_CC_PolicyCommandCode: |
| 560 |
*handleCount = 1; |
| 561 |
result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart, |
| 562 |
bufferRemainingSize); |
| 563 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 564 |
break; |
| 565 |
#endif // CC_PolicyCommandCode |
| 566 |
#if CC_PolicyPhysicalPresence |
| 567 |
case TPM_CC_PolicyPhysicalPresence: |
| 568 |
*handleCount = 1; |
| 569 |
result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart, |
| 570 |
bufferRemainingSize); |
| 571 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 572 |
break; |
| 573 |
#endif // CC_PolicyPhysicalPresence |
| 574 |
#if CC_PolicyCpHash |
| 575 |
case TPM_CC_PolicyCpHash: |
| 576 |
*handleCount = 1; |
| 577 |
result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart, |
| 578 |
bufferRemainingSize); |
| 579 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 580 |
break; |
| 581 |
#endif // CC_PolicyCpHash |
| 582 |
#if CC_PolicyNameHash |
| 583 |
case TPM_CC_PolicyNameHash: |
| 584 |
*handleCount = 1; |
| 585 |
result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart, |
| 586 |
bufferRemainingSize); |
| 587 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 588 |
break; |
| 589 |
#endif // CC_PolicyNameHash |
| 590 |
#if CC_PolicyDuplicationSelect |
| 591 |
case TPM_CC_PolicyDuplicationSelect: |
| 592 |
*handleCount = 1; |
| 593 |
result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart, |
| 594 |
bufferRemainingSize); |
| 595 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 596 |
break; |
| 597 |
#endif // CC_PolicyDuplicationSelect |
| 598 |
#if CC_PolicyAuthorize |
| 599 |
case TPM_CC_PolicyAuthorize: |
| 600 |
*handleCount = 1; |
| 601 |
result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart, |
| 602 |
bufferRemainingSize); |
| 603 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 604 |
break; |
| 605 |
#endif // CC_PolicyAuthorize |
| 606 |
#if CC_PolicyAuthValue |
| 607 |
case TPM_CC_PolicyAuthValue: |
| 608 |
*handleCount = 1; |
| 609 |
result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart, |
| 610 |
bufferRemainingSize); |
| 611 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 612 |
break; |
| 613 |
#endif // CC_PolicyAuthValue |
| 614 |
#if CC_PolicyPassword |
| 615 |
case TPM_CC_PolicyPassword: |
| 616 |
*handleCount = 1; |
| 617 |
result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart, |
| 618 |
bufferRemainingSize); |
| 619 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 620 |
break; |
| 621 |
#endif // CC_PolicyPassword |
| 622 |
#if CC_PolicyGetDigest |
| 623 |
case TPM_CC_PolicyGetDigest: |
| 624 |
*handleCount = 1; |
| 625 |
result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart, |
| 626 |
bufferRemainingSize); |
| 627 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 628 |
break; |
| 629 |
#endif // CC_PolicyGetDigest |
| 630 |
#if CC_PolicyNvWritten |
| 631 |
case TPM_CC_PolicyNvWritten: |
| 632 |
*handleCount = 1; |
| 633 |
result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart, |
| 634 |
bufferRemainingSize); |
| 635 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 636 |
break; |
| 637 |
#endif // CC_PolicyNvWritten |
| 638 |
#if CC_PolicyTemplate |
| 639 |
case TPM_CC_PolicyTemplate: |
| 640 |
*handleCount = 1; |
| 641 |
result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart, |
| 642 |
bufferRemainingSize); |
| 643 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 644 |
break; |
| 645 |
#endif // CC_PolicyTemplate |
| 646 |
#if CC_PolicyAuthorizeNV |
| 647 |
case TPM_CC_PolicyAuthorizeNV: |
| 648 |
*handleCount = 3; |
| 649 |
result = TPMI_RH_NV_AUTH_Unmarshal(&handles[0], handleBufferStart, |
| 650 |
bufferRemainingSize); |
| 651 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 652 |
result = TPMI_RH_NV_INDEX_Unmarshal(&handles[1], handleBufferStart, |
| 653 |
bufferRemainingSize); |
| 654 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2; |
| 655 |
result = TPMI_SH_POLICY_Unmarshal(&handles[2], handleBufferStart, |
| 656 |
bufferRemainingSize); |
| 657 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_3; |
| 658 |
break; |
| 659 |
#endif // CC_PolicyAuthorizeNV |
| 660 |
#if CC_CreatePrimary |
| 661 |
case TPM_CC_CreatePrimary: |
| 662 |
*handleCount = 1; |
| 663 |
result = TPMI_RH_HIERARCHY_Unmarshal(&handles[0], handleBufferStart, |
| 664 |
bufferRemainingSize, TRUE); |
| 665 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 666 |
break; |
| 667 |
#endif // CC_CreatePrimary |
| 668 |
#if CC_HierarchyControl |
| 669 |
case TPM_CC_HierarchyControl: |
| 670 |
*handleCount = 1; |
| 671 |
result = TPMI_RH_HIERARCHY_Unmarshal(&handles[0], handleBufferStart, |
| 672 |
bufferRemainingSize, FALSE); |
| 673 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 674 |
break; |
| 675 |
#endif // CC_HierarchyControl |
| 676 |
#if CC_SetPrimaryPolicy |
| 677 |
case TPM_CC_SetPrimaryPolicy: |
| 678 |
*handleCount = 1; |
| 679 |
result = TPMI_RH_HIERARCHY_AUTH_Unmarshal(&handles[0], handleBufferStart, |
| 680 |
bufferRemainingSize); |
| 681 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 682 |
break; |
| 683 |
#endif // CC_SetPrimaryPolicy |
| 684 |
#if CC_ChangePPS |
| 685 |
case TPM_CC_ChangePPS: |
| 686 |
*handleCount = 1; |
| 687 |
result = TPMI_RH_PLATFORM_Unmarshal(&handles[0], handleBufferStart, |
| 688 |
bufferRemainingSize); |
| 689 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 690 |
break; |
| 691 |
#endif // CC_ChangePPS |
| 692 |
#if CC_ChangeEPS |
| 693 |
case TPM_CC_ChangeEPS: |
| 694 |
*handleCount = 1; |
| 695 |
result = TPMI_RH_PLATFORM_Unmarshal(&handles[0], handleBufferStart, |
| 696 |
bufferRemainingSize); |
| 697 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 698 |
break; |
| 699 |
#endif // CC_ChangeEPS |
| 700 |
#if CC_Clear |
| 701 |
case TPM_CC_Clear: |
| 702 |
*handleCount = 1; |
| 703 |
result = TPMI_RH_CLEAR_Unmarshal(&handles[0], handleBufferStart, |
| 704 |
bufferRemainingSize); |
| 705 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 706 |
break; |
| 707 |
#endif // CC_Clear |
| 708 |
#if CC_ClearControl |
| 709 |
case TPM_CC_ClearControl: |
| 710 |
*handleCount = 1; |
| 711 |
result = TPMI_RH_CLEAR_Unmarshal(&handles[0], handleBufferStart, |
| 712 |
bufferRemainingSize); |
| 713 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 714 |
break; |
| 715 |
#endif // CC_ClearControl |
| 716 |
#if CC_HierarchyChangeAuth |
| 717 |
case TPM_CC_HierarchyChangeAuth: |
| 718 |
*handleCount = 1; |
| 719 |
result = TPMI_RH_HIERARCHY_AUTH_Unmarshal(&handles[0], handleBufferStart, |
| 720 |
bufferRemainingSize); |
| 721 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 722 |
break; |
| 723 |
#endif // CC_HierarchyChangeAuth |
| 724 |
#if CC_DictionaryAttackLockReset |
| 725 |
case TPM_CC_DictionaryAttackLockReset: |
| 726 |
*handleCount = 1; |
| 727 |
result = TPMI_RH_LOCKOUT_Unmarshal(&handles[0], handleBufferStart, |
| 728 |
bufferRemainingSize); |
| 729 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 730 |
break; |
| 731 |
#endif // CC_DictionaryAttackLockReset |
| 732 |
#if CC_DictionaryAttackParameters |
| 733 |
case TPM_CC_DictionaryAttackParameters: |
| 734 |
*handleCount = 1; |
| 735 |
result = TPMI_RH_LOCKOUT_Unmarshal(&handles[0], handleBufferStart, |
| 736 |
bufferRemainingSize); |
| 737 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 738 |
break; |
| 739 |
#endif // CC_DictionaryAttackParameters |
| 740 |
#if CC_PP_Commands |
| 741 |
case TPM_CC_PP_Commands: |
| 742 |
*handleCount = 1; |
| 743 |
result = TPMI_RH_PLATFORM_Unmarshal(&handles[0], handleBufferStart, |
| 744 |
bufferRemainingSize); |
| 745 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 746 |
break; |
| 747 |
#endif // CC_PP_Commands |
| 748 |
#if CC_SetAlgorithmSet |
| 749 |
case TPM_CC_SetAlgorithmSet: |
| 750 |
*handleCount = 1; |
| 751 |
result = TPMI_RH_PLATFORM_Unmarshal(&handles[0], handleBufferStart, |
| 752 |
bufferRemainingSize); |
| 753 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 754 |
break; |
| 755 |
#endif // CC_SetAlgorithmSet |
| 756 |
#if CC_FieldUpgradeStart |
| 757 |
case TPM_CC_FieldUpgradeStart: |
| 758 |
*handleCount = 2; |
| 759 |
result = TPMI_RH_PLATFORM_Unmarshal(&handles[0], handleBufferStart, |
| 760 |
bufferRemainingSize); |
| 761 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 762 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[1], handleBufferStart, |
| 763 |
bufferRemainingSize, FALSE); |
| 764 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2; |
| 765 |
break; |
| 766 |
#endif // CC_FieldUpgradeStart |
| 767 |
#if CC_FieldUpgradeData |
| 768 |
case TPM_CC_FieldUpgradeData: |
| 769 |
break; |
| 770 |
#endif // CC_FieldUpgradeData |
| 771 |
#if CC_FirmwareRead |
| 772 |
case TPM_CC_FirmwareRead: |
| 773 |
break; |
| 774 |
#endif // CC_FirmwareRead |
| 775 |
#if CC_ContextSave |
| 776 |
case TPM_CC_ContextSave: |
| 777 |
*handleCount = 1; |
| 778 |
result = TPMI_DH_CONTEXT_Unmarshal(&handles[0], handleBufferStart, |
| 779 |
bufferRemainingSize); |
| 780 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 781 |
break; |
| 782 |
#endif // CC_ContextSave |
| 783 |
#if CC_ContextLoad |
| 784 |
case TPM_CC_ContextLoad: |
| 785 |
break; |
| 786 |
#endif // CC_ContextLoad |
| 787 |
#if CC_FlushContext |
| 788 |
case TPM_CC_FlushContext: |
| 789 |
break; |
| 790 |
#endif // CC_FlushContext |
| 791 |
#if CC_EvictControl |
| 792 |
case TPM_CC_EvictControl: |
| 793 |
*handleCount = 2; |
| 794 |
result = TPMI_RH_PROVISION_Unmarshal(&handles[0], handleBufferStart, |
| 795 |
bufferRemainingSize); |
| 796 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 797 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[1], handleBufferStart, |
| 798 |
bufferRemainingSize, FALSE); |
| 799 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2; |
| 800 |
break; |
| 801 |
#endif // CC_EvictControl |
| 802 |
#if CC_ReadClock |
| 803 |
case TPM_CC_ReadClock: |
| 804 |
break; |
| 805 |
#endif // CC_ReadClock |
| 806 |
#if CC_ClockSet |
| 807 |
case TPM_CC_ClockSet: |
| 808 |
*handleCount = 1; |
| 809 |
result = TPMI_RH_PROVISION_Unmarshal(&handles[0], handleBufferStart, |
| 810 |
bufferRemainingSize); |
| 811 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 812 |
break; |
| 813 |
#endif // CC_ClockSet |
| 814 |
#if CC_ClockRateAdjust |
| 815 |
case TPM_CC_ClockRateAdjust: |
| 816 |
*handleCount = 1; |
| 817 |
result = TPMI_RH_PROVISION_Unmarshal(&handles[0], handleBufferStart, |
| 818 |
bufferRemainingSize); |
| 819 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 820 |
break; |
| 821 |
#endif // CC_ClockRateAdjust |
| 822 |
#if CC_GetCapability |
| 823 |
case TPM_CC_GetCapability: |
| 824 |
break; |
| 825 |
#endif // CC_GetCapability |
| 826 |
#if CC_TestParms |
| 827 |
case TPM_CC_TestParms: |
| 828 |
break; |
| 829 |
#endif // CC_TestParms |
| 830 |
#if CC_NV_DefineSpace |
| 831 |
case TPM_CC_NV_DefineSpace: |
| 832 |
*handleCount = 1; |
| 833 |
result = TPMI_RH_PROVISION_Unmarshal(&handles[0], handleBufferStart, |
| 834 |
bufferRemainingSize); |
| 835 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 836 |
break; |
| 837 |
#endif // CC_NV_DefineSpace |
| 838 |
#if CC_NV_UndefineSpace |
| 839 |
case TPM_CC_NV_UndefineSpace: |
| 840 |
*handleCount = 2; |
| 841 |
result = TPMI_RH_PROVISION_Unmarshal(&handles[0], handleBufferStart, |
| 842 |
bufferRemainingSize); |
| 843 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 844 |
result = TPMI_RH_NV_INDEX_Unmarshal(&handles[1], handleBufferStart, |
| 845 |
bufferRemainingSize); |
| 846 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2; |
| 847 |
break; |
| 848 |
#endif // CC_NV_UndefineSpace |
| 849 |
#if CC_NV_UndefineSpaceSpecial |
| 850 |
case TPM_CC_NV_UndefineSpaceSpecial: |
| 851 |
*handleCount = 2; |
| 852 |
result = TPMI_RH_NV_INDEX_Unmarshal(&handles[0], handleBufferStart, |
| 853 |
bufferRemainingSize); |
| 854 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 855 |
result = TPMI_RH_PLATFORM_Unmarshal(&handles[1], handleBufferStart, |
| 856 |
bufferRemainingSize); |
| 857 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2; |
| 858 |
break; |
| 859 |
#endif // CC_NV_UndefineSpaceSpecial |
| 860 |
#if CC_NV_ReadPublic |
| 861 |
case TPM_CC_NV_ReadPublic: |
| 862 |
*handleCount = 1; |
| 863 |
result = TPMI_RH_NV_INDEX_Unmarshal(&handles[0], handleBufferStart, |
| 864 |
bufferRemainingSize); |
| 865 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 866 |
break; |
| 867 |
#endif // CC_NV_ReadPublic |
| 868 |
#if CC_NV_Write |
| 869 |
case TPM_CC_NV_Write: |
| 870 |
*handleCount = 2; |
| 871 |
result = TPMI_RH_NV_AUTH_Unmarshal(&handles[0], handleBufferStart, |
| 872 |
bufferRemainingSize); |
| 873 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 874 |
result = TPMI_RH_NV_INDEX_Unmarshal(&handles[1], handleBufferStart, |
| 875 |
bufferRemainingSize); |
| 876 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2; |
| 877 |
break; |
| 878 |
#endif // CC_NV_Write |
| 879 |
#if CC_NV_Increment |
| 880 |
case TPM_CC_NV_Increment: |
| 881 |
*handleCount = 2; |
| 882 |
result = TPMI_RH_NV_AUTH_Unmarshal(&handles[0], handleBufferStart, |
| 883 |
bufferRemainingSize); |
| 884 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 885 |
result = TPMI_RH_NV_INDEX_Unmarshal(&handles[1], handleBufferStart, |
| 886 |
bufferRemainingSize); |
| 887 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2; |
| 888 |
break; |
| 889 |
#endif // CC_NV_Increment |
| 890 |
#if CC_NV_Extend |
| 891 |
case TPM_CC_NV_Extend: |
| 892 |
*handleCount = 2; |
| 893 |
result = TPMI_RH_NV_AUTH_Unmarshal(&handles[0], handleBufferStart, |
| 894 |
bufferRemainingSize); |
| 895 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 896 |
result = TPMI_RH_NV_INDEX_Unmarshal(&handles[1], handleBufferStart, |
| 897 |
bufferRemainingSize); |
| 898 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2; |
| 899 |
break; |
| 900 |
#endif // CC_NV_Extend |
| 901 |
#if CC_NV_SetBits |
| 902 |
case TPM_CC_NV_SetBits: |
| 903 |
*handleCount = 2; |
| 904 |
result = TPMI_RH_NV_AUTH_Unmarshal(&handles[0], handleBufferStart, |
| 905 |
bufferRemainingSize); |
| 906 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 907 |
result = TPMI_RH_NV_INDEX_Unmarshal(&handles[1], handleBufferStart, |
| 908 |
bufferRemainingSize); |
| 909 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2; |
| 910 |
break; |
| 911 |
#endif // CC_NV_SetBits |
| 912 |
#if CC_NV_WriteLock |
| 913 |
case TPM_CC_NV_WriteLock: |
| 914 |
*handleCount = 2; |
| 915 |
result = TPMI_RH_NV_AUTH_Unmarshal(&handles[0], handleBufferStart, |
| 916 |
bufferRemainingSize); |
| 917 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 918 |
result = TPMI_RH_NV_INDEX_Unmarshal(&handles[1], handleBufferStart, |
| 919 |
bufferRemainingSize); |
| 920 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2; |
| 921 |
break; |
| 922 |
#endif // CC_NV_WriteLock |
| 923 |
#if CC_NV_GlobalWriteLock |
| 924 |
case TPM_CC_NV_GlobalWriteLock: |
| 925 |
*handleCount = 1; |
| 926 |
result = TPMI_RH_PROVISION_Unmarshal(&handles[0], handleBufferStart, |
| 927 |
bufferRemainingSize); |
| 928 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 929 |
break; |
| 930 |
#endif // CC_NV_GlobalWriteLock |
| 931 |
#if CC_NV_Read |
| 932 |
case TPM_CC_NV_Read: |
| 933 |
*handleCount = 2; |
| 934 |
result = TPMI_RH_NV_AUTH_Unmarshal(&handles[0], handleBufferStart, |
| 935 |
bufferRemainingSize); |
| 936 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 937 |
result = TPMI_RH_NV_INDEX_Unmarshal(&handles[1], handleBufferStart, |
| 938 |
bufferRemainingSize); |
| 939 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2; |
| 940 |
break; |
| 941 |
#endif // CC_NV_Read |
| 942 |
#if CC_NV_ReadLock |
| 943 |
case TPM_CC_NV_ReadLock: |
| 944 |
*handleCount = 2; |
| 945 |
result = TPMI_RH_NV_AUTH_Unmarshal(&handles[0], handleBufferStart, |
| 946 |
bufferRemainingSize); |
| 947 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 948 |
result = TPMI_RH_NV_INDEX_Unmarshal(&handles[1], handleBufferStart, |
| 949 |
bufferRemainingSize); |
| 950 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2; |
| 951 |
break; |
| 952 |
#endif // CC_NV_ReadLock |
| 953 |
#if CC_NV_ChangeAuth |
| 954 |
case TPM_CC_NV_ChangeAuth: |
| 955 |
*handleCount = 1; |
| 956 |
result = TPMI_RH_NV_INDEX_Unmarshal(&handles[0], handleBufferStart, |
| 957 |
bufferRemainingSize); |
| 958 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 959 |
break; |
| 960 |
#endif // CC_NV_ChangeAuth |
| 961 |
#if CC_NV_Certify |
| 962 |
case TPM_CC_NV_Certify: |
| 963 |
*handleCount = 3; |
| 964 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 965 |
bufferRemainingSize, TRUE); |
| 966 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 967 |
result = TPMI_RH_NV_AUTH_Unmarshal(&handles[1], handleBufferStart, |
| 968 |
bufferRemainingSize); |
| 969 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2; |
| 970 |
result = TPMI_RH_NV_INDEX_Unmarshal(&handles[2], handleBufferStart, |
| 971 |
bufferRemainingSize); |
| 972 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_3; |
| 973 |
break; |
| 974 |
#endif // CC_NV_Certify |
| 975 |
#if CC_AC_GetCapability |
| 976 |
case TPM_CC_AC_GetCapability: |
| 977 |
*handleCount = 1; |
| 978 |
result = TPMI_RH_AC_Unmarshal(&handles[0], handleBufferStart, |
| 979 |
bufferRemainingSize); |
| 980 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 981 |
break; |
| 982 |
#endif // CC_AC_GetCapability |
| 983 |
#if CC_AC_Send |
| 984 |
case TPM_CC_AC_Send: |
| 985 |
*handleCount = 3; |
| 986 |
result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart, |
| 987 |
bufferRemainingSize, FALSE); |
| 988 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 989 |
result = TPMI_RH_NV_AUTH_Unmarshal(&handles[1], handleBufferStart, |
| 990 |
bufferRemainingSize); |
| 991 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2; |
| 992 |
result = TPMI_RH_AC_Unmarshal(&handles[2], handleBufferStart, |
| 993 |
bufferRemainingSize); |
| 994 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_3; |
| 995 |
break; |
| 996 |
#endif // CC_AC_Send |
| 997 |
#if CC_Policy_AC_SendSelect |
| 998 |
case TPM_CC_Policy_AC_SendSelect: |
| 999 |
*handleCount = 1; |
| 1000 |
result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart, |
| 1001 |
bufferRemainingSize); |
| 1002 |
if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1; |
| 1003 |
break; |
| 1004 |
#endif // CC_Policy_AC_SendSelect |
| 1005 |
#if CC_Vendor_TCG_Test |
| 1006 |
case TPM_CC_Vendor_TCG_Test: |
| 1007 |
break; |
| 1008 |
#endif // CC_Vendor_TCG_Test |