Enhance the TPM 2 native_test to include additional ECC curves (P384)#492
Enhance the TPM 2 native_test to include additional ECC curves (P384)#492aidangarske merged 2 commits intowolfSSL:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Extends the TPM2 native test ECDH/ZGen coverage to exercise additional ECC curves (notably P-384) and refactors the ECDH/ZGen sequence into a reusable helper with “graceful skip” behavior when TPM features are unsupported.
Changes:
- Added a curve-aware ECDH/EC_Ephemeral/ZGen_2Phase test helper and an “unsupported curve/command” classifier.
- Updated
TPM2_Native_TestArgsto run the ECDH/ZGen test flow for both P-256 and P-384 and validate coordinate sizes.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bbb465a to
664ad70
Compare
aidangarske
left a comment
There was a problem hiding this comment.
Skoll Code Review
Scan type: review-security
Overall recommendation: COMMENT
Findings: 4 total — 3 posted, 1 skipped
3 finding(s) posted as inline comments (see file-level comments below)
Posted findings
- [Medium] TPM_RC_VALUE treated as 'curve unsupported' for every TPM call masks genuine regressions —
examples/native/native_test.c:68-79 - [Low] Refactor weakens Create/Load failure detection: previously-hard-failed error codes are now silent skips —
examples/native/native_test.c:144-178 - [Low] goto done after rc=-1 still triggers caller's
if (rc != 0) goto exitbut prints a confusing skip message path —examples/native/native_test.c:229-238
Skipped findings
- [Info]
P-384 key created with SHA-256 nameAlg and scheme hash may be rejected by strict TPMs
Review generated by Skoll
aidangarske
left a comment
There was a problem hiding this comment.
Skoll Code Review
Scan type: review
Overall recommendation: COMMENT
Findings: 5 total — 5 posted, 0 skipped
5 finding(s) posted as inline comments (see file-level comments below)
Posted findings
- [Medium] The new P-384 path can pass without ever exercising the added regression check —
examples/native/native_test.c:145-149,168-172,190-194,215-219,244-248,268-272 - [Medium] P-384 key configured with SHA-256 nameAlg/scheme — deviates from repo convention —
examples/native/native_test.c:131-140 - [Low] Two parallel arrays must stay in sync — one-step-off error waiting to happen —
examples/native/native_test.c:444-447 - [Low] Loop bound uses magic literal instead of array length —
examples/native/native_test.c:1323 - [Low]
zCompareusesTPM2B_PUBLIC_KEY_RSAto hold an ECC x-coordinate —examples/native/native_test.c:96
Review generated by Skoll
b774260 to
28c30ee
Compare
No description provided.