summaryrefslogtreecommitdiff
path: root/src/share/mh/add_revoker
diff options
context:
space:
mode:
authorMatt Goins <mjgoins@openflows.com>2009-02-21 16:54:39 -0500
committerMatt Goins <mjgoins@openflows.com>2009-02-21 16:54:39 -0500
commit4e0502a242b89c73535b00cc1b199dfea38ce4d4 (patch)
tree6bed970da1f85171b1c0b13095b702825a90754b /src/share/mh/add_revoker
parentd41fe28eb49e42d7773a223a43fd108913410c99 (diff)
parenteb88374be90344d1808fe49a5bc69a547a09280d (diff)
Merge branch 'master' of git://lair.fifthhorseman.net/~dkg/monkeysphere
Diffstat (limited to 'src/share/mh/add_revoker')
-rw-r--r--src/share/mh/add_revoker16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/share/mh/add_revoker b/src/share/mh/add_revoker
index 428b958..03ae56f 100644
--- a/src/share/mh/add_revoker
+++ b/src/share/mh/add_revoker
@@ -74,14 +74,24 @@ else
# get the full fingerprint of new revoker key
log debug "getting fingerprint of revoker key..."
fingerprint=$(su_monkeysphere_user "GNUPGHOME=$tmpDir gpg --list-key --with-colons --with-fingerprint 0x${keyID}!" \
- | grep '^fpr:' | grep "$keyID" | cut -d: -f10)
+ | grep '^fpr:' | cut -d: -f10)
+
+ # test that there is only a single fingerprint
+ if (( $(echo "$fingerprint" | wc -l) != 1 )) ; then
+ cat <<EOF
+More than one fingerprint found:
+$fingerprint
+Please use a more specific key ID.
+EOF
+ failure
+ fi
log info "key found:"
su_monkeysphere_user "GNUPGHOME=$tmpDir gpg --fingerprint 0x${fingerprint}!"
if [ "$PROMPT" = "true" ] ; then
- echo "Are you sure you want to add the above key as a"
- read -p "revoker of the host key? (Y/n) " OK; OK=${OK:-Y}
+ read -p "Are you sure you want to add the above key as a revoker
+of the host key? (Y/n) " OK; OK=${OK:-Y}
if [ "${OK/y/Y}" != 'Y' ] ; then
failure "revoker not added."
fi