-
Notifications
You must be signed in to change notification settings - Fork 18k
crypto/x509: add SubjectKeyId automatically when IsCA is true #26676
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
Comments
Section 4.2.1.2 of RFC 5280 says this is a MUST for CAs.
|
@FiloSottile Is there something to do here for 1.14? |
Might be too late to do anything for Go1.14 as the bell tolls. I shall move this to the backlog. |
Change https://golang.org/cl/227098 mentions this issue: |
I understand the use of SHA-1 here isn't a security issue, and I understand that the RFC gives examples of using SHA-1 for this, but still the use of SHA-1 seems gratuitous given no unmentioned external constraints. I do think it is better to limit SHA-1 use at this point to uses that cannot be reasonable avoided so that at some point in the future we can get rid of SHA-1 and/or get rid of a bunch of code for optimizing SHA-1.
NIT: RFC 5280 doesn't recommend an algorithm to generate the SubjectKeyID. It seems to be carefully worded to let us know that the SHA-1-based approach is commonly used, without recommending its use. In this case, using any any stronger hash function convenient, e.g. SHA-256 or SHA-512, and truncating to 20 bytes, would be good enough and IMO better. One potential motivation for using SHA-1 would be to help a CA migrate to using this implementation from an implementation that was already using SHA-1, but that motivation isn't mentioned in the code, so I assume it isn't there. It will be more difficult to change the algorithm used this ships in a release so it's worth reconsidering it before the next release, if it hasn't happened yet. |
Go crypto library for versions < 1.15 is not filling in the SKI field for CAs [1] this PR replicate the golang >= 1.15 fix [2] [1] golang/go#26676 [2] https://go-review.googlesource.com/c/go/+/227098/ Signed-off-by: Quique Llorente <ellorent@redhat.com>
The SKI field is mandatory for CA certificates, but Go crypto library for versions < 1.15 is not filling in the SKI field for CAs [1] this PR replicate the golang >= 1.15 fix [2]. Replicated from qinqon/kube-admission-webhook#42 [1] golang/go#26676 [2] https://go-review.googlesource.com/c/go/+/227098/ Signed-off-by: Quique Llorente <ellorent@redhat.com>
The SKI field is mandatory for CA certificates, but Go crypto library for versions < 1.15 is not filling in the SKI field for CAs [1] this PR replicate the golang >= 1.15 fix [2]. Replicated from qinqon/kube-admission-webhook#42 [1] golang/go#26676 [2] https://go-review.googlesource.com/c/go/+/227098/ Signed-off-by: Quique Llorente <ellorent@redhat.com>
Go crypto library for versions < 1.15 is not filling in the SKI field for CAs [1] this PR replicate the golang >= 1.15 fix [2] [1] golang/go#26676 [2] https://go-review.googlesource.com/c/go/+/227098/ Signed-off-by: Quique Llorente <ellorent@redhat.com>
Go crypto library for versions < 1.15 is not filling in the SKI field for CAs [1] so we bump to 1.15 [1] golang/go#26676 [2] https://go-review.googlesource.com/c/go/+/227098/ Signed-off-by: Quique Llorente <ellorent@redhat.com>
Go crypto library for versions < 1.15 is not filling in the SKI field for CAs [1] so we bump to 1.15 [1] golang/go#26676 [2] https://go-review.googlesource.com/c/go/+/227098/ Signed-off-by: Quique Llorente <ellorent@redhat.com>
Go crypto library for versions < 1.15 is not filling in the SKI field for CAs [1] so we bump to 1.15 [1] golang/go#26676 [2] https://go-review.googlesource.com/c/go/+/227098/ Signed-off-by: Quique Llorente <ellorent@redhat.com>
Go crypto library for versions < 1.15 is not filling in the SKI field for CAs [1] so we bump to 1.15 [1] golang/go#26676 [2] https://go-review.googlesource.com/c/go/+/227098/ Signed-off-by: Quique Llorente <ellorent@redhat.com>
Go crypto library for versions < 1.15 is not filling in the SKI field for CAs [1] so we bump to 1.15 [1] golang/go#26676 [2] https://go-review.googlesource.com/c/go/+/227098/ Signed-off-by: Quique Llorente <ellorent@redhat.com>
Go crypto library for versions < 1.15 is not filling in the SKI field for CAs [1] so we bump to 1.15 [1] golang/go#26676 [2] https://go-review.googlesource.com/c/go/+/227098/ Signed-off-by: Quique Llorente <ellorent@redhat.com>
Go crypto library for versions < 1.15 is not filling in the SKI field for CAs [1] so we bump to 1.15 [1] golang/go#26676 [2] https://go-review.googlesource.com/c/go/+/227098/ Signed-off-by: Quique Llorente <ellorent@redhat.com>
Go crypto library for versions < 1.15 is not filling in the SKI field for CAs [1] so we bump to 1.15 [1] golang/go#26676 [2] https://go-review.googlesource.com/c/go/+/227098/ Signed-off-by: Quique Llorente <ellorent@redhat.com>
Go crypto library for versions < 1.15 is not filling in the SKI field for CAs [1] so we bump to 1.15 [1] golang/go#26676 [2] https://go-review.googlesource.com/c/go/+/227098/ Signed-off-by: Quique Llorente <ellorent@redhat.com>
Go crypto library for versions < 1.15 is not filling in the SKI field for CAs [1] so we bump to 1.15 [1] golang/go#26676 [2] https://go-review.googlesource.com/c/go/+/227098/ Signed-off-by: Quique Llorente <ellorent@redhat.com>
Go crypto library for versions < 1.15 is not filling in the SKI field for CAs [1] so we bump to 1.15 [1] golang/go#26676 [2] https://go-review.googlesource.com/c/go/+/227098/ Signed-off-by: Quique Llorente <ellorent@redhat.com>
Go crypto library for versions < 1.15 is not filling in the SKI field for CAs [1] so we bump to 1.15 [1] golang/go#26676 [2] https://go-review.googlesource.com/c/go/+/227098/ Signed-off-by: Quique Llorente <ellorent@redhat.com>
Go crypto library for versions < 1.15 is not filling in the SKI field for CAs [1] so we bump to 1.15 [1] golang/go#26676 [2] https://go-review.googlesource.com/c/go/+/227098/ Signed-off-by: Quique Llorente <ellorent@redhat.com>
RFC 5280 provides a recommended algorithm to generate the SubjectKeyID, and since these are new public keys, we could use it to set it by default. It's mostly useful for CAs, so we can do it only when IsCA is true. We already automatically set AuthorityKeyID when the parent has SubjectKeyId.
The text was updated successfully, but these errors were encountered: