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

TPM support for using the public key with TLS examples #210

Merged
merged 2 commits into from
Jun 27, 2022

Conversation

dgarske
Copy link
Contributor

@dgarske dgarske commented Jun 16, 2022

Copy link
Member

@anhu anhu left a comment

Choose a reason for hiding this comment

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

Nice! Just hoping for a bit of clarification in the comments.

README.md Outdated
@@ -693,7 +693,7 @@ PKCS7 Container Verified (using software)

### TPM TLS Client Example

The wolfSSL TLS client requires loading a private key for mutual authentication. We load a "fake" private key and use the `myTpmCheckKey` callback to check for fake key to use the TPM instead.
The wolfSSL TLS client requires loading a public key to indicate mutual authentication is sued. The crypto callback uses the TPM for the private key signing.
Copy link
Member

Choose a reason for hiding this comment

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

sued ---> used

if (wolfSSL_CTX_use_PrivateKey_buffer(ctx, DUMMY_RSA_KEY,
sizeof(DUMMY_RSA_KEY), WOLFSSL_FILETYPE_ASN1) != WOLFSSL_SUCCESS) {
printf("Failed to set key!\r\n");
/* TLS client (mutual auth) requires a public key loaded */
Copy link
Member

Choose a reason for hiding this comment

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

The API is for using a private key, so this comment "LOOKS" like a mistake. Can we add something to say that we're doing this on purpose? Something like "Even though this is API is for a private key, ....."

if (wolfSSL_CTX_use_PrivateKey_buffer(ctx, DUMMY_ECC_KEY,
sizeof(DUMMY_ECC_KEY), WOLFSSL_FILETYPE_ASN1) != WOLFSSL_SUCCESS) {
printf("Failed to set key!\r\n");
/* TLS client (mutual auth) requires a public key loaded */
Copy link
Member

Choose a reason for hiding this comment

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

The API is for using a private key, so this comment "LOOKS" like a mistake. Can we add something to say that we're doing this on purpose? Something like "Even though this is API is for a private key, ....."

WOLFSSL_FILETYPE_ASN1)
!= WOLFSSL_SUCCESS) {
printf("Failed to set key!\r\n");
/* TLS client (mutual auth) requires a public key loaded */
Copy link
Member

Choose a reason for hiding this comment

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

The API is for using a private key, so this comment "LOOKS" like a mistake. Can we add something to say that we're doing this on purpose? Something like "Even though this is API is for a private key, ....."

if (wolfSSL_CTX_use_PrivateKey_buffer(ctx, DUMMY_ECC_KEY,
sizeof(DUMMY_ECC_KEY), WOLFSSL_FILETYPE_ASN1) != WOLFSSL_SUCCESS) {
printf("Failed to set key!\r\n");
/* TLS client (mutual auth) requires a public key loaded */
Copy link
Member

Choose a reason for hiding this comment

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

The API is for using a private key, so this comment "LOOKS" like a mistake. Can we add something to say that we're doing this on purpose? Something like "Even though this is API is for a private key, ....."

@dgarske dgarske requested a review from anhu June 27, 2022 17:24
Copy link
Member

@anhu anhu left a comment

Choose a reason for hiding this comment

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

Nicely done!!

@anhu anhu merged commit e3c4cf6 into wolfSSL:master Jun 27, 2022
@dgarske dgarske deleted the tls_key branch June 27, 2022 17:47
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.

2 participants