Remove dependency on golang.org/x/crypto
This commit is contained in:
@@ -8,11 +8,9 @@ import (
|
||||
"crypto/x509"
|
||||
"fmt"
|
||||
"os"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"git.sr.ht/~adnano/gmi"
|
||||
"golang.org/x/crypto/ssh/terminal"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -77,16 +75,8 @@ func sendRequest(req *gmi.Request) error {
|
||||
switch resp.Status / 10 {
|
||||
case gmi.StatusClassInput:
|
||||
fmt.Printf("%s: ", resp.Meta)
|
||||
if resp.Status == gmi.StatusSensitiveInput {
|
||||
input, err := terminal.ReadPassword(int(syscall.Stdin))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
req.URL.RawQuery = string(input)
|
||||
} else {
|
||||
scanner.Scan()
|
||||
req.URL.RawQuery = scanner.Text()
|
||||
}
|
||||
scanner.Scan()
|
||||
req.URL.RawQuery = scanner.Text()
|
||||
return sendRequest(req)
|
||||
case gmi.StatusClassSuccess:
|
||||
fmt.Print(string(resp.Body))
|
||||
|
||||
Reference in New Issue
Block a user