Skip to content

Commit cf60e62

Browse files
zx2c4bradfitz
authored andcommitted
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent c5b4c79 commit cf60e62

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

util_windows.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ func ReadPassword(fd int) ([]byte, error) {
9494
defer windows.SetConsoleMode(windows.Handle(fd), old)
9595

9696
var h windows.Handle
97-
p, _ := windows.GetCurrentProcess()
98-
if err := windows.DuplicateHandle(p, windows.Handle(fd), p, &h, 0, false, windows.DUPLICATE_SAME_ACCESS); err != nil {
97+
if err := windows.DuplicateHandle(windows.GetCurrentProcess(), windows.Handle(fd), windows.GetCurrentProcess(), &h, 0, false, windows.DUPLICATE_SAME_ACCESS); err != nil {
9998
return nil, err
10099
}
101100

0 commit comments

Comments
 (0)