strip `.gpg` suffix from browser-provided password path

This commit is contained in:
colin 2022-10-26 06:44:29 -07:00
parent 85bdb08379
commit 8de7959fa5
1 changed files with 2 additions and 0 deletions

View File

@ -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 {