Add support for SSH_ASKPASS_PROMPT
Since 2019, OpenSSH sets the SSH_ASKPASS_PROMPT
environment variable
to inform askpass programs what UI they should display:
- https://github.com/openssh/openssh-portable/commit/b497e920b409250309c4abe64229237b8f2730ba
- https://lists.mindrot.org/pipermail/openssh-unix-dev/2019-November/038032.html
There are 3 reported types:
- "confirm":
[Yes] No
- "none" (e.g. for proof of presence):
[Close]
- "" (referred to as "entry"):
|Text field| [OK] Cancel
These are a subset of UI display modes already supported by KSSHAskPass, so this commit only changes the detection logic. I attempted to make this change minimally invasive and self-contained.
Reading the environment variable is more reliable than parsing strings. In particular, certain SSH agents used in corporate environments use different prompt formats, which was not compatible with KSSHAskPass.
The pre-existing display type enum is kept separate for now because it also supports cleartext. Some string parsing also remains in place for KWallet password storage. I can attempt to refactor model logic in a follow-up MR.