From 8de7959fa5772aca406bf29bb17707119c64b81e Mon Sep 17 00:00:00 2001 From: colin Date: Wed, 26 Oct 2022 06:44:29 -0700 Subject: [PATCH] strip `.gpg` suffix from browser-provided password path --- request/fetch.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/request/fetch.go b/request/fetch.go index 1b120c2..845c31b 100644 --- a/request/fetch.go +++ b/request/fetch.go @@ -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 {