Skip to content

Commit

Permalink
Fix identity detection when using gpg (gopasspw#2218)
Browse files Browse the repository at this point in the history
Fixes gopasspw#2179

RELEASE_NOTES=[BUGFIX] Fix gpg identity detection

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
  • Loading branch information
dominikschulz authored May 16, 2022
1 parent ed74516 commit d122a9c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion internal/action/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/gopasspw/gopass/internal/backend"
"github.com/gopasspw/gopass/internal/backend/crypto/age"
"github.com/gopasspw/gopass/internal/backend/crypto/gpg"
gpgcli "github.com/gopasspw/gopass/internal/backend/crypto/gpg/cli"
"github.com/gopasspw/gopass/internal/out"
"github.com/gopasspw/gopass/internal/store/root"
"github.com/gopasspw/gopass/pkg/ctxutil"
Expand Down Expand Up @@ -112,7 +113,7 @@ func (s *Action) initCheckPrivateKeys(ctx context.Context, crypto backend.Crypto
func (s *Action) initGenerateIdentity(ctx context.Context, crypto backend.Crypto, name, email string) error {
out.Printf(ctx, "🧪 Creating cryptographic key pair (%s) ...", crypto.Name())

if crypto.Name() == "gpgcli" {
if crypto.Name() == gpgcli.Name {
var err error

out.Printf(ctx, "🎩 Gathering information for the %s key pair ...", crypto.Name())
Expand Down
4 changes: 3 additions & 1 deletion internal/backend/crypto/gpg/cli/gpg.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ var (
Ext = "gpg"
// IDFile is the name of the recipients file used by this backend.
IDFile = ".gpg-id"
// Name is the name of this backend.
Name = "gpg"
)

// GPG is a gpg wrapper.
Expand Down Expand Up @@ -88,7 +90,7 @@ func (g *GPG) Initialized(ctx context.Context) error {

// Name returns gpg.
func (g *GPG) Name() string {
return "gpg"
return Name
}

// Ext returns gpg.
Expand Down

0 comments on commit d122a9c

Please sign in to comment.