ssh/terminal: handle non-ASCII characters when reading passwords

ReadPassword uses Windows ReadFile to read from console handle.
But ReadFile does not split input into UTF-8 characters, so ReadFile
only works when input is ASCII. Use os.File instead of Windows
ReadFile, because os.File reads console and parses it into UTF-8.

Fixes golang/go#22828

Change-Id: Ifeed3e8048b51f46706c28d4154a3e4b10111a3e
Reviewed-by: Alex Brainman <>
Run-TryBot: Alex Brainman <>
TryBot-Result: Gobot Gobot <>
1 file changed