From 9e5a8d819afd3ded051bef739dbc4bfb1446dc2e Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Sat, 21 Feb 2009 17:06:47 -0500 Subject: correct return codes for monkeysphere subkey-to-ssh-agent --- src/share/m/subkey_to_ssh_agent | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/share/m/subkey_to_ssh_agent b/src/share/m/subkey_to_ssh_agent index 7fb2fdb..4ce14f8 100644 --- a/src/share/m/subkey_to_ssh_agent +++ b/src/share/m/subkey_to_ssh_agent @@ -13,6 +13,9 @@ # try to add all authentication subkeys to the agent +# FIXME: what if you only want to add one authentication subkey to the +# agent? + subkey_to_ssh_agent() { local sshaddresponse=0 local secretkeys @@ -68,7 +71,6 @@ You might want to 'monkeysphere gen-subkey'" trap "rm -rf $workingdir" EXIT umask 077 mkfifo "$workingdir/passphrase" - keysuccess=1 # FIXME: we're currently allowing any other options to get passed # through to ssh-add. should we limit it to known ones? For @@ -88,7 +90,7 @@ You might want to 'monkeysphere gen-subkey'" if [ "$1" = '-d' ]; then # we're removing the subkey: gpg_user --export "0x${subkey}!" | openpgp2ssh "$subkey" > "$workingdir/$kname" - (cd "$workingdir" && ssh-add -d "$kname") + (cd "$workingdir" && ssh-add -d "$kname") || keysuccess="$?" else # we're adding the subkey: mkfifo "$workingdir/$kname" @@ -98,8 +100,8 @@ You might want to 'monkeysphere gen-subkey'" (cd "$workingdir" && DISPLAY=nosuchdisplay SSH_ASKPASS=/bin/false ssh-add "$@" "$kname" Date: Sat, 21 Feb 2009 17:12:49 -0500 Subject: add FIXME to show key about how it should show revokers as well. --- src/monkeysphere-host | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/monkeysphere-host b/src/monkeysphere-host index 540a8ab..baa7a87 100755 --- a/src/monkeysphere-host +++ b/src/monkeysphere-host @@ -184,6 +184,7 @@ show_key() { # list the host key info # FIXME: make no-show-keyring work so we don't have to do the grep'ing # FIXME: can we show uid validity somehow? + # FIXME: show revokers as well gpg --list-keys --fingerprint \ --list-options show-unusable-uids 2>/dev/null \ | grep -v "^${GNUPGHOME}/pubring.gpg$" \ -- cgit v1.2.3 From 97c0b4f9ba18f9e09b430ece4f1b762958238f31 Mon Sep 17 00:00:00 2001 From: Jameson Graef Rollins Date: Sat, 21 Feb 2009 17:25:11 -0500 Subject: extend show-key to show fingerprints of revokers as well. --- src/monkeysphere-host | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/monkeysphere-host b/src/monkeysphere-host index baa7a87..0dba1f6 100755 --- a/src/monkeysphere-host +++ b/src/monkeysphere-host @@ -163,6 +163,8 @@ find_host_userid() { # show info about the host key show_key() { local GNUPGHOME + local TMPSSH + local revokers # tmp gpghome dir export GNUPGHOME=$(msmktempdir) @@ -184,12 +186,22 @@ show_key() { # list the host key info # FIXME: make no-show-keyring work so we don't have to do the grep'ing # FIXME: can we show uid validity somehow? - # FIXME: show revokers as well gpg --list-keys --fingerprint \ --list-options show-unusable-uids 2>/dev/null \ | grep -v "^${GNUPGHOME}/pubring.gpg$" \ | egrep -v '^-+$' + # list revokers, if there are any + revokers=$(gpg --list-keys --with-colons --fixed-list-mode \ + | grep '^rvk:' | cut -d: -f10) + if [ "$revokers" ] ; then + echo "The following keys are allowed to revoke this host key:" + for key in $revokers ; do + echo "revoker: $key" + done + echo + fi + # list the pgp fingerprint echo "OpenPGP fingerprint: $HOST_FINGERPRINT" -- cgit v1.2.3 From fa47d0b373ae70733c50420821cf2ef8e1ad7466 Mon Sep 17 00:00:00 2001 From: Jameson Graef Rollins Date: Sat, 21 Feb 2009 17:30:54 -0500 Subject: make show-key so that it works even if there are no revokers. --- src/monkeysphere-host | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/monkeysphere-host b/src/monkeysphere-host index 0dba1f6..fc3b607 100755 --- a/src/monkeysphere-host +++ b/src/monkeysphere-host @@ -193,7 +193,7 @@ show_key() { # list revokers, if there are any revokers=$(gpg --list-keys --with-colons --fixed-list-mode \ - | grep '^rvk:' | cut -d: -f10) + | grep '^rvk:' | cut -d: -f10) || true if [ "$revokers" ] ; then echo "The following keys are allowed to revoke this host key:" for key in $revokers ; do -- cgit v1.2.3 From 46fe34d78ca1acb59c996064e4b85f922cf9e9e6 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Sat, 21 Feb 2009 17:34:15 -0500 Subject: adjusting extraction of revokers. --- src/monkeysphere-host | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/monkeysphere-host b/src/monkeysphere-host index fc3b607..1b0de0c 100755 --- a/src/monkeysphere-host +++ b/src/monkeysphere-host @@ -193,7 +193,7 @@ show_key() { # list revokers, if there are any revokers=$(gpg --list-keys --with-colons --fixed-list-mode \ - | grep '^rvk:' | cut -d: -f10) || true + | awk -F: '/^rvk:/{ print $10 }' ) if [ "$revokers" ] ; then echo "The following keys are allowed to revoke this host key:" for key in $revokers ; do -- cgit v1.2.3