mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-09-24 03:42:32 -04:00
Swap out gopass dependency
Remove github.com/mewbak/gopass in favor of github.com/howeyc/gopass
This commit is contained in:
parent
3535fb35bb
commit
b5fa56861d
7
.gitmodules
vendored
7
.gitmodules
vendored
@ -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
|
||||
|
@ -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)
|
||||
}
|
||||
|
1
vendor/github.com/howeyc/gopass
generated
vendored
Submodule
1
vendor/github.com/howeyc/gopass
generated
vendored
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 26c6e1184fd5255fa5f5289d0b789a4819c203a4
|
1
vendor/github.com/mewbak/gopass
generated
vendored
1
vendor/github.com/mewbak/gopass
generated
vendored
@ -1 +0,0 @@
|
||||
Subproject commit fa08fb4d03e3a626c172af829a5029727baf9222
|
Loading…
x
Reference in New Issue
Block a user