summaryrefslogtreecommitdiff
path: root/src/share/mh
diff options
context:
space:
mode:
Diffstat (limited to 'src/share/mh')
-rw-r--r--src/share/mh/add_hostname6
-rw-r--r--src/share/mh/add_revoker4
-rw-r--r--src/share/mh/import_key15
-rw-r--r--src/share/mh/revoke_hostname8
4 files changed, 26 insertions, 7 deletions
diff --git a/src/share/mh/add_hostname b/src/share/mh/add_hostname
index 0da6a06..ec741ee 100644
--- a/src/share/mh/add_hostname
+++ b/src/share/mh/add_hostname
@@ -32,8 +32,10 @@ find_host_userid > /dev/null && \
failure "Host userID '$userID' already exists."
if [ "$PROMPT" = "true" ] ; then
- echo "The following user ID will be added to the host key:"
- echo " $userID"
+ cat <<EOF
+The following user ID will be added to the host key:
+ $userID
+EOF
read -p "Are you sure you would like to add this user ID? (Y/n) " OK; OK=${OK:=Y}
if [ "${OK/y/Y}" != 'Y' ] ; then
failure "User ID not added."
diff --git a/src/share/mh/add_revoker b/src/share/mh/add_revoker
index 428b958..18ad2b7 100644
--- a/src/share/mh/add_revoker
+++ b/src/share/mh/add_revoker
@@ -80,8 +80,8 @@ else
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}
+ echo "Are you sure you want to add the above key as a revoker"
+ read -p "of the host key? (Y/n) " OK; OK=${OK:-Y}
if [ "${OK/y/Y}" != 'Y' ] ; then
failure "revoker not added."
fi
diff --git a/src/share/mh/import_key b/src/share/mh/import_key
index 040b41c..7c11890 100644
--- a/src/share/mh/import_key
+++ b/src/share/mh/import_key
@@ -44,6 +44,21 @@ fi
userID="ssh://${hostName}"
+if [ "$PROMPT" = "true" ] ; then
+ cat <<EOF
+The ssh key will be imported and an OpenPGP certificate for this host
+will be generated with the following user ID:
+ $userID
+EOF
+ read -p "Are you sure you would like to create certificate? [Y/n] " OK; OK=${OK:-Y}
+ if [ "${OK/y/Y}" != 'Y' ] ; then
+ failure "revoker not added."
+ fi
+else
+ log debug "importing key without prompting."
+fi
+
+
# create host home
mkdir -p "${MHDATADIR}"
mkdir -p "${GNUPGHOME_HOST}"
diff --git a/src/share/mh/revoke_hostname b/src/share/mh/revoke_hostname
index 71b56ed..1215828 100644
--- a/src/share/mh/revoke_hostname
+++ b/src/share/mh/revoke_hostname
@@ -43,9 +43,11 @@ uidIndex=$(find_host_userid) || \
failure "No non-revoked user ID found matching '$userID'."
if [ "$PROMPT" = "true" ] ; then
- echo "The following host key user ID will be revoked:"
- echo " $userID"
- read -p "Are you sure you would like to revoke this user ID? (N/y) " OK; OK=${OK:=Y}
+ cat <<EOF
+The following host key user ID will be revoked:
+ $userID
+EOF
+ read -p "Are you sure you would like to revoke this user ID? (Y/n) " OK; OK=${OK:=Y}
if [ "${OK/y/Y}" != 'Y' ] ; then
failure "User ID not revoked."
fi