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

Attempting to load a passphrase-protected key should not prompt cin #4627

Open
themightyoarfish opened this issue Aug 6, 2024 · 0 comments · May be fixed by #4799
Open

Attempting to load a passphrase-protected key should not prompt cin #4627

themightyoarfish opened this issue Aug 6, 2024 · 0 comments · May be fixed by #4799
Assignees
Labels

Comments

@themightyoarfish
Copy link

Describe the bug

Assuming a private key file protected by a password exists, it can be loaded with the EVPPkey constructor accepting empty pubkey name, private key name, and passphrase. If The passphrase is empty, the program will prompt the user to type in the key
with a message like Enter PEM pass phrase:. This is unsuitable for library code, since this cannot be reacted to unless the program is running in an interactive terminal.
It would be better to raise an exception, which happens e.g. when the wrong password is supplied.

To Reproduce

Attached an MVP with an encrypted openssl key

poco.zip

Expected behavior

Poco raises an exception when the key requires a passphrase, but none was supplied

Logs
n/a

Screenshots

CleanShot 2024-08-06 at 13 58 31

Please add relevant environment information:

  • OS Type and Version: macos ARM 12.7.5
  • POCO Version: 1.13.3 (homebrew)

Additional context

I know this probably comes from OpenSSL, but can this be worked around somehow?

@matejk matejk added this to the Release 1.15.0 milestone Nov 25, 2024
@obiltschnig obiltschnig self-assigned this Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants