wolfSSL / wolfTPM

wolfTPM is a highly portable TPM 2.0 library, designed for embedded use.
https://www.wolfssl.com
GNU General Public License v2.0
230 stars 55 forks source link

Support for importing and loading public ECC/RSA keys formatted as PEM or DER #290

Closed dgarske closed 10 months ago

dgarske commented 10 months ago

This test requires CFLAGS='-DWOLFSSL_PUBLIC_MP' for wolfSSL right? should add

#if !defined(WOLFTPM2_NO_WRAPPER) && !defined(WOLFTPM2_NO_WOLFCRYPT) && defined(WOLFSSL_PUBLIC_MP)

to main, couldn't tag it in the review

Yes and that change has been upstreamed into wolfSSL master with --enable-wolftpm. The WOLFSSL_PUBLIC_MP is required to expose some of the math functions for the ECC encrypt. Am I missing some documentation?

jpbland1 commented 10 months ago

No I'm saying to give the user the not compiled in error if their wolfSSL is compiled wrong, like this:

int main(int argc, char *argv[])
{
    int rc = NOT_COMPILED_IN;

#if !defined(WOLFTPM2_NO_WRAPPER) && !defined(WOLFTPM2_NO_WOLFCRYPT) && defined(WOLFSSL_PUBLIC_MP)
    rc = TPM2_Keyimport_Example(NULL, argc, argv);
#else
    printf("KeyImport code not compiled in\n");
    (void)argc;
    (void)argv;
#endif

    return rc;
}

but add the WOLFSSL_PUBLIC_MP to the macros