voxpupuli / puppet-openssl

Puppet OpenSSL module
Apache License 2.0
38 stars 84 forks source link

Allow openssl_version regex to match more FIPS versions #112

Closed runejuhl closed 4 years ago

runejuhl commented 4 years ago

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 commented 4 years ago

Thank you. Could you add a test case please?

runejuhl commented 4 years ago

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 commented 4 years ago

No, I have no clue on that, sorry.

runejuhl commented 4 years ago

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 commented 4 years ago

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