strip .gpg
suffix from browser-provided password path
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/browserpass/browserpass-native/errors"
|
||||
"github.com/browserpass/browserpass-native/response"
|
||||
@@ -134,6 +135,7 @@ func validateGpgBinary(gpgPath string) error {
|
||||
}
|
||||
|
||||
func decryptFile(store *store, file string, gpgPath string) (string, error) {
|
||||
file = strings.TrimSuffix(file, ".gpg"); // browserpass-extension forcibly adds the .gpg extension
|
||||
passwordFilePath := filepath.Join(store.Path, file)
|
||||
passwordFile, err := os.Open(passwordFilePath)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user