-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Custom extended key usage for PKI #4667
Custom extended key usage for PKI #4667
Conversation
alexionescu
commented
May 31, 2018
- Adds ability to have roles that sign certificates with custom EKU OIDs.
- Adds ability to have roles that sign certificates with custom EKU OIDs.
ui/app/models/role-pki.js
Outdated
@@ -55,6 +55,10 @@ export default DS.Model.extend({ | |||
defaultValue: 'DigitalSignature,KeyAgreement,KeyEncipherment', | |||
editType: 'stringArray', | |||
}), | |||
extKeyUsageOIDs: attr({ |
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.
ext_key_usage_oids will get "camelized" to extKeyUsageOids
- so will need to change that here and below.
@@ -451,6 +457,7 @@ func (b *backend) pathRoleCreate(ctx context.Context, req *logical.Request, data | |||
UseCSRCommonName: data.Get("use_csr_common_name").(bool), | |||
UseCSRSANs: data.Get("use_csr_sans").(bool), | |||
KeyUsage: data.Get("key_usage").([]string), | |||
ExtKeyUsageOIDs: data.Get("ext_key_usage_oids").([]string), |
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.
Can you add a check on the values similar to the PolicyIdentifiers check below? That way we'll know there won't be an error when generating a cert, instead of silently ignoring it.
@@ -1045,6 +1057,8 @@ func createCertificate(data *dataBundle) (*certutil.ParsedCertBundle, error) { | |||
|
|||
addKeyUsages(data, certTemplate) | |||
|
|||
addExtKeyUsageOids(data, certTemplate) |
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.
This needs to be in signCertificate
too
builtin/logical/pki/path_roles.go
Outdated
@@ -166,6 +166,12 @@ To remove all key usages from being set, set | |||
this value to an empty list.`, | |||
}, | |||
|
|||
"ext_key_usage_oids": &framework.FieldSchema{ | |||
Type: framework.TypeCommaStringSlice, | |||
Default: []string{}, |
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.
Don't set an empty default here -- it's done automatically!
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.
Looks good! Just that one final comment.
Also please |
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.
Thanks so much!
Thank you for reviewing it so quickly! |