Allow Use Of Non-ASCII Character In SSH Client Passwords#322
Allow Use Of Non-ASCII Character In SSH Client Passwords#322bagajjal merged 3 commits intoPowerShell:latestw_allfrom
Conversation
- Modified readpassphrase() to read unicode characters and return utf8-encoded password strings to allow use of non-ascii characters.
manojampalam
left a comment
There was a problem hiding this comment.
I've been longing to rewrite this logic for a while.
My proposal is to do the following:
- Save current console settings
- Modify console settings to echo off and line mode (SetConsoleMode(ENABLE_LINE_INPUT)
- ReadFile(CONIN)
- Revert console settings
Thoughts?
|
Topically, I think that could work although messing with console mode can sometimes have some unforeseen consequences. I haven't written many console programs that dynamically ask for input so I don't have a strong knowledge base about what those might be. The only immediate questions/concerns that come to mind are:
|
|
Hmm. Right. My proposal would only support a specific use case of readpassphrase and has unintended consequences. Let me review your changes. |
|
@manojampalam I hadn't noticed this before, but apparently when compiling under Visual Studio 2017 vice Visual Studio 2015 (and/or against the latest Windows 10 SDK), the current readpassphrase() truncates its output to the first character. This change also happens to address that behavior and, other than setting ENABLE_PKCS11 as a processor definition, is literally the only other thing I had to do to get PKCS11 support working. Any chance to review these changes? |
|
Apologies for the delay. I'm still looking into Unix implementation and checking how best we can support all the different modes. |
|
@manojampalam Thoughts on moving forward with this? |
|
Can we merge this in with as part of the 8.1 release? (rebase needed first) |
Addresses: PowerShell/Win32-OpenSSH#1178
May be related to: PowerShell/Win32-OpenSSH#1084