diff --git a/.gitmodules b/.gitmodules index 37f75fa..6a104c5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -6,10 +6,6 @@ path = vendor/github.com/jessevdk/go-flags url = https://github.com/jessevdk/go-flags branch = master -[submodule "vendor/github.com/mewbak/gopass"] - path = vendor/github.com/mewbak/gopass - url = https://github.com/mewbak/gopass - branch = master [submodule "vendor/github.com/shazow/rateio"] path = vendor/github.com/shazow/rateio url = https://github.com/shazow/rateio @@ -18,3 +14,6 @@ path = vendor/github.com/dustin/go-humanize url = https://github.com/dustin/go-humanize branch = master +[submodule "vendor/github.com/howeyc/gopass"] + path = vendor/github.com/howeyc/gopass + url = https://github.com/howeyc/gopass.git diff --git a/Makefile b/Makefile index a43917c..43a897a 100644 --- a/Makefile +++ b/Makefile @@ -39,3 +39,4 @@ release: GOOS=linux GOARCH=386 $(LDFLAGS) ./build_release "github.com/shazow/ssh-chat/cmd/ssh-chat" README.md LICENSE GOOS=darwin GOARCH=amd64 $(LDFLAGS) ./build_release "github.com/shazow/ssh-chat/cmd/ssh-chat" README.md LICENSE GOOS=freebsd GOARCH=amd64 $(LDFLAGS) ./build_release "github.com/shazow/ssh-chat/cmd/ssh-chat" README.md LICENSE + GOOS=windows GOARCH=386 $(LDFLAGS) ./build_release "github.com/shazow/ssh-chat/cmd/ssh-chat" README.md LICENSE diff --git a/build_release b/build_release index 00d4c35..d0758c5 100755 --- a/build_release +++ b/build_release @@ -37,6 +37,11 @@ build() { local bin="$(basename $package)" local tarball="${bin}-${GOOS}_${GOARCH}.tgz" local outdir="$BUILDDIR/$bin" + local tardir="$bin" + if [ "$GOOS" == "windows" ]; then + bin="$bin.exe" + fi + if [[ -d "$outdir" ]]; then echo "err: outdir already exists: $PWD/$outdir" @@ -51,7 +56,7 @@ build() { fi # Create tarball - tar -C "$BUILDDIR" -czvf "$BUILDDIR/$tarball" "$bin" + tar -C "$BUILDDIR" -czvf "$BUILDDIR/$tarball" "$tardir" # Cleanup rm -rf "$outdir" diff --git a/cmd/ssh-chat/key.go b/cmd/ssh-chat/key.go index 864e1fc..e7135a9 100644 --- a/cmd/ssh-chat/key.go +++ b/cmd/ssh-chat/key.go @@ -7,7 +7,7 @@ import ( "io/ioutil" "os" - "github.com/mewbak/gopass" + "github.com/howeyc/gopass" ) // ReadPrivateKey attempts to read your private key and possibly decrypt it if it @@ -28,14 +28,15 @@ func ReadPrivateKey(path string) ([]byte, error) { return privateKey, nil } - passphrase := os.Getenv("IDENTITY_PASSPHRASE") - if passphrase == "" { - passphrase, err = gopass.GetPass("Enter passphrase: ") + passphrase := []byte(os.Getenv("IDENTITY_PASSPHRASE")) + if len(passphrase) == 0 { + fmt.Print("Enter passphrase: ") + passphrase, err = gopass.GetPasswd() if err != nil { return nil, fmt.Errorf("couldn't read passphrase: %v", err) } } - der, err := x509.DecryptPEMBlock(block, []byte(passphrase)) + der, err := x509.DecryptPEMBlock(block, passphrase) if err != nil { return nil, fmt.Errorf("decrypt failed: %v", err) } diff --git a/vendor/github.com/howeyc/gopass b/vendor/github.com/howeyc/gopass new file mode 160000 index 0000000..26c6e11 --- /dev/null +++ b/vendor/github.com/howeyc/gopass @@ -0,0 +1 @@ +Subproject commit 26c6e1184fd5255fa5f5289d0b789a4819c203a4 diff --git a/vendor/github.com/mewbak/gopass b/vendor/github.com/mewbak/gopass deleted file mode 160000 index fa08fb4..0000000 --- a/vendor/github.com/mewbak/gopass +++ /dev/null @@ -1 +0,0 @@ -Subproject commit fa08fb4d03e3a626c172af829a5029727baf9222