aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDale Phurrough <dale@hidale.com>2018-11-16 17:54:53 +0100
committerDale Phurrough <dale@hidale.com>2018-11-16 17:54:53 +0100
commita037c4f9feeb69cffb9a06c9b928f4159f5527d7 (patch)
tree50759756fbbe71cce43407075118ffe380ecfe43
parent13c1b4e13e1d195bd47d12300a516a5e831e1641 (diff)
downloadpinentry-rofi-a037c4f9feeb69cffb9a06c9b928f4159f5527d7.tar.gz
return OK for SETDESC in cases without keys/ids
-rw-r--r--pinentry-wsl-ps1.sh15
1 files changed, 10 insertions, 5 deletions
diff --git a/pinentry-wsl-ps1.sh b/pinentry-wsl-ps1.sh
index 779ad8c..55ca67c 100644
--- a/pinentry-wsl-ps1.sh
+++ b/pinentry-wsl-ps1.sh
@@ -36,7 +36,7 @@ NOTIFY="1"
DEBUGLOG=""
# Do not casually edit the below values
-VERSION="0.2.0"
+VERSION="0.2.1"
TIMEOUT="0"
DESCRIPTION="Enter password for GPG key"
PROMPT="Password:"
@@ -86,10 +86,14 @@ assuan_result() {
# GUI dialogs for passwords; text is dynamically set by gpg-agent via protocol
getpassword() {
- if [ -n $CACHEUSER ]; then
+ if [ -n "$CACHEUSER" ]; then
local creduser="$CACHEUSER"
else
- local creduser="$KEYINFO"
+ if [ -n "$KEYINFO" ]; then
+ local creduser="$KEYINFO"
+ else
+ local creduser="--not yet defined--"
+ fi
fi
local cmd_prompt=$(cat <<-DLM
\$cred = \$Host.ui.PromptForCredential("$TITLE",
@@ -275,7 +279,7 @@ decodegpgagentstr() {
}
# commonly used to set main text in GUI dialog boxes
-# also parses for key ids to display in GUI prompts
+# also parses for key ids to display in GUI prompts
setdescription() {
DESCRIPTION="$(decodegpgagentstr "$1")"
local searchfor='ID ([[:xdigit:]]{16})' # hack to search for first gpg key id in description
@@ -290,6 +294,7 @@ setdescription() {
echo "OK"
return
fi
+ echo "OK"
}
setprompt() {
@@ -312,7 +317,7 @@ setkeyinfo() {
KEYINFO=""
else
KEYINFO="$1"
- fi
+ fi
echo "OK"
}