makepkg/repo-add: do not accept public-only keys for signing
If it's not listed by --list-secret-key we don't care if it has been
imported into your keyring, it's unusable. And you might not have a
private key at all in the no-keyid-specified case.
Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
(cherry picked from commit 02ae97b0da
)
This commit is contained in:
parent
2a345604cd
commit
1e9cd30e48
2 changed files with 2 additions and 2 deletions
|
@ -1284,7 +1284,7 @@ fi
|
|||
# check if gpg signature is to be created and if signing key is valid
|
||||
if { [[ -z $SIGNPKG ]] && check_buildenv "sign" "y"; } || [[ $SIGNPKG == 'y' ]]; then
|
||||
SIGNPKG='y'
|
||||
if ! gpg --list-key ${GPGKEY:+"$GPGKEY"} &>/dev/null; then
|
||||
if ! gpg --list-secret-key ${GPGKEY:+"$GPGKEY"} &>/dev/null; then
|
||||
if [[ ! -z $GPGKEY ]]; then
|
||||
error "$(gettext "The key %s does not exist in your keyring.")" "${GPGKEY}"
|
||||
else
|
||||
|
|
|
@ -138,7 +138,7 @@ check_gpg() {
|
|||
fi
|
||||
|
||||
if (( ! VERIFY )); then
|
||||
if ! gpg --list-key ${GPGKEY:+"$GPGKEY"} &>/dev/null; then
|
||||
if ! gpg --list-secret-key ${GPGKEY:+"$GPGKEY"} &>/dev/null; then
|
||||
if [[ ! -z $GPGKEY ]]; then
|
||||
error "$(gettext "The key ${GPGKEY} does not exist in your keyring.")"
|
||||
elif (( ! KEY )); then
|
||||
|
|
Loading…
Add table
Reference in a new issue