Skip to content

Add openssl genpkey cli utility tool#2907

Merged
samuel40791765 merged 2 commits intoaws:mainfrom
samuel40791765:genpkey
Dec 16, 2025
Merged

Add openssl genpkey cli utility tool#2907
samuel40791765 merged 2 commits intoaws:mainfrom
samuel40791765:genpkey

Conversation

@samuel40791765
Copy link
Copy Markdown
Contributor

Issues:

Resolves P342458515

Description of changes:

Internal consumers are depending on the openssl genpkey cli tool, so this adds the necessary functionality to support that. This is mainly used for generating a private key or key pair.
I've only added the necessary options for now which are -algorithm, -pkeyopt, and -out. We can add more if needed, but there haven't been more use cases discovered yet. I've also reused and cleaned up a bit of the surrounding code while I was at it. Would like to refactor more, but that would be a separate PR.

Call-outs:

N/A

Testing:

new unit tests. I haven't added any comparison tests, since it didn't really make sense to compare generated private keys from two different libraries.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.

@samuel40791765 samuel40791765 requested a review from a team as a code owner December 15, 2025 23:23
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Dec 16, 2025

Codecov Report

❌ Patch coverage is 68.51852% with 34 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.17%. Comparing base (c23b2ae) to head (756ce8f).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
tool-openssl/genpkey.cc 69.09% 17 Missing ⚠️
tool-openssl/test_util.cc 0.00% 13 Missing ⚠️
tool-openssl/dgst.cc 0.00% 2 Missing ⚠️
tool-openssl/tool_util.cc 83.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2907      +/-   ##
==========================================
+ Coverage   78.15%   78.17%   +0.02%     
==========================================
  Files         687      689       +2     
  Lines      118579   118634      +55     
  Branches    16671    16685      +14     
==========================================
+ Hits        92671    92745      +74     
+ Misses      25019    25002      -17     
+ Partials      889      887       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@WillChilds-Klein WillChilds-Klein left a comment

Choose a reason for hiding this comment

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

some minor comments, rest LGTM

@samuel40791765 samuel40791765 enabled auto-merge (squash) December 16, 2025 18:37
@samuel40791765 samuel40791765 merged commit 192d915 into aws:main Dec 16, 2025
410 of 414 checks passed
m271828 pushed a commit to m271828/aws-lc that referenced this pull request Dec 19, 2025
Internal consumers are depending on the `openssl genpkey` cli tool, so
this adds the necessary functionality to support that. This is mainly
used for generating a private key or key pair.
I've only added the necessary options for now which are `-algorithm`,
`-pkeyopt`, and `-out`. We can add more if needed, but there haven't
been more use cases discovered yet. I've also reused and cleaned up a
bit of the surrounding code while I was at it. Would like to refactor
more, but that would be a separate PR.

### Testing:
new unit tests. I haven't added any comparison tests, since it didn't
really make sense to compare generated private keys from two different
libraries.

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license and the ISC license.
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.

4 participants