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

Fix misuse of fqdn_rand_string #291

Merged
merged 1 commit into from
Jun 22, 2022
Merged

Conversation

smokris
Copy link
Contributor

@smokris smokris commented Jun 16, 2022

Pull Request (PR) description

According to the puppetlabs-stdlib documentation,
fqdn_rand_string()'s second argument is the character set to use
when generating the random string, and its third argument is
the seed. The certonly class incorrectly passes the domain name
as the second argument, causing fqdn_rand_string() to use the
host's fqdn as the seed, resulting in more-frequent-than-necessary
hash collisions.

This Pull Request (PR) fixes the following issues

(no issue)

Copy link
Member

@smortex smortex left a comment

Choose a reason for hiding this comment

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

I think you are right and the passed parameters where wrong. That being said, I think we do not need the fqdn_rand_string() at all?

manifests/certonly.pp Outdated Show resolved Hide resolved
According to the puppetlabs-stdlib documentation,
fqdn_rand_string()'s second argument is the character set to use
when generating the random string, and its third argument is
the seed.  The certonly class incorrectly passes the domain name
as the second argument, causing fqdn_rand_string() to use the
host's fqdn as the seed, resulting in more-frequent-than-necessary
hash collisions.  The current implementation of fqdn_rand() seems
to provide sufficient randomness, so fqdn_rand_string() doesn't
seem to be necessary.
@smokris smokris force-pushed the fqdn_rand_string branch from bfc9f37 to 28d67f5 Compare June 16, 2022 21:07
Copy link
Member

@smortex smortex left a comment

Choose a reason for hiding this comment

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

LGTM!

@smortex smortex merged commit af63906 into voxpupuli:master Jun 22, 2022
@smokris
Copy link
Contributor Author

smokris commented Jun 23, 2022

Thanks, @smortex!

@smokris smokris deleted the fqdn_rand_string branch June 23, 2022 01:01
@evgeni evgeni added the bug Something isn't working label Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants