diff options
author | Jakob Unterwurzacher | 2015-10-11 17:14:18 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2015-10-11 17:14:18 +0200 |
commit | 5dc7e44aa2cb6527b0e2f4e7108c8cbd7c2a72c1 (patch) | |
tree | 30c9c35c0aaa5646ba90fee3efdfe4ea62550fed /gocryptfs_main/password.go | |
parent | 6825d0e7406b8e761daca63770e28842bed5fd85 (diff) |
Move main files to top level dir
This is in preparation of getting rid of the shell wrapper
Diffstat (limited to 'gocryptfs_main/password.go')
-rw-r--r-- | gocryptfs_main/password.go | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/gocryptfs_main/password.go b/gocryptfs_main/password.go deleted file mode 100644 index 821ecb4..0000000 --- a/gocryptfs_main/password.go +++ /dev/null @@ -1,31 +0,0 @@ -package main - -import ( - "fmt" - "golang.org/x/crypto/ssh/terminal" - "os" -) - -func readPasswordTwice() string { - fmt.Printf("Password: ") - p1 := readPassword() - fmt.Printf("\nRepeat: ") - p2 := readPassword() - fmt.Printf("\n") - if p1 != p2 { - fmt.Printf("Passwords do not match\n") - os.Exit(ERREXIT_PASSWORD) - } - return p1 -} - -// Get password from terminal -func readPassword() string { - fd := int(os.Stdin.Fd()) - p, err := terminal.ReadPassword(fd) - if err != nil { - fmt.Printf("Error: Could not read password: %v\n", err) - os.Exit(ERREXIT_PASSWORD) - } - return string(p) -} |