Skip to content

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

Closed
nyashbox wants to merge 2 commits intopocoproject:mainfrom
nyashbox:fix/passphrase_protected_key_prompt_cin
Closed

Attempting to load a passphrase-protected key should not prompt cin#4799
nyashbox wants to merge 2 commits intopocoproject:mainfrom
nyashbox:fix/passphrase_protected_key_prompt_cin

Conversation

@nyashbox
Copy link
Copy Markdown
Contributor

@nyashbox nyashbox commented Dec 2, 2024

Fixes #4627

@matejk matejk added this to the Release 1.14.1 milestone Dec 2, 2024
@obiltschnig obiltschnig self-assigned this Dec 5, 2024
@matejk
Copy link
Copy Markdown
Contributor

matejk commented Feb 11, 2025

This PR seems to solve the problem with empty password on macOS (OpenSSL 3.4.0).

However, on Ubuntu 24.10 (OpenSSL 3.3.1), the example prompts for the password with or without the code change.

@obiltschnig
Copy link
Copy Markdown
Member

Let's move this to 1.15.

@matejk
Copy link
Copy Markdown
Contributor

matejk commented Dec 18, 2025

Superseded by #5128, which provides a more complete fix that works on both macOS and Linux.

The issue with PR #4799 was that it only changed pPassword but kept pCB (callback) as NULL when password was empty. On Linux, when the callback is NULL, OpenSSL ignores pPassword entirely and still prompts stdin.

The fix in #5128 always provides the callback, which correctly handles empty passwords by returning 0 (no password), causing OpenSSL to throw a proper error.

@matejk matejk modified the milestones: Release 1.16.0, Release 1.15.0 Dec 18, 2025
@matejk matejk closed this Dec 18, 2025
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.

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

3 participants