-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Switch to using new Go 1.19 CRL parser #12315
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
Conversation
`x509.ParseCRL` is deprecated, we should use `x509.ParseRevocationList` instead which is new in Go 1.19. Signed-off-by: Dirkjan Bussink <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
If a new flag is being introduced:
If a workflow is added or modified:
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
block, _ := pem.Decode(data) | ||
if block == nil || block.Type != "X509 CRL" { | ||
log.Fatal("failed to parse CRL PEM") | ||
} |
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.
PEM
decoding is not done implicitly with x509.ParseRevocationList
so this needs to be done here explicitly in the tests.
@@ -83,7 +82,7 @@ func loadCRLSet(crl string) ([]*pkix.CertificateList, error) { | |||
continue | |||
} | |||
|
|||
parsedCRL, err := x509.ParseCRL(block.Bytes) | |||
parsedCRL, err := x509.ParseRevocationList(block.Bytes) |
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.
PEM
decoding here is already done explicitly so there's no user facing changes in the usage (still only PEM
formatted CRLs are supported).
FYI @hkdsun as original contributor of the CRL support. To be clear, at the time this was the right API since Go 1.19 didn't exist yet, but we should still switch now to the newer API. |
`x509.ParseCRL` is deprecated, we should use `x509.ParseRevocationList` instead which is new in Go 1.19. Signed-off-by: Dirkjan Bussink <[email protected]> Signed-off-by: Florent Poinsard <[email protected]>
* Upgrade release-16.0 to go1.19.6 Signed-off-by: Florent Poinsard <[email protected]> * upgrade to 1.20.1 Signed-off-by: Florent Poinsard <[email protected]> * bump the golangci-lint version Signed-off-by: Florent Poinsard <[email protected]> * Apply linter suggestions Signed-off-by: Florent Poinsard <[email protected]> * Apply linter suggestions Signed-off-by: Florent Poinsard <[email protected]> * fix TestTLSClientVerifyIdentity Signed-off-by: Florent Poinsard <[email protected]> * Switch to using new Go 1.19 CRL parser (#12315) `x509.ParseCRL` is deprecated, we should use `x509.ParseRevocationList` instead which is new in Go 1.19. Signed-off-by: Dirkjan Bussink <[email protected]> Signed-off-by: Florent Poinsard <[email protected]> * Skip TestFuzz for now Signed-off-by: Florent Poinsard <[email protected]> --------- Signed-off-by: Florent Poinsard <[email protected]> Signed-off-by: Dirkjan Bussink <[email protected]> Co-authored-by: Dirkjan Bussink <[email protected]>
* Upgrade release-16.0 to go1.19.6 Signed-off-by: Florent Poinsard <[email protected]> * upgrade to 1.20.1 Signed-off-by: Florent Poinsard <[email protected]> * bump the golangci-lint version Signed-off-by: Florent Poinsard <[email protected]> * Apply linter suggestions Signed-off-by: Florent Poinsard <[email protected]> * Apply linter suggestions Signed-off-by: Florent Poinsard <[email protected]> * fix TestTLSClientVerifyIdentity Signed-off-by: Florent Poinsard <[email protected]> * Switch to using new Go 1.19 CRL parser (vitessio#12315) `x509.ParseCRL` is deprecated, we should use `x509.ParseRevocationList` instead which is new in Go 1.19. Signed-off-by: Dirkjan Bussink <[email protected]> Signed-off-by: Florent Poinsard <[email protected]> * Skip TestFuzz for now Signed-off-by: Florent Poinsard <[email protected]> --------- Signed-off-by: Florent Poinsard <[email protected]> Signed-off-by: Dirkjan Bussink <[email protected]> Co-authored-by: Dirkjan Bussink <[email protected]>
* Upgrade release-16.0 to go1.19.6 Signed-off-by: Florent Poinsard <[email protected]> * upgrade to 1.20.1 Signed-off-by: Florent Poinsard <[email protected]> * bump the golangci-lint version Signed-off-by: Florent Poinsard <[email protected]> * Apply linter suggestions Signed-off-by: Florent Poinsard <[email protected]> * Apply linter suggestions Signed-off-by: Florent Poinsard <[email protected]> * fix TestTLSClientVerifyIdentity Signed-off-by: Florent Poinsard <[email protected]> * Switch to using new Go 1.19 CRL parser (vitessio#12315) `x509.ParseCRL` is deprecated, we should use `x509.ParseRevocationList` instead which is new in Go 1.19. Signed-off-by: Dirkjan Bussink <[email protected]> Signed-off-by: Florent Poinsard <[email protected]> * Skip TestFuzz for now Signed-off-by: Florent Poinsard <[email protected]> --------- Signed-off-by: Florent Poinsard <[email protected]> Signed-off-by: Dirkjan Bussink <[email protected]> Co-authored-by: Dirkjan Bussink <[email protected]>
* go1.20.14 Signed-off-by: Tim Vaillancourt <[email protected]> * more go-version: updates Signed-off-by: Tim Vaillancourt <[email protected]> * make proto w/go1.20 Signed-off-by: Tim Vaillancourt <[email protected]> * Fix the golangci-lint config (vitessio#11812) There's a bunch of deprecated linters that don't work anymore, so let's remove them: ``` WARN [runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused. WARN [runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused. WARN [runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused. WARN [linters context] structcheck is disabled because of generics. You can track the evolution of the generics support by following the golangci/golangci-lint#2649. ``` Signed-off-by: Dirkjan Bussink <[email protected]> Signed-off-by: Dirkjan Bussink <[email protected]> * update golangci-lint to 1.50.1 (vitessio#11873) Signed-off-by: Andres Taylor <[email protected]> Signed-off-by: Andres Taylor <[email protected]> Signed-off-by: Tim Vaillancourt <[email protected]> * Add timeout to golangci-lint and bump its version (vitessio#12852) (vitessio#12853) Signed-off-by: Florent Poinsard <[email protected]> Signed-off-by: Tim Vaillancourt <[email protected]> * Upgrade `release-16.0` to `go1.20.1` (vitessio#12398) * Upgrade release-16.0 to go1.19.6 Signed-off-by: Florent Poinsard <[email protected]> * upgrade to 1.20.1 Signed-off-by: Florent Poinsard <[email protected]> * bump the golangci-lint version Signed-off-by: Florent Poinsard <[email protected]> * Apply linter suggestions Signed-off-by: Florent Poinsard <[email protected]> * Apply linter suggestions Signed-off-by: Florent Poinsard <[email protected]> * fix TestTLSClientVerifyIdentity Signed-off-by: Florent Poinsard <[email protected]> * Switch to using new Go 1.19 CRL parser (vitessio#12315) `x509.ParseCRL` is deprecated, we should use `x509.ParseRevocationList` instead which is new in Go 1.19. Signed-off-by: Dirkjan Bussink <[email protected]> Signed-off-by: Florent Poinsard <[email protected]> * Skip TestFuzz for now Signed-off-by: Florent Poinsard <[email protected]> --------- Signed-off-by: Florent Poinsard <[email protected]> Signed-off-by: Dirkjan Bussink <[email protected]> Co-authored-by: Dirkjan Bussink <[email protected]> * Remove recent golangci-lint version bump (vitessio#12909) Signed-off-by: Florent Poinsard <[email protected]> * Fix conflict resolution Signed-off-by: Tim Vaillancourt <[email protected]> * make ensure_bootstrap_version Signed-off-by: Tim Vaillancourt <[email protected]> * hardcode previous release Signed-off-by: Tim Vaillancourt <[email protected]> * Add comment for hardcoded previous release Signed-off-by: Tim Vaillancourt <[email protected]> --------- Signed-off-by: Tim Vaillancourt <[email protected]> Signed-off-by: Dirkjan Bussink <[email protected]> Signed-off-by: Andres Taylor <[email protected]> Signed-off-by: Florent Poinsard <[email protected]> Co-authored-by: Dirkjan Bussink <[email protected]> Co-authored-by: Andres Taylor <[email protected]> Co-authored-by: Florent Poinsard <[email protected]>
x509.ParseCRL
is deprecated, we should usex509.ParseRevocationList
instead which is new in Go 1.19.Related Issue(s)
Fixes #12314
Checklist