Repository navigation
Add new TPM2_ASN_GetNameAttr API and capture X.509 issuer and subject in TPM2_ASN_DecodeX509Cert - #646
Merged
Conversation
dgarske
force-pushed
the
asn_subject
branch
2 times, most recently
from
October 22, 2026 14:20
b32d902 to
b4fe014
Compare
aidangarske
requested changes
Oct 22, 2026
aidangarske
left a comment
Member
There was a problem hiding this comment.
Skoll Code Review
Scan type: review
Overall recommendation: REQUEST_CHANGES
Findings: 4 total — 4 posted, 0 skipped
4 finding(s) posted as inline comments (see file-level comments below)
Posted findings
- [High] Existing binaries pass a smaller DecodedX509 buffer —
src/tpm2_asn.c:247-275 - [High] Malformed AttributeTypeAndValue sequences can return success —
src/tpm2_asn.c:409-425 - [Medium] Truncated headers violate the documented error contract —
wolftpm/tpm2_asn.h:164-165 - [Medium] Boundary and bad-argument paths are not covered —
tests/unit_tests.c:9020-9026
Review generated by Skoll
aidangarske
approved these changes
Oct 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Lets callers read identity fields from an X.509 certificate stored in NV without wolfCrypt. Used by the U-Boot integration, which builds with
WOLFTPM2_NO_WOLFCRYPT.DecodedX509gainsissuer/issuerSzandsubject/subjectSz, appended so existing members keep their offsets.TPM2_ASN_GetNameAttr()returns the first attribute with a given OID (for example commonName or serialNumber) from a Name, with every length bounds-checked.Testing
New
test_TPM2_ASN_GetNameAttrunit test.unit.testpasses against fwTPM and ibmswtpm2, and the API is used by U-Boottpm2 nv_read_certon QEMU with swtpm. Not tested on hardware.