cert-manager/pkg/controller/certificaterequests
Ashley Davis 68f5ceb3b4
Fix manually specified Certificate and CertificateRequest versions
Basically all modern X.509 certs are version 3, but confusingly to
specify "version 3" in an encoded cert, the version number is actually
2.

For PKCS#10 CSRs, the only valid version is 1, which again
confusingly has the value "0" when encoded.

This was incorrect in many places, including one place in which the
version number on a CSR was used as a certificate's version number,
when the two are entirely unrelated.

Go ignores these values, so there's no functional changes here; still,
it's better to be accurate.

Go ignoring CSR version and specifying 0:
https://cs.opensource.google/go/go/+/refs/tags/go1.17:src/crypto/x509/x509.go;l=1958

Go ignoring Certificate version and specifying 2:
https://cs.opensource.google/go/go/+/refs/tags/go1.17:src/crypto/x509/x509.go;l=1534

PKCS#10 CSR specification in RFC 2986 section 4.1:
https://datatracker.ietf.org/doc/html/rfc2986#section-4

X.509 Cert specification in RFC 5280 section 4.1.2.1:
https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.1

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2021-08-19 14:48:12 +01:00
..
acme Fix manually specified Certificate and CertificateRequest versions 2021-08-19 14:48:12 +01:00
approver data race: fix certificate requests in cache being mutated 2021-07-20 19:50:26 +02:00
ca Fix manually specified Certificate and CertificateRequest versions 2021-08-19 14:48:12 +01:00
fake Use The cert-manager Authors. 2020-12-11 19:04:13 +01:00
selfsigned Remove expected events when Ready Denied condition set 2021-04-09 18:20:07 +01:00
util Tidy godoc comments 2021-05-05 16:21:24 +01:00
vault static analysis: pkg/controller 2021-05-21 12:03:47 +01:00
venafi Fix manually specified Certificate and CertificateRequest versions 2021-08-19 14:48:12 +01:00
BUILD.bazel Replace reflect.DeepEqual with semantic equality check and remove status marshal 2021-03-27 12:49:14 +05:30
checks.go Use The cert-manager Authors. 2020-12-11 19:04:13 +01:00
controller.go Adds a bunch of comments for exported types 2021-05-19 10:19:43 +01:00
sync_test.go Remove expected events when Ready Denied condition set 2021-04-09 18:20:07 +01:00
sync.go Sets the Ready condition to False when a request is Denied 2021-04-09 15:34:32 +01:00