scion-pki: support additional extended key usage#4899
Open
lukedirtwalker wants to merge 4 commits into
Open
Conversation
Add the ability to specify additional extended key usage (EKU) in the certificate creation process. This applies to `scion-pki certificate create` and `scion-pki certificate sign` commands. When setting the `--eku-any` flag is set, the ExtKeyUsageAny is set on the certificate or CSR. Furthermore, the `--eku` flag allows the user to provide a comma-separated list of ASN.1 OIDs for additional EKUs that are unknown to scion-pki.
oncilla
approved these changes
Mar 9, 2026
oncilla
approved these changes
Mar 10, 2026
romshark
reviewed
Mar 12, 2026
| @@ -0,0 +1,27 @@ | |||
| // Copyright 2025 Anapaya Systems | |||
romshark
reviewed
Mar 12, 2026
| } | ||
| } | ||
|
|
||
| func parseOID(s string) (asn1.ObjectIdentifier, error) { |
Contributor
There was a problem hiding this comment.
I'm not an expert on this topic, but it looks like parseOID is too permissive according to RFC 4512 - 1.4
Seems to violate:
- minimum two arcs
- no leading zeros
- no negative arcs
func TestParseOIDRejectsInvalidRFC4512Numericoids(t *testing.T) {
// https://datatracker.ietf.org/doc/html/rfc4512#section-1.4
testCases := map[string]string{
// "numericoid = number 1*( DOT number )"
// A numericoid must contain at least two arcs.
"single arc": "1",
// "number = DIGIT / ( LDIGIT 1*DIGIT )"
// A numericoid arc is a decimal number, so '-' is not allowed.
"negative arc": "1.-2",
// "number = DIGIT / ( LDIGIT 1*DIGIT )"
// Multi-digit arcs must start with LDIGIT (1-9), not 0.
"leading zero in first arc": "01.2",
// "number = DIGIT / ( LDIGIT 1*DIGIT )"
// The same no-leading-zero rule applies to every arc.
"leading zero in later arc": "1.02",
}
for name, input := range testCases {
t.Run(name, func(t *testing.T) {
_, err := parseOID(input)
require.Error(t, err)
})
}
}
Is strict compliance not necessary in this particular context?
Please correct me if I'm wrong, but as far as I undertood the consequence would be a nonsensical OID baked in to the cert, which isn't really a security problem but a minor inconvenience?
Contributor
|
@lukedirtwalker is this in any way affecting the PKI draft (that we can still change) |
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.
Add the ability to specify additional extended key usage (EKU) in the certificate creation process. This applies to
scion-pki certificate createandscion-pki certificate signcommands.When setting the
--eku-anyflag is set, the ExtKeyUsageAny is set on the certificate or CSR. Furthermore, the--ekuflag allows the user to provide a comma-separated list of ASN.1 OIDs for additional EKUs that are unknown to scion-pki.