Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from Aug 15, 2023

Conversation

dgarske
Copy link
Contributor

@dgarske dgarske commented Aug 15, 2023

No description provided.

@dgarske dgarske removed their assignment Aug 15, 2023
Copy link
Contributor

@jpbland1 jpbland1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@dgarske
Copy link
Contributor Author

dgarske commented Aug 15, 2023

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?

@dgarske dgarske requested a review from jpbland1 August 15, 2023 17:16
@jpbland1
Copy link
Contributor

jpbland1 commented Aug 15, 2023

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

@dgarske dgarske requested review from jpbland1 and removed request for jpbland1 August 15, 2023 17:52
Copy link
Contributor

@jpbland1 jpbland1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested with known bad wolfssl build, rsa woked correctly and ecc correctly printed the not compiled in error

@jpbland1 jpbland1 merged commit b159d70 into wolfSSL:master Aug 15, 2023
1 check passed
@dgarske dgarske deleted the publickey_import branch December 29, 2023 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants