Skip to content

Conversation

@joshdrake
Copy link
Contributor

This PR adds functionality to the capi KMS to support setting the "friendly name" and "description" certificate properties. The tpmkms passes these through as needed.

💔Thank you!

@joshdrake joshdrake marked this pull request as draft October 14, 2025 02:25
@CLAassistant
Copy link

CLAassistant commented Oct 14, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 2 committers have signed the CLA.

❌ joshdrake
❌ darkfronza
You have signed the CLA already but the status is still pending? Let us recheck it.

@joshdrake joshdrake requested a review from hslatman October 14, 2025 02:25
@hslatman hslatman changed the title Josh/capi set cert context props Add support for additional CAPI certificate context properties Oct 14, 2025
uv.Set("friendly-name", o.friendlyName)
case o.description != "":
uv.Set("description", o.description)
}

Choose a reason for hiding this comment

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

Are those mutually exclusive?

Copy link
Contributor Author

@joshdrake joshdrake Jan 7, 2026

Choose a reason for hiding this comment

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

It might not make much sense, but if we're going off the underlying CAPI, they shouldn't be. In our calling code paths, we may want make to only ever provide one, so that we can ensure our desired property is used for retrieval (eg: the description), without worrying about the underlying implementation in capikms.

Choose a reason for hiding this comment

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

I see, makes sense.

kms/capi/capi.go Outdated
Comment on lines 356 to 358
canLookupByIssuer := func() bool {
return issuerName != "" && (serialNumber != "" || subjectCN != "" || friendlyName != "" || description != "")
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why a function here, instead of eg: a const?

Choose a reason for hiding this comment

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

Ah, this was relic from previous code when I was updating it, fixed here b78b8bb

Copy link
Contributor Author

@joshdrake joshdrake left a comment

Choose a reason for hiding this comment

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

One nit/question, otherwise lgtm. Need another reviewer to be able to merge, cc @hslatman

joshdrake and others added 8 commits January 8, 2026 09:58
This fixes an issue with agent, where it was unable to find device
certificates due to using a key-id derived from a random string for
certificate lookups.

If the key-id lookup fails automatically attempt lookup by cert+attr
where attr can be one of the certificate atributes, serial number,
friendly-name, description, etc.
The function was a relic from past refactoring code, not necessary
anymore.
@joshdrake joshdrake force-pushed the josh/capi-set-cert-context-props branch from b78b8bb to 5505db4 Compare January 8, 2026 16:13
- Wrong variable names.
- Added missing forwarding issuer,description,friendly-name params to CAPI.
@darkfronza darkfronza marked this pull request as ready for review January 8, 2026 21:30
@joshdrake
Copy link
Contributor Author

Looks good to me, just need @maraino or @hslatman to take a quick look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants