summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/monkeysphere-host10
-rwxr-xr-xtests/basic5
2 files changed, 8 insertions, 7 deletions
diff --git a/src/monkeysphere-host b/src/monkeysphere-host
index b45b50e..903e333 100755
--- a/src/monkeysphere-host
+++ b/src/monkeysphere-host
@@ -174,11 +174,6 @@ multi_key() {
if [[ -z "$1" || "$1" == '--all' ]] ; then
keys="${fprs[@]}"
- else
- for key in $keys ; do
- printf '%s\n' "${fprs[@]}" | grep "${key}$" \
- || failure "Key '$key' not found."
- done
fi
for key in $keys ; do
@@ -208,7 +203,10 @@ show_key() {
# create the ssh key
TMPSSH="$GNUPGHOME"/ssh_host_key_rsa_pub
- gpg --export "$id" | openpgp2ssh 2>/dev/null >"$TMPSSH"
+ if ! gpg --export "$id" 2>/dev/null \
+ | openpgp2ssh 2>/dev/null >"$TMPSSH" ; then
+ failure "Key '$id' not found."
+ fi
# get the gpg fingerprint
fingerprint=$(gpg --quiet --list-keys \
diff --git a/tests/basic b/tests/basic
index 15afa77..d9b7f44 100755
--- a/tests/basic
+++ b/tests/basic
@@ -567,7 +567,10 @@ echo "##################################################"
echo "### revoking ssh host key..."
# generate the revocation certificate and feed it directly to the test
# user's keyring (we're not publishing to the keyservers)
-monkeysphere-host revoke-key | gpg --import
+keyID=$(monkeysphere-host s 'https://testhost' | grep 'OpenPGP fingerprint:' | awk '{ print $3 }')
+monkeysphere-host revoke-key "$keyID" >"$TEMPDIR"/revcert
+cat "$TEMPDIR"/revcert
+<"$TEMPDIR"/revcert gpg --import
echo
echo "##################################################"
echo "### ssh connection test for failure..."