diff --git a/internal/action/setup.go b/internal/action/setup.go index 9eb26d344f..fb5b082291 100644 --- a/internal/action/setup.go +++ b/internal/action/setup.go @@ -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" @@ -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()) diff --git a/internal/backend/crypto/gpg/cli/gpg.go b/internal/backend/crypto/gpg/cli/gpg.go index 23a2224cfe..52a2b78ff2 100644 --- a/internal/backend/crypto/gpg/cli/gpg.go +++ b/internal/backend/crypto/gpg/cli/gpg.go @@ -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. @@ -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.