Skip to content
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

Correct certificate lifetime calculation #28

Merged
merged 1 commit into from
Oct 26, 2021

Conversation

allisonkarlitskaya
Copy link
Contributor

sscg allows passing the certificate lifetime, as a number of days, as a
commandline argument. It converts this value to seconds using the
formula

days * 24 * 3650

which is incorrect. The correct value is 3600.

This effectively adds an extra 20 minutes to the lifetime of the
certificate for each day as given on the commandline, and was enough to
cause some new integration tests in cockpit to fail.

Interestingly, 3650 is the old default value for the number of days of
certificate validity (~10 years) so this probably slipped in as a sort
of muscle-memory-assisted typo.

Let's just write 24 * 60 * 60 to make things clear.

sscg allows passing the certificate lifetime, as a number of days, as a
commandline argument.  It converts this value to seconds using the
formula

  days * 24 * 3650

which is incorrect.  The correct value is 3600.

This effectively adds an extra 20 minutes to the lifetime of the
certificate for each day as given on the commandline, and was enough to
cause some new integration tests in cockpit to fail.

Interestingly, 3650 is the old default value for the number of days of
certificate validity (~10 years) so this probably slipped in as a sort
of muscle-memory-assisted typo.

Let's just write `24 * 60 * 60` to make things clear.
Copy link
Owner

@sgallagher sgallagher left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for spotting this!

@sgallagher sgallagher merged commit 68c9ce4 into sgallagher:main Oct 26, 2021
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.

2 participants