Reintroduce conversion required for Windows (#1868)

This commit is contained in:
Martin Angers 2021-08-31 09:24:28 -04:00 committed by GitHub
parent e1ba813f0c
commit d1a0ea3881
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -443,7 +443,8 @@ func (p *passphraseHandler) readPassphrase(role string, confirm bool) ([]byte, e
}
fmt.Printf("Enter %s key passphrase: ", role)
passphrase, err := terminal.ReadPassword(syscall.Stdin)
// the int(...) conversion is required as on Windows syscall.Stdin is of type Handle.
passphrase, err := terminal.ReadPassword(int(syscall.Stdin)) //nolint:unconvert
fmt.Println()
if err != nil {
return nil, errors.Wrap(err, "read password")
@ -454,7 +455,8 @@ func (p *passphraseHandler) readPassphrase(role string, confirm bool) ([]byte, e
}
fmt.Printf("Repeat %s key passphrase: ", role)
confirmation, err := terminal.ReadPassword(syscall.Stdin)
// the int(...) conversion is required as on Windows syscall.Stdin is of type Handle.
confirmation, err := terminal.ReadPassword(int(syscall.Stdin)) //nolint:unconvert
fmt.Println()
if err != nil {
return nil, errors.Wrap(err, "read password confirmation")