@@ -510,7 +510,6 @@ int TPM2_Wrapper_TestArgs(void* userCtx, int argc, char *argv[])
510510 storageKey .handle .auth .size );
511511 }
512512
513- #if 0 /* disabled until ECC Encrypted salt is added */
514513 /* Start an authenticated session (salted / unbound) with parameter encryption */
515514 if (paramEncAlg != TPM_ALG_NULL ) {
516515 rc = wolfTPM2_StartSession (& dev , & tpmSession , & storageKey , NULL ,
@@ -520,11 +519,10 @@ int TPM2_Wrapper_TestArgs(void* userCtx, int argc, char *argv[])
520519 (word32 )tpmSession .handle .hndl );
521520
522521 /* set session for authorization of the storage key */
523- rc = wolfTPM2_SetAuthSession (& dev , 1 , & tpmSession ,
522+ rc = wolfTPM2_SetAuthSession (& dev , 0 , & tpmSession ,
524523 (TPMA_SESSION_decrypt | TPMA_SESSION_encrypt | TPMA_SESSION_continueSession ));
525524 if (rc != 0 ) goto exit ;
526525 }
527- #endif
528526
529527 /* Create an ECC key for ECDSA */
530528 rc = wolfTPM2_GetKeyTemplate_ECC (& publicTemplate ,
@@ -661,7 +659,11 @@ int TPM2_Wrapper_TestArgs(void* userCtx, int argc, char *argv[])
661659 if (rc != 0 ) goto exit ;
662660 rc = wolfTPM2_EccKey_WolfToTpm_ex (& dev , & storageKey , & wolfEccPrivKey ,
663661 & eccKey );
664- if (rc != 0 ) goto exit ;
662+ if (rc != 0 && rc != NOT_COMPILED_IN ) {
663+ /* a NOT_COMPILED_IN here likely means the WOLFSSL_PUBLIC_MP is enabled
664+ * exposing the mp_ math API's needed for encrypting secrets */
665+ goto exit ;
666+ }
665667 /* Use TPM Handle... */
666668 wc_ecc_free (& wolfEccPrivKey );
667669 rc = wolfTPM2_UnloadHandle (& dev , & eccKey .handle );
@@ -672,7 +674,11 @@ int TPM2_Wrapper_TestArgs(void* userCtx, int argc, char *argv[])
672674 kEccKeyPubXRaw , (word32 )sizeof (kEccKeyPubXRaw ),
673675 kEccKeyPubYRaw , (word32 )sizeof (kEccKeyPubYRaw ),
674676 kEccKeyPrivD , (word32 )sizeof (kEccKeyPrivD ));
675- if (rc != 0 ) goto exit ;
677+ if (rc != 0 && rc != NOT_COMPILED_IN ) {
678+ /* a NOT_COMPILED_IN here likely means the WOLFSSL_PUBLIC_MP is enabled
679+ * exposing the mp_ math API's needed for encrypting secrets */
680+ goto exit ;
681+ }
676682 /* Use TPM Handle... */
677683 printf ("ECC Private Key Loaded into TPM: Handle 0x%x\n" ,
678684 (word32 )eccKey .handle .hndl );
0 commit comments