-
Notifications
You must be signed in to change notification settings - Fork 62
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
add example manual verification of quote signature with ecc #379
Conversation
b0713ed
to
a3beae8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible you could add support for this with RSA also?
examples/pcr/quote.c
Outdated
goto exit; | ||
} | ||
|
||
pubKey = (byte*)malloc(pubKeySz); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use XMALLOC
/XFREE
for portability. They exist unless WOLFTPM2_NO_HEAP
is used.
examples/pcr/quote.c
Outdated
@@ -229,6 +266,60 @@ int TPM2_PCR_Quote_Test(void* userCtx, int argc, char *argv[]) | |||
cmdOut.quoteResult.signature.signature.rsassa.sig.size); | |||
#endif | |||
|
|||
#ifdef HAVE_ECC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider also gating on WOLFTPM2_NO_HEAP
and WOLFSSL_PUBLIC_MP
mp_free(&r); | ||
mp_free(&s); | ||
wc_ecc_free(&ecKey); | ||
printf("%s [rc = %d, result = %d]\n", (res == 1)? "SUCCESS": "FAILURE", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mine consistently shows: Attempting to manually verify the quotes signature :FAILURE [rc = 0, result = 0]
. Any special steps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly different for swtpm used? Try with ms-tpm-20-ref. I made a commit now updating the docs/SWTPM.md with steps for a test done.
Yup, can add in RSA. Would like to follow up with it though in a separate PR, keeping this one with as few code changes as can for the use. |
… `examples/pcr/quote.c:336:9: error: use of undeclared identifier 'pubKey'`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me now! Thank you
./examples/pcr/quote -ecc