From a04f56a4b5d1020a25da1ff75f3835f194bd708c Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Tue, 5 Aug 2008 14:14:07 -0400 Subject: [PATCH] working around https://bugs.g10code.com/gnupg/issue945 in seckey2sshagent --- src/seckey2sshagent | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/seckey2sshagent b/src/seckey2sshagent index 2a98cf1..2febff8 100755 --- a/src/seckey2sshagent +++ b/src/seckey2sshagent @@ -67,8 +67,13 @@ trap cleanup EXIT GPGIDS="$1" if [ -z "$GPGIDS" ]; then + # hack: we need to get the list of secret keys, because if you + # --list-secret-keys with no arguments, GPG fails to print the + # capability flags (i've just filed this as + # https://bugs.g10code.com/gnupg/issue945) + KEYIDS=$(gpg2 --with-colons --list-secret-keys | grep ^sec | cut -f5 -d:) # default to using all fingerprints of authentication-enabled keys - GPGIDS=$(gpg --with-colons --fingerprint --fingerprint --list-secret-keys "$GPGID" | egrep -A1 '^(ssb|sec):.*:[^:]*a[^:]*:$' | grep ^fpr: | cut -d: -f10) + GPGIDS=$(gpg --with-colons --fingerprint --fingerprint --list-secret-keys $KEYIDS | egrep -A1 '^(ssb|sec):.*:[^:]*a[^:]*:$' | grep ^fpr: | cut -d: -f10) fi for GPGID in $GPGIDS; do -- 2.26.2