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

Openssl version matcher accounts for vanilla and os pecularities #248

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

marcusdots
Copy link
Contributor

Pull Request (PR) description

This Pull Request (PR) fixes the following issues

@@ -4,7 +4,8 @@
setcode do
if Facter::Util::Resolution.which('openssl')
openssl_version = Facter::Util::Resolution.exec('openssl version 2>&1')
matches = %r{^OpenSSL ([\w.-]+)(\s+FIPS)?( +)([\d.]+)( +)([\w.]+)( +)([\d.]+)}.match(openssl_version)
# OracleLinux did some uppercase-lowercase-extras
matches = %r{^OpenSSL ([\w.]+)[ -]*(fips|FIPS|dev)? +([\d.]+) +([\w.]+) +([\d.]+) *(\([\w:. ]+\))?}.match(openssl_version)
Copy link
Member

Choose a reason for hiding this comment

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

I'm not convinced yet that such a complicated regex is still required.

Facter::Util::Resolution.exec('openssl version 2>&1').split(' ')[1]

Copy link

Choose a reason for hiding this comment

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

Since the revision character has been included in the version for a while, that might be ok. However, doing so would miss the fips information. For example, OpenSSL 1.1.1k FIPS and OpenSSL 1.0.2k-fips. As I said in my PR, As an aside, it seems like we could be adding another fact based on FIPS mode, and possibly the library information for v3, but that is best left to another PR.

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.

3 participants