Jocelyn Bohr | a4ed3aa | 2015-07-30 10:44:16 -0700 | [diff] [blame^] | 1 | // Copyright 2015 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | // THIS CODE IS GENERATED - DO NOT MODIFY! |
| 6 | |
| 7 | #include "tpm_generated.h" |
| 8 | #include "HandleProcess_fp.h" |
| 9 | #include "Implementation.h" |
| 10 | #include "TPM_Types.h" |
| 11 | |
| 12 | TPM_RC ParseHandleBuffer(TPM_CC command_code, |
| 13 | BYTE** request_handle_buffer_start, |
| 14 | INT32* request_buffer_remaining_size, |
| 15 | TPM_HANDLE request_handles[], |
| 16 | UINT32* num_request_handles) { |
| 17 | TPM_RC result = TPM_RC_SUCCESS; |
| 18 | *num_request_handles = 0; |
| 19 | switch (command_code) { |
| 20 | #ifdef TPM_CC_Startup |
| 21 | case TPM_CC_Startup: |
| 22 | return TPM_RC_SUCCESS; |
| 23 | #endif |
| 24 | #ifdef TPM_CC_Shutdown |
| 25 | case TPM_CC_Shutdown: |
| 26 | return TPM_RC_SUCCESS; |
| 27 | #endif |
| 28 | #ifdef TPM_CC_SelfTest |
| 29 | case TPM_CC_SelfTest: |
| 30 | return TPM_RC_SUCCESS; |
| 31 | #endif |
| 32 | #ifdef TPM_CC_IncrementalSelfTest |
| 33 | case TPM_CC_IncrementalSelfTest: |
| 34 | return TPM_RC_SUCCESS; |
| 35 | #endif |
| 36 | #ifdef TPM_CC_GetTestResult |
| 37 | case TPM_CC_GetTestResult: |
| 38 | return TPM_RC_SUCCESS; |
| 39 | #endif |
| 40 | #ifdef TPM_CC_StartAuthSession |
| 41 | case TPM_CC_StartAuthSession: |
| 42 | result = TPMI_DH_OBJECT_Unmarshal( |
| 43 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 44 | request_handle_buffer_start, request_buffer_remaining_size, TRUE); |
| 45 | if (result != TPM_RC_SUCCESS) { |
| 46 | return result; |
| 47 | } |
| 48 | ++(*num_request_handles); |
| 49 | result = TPMI_DH_ENTITY_Unmarshal( |
| 50 | (TPMI_DH_ENTITY*)&request_handles[*num_request_handles], |
| 51 | request_handle_buffer_start, request_buffer_remaining_size, TRUE); |
| 52 | if (result != TPM_RC_SUCCESS) { |
| 53 | return result; |
| 54 | } |
| 55 | ++(*num_request_handles); |
| 56 | return TPM_RC_SUCCESS; |
| 57 | #endif |
| 58 | #ifdef TPM_CC_PolicyRestart |
| 59 | case TPM_CC_PolicyRestart: |
| 60 | result = TPMI_SH_POLICY_Unmarshal( |
| 61 | (TPMI_SH_POLICY*)&request_handles[*num_request_handles], |
| 62 | request_handle_buffer_start, request_buffer_remaining_size); |
| 63 | if (result != TPM_RC_SUCCESS) { |
| 64 | return result; |
| 65 | } |
| 66 | ++(*num_request_handles); |
| 67 | return TPM_RC_SUCCESS; |
| 68 | #endif |
| 69 | #ifdef TPM_CC_Create |
| 70 | case TPM_CC_Create: |
| 71 | result = TPMI_DH_OBJECT_Unmarshal( |
| 72 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 73 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 74 | if (result != TPM_RC_SUCCESS) { |
| 75 | return result; |
| 76 | } |
| 77 | ++(*num_request_handles); |
| 78 | return TPM_RC_SUCCESS; |
| 79 | #endif |
| 80 | #ifdef TPM_CC_Load |
| 81 | case TPM_CC_Load: |
| 82 | result = TPMI_DH_OBJECT_Unmarshal( |
| 83 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 84 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 85 | if (result != TPM_RC_SUCCESS) { |
| 86 | return result; |
| 87 | } |
| 88 | ++(*num_request_handles); |
| 89 | return TPM_RC_SUCCESS; |
| 90 | #endif |
| 91 | #ifdef TPM_CC_LoadExternal |
| 92 | case TPM_CC_LoadExternal: |
| 93 | result = TPMI_RH_HIERARCHY_Unmarshal( |
| 94 | (TPMI_RH_HIERARCHY*)&request_handles[*num_request_handles], |
| 95 | request_handle_buffer_start, request_buffer_remaining_size, TRUE); |
| 96 | if (result != TPM_RC_SUCCESS) { |
| 97 | return result; |
| 98 | } |
| 99 | ++(*num_request_handles); |
| 100 | return TPM_RC_SUCCESS; |
| 101 | #endif |
| 102 | #ifdef TPM_CC_ReadPublic |
| 103 | case TPM_CC_ReadPublic: |
| 104 | result = TPMI_DH_OBJECT_Unmarshal( |
| 105 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 106 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 107 | if (result != TPM_RC_SUCCESS) { |
| 108 | return result; |
| 109 | } |
| 110 | ++(*num_request_handles); |
| 111 | return TPM_RC_SUCCESS; |
| 112 | #endif |
| 113 | #ifdef TPM_CC_ActivateCredential |
| 114 | case TPM_CC_ActivateCredential: |
| 115 | result = TPMI_DH_OBJECT_Unmarshal( |
| 116 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 117 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 118 | if (result != TPM_RC_SUCCESS) { |
| 119 | return result; |
| 120 | } |
| 121 | ++(*num_request_handles); |
| 122 | result = TPMI_DH_OBJECT_Unmarshal( |
| 123 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 124 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 125 | if (result != TPM_RC_SUCCESS) { |
| 126 | return result; |
| 127 | } |
| 128 | ++(*num_request_handles); |
| 129 | return TPM_RC_SUCCESS; |
| 130 | #endif |
| 131 | #ifdef TPM_CC_MakeCredential |
| 132 | case TPM_CC_MakeCredential: |
| 133 | result = TPMI_DH_OBJECT_Unmarshal( |
| 134 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 135 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 136 | if (result != TPM_RC_SUCCESS) { |
| 137 | return result; |
| 138 | } |
| 139 | ++(*num_request_handles); |
| 140 | return TPM_RC_SUCCESS; |
| 141 | #endif |
| 142 | #ifdef TPM_CC_Unseal |
| 143 | case TPM_CC_Unseal: |
| 144 | result = TPMI_DH_OBJECT_Unmarshal( |
| 145 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 146 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 147 | if (result != TPM_RC_SUCCESS) { |
| 148 | return result; |
| 149 | } |
| 150 | ++(*num_request_handles); |
| 151 | return TPM_RC_SUCCESS; |
| 152 | #endif |
| 153 | #ifdef TPM_CC_ObjectChangeAuth |
| 154 | case TPM_CC_ObjectChangeAuth: |
| 155 | result = TPMI_DH_OBJECT_Unmarshal( |
| 156 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 157 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 158 | if (result != TPM_RC_SUCCESS) { |
| 159 | return result; |
| 160 | } |
| 161 | ++(*num_request_handles); |
| 162 | result = TPMI_DH_OBJECT_Unmarshal( |
| 163 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 164 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 165 | if (result != TPM_RC_SUCCESS) { |
| 166 | return result; |
| 167 | } |
| 168 | ++(*num_request_handles); |
| 169 | return TPM_RC_SUCCESS; |
| 170 | #endif |
| 171 | #ifdef TPM_CC_Duplicate |
| 172 | case TPM_CC_Duplicate: |
| 173 | result = TPMI_DH_OBJECT_Unmarshal( |
| 174 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 175 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 176 | if (result != TPM_RC_SUCCESS) { |
| 177 | return result; |
| 178 | } |
| 179 | ++(*num_request_handles); |
| 180 | result = TPMI_DH_OBJECT_Unmarshal( |
| 181 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 182 | request_handle_buffer_start, request_buffer_remaining_size, TRUE); |
| 183 | if (result != TPM_RC_SUCCESS) { |
| 184 | return result; |
| 185 | } |
| 186 | ++(*num_request_handles); |
| 187 | return TPM_RC_SUCCESS; |
| 188 | #endif |
| 189 | #ifdef TPM_CC_Rewrap |
| 190 | case TPM_CC_Rewrap: |
| 191 | result = TPMI_DH_OBJECT_Unmarshal( |
| 192 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 193 | request_handle_buffer_start, request_buffer_remaining_size, TRUE); |
| 194 | if (result != TPM_RC_SUCCESS) { |
| 195 | return result; |
| 196 | } |
| 197 | ++(*num_request_handles); |
| 198 | result = TPMI_DH_OBJECT_Unmarshal( |
| 199 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 200 | request_handle_buffer_start, request_buffer_remaining_size, TRUE); |
| 201 | if (result != TPM_RC_SUCCESS) { |
| 202 | return result; |
| 203 | } |
| 204 | ++(*num_request_handles); |
| 205 | return TPM_RC_SUCCESS; |
| 206 | #endif |
| 207 | #ifdef TPM_CC_Import |
| 208 | case TPM_CC_Import: |
| 209 | result = TPMI_DH_OBJECT_Unmarshal( |
| 210 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 211 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 212 | if (result != TPM_RC_SUCCESS) { |
| 213 | return result; |
| 214 | } |
| 215 | ++(*num_request_handles); |
| 216 | return TPM_RC_SUCCESS; |
| 217 | #endif |
| 218 | #ifdef TPM_CC_RSA_Encrypt |
| 219 | case TPM_CC_RSA_Encrypt: |
| 220 | result = TPMI_DH_OBJECT_Unmarshal( |
| 221 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 222 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 223 | if (result != TPM_RC_SUCCESS) { |
| 224 | return result; |
| 225 | } |
| 226 | ++(*num_request_handles); |
| 227 | return TPM_RC_SUCCESS; |
| 228 | #endif |
| 229 | #ifdef TPM_CC_RSA_Decrypt |
| 230 | case TPM_CC_RSA_Decrypt: |
| 231 | result = TPMI_DH_OBJECT_Unmarshal( |
| 232 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 233 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 234 | if (result != TPM_RC_SUCCESS) { |
| 235 | return result; |
| 236 | } |
| 237 | ++(*num_request_handles); |
| 238 | return TPM_RC_SUCCESS; |
| 239 | #endif |
| 240 | #ifdef TPM_CC_ECDH_KeyGen |
| 241 | case TPM_CC_ECDH_KeyGen: |
| 242 | result = TPMI_DH_OBJECT_Unmarshal( |
| 243 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 244 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 245 | if (result != TPM_RC_SUCCESS) { |
| 246 | return result; |
| 247 | } |
| 248 | ++(*num_request_handles); |
| 249 | return TPM_RC_SUCCESS; |
| 250 | #endif |
| 251 | #ifdef TPM_CC_ECDH_ZGen |
| 252 | case TPM_CC_ECDH_ZGen: |
| 253 | result = TPMI_DH_OBJECT_Unmarshal( |
| 254 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 255 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 256 | if (result != TPM_RC_SUCCESS) { |
| 257 | return result; |
| 258 | } |
| 259 | ++(*num_request_handles); |
| 260 | return TPM_RC_SUCCESS; |
| 261 | #endif |
| 262 | #ifdef TPM_CC_ECC_Parameters |
| 263 | case TPM_CC_ECC_Parameters: |
| 264 | return TPM_RC_SUCCESS; |
| 265 | #endif |
| 266 | #ifdef TPM_CC_ZGen_2Phase |
| 267 | case TPM_CC_ZGen_2Phase: |
| 268 | result = TPMI_DH_OBJECT_Unmarshal( |
| 269 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 270 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 271 | if (result != TPM_RC_SUCCESS) { |
| 272 | return result; |
| 273 | } |
| 274 | ++(*num_request_handles); |
| 275 | return TPM_RC_SUCCESS; |
| 276 | #endif |
| 277 | #ifdef TPM_CC_EncryptDecrypt |
| 278 | case TPM_CC_EncryptDecrypt: |
| 279 | result = TPMI_DH_OBJECT_Unmarshal( |
| 280 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 281 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 282 | if (result != TPM_RC_SUCCESS) { |
| 283 | return result; |
| 284 | } |
| 285 | ++(*num_request_handles); |
| 286 | return TPM_RC_SUCCESS; |
| 287 | #endif |
| 288 | #ifdef TPM_CC_Hash |
| 289 | case TPM_CC_Hash: |
| 290 | result = TPMI_RH_HIERARCHY_Unmarshal( |
| 291 | (TPMI_RH_HIERARCHY*)&request_handles[*num_request_handles], |
| 292 | request_handle_buffer_start, request_buffer_remaining_size, TRUE); |
| 293 | if (result != TPM_RC_SUCCESS) { |
| 294 | return result; |
| 295 | } |
| 296 | ++(*num_request_handles); |
| 297 | return TPM_RC_SUCCESS; |
| 298 | #endif |
| 299 | #ifdef TPM_CC_HMAC |
| 300 | case TPM_CC_HMAC: |
| 301 | result = TPMI_DH_OBJECT_Unmarshal( |
| 302 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 303 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 304 | if (result != TPM_RC_SUCCESS) { |
| 305 | return result; |
| 306 | } |
| 307 | ++(*num_request_handles); |
| 308 | return TPM_RC_SUCCESS; |
| 309 | #endif |
| 310 | #ifdef TPM_CC_GetRandom |
| 311 | case TPM_CC_GetRandom: |
| 312 | return TPM_RC_SUCCESS; |
| 313 | #endif |
| 314 | #ifdef TPM_CC_StirRandom |
| 315 | case TPM_CC_StirRandom: |
| 316 | return TPM_RC_SUCCESS; |
| 317 | #endif |
| 318 | #ifdef TPM_CC_HMAC_Start |
| 319 | case TPM_CC_HMAC_Start: |
| 320 | result = TPMI_DH_OBJECT_Unmarshal( |
| 321 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 322 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 323 | if (result != TPM_RC_SUCCESS) { |
| 324 | return result; |
| 325 | } |
| 326 | ++(*num_request_handles); |
| 327 | return TPM_RC_SUCCESS; |
| 328 | #endif |
| 329 | #ifdef TPM_CC_HashSequenceStart |
| 330 | case TPM_CC_HashSequenceStart: |
| 331 | return TPM_RC_SUCCESS; |
| 332 | #endif |
| 333 | #ifdef TPM_CC_SequenceUpdate |
| 334 | case TPM_CC_SequenceUpdate: |
| 335 | result = TPMI_DH_OBJECT_Unmarshal( |
| 336 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 337 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 338 | if (result != TPM_RC_SUCCESS) { |
| 339 | return result; |
| 340 | } |
| 341 | ++(*num_request_handles); |
| 342 | return TPM_RC_SUCCESS; |
| 343 | #endif |
| 344 | #ifdef TPM_CC_SequenceComplete |
| 345 | case TPM_CC_SequenceComplete: |
| 346 | result = TPMI_DH_OBJECT_Unmarshal( |
| 347 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 348 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 349 | if (result != TPM_RC_SUCCESS) { |
| 350 | return result; |
| 351 | } |
| 352 | ++(*num_request_handles); |
| 353 | result = TPMI_RH_HIERARCHY_Unmarshal( |
| 354 | (TPMI_RH_HIERARCHY*)&request_handles[*num_request_handles], |
| 355 | request_handle_buffer_start, request_buffer_remaining_size, TRUE); |
| 356 | if (result != TPM_RC_SUCCESS) { |
| 357 | return result; |
| 358 | } |
| 359 | ++(*num_request_handles); |
| 360 | return TPM_RC_SUCCESS; |
| 361 | #endif |
| 362 | #ifdef TPM_CC_EventSequenceComplete |
| 363 | case TPM_CC_EventSequenceComplete: |
| 364 | result = TPMI_DH_PCR_Unmarshal( |
| 365 | (TPMI_DH_PCR*)&request_handles[*num_request_handles], |
| 366 | request_handle_buffer_start, request_buffer_remaining_size, TRUE); |
| 367 | if (result != TPM_RC_SUCCESS) { |
| 368 | return result; |
| 369 | } |
| 370 | ++(*num_request_handles); |
| 371 | result = TPMI_DH_OBJECT_Unmarshal( |
| 372 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 373 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 374 | if (result != TPM_RC_SUCCESS) { |
| 375 | return result; |
| 376 | } |
| 377 | ++(*num_request_handles); |
| 378 | return TPM_RC_SUCCESS; |
| 379 | #endif |
| 380 | #ifdef TPM_CC_Certify |
| 381 | case TPM_CC_Certify: |
| 382 | result = TPMI_DH_OBJECT_Unmarshal( |
| 383 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 384 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 385 | if (result != TPM_RC_SUCCESS) { |
| 386 | return result; |
| 387 | } |
| 388 | ++(*num_request_handles); |
| 389 | result = TPMI_DH_OBJECT_Unmarshal( |
| 390 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 391 | request_handle_buffer_start, request_buffer_remaining_size, TRUE); |
| 392 | if (result != TPM_RC_SUCCESS) { |
| 393 | return result; |
| 394 | } |
| 395 | ++(*num_request_handles); |
| 396 | return TPM_RC_SUCCESS; |
| 397 | #endif |
| 398 | #ifdef TPM_CC_CertifyCreation |
| 399 | case TPM_CC_CertifyCreation: |
| 400 | result = TPMI_DH_OBJECT_Unmarshal( |
| 401 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 402 | request_handle_buffer_start, request_buffer_remaining_size, TRUE); |
| 403 | if (result != TPM_RC_SUCCESS) { |
| 404 | return result; |
| 405 | } |
| 406 | ++(*num_request_handles); |
| 407 | result = TPMI_DH_OBJECT_Unmarshal( |
| 408 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 409 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 410 | if (result != TPM_RC_SUCCESS) { |
| 411 | return result; |
| 412 | } |
| 413 | ++(*num_request_handles); |
| 414 | return TPM_RC_SUCCESS; |
| 415 | #endif |
| 416 | #ifdef TPM_CC_Quote |
| 417 | case TPM_CC_Quote: |
| 418 | result = TPMI_DH_OBJECT_Unmarshal( |
| 419 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 420 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 421 | if (result != TPM_RC_SUCCESS) { |
| 422 | return result; |
| 423 | } |
| 424 | ++(*num_request_handles); |
| 425 | return TPM_RC_SUCCESS; |
| 426 | #endif |
| 427 | #ifdef TPM_CC_GetSessionAuditDigest |
| 428 | case TPM_CC_GetSessionAuditDigest: |
| 429 | result = TPMI_RH_ENDORSEMENT_Unmarshal( |
| 430 | (TPMI_RH_ENDORSEMENT*)&request_handles[*num_request_handles], |
| 431 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 432 | if (result != TPM_RC_SUCCESS) { |
| 433 | return result; |
| 434 | } |
| 435 | ++(*num_request_handles); |
| 436 | result = TPMI_DH_OBJECT_Unmarshal( |
| 437 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 438 | request_handle_buffer_start, request_buffer_remaining_size, TRUE); |
| 439 | if (result != TPM_RC_SUCCESS) { |
| 440 | return result; |
| 441 | } |
| 442 | ++(*num_request_handles); |
| 443 | result = TPMI_SH_HMAC_Unmarshal( |
| 444 | (TPMI_SH_HMAC*)&request_handles[*num_request_handles], |
| 445 | request_handle_buffer_start, request_buffer_remaining_size); |
| 446 | if (result != TPM_RC_SUCCESS) { |
| 447 | return result; |
| 448 | } |
| 449 | ++(*num_request_handles); |
| 450 | return TPM_RC_SUCCESS; |
| 451 | #endif |
| 452 | #ifdef TPM_CC_GetCommandAuditDigest |
| 453 | case TPM_CC_GetCommandAuditDigest: |
| 454 | result = TPMI_RH_ENDORSEMENT_Unmarshal( |
| 455 | (TPMI_RH_ENDORSEMENT*)&request_handles[*num_request_handles], |
| 456 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 457 | if (result != TPM_RC_SUCCESS) { |
| 458 | return result; |
| 459 | } |
| 460 | ++(*num_request_handles); |
| 461 | result = TPMI_DH_OBJECT_Unmarshal( |
| 462 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 463 | request_handle_buffer_start, request_buffer_remaining_size, TRUE); |
| 464 | if (result != TPM_RC_SUCCESS) { |
| 465 | return result; |
| 466 | } |
| 467 | ++(*num_request_handles); |
| 468 | return TPM_RC_SUCCESS; |
| 469 | #endif |
| 470 | #ifdef TPM_CC_GetTime |
| 471 | case TPM_CC_GetTime: |
| 472 | result = TPMI_RH_ENDORSEMENT_Unmarshal( |
| 473 | (TPMI_RH_ENDORSEMENT*)&request_handles[*num_request_handles], |
| 474 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 475 | if (result != TPM_RC_SUCCESS) { |
| 476 | return result; |
| 477 | } |
| 478 | ++(*num_request_handles); |
| 479 | result = TPMI_DH_OBJECT_Unmarshal( |
| 480 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 481 | request_handle_buffer_start, request_buffer_remaining_size, TRUE); |
| 482 | if (result != TPM_RC_SUCCESS) { |
| 483 | return result; |
| 484 | } |
| 485 | ++(*num_request_handles); |
| 486 | return TPM_RC_SUCCESS; |
| 487 | #endif |
| 488 | #ifdef TPM_CC_Commit |
| 489 | case TPM_CC_Commit: |
| 490 | result = TPMI_DH_OBJECT_Unmarshal( |
| 491 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 492 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 493 | if (result != TPM_RC_SUCCESS) { |
| 494 | return result; |
| 495 | } |
| 496 | ++(*num_request_handles); |
| 497 | return TPM_RC_SUCCESS; |
| 498 | #endif |
| 499 | #ifdef TPM_CC_EC_Ephemeral |
| 500 | case TPM_CC_EC_Ephemeral: |
| 501 | return TPM_RC_SUCCESS; |
| 502 | #endif |
| 503 | #ifdef TPM_CC_VerifySignature |
| 504 | case TPM_CC_VerifySignature: |
| 505 | result = TPMI_DH_OBJECT_Unmarshal( |
| 506 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 507 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 508 | if (result != TPM_RC_SUCCESS) { |
| 509 | return result; |
| 510 | } |
| 511 | ++(*num_request_handles); |
| 512 | return TPM_RC_SUCCESS; |
| 513 | #endif |
| 514 | #ifdef TPM_CC_Sign |
| 515 | case TPM_CC_Sign: |
| 516 | result = TPMI_DH_OBJECT_Unmarshal( |
| 517 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 518 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 519 | if (result != TPM_RC_SUCCESS) { |
| 520 | return result; |
| 521 | } |
| 522 | ++(*num_request_handles); |
| 523 | return TPM_RC_SUCCESS; |
| 524 | #endif |
| 525 | #ifdef TPM_CC_SetCommandCodeAuditStatus |
| 526 | case TPM_CC_SetCommandCodeAuditStatus: |
| 527 | result = TPMI_RH_PROVISION_Unmarshal( |
| 528 | (TPMI_RH_PROVISION*)&request_handles[*num_request_handles], |
| 529 | request_handle_buffer_start, request_buffer_remaining_size); |
| 530 | if (result != TPM_RC_SUCCESS) { |
| 531 | return result; |
| 532 | } |
| 533 | ++(*num_request_handles); |
| 534 | return TPM_RC_SUCCESS; |
| 535 | #endif |
| 536 | #ifdef TPM_CC_PCR_Extend |
| 537 | case TPM_CC_PCR_Extend: |
| 538 | result = TPMI_DH_PCR_Unmarshal( |
| 539 | (TPMI_DH_PCR*)&request_handles[*num_request_handles], |
| 540 | request_handle_buffer_start, request_buffer_remaining_size, TRUE); |
| 541 | if (result != TPM_RC_SUCCESS) { |
| 542 | return result; |
| 543 | } |
| 544 | ++(*num_request_handles); |
| 545 | return TPM_RC_SUCCESS; |
| 546 | #endif |
| 547 | #ifdef TPM_CC_PCR_Event |
| 548 | case TPM_CC_PCR_Event: |
| 549 | result = TPMI_DH_PCR_Unmarshal( |
| 550 | (TPMI_DH_PCR*)&request_handles[*num_request_handles], |
| 551 | request_handle_buffer_start, request_buffer_remaining_size, TRUE); |
| 552 | if (result != TPM_RC_SUCCESS) { |
| 553 | return result; |
| 554 | } |
| 555 | ++(*num_request_handles); |
| 556 | return TPM_RC_SUCCESS; |
| 557 | #endif |
| 558 | #ifdef TPM_CC_PCR_Read |
| 559 | case TPM_CC_PCR_Read: |
| 560 | return TPM_RC_SUCCESS; |
| 561 | #endif |
| 562 | #ifdef TPM_CC_PCR_Allocate |
| 563 | case TPM_CC_PCR_Allocate: |
| 564 | result = TPMI_RH_PLATFORM_Unmarshal( |
| 565 | (TPMI_RH_PLATFORM*)&request_handles[*num_request_handles], |
| 566 | request_handle_buffer_start, request_buffer_remaining_size); |
| 567 | if (result != TPM_RC_SUCCESS) { |
| 568 | return result; |
| 569 | } |
| 570 | ++(*num_request_handles); |
| 571 | return TPM_RC_SUCCESS; |
| 572 | #endif |
| 573 | #ifdef TPM_CC_PCR_SetAuthPolicy |
| 574 | case TPM_CC_PCR_SetAuthPolicy: |
| 575 | result = TPMI_RH_PLATFORM_Unmarshal( |
| 576 | (TPMI_RH_PLATFORM*)&request_handles[*num_request_handles], |
| 577 | request_handle_buffer_start, request_buffer_remaining_size); |
| 578 | if (result != TPM_RC_SUCCESS) { |
| 579 | return result; |
| 580 | } |
| 581 | ++(*num_request_handles); |
| 582 | result = TPMI_DH_PCR_Unmarshal( |
| 583 | (TPMI_DH_PCR*)&request_handles[*num_request_handles], |
| 584 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 585 | if (result != TPM_RC_SUCCESS) { |
| 586 | return result; |
| 587 | } |
| 588 | ++(*num_request_handles); |
| 589 | return TPM_RC_SUCCESS; |
| 590 | #endif |
| 591 | #ifdef TPM_CC_PCR_SetAuthValue |
| 592 | case TPM_CC_PCR_SetAuthValue: |
| 593 | result = TPMI_DH_PCR_Unmarshal( |
| 594 | (TPMI_DH_PCR*)&request_handles[*num_request_handles], |
| 595 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 596 | if (result != TPM_RC_SUCCESS) { |
| 597 | return result; |
| 598 | } |
| 599 | ++(*num_request_handles); |
| 600 | return TPM_RC_SUCCESS; |
| 601 | #endif |
| 602 | #ifdef TPM_CC_PCR_Reset |
| 603 | case TPM_CC_PCR_Reset: |
| 604 | result = TPMI_DH_PCR_Unmarshal( |
| 605 | (TPMI_DH_PCR*)&request_handles[*num_request_handles], |
| 606 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 607 | if (result != TPM_RC_SUCCESS) { |
| 608 | return result; |
| 609 | } |
| 610 | ++(*num_request_handles); |
| 611 | return TPM_RC_SUCCESS; |
| 612 | #endif |
| 613 | #ifdef TPM_CC_PolicySigned |
| 614 | case TPM_CC_PolicySigned: |
| 615 | result = TPMI_DH_OBJECT_Unmarshal( |
| 616 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 617 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 618 | if (result != TPM_RC_SUCCESS) { |
| 619 | return result; |
| 620 | } |
| 621 | ++(*num_request_handles); |
| 622 | result = TPMI_SH_POLICY_Unmarshal( |
| 623 | (TPMI_SH_POLICY*)&request_handles[*num_request_handles], |
| 624 | request_handle_buffer_start, request_buffer_remaining_size); |
| 625 | if (result != TPM_RC_SUCCESS) { |
| 626 | return result; |
| 627 | } |
| 628 | ++(*num_request_handles); |
| 629 | return TPM_RC_SUCCESS; |
| 630 | #endif |
| 631 | #ifdef TPM_CC_PolicySecret |
| 632 | case TPM_CC_PolicySecret: |
| 633 | result = TPMI_DH_ENTITY_Unmarshal( |
| 634 | (TPMI_DH_ENTITY*)&request_handles[*num_request_handles], |
| 635 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 636 | if (result != TPM_RC_SUCCESS) { |
| 637 | return result; |
| 638 | } |
| 639 | ++(*num_request_handles); |
| 640 | result = TPMI_SH_POLICY_Unmarshal( |
| 641 | (TPMI_SH_POLICY*)&request_handles[*num_request_handles], |
| 642 | request_handle_buffer_start, request_buffer_remaining_size); |
| 643 | if (result != TPM_RC_SUCCESS) { |
| 644 | return result; |
| 645 | } |
| 646 | ++(*num_request_handles); |
| 647 | return TPM_RC_SUCCESS; |
| 648 | #endif |
| 649 | #ifdef TPM_CC_PolicyTicket |
| 650 | case TPM_CC_PolicyTicket: |
| 651 | result = TPMI_SH_POLICY_Unmarshal( |
| 652 | (TPMI_SH_POLICY*)&request_handles[*num_request_handles], |
| 653 | request_handle_buffer_start, request_buffer_remaining_size); |
| 654 | if (result != TPM_RC_SUCCESS) { |
| 655 | return result; |
| 656 | } |
| 657 | ++(*num_request_handles); |
| 658 | return TPM_RC_SUCCESS; |
| 659 | #endif |
| 660 | #ifdef TPM_CC_PolicyOR |
| 661 | case TPM_CC_PolicyOR: |
| 662 | result = TPMI_SH_POLICY_Unmarshal( |
| 663 | (TPMI_SH_POLICY*)&request_handles[*num_request_handles], |
| 664 | request_handle_buffer_start, request_buffer_remaining_size); |
| 665 | if (result != TPM_RC_SUCCESS) { |
| 666 | return result; |
| 667 | } |
| 668 | ++(*num_request_handles); |
| 669 | return TPM_RC_SUCCESS; |
| 670 | #endif |
| 671 | #ifdef TPM_CC_PolicyPCR |
| 672 | case TPM_CC_PolicyPCR: |
| 673 | result = TPMI_SH_POLICY_Unmarshal( |
| 674 | (TPMI_SH_POLICY*)&request_handles[*num_request_handles], |
| 675 | request_handle_buffer_start, request_buffer_remaining_size); |
| 676 | if (result != TPM_RC_SUCCESS) { |
| 677 | return result; |
| 678 | } |
| 679 | ++(*num_request_handles); |
| 680 | return TPM_RC_SUCCESS; |
| 681 | #endif |
| 682 | #ifdef TPM_CC_PolicyLocality |
| 683 | case TPM_CC_PolicyLocality: |
| 684 | result = TPMI_SH_POLICY_Unmarshal( |
| 685 | (TPMI_SH_POLICY*)&request_handles[*num_request_handles], |
| 686 | request_handle_buffer_start, request_buffer_remaining_size); |
| 687 | if (result != TPM_RC_SUCCESS) { |
| 688 | return result; |
| 689 | } |
| 690 | ++(*num_request_handles); |
| 691 | return TPM_RC_SUCCESS; |
| 692 | #endif |
| 693 | #ifdef TPM_CC_PolicyNV |
| 694 | case TPM_CC_PolicyNV: |
| 695 | result = TPMI_RH_NV_AUTH_Unmarshal( |
| 696 | (TPMI_RH_NV_AUTH*)&request_handles[*num_request_handles], |
| 697 | request_handle_buffer_start, request_buffer_remaining_size); |
| 698 | if (result != TPM_RC_SUCCESS) { |
| 699 | return result; |
| 700 | } |
| 701 | ++(*num_request_handles); |
| 702 | result = TPMI_RH_NV_INDEX_Unmarshal( |
| 703 | (TPMI_RH_NV_INDEX*)&request_handles[*num_request_handles], |
| 704 | request_handle_buffer_start, request_buffer_remaining_size); |
| 705 | if (result != TPM_RC_SUCCESS) { |
| 706 | return result; |
| 707 | } |
| 708 | ++(*num_request_handles); |
| 709 | result = TPMI_SH_POLICY_Unmarshal( |
| 710 | (TPMI_SH_POLICY*)&request_handles[*num_request_handles], |
| 711 | request_handle_buffer_start, request_buffer_remaining_size); |
| 712 | if (result != TPM_RC_SUCCESS) { |
| 713 | return result; |
| 714 | } |
| 715 | ++(*num_request_handles); |
| 716 | return TPM_RC_SUCCESS; |
| 717 | #endif |
| 718 | #ifdef TPM_CC_PolicyCounterTimer |
| 719 | case TPM_CC_PolicyCounterTimer: |
| 720 | result = TPMI_SH_POLICY_Unmarshal( |
| 721 | (TPMI_SH_POLICY*)&request_handles[*num_request_handles], |
| 722 | request_handle_buffer_start, request_buffer_remaining_size); |
| 723 | if (result != TPM_RC_SUCCESS) { |
| 724 | return result; |
| 725 | } |
| 726 | ++(*num_request_handles); |
| 727 | return TPM_RC_SUCCESS; |
| 728 | #endif |
| 729 | #ifdef TPM_CC_PolicyCommandCode |
| 730 | case TPM_CC_PolicyCommandCode: |
| 731 | result = TPMI_SH_POLICY_Unmarshal( |
| 732 | (TPMI_SH_POLICY*)&request_handles[*num_request_handles], |
| 733 | request_handle_buffer_start, request_buffer_remaining_size); |
| 734 | if (result != TPM_RC_SUCCESS) { |
| 735 | return result; |
| 736 | } |
| 737 | ++(*num_request_handles); |
| 738 | return TPM_RC_SUCCESS; |
| 739 | #endif |
| 740 | #ifdef TPM_CC_PolicyPhysicalPresence |
| 741 | case TPM_CC_PolicyPhysicalPresence: |
| 742 | result = TPMI_SH_POLICY_Unmarshal( |
| 743 | (TPMI_SH_POLICY*)&request_handles[*num_request_handles], |
| 744 | request_handle_buffer_start, request_buffer_remaining_size); |
| 745 | if (result != TPM_RC_SUCCESS) { |
| 746 | return result; |
| 747 | } |
| 748 | ++(*num_request_handles); |
| 749 | return TPM_RC_SUCCESS; |
| 750 | #endif |
| 751 | #ifdef TPM_CC_PolicyCpHash |
| 752 | case TPM_CC_PolicyCpHash: |
| 753 | result = TPMI_SH_POLICY_Unmarshal( |
| 754 | (TPMI_SH_POLICY*)&request_handles[*num_request_handles], |
| 755 | request_handle_buffer_start, request_buffer_remaining_size); |
| 756 | if (result != TPM_RC_SUCCESS) { |
| 757 | return result; |
| 758 | } |
| 759 | ++(*num_request_handles); |
| 760 | return TPM_RC_SUCCESS; |
| 761 | #endif |
| 762 | #ifdef TPM_CC_PolicyNameHash |
| 763 | case TPM_CC_PolicyNameHash: |
| 764 | result = TPMI_SH_POLICY_Unmarshal( |
| 765 | (TPMI_SH_POLICY*)&request_handles[*num_request_handles], |
| 766 | request_handle_buffer_start, request_buffer_remaining_size); |
| 767 | if (result != TPM_RC_SUCCESS) { |
| 768 | return result; |
| 769 | } |
| 770 | ++(*num_request_handles); |
| 771 | return TPM_RC_SUCCESS; |
| 772 | #endif |
| 773 | #ifdef TPM_CC_PolicyDuplicationSelect |
| 774 | case TPM_CC_PolicyDuplicationSelect: |
| 775 | result = TPMI_SH_POLICY_Unmarshal( |
| 776 | (TPMI_SH_POLICY*)&request_handles[*num_request_handles], |
| 777 | request_handle_buffer_start, request_buffer_remaining_size); |
| 778 | if (result != TPM_RC_SUCCESS) { |
| 779 | return result; |
| 780 | } |
| 781 | ++(*num_request_handles); |
| 782 | return TPM_RC_SUCCESS; |
| 783 | #endif |
| 784 | #ifdef TPM_CC_PolicyAuthorize |
| 785 | case TPM_CC_PolicyAuthorize: |
| 786 | result = TPMI_SH_POLICY_Unmarshal( |
| 787 | (TPMI_SH_POLICY*)&request_handles[*num_request_handles], |
| 788 | request_handle_buffer_start, request_buffer_remaining_size); |
| 789 | if (result != TPM_RC_SUCCESS) { |
| 790 | return result; |
| 791 | } |
| 792 | ++(*num_request_handles); |
| 793 | return TPM_RC_SUCCESS; |
| 794 | #endif |
| 795 | #ifdef TPM_CC_PolicyAuthValue |
| 796 | case TPM_CC_PolicyAuthValue: |
| 797 | result = TPMI_SH_POLICY_Unmarshal( |
| 798 | (TPMI_SH_POLICY*)&request_handles[*num_request_handles], |
| 799 | request_handle_buffer_start, request_buffer_remaining_size); |
| 800 | if (result != TPM_RC_SUCCESS) { |
| 801 | return result; |
| 802 | } |
| 803 | ++(*num_request_handles); |
| 804 | return TPM_RC_SUCCESS; |
| 805 | #endif |
| 806 | #ifdef TPM_CC_PolicyPassword |
| 807 | case TPM_CC_PolicyPassword: |
| 808 | result = TPMI_SH_POLICY_Unmarshal( |
| 809 | (TPMI_SH_POLICY*)&request_handles[*num_request_handles], |
| 810 | request_handle_buffer_start, request_buffer_remaining_size); |
| 811 | if (result != TPM_RC_SUCCESS) { |
| 812 | return result; |
| 813 | } |
| 814 | ++(*num_request_handles); |
| 815 | return TPM_RC_SUCCESS; |
| 816 | #endif |
| 817 | #ifdef TPM_CC_PolicyGetDigest |
| 818 | case TPM_CC_PolicyGetDigest: |
| 819 | result = TPMI_SH_POLICY_Unmarshal( |
| 820 | (TPMI_SH_POLICY*)&request_handles[*num_request_handles], |
| 821 | request_handle_buffer_start, request_buffer_remaining_size); |
| 822 | if (result != TPM_RC_SUCCESS) { |
| 823 | return result; |
| 824 | } |
| 825 | ++(*num_request_handles); |
| 826 | return TPM_RC_SUCCESS; |
| 827 | #endif |
| 828 | #ifdef TPM_CC_PolicyNvWritten |
| 829 | case TPM_CC_PolicyNvWritten: |
| 830 | result = TPMI_SH_POLICY_Unmarshal( |
| 831 | (TPMI_SH_POLICY*)&request_handles[*num_request_handles], |
| 832 | request_handle_buffer_start, request_buffer_remaining_size); |
| 833 | if (result != TPM_RC_SUCCESS) { |
| 834 | return result; |
| 835 | } |
| 836 | ++(*num_request_handles); |
| 837 | return TPM_RC_SUCCESS; |
| 838 | #endif |
| 839 | #ifdef TPM_CC_CreatePrimary |
| 840 | case TPM_CC_CreatePrimary: |
| 841 | result = TPMI_RH_HIERARCHY_Unmarshal( |
| 842 | (TPMI_RH_HIERARCHY*)&request_handles[*num_request_handles], |
| 843 | request_handle_buffer_start, request_buffer_remaining_size, TRUE); |
| 844 | if (result != TPM_RC_SUCCESS) { |
| 845 | return result; |
| 846 | } |
| 847 | ++(*num_request_handles); |
| 848 | return TPM_RC_SUCCESS; |
| 849 | #endif |
| 850 | #ifdef TPM_CC_HierarchyControl |
| 851 | case TPM_CC_HierarchyControl: |
| 852 | result = TPMI_RH_HIERARCHY_Unmarshal( |
| 853 | (TPMI_RH_HIERARCHY*)&request_handles[*num_request_handles], |
| 854 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 855 | if (result != TPM_RC_SUCCESS) { |
| 856 | return result; |
| 857 | } |
| 858 | ++(*num_request_handles); |
| 859 | return TPM_RC_SUCCESS; |
| 860 | #endif |
| 861 | #ifdef TPM_CC_SetPrimaryPolicy |
| 862 | case TPM_CC_SetPrimaryPolicy: |
| 863 | result = TPMI_RH_HIERARCHY_Unmarshal( |
| 864 | (TPMI_RH_HIERARCHY*)&request_handles[*num_request_handles], |
| 865 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 866 | if (result != TPM_RC_SUCCESS) { |
| 867 | return result; |
| 868 | } |
| 869 | ++(*num_request_handles); |
| 870 | return TPM_RC_SUCCESS; |
| 871 | #endif |
| 872 | #ifdef TPM_CC_ChangePPS |
| 873 | case TPM_CC_ChangePPS: |
| 874 | result = TPMI_RH_PLATFORM_Unmarshal( |
| 875 | (TPMI_RH_PLATFORM*)&request_handles[*num_request_handles], |
| 876 | request_handle_buffer_start, request_buffer_remaining_size); |
| 877 | if (result != TPM_RC_SUCCESS) { |
| 878 | return result; |
| 879 | } |
| 880 | ++(*num_request_handles); |
| 881 | return TPM_RC_SUCCESS; |
| 882 | #endif |
| 883 | #ifdef TPM_CC_ChangeEPS |
| 884 | case TPM_CC_ChangeEPS: |
| 885 | result = TPMI_RH_PLATFORM_Unmarshal( |
| 886 | (TPMI_RH_PLATFORM*)&request_handles[*num_request_handles], |
| 887 | request_handle_buffer_start, request_buffer_remaining_size); |
| 888 | if (result != TPM_RC_SUCCESS) { |
| 889 | return result; |
| 890 | } |
| 891 | ++(*num_request_handles); |
| 892 | return TPM_RC_SUCCESS; |
| 893 | #endif |
| 894 | #ifdef TPM_CC_Clear |
| 895 | case TPM_CC_Clear: |
| 896 | result = TPMI_RH_CLEAR_Unmarshal( |
| 897 | (TPMI_RH_CLEAR*)&request_handles[*num_request_handles], |
| 898 | request_handle_buffer_start, request_buffer_remaining_size); |
| 899 | if (result != TPM_RC_SUCCESS) { |
| 900 | return result; |
| 901 | } |
| 902 | ++(*num_request_handles); |
| 903 | return TPM_RC_SUCCESS; |
| 904 | #endif |
| 905 | #ifdef TPM_CC_ClearControl |
| 906 | case TPM_CC_ClearControl: |
| 907 | result = TPMI_RH_CLEAR_Unmarshal( |
| 908 | (TPMI_RH_CLEAR*)&request_handles[*num_request_handles], |
| 909 | request_handle_buffer_start, request_buffer_remaining_size); |
| 910 | if (result != TPM_RC_SUCCESS) { |
| 911 | return result; |
| 912 | } |
| 913 | ++(*num_request_handles); |
| 914 | return TPM_RC_SUCCESS; |
| 915 | #endif |
| 916 | #ifdef TPM_CC_HierarchyChangeAuth |
| 917 | case TPM_CC_HierarchyChangeAuth: |
| 918 | result = TPMI_RH_HIERARCHY_AUTH_Unmarshal( |
| 919 | (TPMI_RH_HIERARCHY_AUTH*)&request_handles[*num_request_handles], |
| 920 | request_handle_buffer_start, request_buffer_remaining_size); |
| 921 | if (result != TPM_RC_SUCCESS) { |
| 922 | return result; |
| 923 | } |
| 924 | ++(*num_request_handles); |
| 925 | return TPM_RC_SUCCESS; |
| 926 | #endif |
| 927 | #ifdef TPM_CC_DictionaryAttackLockReset |
| 928 | case TPM_CC_DictionaryAttackLockReset: |
| 929 | result = TPMI_RH_LOCKOUT_Unmarshal( |
| 930 | (TPMI_RH_LOCKOUT*)&request_handles[*num_request_handles], |
| 931 | request_handle_buffer_start, request_buffer_remaining_size); |
| 932 | if (result != TPM_RC_SUCCESS) { |
| 933 | return result; |
| 934 | } |
| 935 | ++(*num_request_handles); |
| 936 | return TPM_RC_SUCCESS; |
| 937 | #endif |
| 938 | #ifdef TPM_CC_DictionaryAttackParameters |
| 939 | case TPM_CC_DictionaryAttackParameters: |
| 940 | result = TPMI_RH_LOCKOUT_Unmarshal( |
| 941 | (TPMI_RH_LOCKOUT*)&request_handles[*num_request_handles], |
| 942 | request_handle_buffer_start, request_buffer_remaining_size); |
| 943 | if (result != TPM_RC_SUCCESS) { |
| 944 | return result; |
| 945 | } |
| 946 | ++(*num_request_handles); |
| 947 | return TPM_RC_SUCCESS; |
| 948 | #endif |
| 949 | #ifdef TPM_CC_PP_Commands |
| 950 | case TPM_CC_PP_Commands: |
| 951 | result = TPMI_RH_PLATFORM_Unmarshal( |
| 952 | (TPMI_RH_PLATFORM*)&request_handles[*num_request_handles], |
| 953 | request_handle_buffer_start, request_buffer_remaining_size); |
| 954 | if (result != TPM_RC_SUCCESS) { |
| 955 | return result; |
| 956 | } |
| 957 | ++(*num_request_handles); |
| 958 | return TPM_RC_SUCCESS; |
| 959 | #endif |
| 960 | #ifdef TPM_CC_SetAlgorithmSet |
| 961 | case TPM_CC_SetAlgorithmSet: |
| 962 | result = TPMI_RH_PLATFORM_Unmarshal( |
| 963 | (TPMI_RH_PLATFORM*)&request_handles[*num_request_handles], |
| 964 | request_handle_buffer_start, request_buffer_remaining_size); |
| 965 | if (result != TPM_RC_SUCCESS) { |
| 966 | return result; |
| 967 | } |
| 968 | ++(*num_request_handles); |
| 969 | return TPM_RC_SUCCESS; |
| 970 | #endif |
| 971 | #ifdef TPM_CC_FieldUpgradeStart |
| 972 | case TPM_CC_FieldUpgradeStart: |
| 973 | result = TPMI_RH_PLATFORM_Unmarshal( |
| 974 | (TPMI_RH_PLATFORM*)&request_handles[*num_request_handles], |
| 975 | request_handle_buffer_start, request_buffer_remaining_size); |
| 976 | if (result != TPM_RC_SUCCESS) { |
| 977 | return result; |
| 978 | } |
| 979 | ++(*num_request_handles); |
| 980 | result = TPMI_DH_OBJECT_Unmarshal( |
| 981 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 982 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 983 | if (result != TPM_RC_SUCCESS) { |
| 984 | return result; |
| 985 | } |
| 986 | ++(*num_request_handles); |
| 987 | return TPM_RC_SUCCESS; |
| 988 | #endif |
| 989 | #ifdef TPM_CC_FieldUpgradeData |
| 990 | case TPM_CC_FieldUpgradeData: |
| 991 | return TPM_RC_SUCCESS; |
| 992 | #endif |
| 993 | #ifdef TPM_CC_FirmwareRead |
| 994 | case TPM_CC_FirmwareRead: |
| 995 | return TPM_RC_SUCCESS; |
| 996 | #endif |
| 997 | #ifdef TPM_CC_ContextSave |
| 998 | case TPM_CC_ContextSave: |
| 999 | result = TPMI_DH_CONTEXT_Unmarshal( |
| 1000 | (TPMI_DH_CONTEXT*)&request_handles[*num_request_handles], |
| 1001 | request_handle_buffer_start, request_buffer_remaining_size); |
| 1002 | if (result != TPM_RC_SUCCESS) { |
| 1003 | return result; |
| 1004 | } |
| 1005 | ++(*num_request_handles); |
| 1006 | return TPM_RC_SUCCESS; |
| 1007 | #endif |
| 1008 | #ifdef TPM_CC_ContextLoad |
| 1009 | case TPM_CC_ContextLoad: |
| 1010 | return TPM_RC_SUCCESS; |
| 1011 | #endif |
| 1012 | #ifdef TPM_CC_FlushContext |
| 1013 | case TPM_CC_FlushContext: |
| 1014 | return TPM_RC_SUCCESS; |
| 1015 | #endif |
| 1016 | #ifdef TPM_CC_EvictControl |
| 1017 | case TPM_CC_EvictControl: |
| 1018 | result = TPMI_RH_PROVISION_Unmarshal( |
| 1019 | (TPMI_RH_PROVISION*)&request_handles[*num_request_handles], |
| 1020 | request_handle_buffer_start, request_buffer_remaining_size); |
| 1021 | if (result != TPM_RC_SUCCESS) { |
| 1022 | return result; |
| 1023 | } |
| 1024 | ++(*num_request_handles); |
| 1025 | result = TPMI_DH_OBJECT_Unmarshal( |
| 1026 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 1027 | request_handle_buffer_start, request_buffer_remaining_size, FALSE); |
| 1028 | if (result != TPM_RC_SUCCESS) { |
| 1029 | return result; |
| 1030 | } |
| 1031 | ++(*num_request_handles); |
| 1032 | return TPM_RC_SUCCESS; |
| 1033 | #endif |
| 1034 | #ifdef TPM_CC_ReadClock |
| 1035 | case TPM_CC_ReadClock: |
| 1036 | return TPM_RC_SUCCESS; |
| 1037 | #endif |
| 1038 | #ifdef TPM_CC_ClockSet |
| 1039 | case TPM_CC_ClockSet: |
| 1040 | result = TPMI_RH_PROVISION_Unmarshal( |
| 1041 | (TPMI_RH_PROVISION*)&request_handles[*num_request_handles], |
| 1042 | request_handle_buffer_start, request_buffer_remaining_size); |
| 1043 | if (result != TPM_RC_SUCCESS) { |
| 1044 | return result; |
| 1045 | } |
| 1046 | ++(*num_request_handles); |
| 1047 | return TPM_RC_SUCCESS; |
| 1048 | #endif |
| 1049 | #ifdef TPM_CC_ClockRateAdjust |
| 1050 | case TPM_CC_ClockRateAdjust: |
| 1051 | result = TPMI_RH_PROVISION_Unmarshal( |
| 1052 | (TPMI_RH_PROVISION*)&request_handles[*num_request_handles], |
| 1053 | request_handle_buffer_start, request_buffer_remaining_size); |
| 1054 | if (result != TPM_RC_SUCCESS) { |
| 1055 | return result; |
| 1056 | } |
| 1057 | ++(*num_request_handles); |
| 1058 | return TPM_RC_SUCCESS; |
| 1059 | #endif |
| 1060 | #ifdef TPM_CC_GetCapability |
| 1061 | case TPM_CC_GetCapability: |
| 1062 | return TPM_RC_SUCCESS; |
| 1063 | #endif |
| 1064 | #ifdef TPM_CC_TestParms |
| 1065 | case TPM_CC_TestParms: |
| 1066 | return TPM_RC_SUCCESS; |
| 1067 | #endif |
| 1068 | #ifdef TPM_CC_NV_DefineSpace |
| 1069 | case TPM_CC_NV_DefineSpace: |
| 1070 | result = TPMI_RH_PROVISION_Unmarshal( |
| 1071 | (TPMI_RH_PROVISION*)&request_handles[*num_request_handles], |
| 1072 | request_handle_buffer_start, request_buffer_remaining_size); |
| 1073 | if (result != TPM_RC_SUCCESS) { |
| 1074 | return result; |
| 1075 | } |
| 1076 | ++(*num_request_handles); |
| 1077 | return TPM_RC_SUCCESS; |
| 1078 | #endif |
| 1079 | #ifdef TPM_CC_NV_UndefineSpace |
| 1080 | case TPM_CC_NV_UndefineSpace: |
| 1081 | result = TPMI_RH_PROVISION_Unmarshal( |
| 1082 | (TPMI_RH_PROVISION*)&request_handles[*num_request_handles], |
| 1083 | request_handle_buffer_start, request_buffer_remaining_size); |
| 1084 | if (result != TPM_RC_SUCCESS) { |
| 1085 | return result; |
| 1086 | } |
| 1087 | ++(*num_request_handles); |
| 1088 | result = TPMI_RH_NV_INDEX_Unmarshal( |
| 1089 | (TPMI_RH_NV_INDEX*)&request_handles[*num_request_handles], |
| 1090 | request_handle_buffer_start, request_buffer_remaining_size); |
| 1091 | if (result != TPM_RC_SUCCESS) { |
| 1092 | return result; |
| 1093 | } |
| 1094 | ++(*num_request_handles); |
| 1095 | return TPM_RC_SUCCESS; |
| 1096 | #endif |
| 1097 | #ifdef TPM_CC_NV_UndefineSpaceSpecial |
| 1098 | case TPM_CC_NV_UndefineSpaceSpecial: |
| 1099 | result = TPMI_RH_NV_INDEX_Unmarshal( |
| 1100 | (TPMI_RH_NV_INDEX*)&request_handles[*num_request_handles], |
| 1101 | request_handle_buffer_start, request_buffer_remaining_size); |
| 1102 | if (result != TPM_RC_SUCCESS) { |
| 1103 | return result; |
| 1104 | } |
| 1105 | ++(*num_request_handles); |
| 1106 | result = TPMI_RH_PLATFORM_Unmarshal( |
| 1107 | (TPMI_RH_PLATFORM*)&request_handles[*num_request_handles], |
| 1108 | request_handle_buffer_start, request_buffer_remaining_size); |
| 1109 | if (result != TPM_RC_SUCCESS) { |
| 1110 | return result; |
| 1111 | } |
| 1112 | ++(*num_request_handles); |
| 1113 | return TPM_RC_SUCCESS; |
| 1114 | #endif |
| 1115 | #ifdef TPM_CC_NV_ReadPublic |
| 1116 | case TPM_CC_NV_ReadPublic: |
| 1117 | result = TPMI_RH_NV_INDEX_Unmarshal( |
| 1118 | (TPMI_RH_NV_INDEX*)&request_handles[*num_request_handles], |
| 1119 | request_handle_buffer_start, request_buffer_remaining_size); |
| 1120 | if (result != TPM_RC_SUCCESS) { |
| 1121 | return result; |
| 1122 | } |
| 1123 | ++(*num_request_handles); |
| 1124 | return TPM_RC_SUCCESS; |
| 1125 | #endif |
| 1126 | #ifdef TPM_CC_NV_Write |
| 1127 | case TPM_CC_NV_Write: |
| 1128 | result = TPMI_RH_NV_AUTH_Unmarshal( |
| 1129 | (TPMI_RH_NV_AUTH*)&request_handles[*num_request_handles], |
| 1130 | request_handle_buffer_start, request_buffer_remaining_size); |
| 1131 | if (result != TPM_RC_SUCCESS) { |
| 1132 | return result; |
| 1133 | } |
| 1134 | ++(*num_request_handles); |
| 1135 | result = TPMI_RH_NV_INDEX_Unmarshal( |
| 1136 | (TPMI_RH_NV_INDEX*)&request_handles[*num_request_handles], |
| 1137 | request_handle_buffer_start, request_buffer_remaining_size); |
| 1138 | if (result != TPM_RC_SUCCESS) { |
| 1139 | return result; |
| 1140 | } |
| 1141 | ++(*num_request_handles); |
| 1142 | return TPM_RC_SUCCESS; |
| 1143 | #endif |
| 1144 | #ifdef TPM_CC_NV_Increment |
| 1145 | case TPM_CC_NV_Increment: |
| 1146 | result = TPMI_RH_NV_AUTH_Unmarshal( |
| 1147 | (TPMI_RH_NV_AUTH*)&request_handles[*num_request_handles], |
| 1148 | request_handle_buffer_start, request_buffer_remaining_size); |
| 1149 | if (result != TPM_RC_SUCCESS) { |
| 1150 | return result; |
| 1151 | } |
| 1152 | ++(*num_request_handles); |
| 1153 | result = TPMI_RH_NV_INDEX_Unmarshal( |
| 1154 | (TPMI_RH_NV_INDEX*)&request_handles[*num_request_handles], |
| 1155 | request_handle_buffer_start, request_buffer_remaining_size); |
| 1156 | if (result != TPM_RC_SUCCESS) { |
| 1157 | return result; |
| 1158 | } |
| 1159 | ++(*num_request_handles); |
| 1160 | return TPM_RC_SUCCESS; |
| 1161 | #endif |
| 1162 | #ifdef TPM_CC_NV_Extend |
| 1163 | case TPM_CC_NV_Extend: |
| 1164 | result = TPMI_RH_NV_AUTH_Unmarshal( |
| 1165 | (TPMI_RH_NV_AUTH*)&request_handles[*num_request_handles], |
| 1166 | request_handle_buffer_start, request_buffer_remaining_size); |
| 1167 | if (result != TPM_RC_SUCCESS) { |
| 1168 | return result; |
| 1169 | } |
| 1170 | ++(*num_request_handles); |
| 1171 | result = TPMI_RH_NV_INDEX_Unmarshal( |
| 1172 | (TPMI_RH_NV_INDEX*)&request_handles[*num_request_handles], |
| 1173 | request_handle_buffer_start, request_buffer_remaining_size); |
| 1174 | if (result != TPM_RC_SUCCESS) { |
| 1175 | return result; |
| 1176 | } |
| 1177 | ++(*num_request_handles); |
| 1178 | return TPM_RC_SUCCESS; |
| 1179 | #endif |
| 1180 | #ifdef TPM_CC_NV_SetBits |
| 1181 | case TPM_CC_NV_SetBits: |
| 1182 | result = TPMI_RH_NV_AUTH_Unmarshal( |
| 1183 | (TPMI_RH_NV_AUTH*)&request_handles[*num_request_handles], |
| 1184 | request_handle_buffer_start, request_buffer_remaining_size); |
| 1185 | if (result != TPM_RC_SUCCESS) { |
| 1186 | return result; |
| 1187 | } |
| 1188 | ++(*num_request_handles); |
| 1189 | result = TPMI_RH_NV_INDEX_Unmarshal( |
| 1190 | (TPMI_RH_NV_INDEX*)&request_handles[*num_request_handles], |
| 1191 | request_handle_buffer_start, request_buffer_remaining_size); |
| 1192 | if (result != TPM_RC_SUCCESS) { |
| 1193 | return result; |
| 1194 | } |
| 1195 | ++(*num_request_handles); |
| 1196 | return TPM_RC_SUCCESS; |
| 1197 | #endif |
| 1198 | #ifdef TPM_CC_NV_WriteLock |
| 1199 | case TPM_CC_NV_WriteLock: |
| 1200 | result = TPMI_RH_NV_AUTH_Unmarshal( |
| 1201 | (TPMI_RH_NV_AUTH*)&request_handles[*num_request_handles], |
| 1202 | request_handle_buffer_start, request_buffer_remaining_size); |
| 1203 | if (result != TPM_RC_SUCCESS) { |
| 1204 | return result; |
| 1205 | } |
| 1206 | ++(*num_request_handles); |
| 1207 | result = TPMI_RH_NV_INDEX_Unmarshal( |
| 1208 | (TPMI_RH_NV_INDEX*)&request_handles[*num_request_handles], |
| 1209 | request_handle_buffer_start, request_buffer_remaining_size); |
| 1210 | if (result != TPM_RC_SUCCESS) { |
| 1211 | return result; |
| 1212 | } |
| 1213 | ++(*num_request_handles); |
| 1214 | return TPM_RC_SUCCESS; |
| 1215 | #endif |
| 1216 | #ifdef TPM_CC_NV_GlobalWriteLock |
| 1217 | case TPM_CC_NV_GlobalWriteLock: |
| 1218 | result = TPMI_RH_PROVISION_Unmarshal( |
| 1219 | (TPMI_RH_PROVISION*)&request_handles[*num_request_handles], |
| 1220 | request_handle_buffer_start, request_buffer_remaining_size); |
| 1221 | if (result != TPM_RC_SUCCESS) { |
| 1222 | return result; |
| 1223 | } |
| 1224 | ++(*num_request_handles); |
| 1225 | return TPM_RC_SUCCESS; |
| 1226 | #endif |
| 1227 | #ifdef TPM_CC_NV_Read |
| 1228 | case TPM_CC_NV_Read: |
| 1229 | result = TPMI_RH_NV_AUTH_Unmarshal( |
| 1230 | (TPMI_RH_NV_AUTH*)&request_handles[*num_request_handles], |
| 1231 | request_handle_buffer_start, request_buffer_remaining_size); |
| 1232 | if (result != TPM_RC_SUCCESS) { |
| 1233 | return result; |
| 1234 | } |
| 1235 | ++(*num_request_handles); |
| 1236 | result = TPMI_RH_NV_INDEX_Unmarshal( |
| 1237 | (TPMI_RH_NV_INDEX*)&request_handles[*num_request_handles], |
| 1238 | request_handle_buffer_start, request_buffer_remaining_size); |
| 1239 | if (result != TPM_RC_SUCCESS) { |
| 1240 | return result; |
| 1241 | } |
| 1242 | ++(*num_request_handles); |
| 1243 | return TPM_RC_SUCCESS; |
| 1244 | #endif |
| 1245 | #ifdef TPM_CC_NV_ReadLock |
| 1246 | case TPM_CC_NV_ReadLock: |
| 1247 | result = TPMI_RH_NV_AUTH_Unmarshal( |
| 1248 | (TPMI_RH_NV_AUTH*)&request_handles[*num_request_handles], |
| 1249 | request_handle_buffer_start, request_buffer_remaining_size); |
| 1250 | if (result != TPM_RC_SUCCESS) { |
| 1251 | return result; |
| 1252 | } |
| 1253 | ++(*num_request_handles); |
| 1254 | result = TPMI_RH_NV_INDEX_Unmarshal( |
| 1255 | (TPMI_RH_NV_INDEX*)&request_handles[*num_request_handles], |
| 1256 | request_handle_buffer_start, request_buffer_remaining_size); |
| 1257 | if (result != TPM_RC_SUCCESS) { |
| 1258 | return result; |
| 1259 | } |
| 1260 | ++(*num_request_handles); |
| 1261 | return TPM_RC_SUCCESS; |
| 1262 | #endif |
| 1263 | #ifdef TPM_CC_NV_ChangeAuth |
| 1264 | case TPM_CC_NV_ChangeAuth: |
| 1265 | result = TPMI_RH_NV_INDEX_Unmarshal( |
| 1266 | (TPMI_RH_NV_INDEX*)&request_handles[*num_request_handles], |
| 1267 | request_handle_buffer_start, request_buffer_remaining_size); |
| 1268 | if (result != TPM_RC_SUCCESS) { |
| 1269 | return result; |
| 1270 | } |
| 1271 | ++(*num_request_handles); |
| 1272 | return TPM_RC_SUCCESS; |
| 1273 | #endif |
| 1274 | #ifdef TPM_CC_NV_Certify |
| 1275 | case TPM_CC_NV_Certify: |
| 1276 | result = TPMI_DH_OBJECT_Unmarshal( |
| 1277 | (TPMI_DH_OBJECT*)&request_handles[*num_request_handles], |
| 1278 | request_handle_buffer_start, request_buffer_remaining_size, TRUE); |
| 1279 | if (result != TPM_RC_SUCCESS) { |
| 1280 | return result; |
| 1281 | } |
| 1282 | ++(*num_request_handles); |
| 1283 | result = TPMI_RH_NV_AUTH_Unmarshal( |
| 1284 | (TPMI_RH_NV_AUTH*)&request_handles[*num_request_handles], |
| 1285 | request_handle_buffer_start, request_buffer_remaining_size); |
| 1286 | if (result != TPM_RC_SUCCESS) { |
| 1287 | return result; |
| 1288 | } |
| 1289 | ++(*num_request_handles); |
| 1290 | result = TPMI_RH_NV_INDEX_Unmarshal( |
| 1291 | (TPMI_RH_NV_INDEX*)&request_handles[*num_request_handles], |
| 1292 | request_handle_buffer_start, request_buffer_remaining_size); |
| 1293 | if (result != TPM_RC_SUCCESS) { |
| 1294 | return result; |
| 1295 | } |
| 1296 | ++(*num_request_handles); |
| 1297 | return TPM_RC_SUCCESS; |
| 1298 | #endif |
| 1299 | default: |
| 1300 | return TPM_RC_COMMAND_CODE; |
| 1301 | } |
| 1302 | } |