Skip to content

config: return an error instead of panicking when not_after is before not_before - #1457

Open
auraseb wants to merge 1 commit into
cloudflare:masterfrom
auraseb:fix/config-not-after-before-not-before-panics
Open

auraseb wants to merge 1 commit into
cloudflare:masterfrom
auraseb:fix/config-not-after-before-not-before-panics

Conversation

@auraseb

@auraseb auraseb commented Oct 18, 2026

Copy link
Copy Markdown

SigningProfile.populate rejects a profile whose not_after is before its not_before, but it passes a nil err to cferr.Wrap, which panics. So config.LoadConfig (and cfssl serve -config, cfssl gencert -config) crash with "Wrap needs a supplied error to initialize." on such a config instead of reporting it as invalid.

This change passes a descriptive error to cferr.Wrap, so the profile is rejected with an InvalidPolicy error.

Testing: added TestNotAfterBeforeNotBefore in config/config_test.go. It panics on master and passes with this change. go test ./config/ passes.

Fixes #1456

… not_before

Signed-off-by: Sebastian Turner <sebastiant3484@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

config: LoadConfig panics when not_after is before not_before

1 participant