Skip to content

Fix OpenSSL genpkey parameter formatting for SSL certificate generation - #76

Merged
ngetahun merged 1 commit into
masterfrom
fix-genpkey-parameter-bsc1266671
Jun 3, 2026
Merged

Fix OpenSSL genpkey parameter formatting for SSL certificate generation#76
ngetahun merged 1 commit into
masterfrom
fix-genpkey-parameter-bsc1266671

Conversation

@ngetahun

@ngetahun ngetahun commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes the OpenSSL genpkey command parameter formatting that was causing SSL certificate generation to fail during the RMT wizard setup.

Problem

The OpenQA test reported the following error:

Error setting rsa_keygen_bits: 2048 parameter

This was caused by incorrect parameter formatting in the -pkeyopt argument. The parameter rsa_keygen_bits: 2048 had a space after the colon, but OpenSSL expects rsa_keygen_bits:2048 (no space).

Root Cause

This issue was introduced in commit 0b73535 when migrating from genrsa to genpkey for FIPS compatibility (bsc#1235462).

Changes

  • Fixed the -pkeyopt parameter in certificate_generator.rb (removed space after colon)
  • Updated the corresponding test expectation in certificate_generator_spec.rb
  • Added changelog entry referencing bsc#1266671

Testing

Verified the fix with OpenSSL command line:

# Correct syntax (no space) - works ✓
openssl genpkey -algorithm RSA -pass stdin -aes256 \
  -out /tmp/test.key -pkeyopt rsa_keygen_bits:2048

# Incorrect syntax (with space) - fails ✗
openssl genpkey -algorithm RSA -pkeyopt "rsa_keygen_bits: 2048" \
  -out /tmp/test.key
# Error: genpkey: Error setting rsa_keygen_bits: 2048 parameter

References

The OpenSSL genpkey command was failing with the error:
'Error setting rsa_keygen_bits: 2048 parameter'

This was caused by incorrect parameter formatting in the -pkeyopt
argument. The parameter 'rsa_keygen_bits: 2048' had a space after
the colon, but OpenSSL expects 'rsa_keygen_bits:2048' (no space).

This issue was introduced in commit 0b73535 when migrating from
genrsa to genpkey for FIPS compatibility.

Changes:
- Fixed the -pkeyopt parameter in certificate_generator.rb
- Updated the corresponding test expectation
- Added changelog entry

Testing:
Verified with OpenSSL command line:
  openssl genpkey -algorithm RSA -pass stdin -aes256 \
    -out /tmp/test.key -pkeyopt rsa_keygen_bits:2048
Successfully generates encrypted key with correct syntax.

Fixes: bsc#1266671
Related: bsc#1235462 (FIPS compatibility)
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 26746178175

Coverage remained the same at 98.499%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1666
Covered Lines: 1641
Line Coverage: 98.5%
Coverage Strength: 1.97 hits per line

💛 - Coveralls

@brett060102 brett060102 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@rtamalin rtamalin left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@felixsch felixsch left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm 👍

@ngetahun
ngetahun merged commit d7d6f59 into master Jun 3, 2026
8 checks passed
@ngetahun
ngetahun deleted the fix-genpkey-parameter-bsc1266671 branch June 3, 2026 13:03
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.

5 participants