Skip to content

Conversation

@cviecco
Copy link
Contributor

@cviecco cviecco commented Dec 7, 2025

During the addition of the new auth method I forgot to also reset the certgentime.
This PR fixes this and add a test case so that we dont regress

During the addition of the new auth method I forgot to also reset the
certgentime.
This PR fixes this and add a test case so that we dont regress
@cviecco cviecco linked an issue Dec 7, 2025 that may be closed by this pull request
@cviecco cviecco requested a review from Copilot December 7, 2025 03:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where certificate expiration times were not being properly extracted from JWT tokens, causing generated certificates to have incorrect expiry dates. The fix adds the missing assignment of CertNotAfter from the JWT and updates the backwards compatibility logic accordingly, along with test coverage to prevent regression.

  • Added missing CertNotAfter extraction from JWT tokens in authentication flow
  • Updated backwards compatibility check to properly handle the newly extracted field
  • Added test validation to ensure generated certificates have valid time ranges

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
cmd/keymasterd/jwt.go Fixed missing CertNotAfter assignment from JWT and updated backwards compatibility check from zero-value to time comparison
cmd/keymasterd/certgen.go Enhanced debug logging to include full authData structure for troubleshooting
cmd/keymasterd/main_test.go Added certificate validity time checks to test generated X.509 certificates have proper NotBefore and NotAfter values

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cviecco cviecco merged commit 77cfeac into Cloud-Foundations:master Dec 7, 2025
15 checks passed
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.

1.17.1 generating invalid x509 certs

1 participant