Revert "ssh/terminal: account for win32 api changes"

This reverts commit CL 196897 (commit cf60e62b0d)

Reason for revert: we're reverting the API change instead
in https://go-review.googlesource.com/c/sys/+/197597

Change-Id: I41741c85bb7a07b9ce13264ebb26ee3f968772fa
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/197598
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
This commit is contained in:
Brad Fitzpatrick
2019-09-26 17:54:57 +00:00
parent cf60e62b0d
commit 24acb349b8

View File

@@ -94,7 +94,8 @@ func ReadPassword(fd int) ([]byte, error) {
defer windows.SetConsoleMode(windows.Handle(fd), old)
var h windows.Handle
if err := windows.DuplicateHandle(windows.GetCurrentProcess(), windows.Handle(fd), windows.GetCurrentProcess(), &h, 0, false, windows.DUPLICATE_SAME_ACCESS); err != nil {
p, _ := windows.GetCurrentProcess()
if err := windows.DuplicateHandle(p, windows.Handle(fd), p, &h, 0, false, windows.DUPLICATE_SAME_ACCESS); err != nil {
return nil, err
}