Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix identity detection when using gpg #2218

Merged
merged 1 commit into from
May 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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