From cf60e62b0da838f031b049c9c7052d369176fcc6 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sun, 22 Sep 2019 23:01:56 +0200 Subject: [PATCH] ssh/terminal: account for win32 api changes The API changed for this function, since the call always succeeds. Update this user of it accordingly. Fixes: golang/go#34461 Change-Id: I9d19b70767fc6b1b9292ad8732dd8e54bb6a8ae0 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/196897 Run-TryBot: Jason A. Donenfeld TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- util_windows.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/util_windows.go b/util_windows.go index 5cfdf8f..61312ae 100644 --- a/util_windows.go +++ b/util_windows.go @@ -94,8 +94,7 @@ func ReadPassword(fd int) ([]byte, error) { defer windows.SetConsoleMode(windows.Handle(fd), old) var h windows.Handle - p, _ := windows.GetCurrentProcess() - if err := windows.DuplicateHandle(p, windows.Handle(fd), p, &h, 0, false, windows.DUPLICATE_SAME_ACCESS); err != nil { + if err := windows.DuplicateHandle(windows.GetCurrentProcess(), windows.Handle(fd), windows.GetCurrentProcess(), &h, 0, false, windows.DUPLICATE_SAME_ACCESS); err != nil { return nil, err }