summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2008-08-20 21:01:12 -0400
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>2008-08-20 21:01:12 -0400
commit35f16f7e3eaa05b04e97337d7ef0188fb3050f8e (patch)
treea40c968fb8172bd06aa0e7b75bb03ae32aea095f /src/common
parent81b95ea5c16e589d89d082f9572ab8a8bd5fc54f (diff)
broke out ssh-askpass-style prompting (to feed to gpg); implemented first pass at monkeysphere subkey-to-ssh-agent.
Diffstat (limited to 'src/common')
-rw-r--r--src/common15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/common b/src/common
index 9d7deb7..6a62080 100644
--- a/src/common
+++ b/src/common
@@ -105,6 +105,21 @@ EOF
echo "$keyExpire"
}
+passphrase_prompt() {
+ local prompt="$1"
+ local fifo="$2"
+ local PASS
+
+ if [ "$DISPLAY" ] && which "${SSH_ASKPASS:-ssh-askpass}" >/dev/null; then
+ "${SSH_ASKPASS:-ssh-askpass}" "$prompt" > "$fifo"
+ else
+ read -s -p "$prompt" PASS
+ # Uses the builtin echo, so should not put the passphrase into
+ # the process table. I think. --dkg
+ echo "$PASS" > "$fifo"
+ fi
+}
+
# remove all lines with specified string from specified file
remove_line() {
local file