782     TSS2_RC rval = TSS2_RETRY_EXP(Tss2_Sys_Import(sapi_context, phandle,
783                 &sessionsData, enc_sensitive_key, public,
784                 private, encrypted_seed, sym_alg,
785                 imported_private, &npsessionsDataOut));
786     if (rval != TPM2_RC_SUCCESS) {
787         LOG_ERROR("Tss2_Sys_Import() failed: %#x", rval);
788         return -1;
789     }


This function returns 0x3d5, and I don't know which parameter should be checked.

On Thu, Nov 1, 2018 at 12:47 AM Tadeusz Struk <tadeusz.struk@intel.com> wrote:
On 10/31/18 2:15 AM, Terry An wrote:
> [root@localhost tpm2-init]# tpm2_rc_decode  0x1d5
> tpm:parameter(1):structure is the wrong size
> [root@localhost tpm2-init]# tpm2_rc_decode  0x3d5
> tpm:parameter(3):structure is the wrong size
>
> I'm so confusing where my code is wrong.

The first error code indicates that the size of the
first parameter is wrong, and the second error code
says that the size of the third parameter is wrong.
See section 6.6 of: https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-01.38.pdf
for details.

--
Tadeusz