diff --git a/cmd/publish_repo.go b/cmd/publish_repo.go index 33022fa92..03becce4a 100644 --- a/cmd/publish_repo.go +++ b/cmd/publish_repo.go @@ -37,8 +37,8 @@ Example: cmd.Flag.String("gpg-key", "", "GPG key ID to use when signing the release") cmd.Flag.Var(&keyRingsFlag{}, "keyring", "GPG keyring to use (instead of default)") cmd.Flag.String("secret-keyring", "", "GPG secret keyring to use (instead of default)") - cmd.Flag.String("passphrase", "", "GPG passhprase for the key (warning: could be insecure)") - cmd.Flag.String("passphrase-file", "", "GPG passhprase-file for the key (warning: could be insecure)") + cmd.Flag.String("passphrase", "", "GPG passphrase for the key (warning: could be insecure)") + cmd.Flag.String("passphrase-file", "", "GPG passphrase-file for the key (warning: could be insecure)") cmd.Flag.Bool("batch", false, "run GPG with detached tty") cmd.Flag.Bool("skip-signing", false, "don't sign Release files with GPG") cmd.Flag.Bool("skip-contents", false, "don't generate Contents indexes") diff --git a/cmd/publish_snapshot.go b/cmd/publish_snapshot.go index 6e3e09526..2df47bd22 100644 --- a/cmd/publish_snapshot.go +++ b/cmd/publish_snapshot.go @@ -221,8 +221,8 @@ Example: cmd.Flag.String("gpg-key", "", "GPG key ID to use when signing the release") cmd.Flag.Var(&keyRingsFlag{}, "keyring", "GPG keyring to use (instead of default)") cmd.Flag.String("secret-keyring", "", "GPG secret keyring to use (instead of default)") - cmd.Flag.String("passphrase", "", "GPG passhprase for the key (warning: could be insecure)") - cmd.Flag.String("passphrase-file", "", "GPG passhprase-file for the key (warning: could be insecure)") + cmd.Flag.String("passphrase", "", "GPG passphrase for the key (warning: could be insecure)") + cmd.Flag.String("passphrase-file", "", "GPG passphrase-file for the key (warning: could be insecure)") cmd.Flag.Bool("batch", false, "run GPG with detached tty") cmd.Flag.Bool("skip-signing", false, "don't sign Release files with GPG") cmd.Flag.Bool("skip-contents", false, "don't generate Contents indexes") diff --git a/cmd/publish_switch.go b/cmd/publish_switch.go index d367e9960..ef10f18f0 100644 --- a/cmd/publish_switch.go +++ b/cmd/publish_switch.go @@ -147,8 +147,8 @@ This command would switch published repository (with one component) named ppa/wh cmd.Flag.String("gpg-key", "", "GPG key ID to use when signing the release") cmd.Flag.Var(&keyRingsFlag{}, "keyring", "GPG keyring to use (instead of default)") cmd.Flag.String("secret-keyring", "", "GPG secret keyring to use (instead of default)") - cmd.Flag.String("passphrase", "", "GPG passhprase for the key (warning: could be insecure)") - cmd.Flag.String("passphrase-file", "", "GPG passhprase-file for the key (warning: could be insecure)") + cmd.Flag.String("passphrase", "", "GPG passphrase for the key (warning: could be insecure)") + cmd.Flag.String("passphrase-file", "", "GPG passphrase-file for the key (warning: could be insecure)") cmd.Flag.Bool("batch", false, "run GPG with detached tty") cmd.Flag.Bool("skip-signing", false, "don't sign Release files with GPG") cmd.Flag.Bool("skip-contents", false, "don't generate Contents indexes") diff --git a/cmd/publish_update.go b/cmd/publish_update.go index b18f767e8..dea5ac5e7 100644 --- a/cmd/publish_update.go +++ b/cmd/publish_update.go @@ -106,8 +106,8 @@ Example: cmd.Flag.String("gpg-key", "", "GPG key ID to use when signing the release") cmd.Flag.Var(&keyRingsFlag{}, "keyring", "GPG keyring to use (instead of default)") cmd.Flag.String("secret-keyring", "", "GPG secret keyring to use (instead of default)") - cmd.Flag.String("passphrase", "", "GPG passhprase for the key (warning: could be insecure)") - cmd.Flag.String("passphrase-file", "", "GPG passhprase-file for the key (warning: could be insecure)") + cmd.Flag.String("passphrase", "", "GPG passphrase for the key (warning: could be insecure)") + cmd.Flag.String("passphrase-file", "", "GPG passphrase-file for the key (warning: could be insecure)") cmd.Flag.Bool("batch", false, "run GPG with detached tty") cmd.Flag.Bool("skip-signing", false, "don't sign Release files with GPG") cmd.Flag.Bool("skip-contents", false, "don't generate Contents indexes") diff --git a/completion.d/_aptly b/completion.d/_aptly index c93cd68d1..13de4f096 100644 --- a/completion.d/_aptly +++ b/completion.d/_aptly @@ -439,8 +439,8 @@ local keyring="*-keyring=[gpg keyring to use when verifying Release file (could "-force-overwrite=[overwrite files in package pool in case of mismatch]:$bool" "-gpg-key=[GPG key ID to use when signing the release]:gpg key id:$gpg_keys" "-keyring=[GPG keyring to use (instead of default)]:keyring file:_files -g '*.gpg'" - "-passphrase=[GPG passhprase for the key (warning: could be insecure)]:passphrase: " - "-passphrase-file=[GPG passhprase−file for the key (warning: could be insecure)]:passphrase file:_files" + "-passphrase=[GPG passphrase for the key (warning: could be insecure)]:passphrase: " + "-passphrase-file=[GPG passphrase−file for the key (warning: could be insecure)]:passphrase file:_files" "-secret-keyring=[GPG secret keyring to use (instead of default)]:secret-keyring:_files" "-skip-contents=[don’t generate Contents indexes]:$bool" "-skip-signing=[don’t sign Release files with GPG]:$bool" diff --git a/man/aptly.1 b/man/aptly.1 index 8d221044d..36730499f 100644 --- a/man/aptly.1 +++ b/man/aptly.1 @@ -1431,11 +1431,11 @@ origin name to publish . .TP \-\fBpassphrase\fR= -GPG passhprase for the key (warning: could be insecure) +GPG passphrase for the key (warning: could be insecure) . .TP \-\fBpassphrase\-file\fR= -GPG passhprase\-file for the key (warning: could be insecure) +GPG passphrase\-file for the key (warning: could be insecure) . .TP \-\fBsecret\-keyring\fR= @@ -1530,11 +1530,11 @@ overwrite origin name to publish . .TP \-\fBpassphrase\fR= -GPG passhprase for the key (warning: could be insecure) +GPG passphrase for the key (warning: could be insecure) . .TP \-\fBpassphrase\-file\fR= -GPG passhprase\-file for the key (warning: could be insecure) +GPG passphrase\-file for the key (warning: could be insecure) . .TP \-\fBsecret\-keyring\fR= @@ -1608,11 +1608,11 @@ GPG keyring to use (instead of default) . .TP \-\fBpassphrase\fR= -GPG passhprase for the key (warning: could be insecure) +GPG passphrase for the key (warning: could be insecure) . .TP \-\fBpassphrase\-file\fR= -GPG passhprase\-file for the key (warning: could be insecure) +GPG passphrase\-file for the key (warning: could be insecure) . .TP \-\fBsecret\-keyring\fR= @@ -1673,11 +1673,11 @@ GPG keyring to use (instead of default) . .TP \-\fBpassphrase\fR= -GPG passhprase for the key (warning: could be insecure) +GPG passphrase for the key (warning: could be insecure) . .TP \-\fBpassphrase\-file\fR= -GPG passhprase\-file for the key (warning: could be insecure) +GPG passphrase\-file for the key (warning: could be insecure) . .TP \-\fBsecret\-keyring\fR= @@ -2062,4 +2062,3 @@ William Manley (https://github\.com/wmanley) Shengjing Zhu (https://github\.com/zhsj) . .IP "" 0 - diff --git a/pgp/gnupg.go b/pgp/gnupg.go index 5205a450e..9441ae9d6 100644 --- a/pgp/gnupg.go +++ b/pgp/gnupg.go @@ -44,7 +44,7 @@ func (g *GpgSigner) SetKeyRing(keyring, secretKeyring string) { g.keyring, g.secretKeyring = keyring, secretKeyring } -// SetPassphrase sets passhprase params +// SetPassphrase sets passphrase params func (g *GpgSigner) SetPassphrase(passphrase, passphraseFile string) { g.passphrase, g.passphraseFile = passphrase, passphraseFile } diff --git a/pgp/internal.go b/pgp/internal.go index 0150da2a9..82a0a8c35 100644 --- a/pgp/internal.go +++ b/pgp/internal.go @@ -29,7 +29,7 @@ var ( // Internal errors var ( - errWrongPasshprase = errors.New("unable to decrypt the key, passphrase is wrong") + errWrongPassphrase = errors.New("unable to decrypt the key, passphrase is wrong") ) // GoSigner is implementation of Signer interface using Go internal OpenPGP library @@ -60,7 +60,7 @@ func (g *GoSigner) SetKeyRing(keyring, secretKeyring string) { g.keyringFile, g.secretKeyringFile = keyring, secretKeyring } -// SetPassphrase sets passhprase params +// SetPassphrase sets passphrase params func (g *GoSigner) SetPassphrase(passphrase, passphraseFile string) { g.passphrase, g.passphraseFile = passphrase, passphraseFile } @@ -182,7 +182,7 @@ func (g *GoSigner) Init() error { g.passphrase = string(bytePassphrase) err = g.decryptKey() - if err == nil || err != errWrongPasshprase { + if err == nil || err != errWrongPassphrase { break } @@ -209,7 +209,7 @@ func (g *GoSigner) decryptKey() error { if e, ok := err.(openpgp_errors.StructuralError); ok { if string(e) == "private key checksum failure" { - return errWrongPasshprase + return errWrongPassphrase } }