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

Allow openssl_version regex to match more FIPS versions #112

Merged
merged 2 commits into from
Mar 17, 2020

Conversation

runejuhl
Copy link
Contributor

el8 may have an OpenSSL version that doesn't match the current version regex,
e.g. OpenSSL 1.1.1c FIPS 28 May 2019. With this PR the regex now allows the
version string to contain FIPS between the version number and date.

openssl_version = 'OpenSSL 1.1.1c FIPS  28 May 2019'
%r{^OpenSSL ([\w\.\-]+)( FIPS)?([ ]+)([\d\.]+)([ ]+)([\w\.]+)([ ]+)([\d\.]+)}.match(openssl_version)[1]
# => "1.1.1c"

@raphink
Copy link
Member

raphink commented Mar 16, 2020

Thank you. Could you add a test case please?

@raphink raphink added enhancement New feature or request needs tests labels Mar 16, 2020
@runejuhl
Copy link
Contributor Author

Thank you. Could you add a test case please?

Absolutely -- coming up.

...on a related note, do you have any idea if the previous -fips suffix in the version string is used to control logic? I.e. should OpenSSL 1.1.1c FIPS 28 May 2019 become 1.1.1c or 1.1.1c-fips?

@raphink
Copy link
Member

raphink commented Mar 16, 2020

No, I have no clue on that, sorry.

@runejuhl
Copy link
Contributor Author

Added a test. Pushed another branch with a structured fact to https://github.com/runejuhl/puppet-openssl/blob/fix-el8-structured/lib/facter/openssl_version.rb, let me know if you want to merge that instead!

@raphink
Copy link
Member

raphink commented Mar 17, 2020

The structured fact looks nice. Let's merge this one for now, and then the structured one.

@raphink raphink merged commit 5fe38f9 into voxpupuli:master Mar 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants