-
Notifications
You must be signed in to change notification settings - Fork 29
Add support for additional CAPI certificate context properties #873
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
base: master
Are you sure you want to change the base?
Conversation
|
|
kms/tpmkms/tpmkms.go
Outdated
| uv.Set("friendly-name", o.friendlyName) | ||
| case o.description != "": | ||
| uv.Set("description", o.description) | ||
| } |
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.
Are those mutually exclusive?
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.
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.
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.
I see, makes sense.
kms/capi/capi.go
Outdated
| canLookupByIssuer := func() bool { | ||
| return issuerName != "" && (serialNumber != "" || subjectCN != "" || friendlyName != "" || description != "") | ||
| } |
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.
Why a function here, instead of eg: a const?
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.
Ah, this was relic from previous code when I was updating it, fixed here b78b8bb
joshdrake
left a comment
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.
One nit/question, otherwise lgtm. Need another reviewer to be able to merge, cc @hslatman
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.
b78b8bb to
5505db4
Compare
- Wrong variable names. - Added missing forwarding issuer,description,friendly-name params to CAPI.
This PR adds functionality to the
capiKMS to support setting the "friendly name" and "description" certificate properties. Thetpmkmspasses these through as needed.💔Thank you!