Fix import cycle (over SSH keyfile passphrase input)

This commit is contained in:
2024-05-17 12:25:10 -04:00
parent 278a672095
commit 224289d404
2 changed files with 19 additions and 4 deletions
+16
View File
@@ -0,0 +1,16 @@
package sync
import (
"fmt"
"golang.org/x/crypto/ssh/terminal"
"os"
)
// inputKeyFilePassphrase prompts the user for a passphrase for an SSH key file
// TODO support non-CLI implementations
func inputKeyFilePassphrase() []byte {
fmt.Print("\nEnter passphrase for your SSH keyfile: ")
passphrase, _ := terminal.ReadPassword(int(os.Stdin.Fd()))
fmt.Println()
return passphrase
}