summaryrefslogtreecommitdiffstats
path: root/tests/fake-pinentries/fake-pinentry.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 16:14:06 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 16:14:06 +0000
commiteee068778cb28ecf3c14e1bf843a95547d72c42d (patch)
tree0e07b30ddc5ea579d682d5dbe57998200d1c9ab7 /tests/fake-pinentries/fake-pinentry.sh
parentInitial commit. (diff)
downloadgnupg2-eee068778cb28ecf3c14e1bf843a95547d72c42d.tar.xz
gnupg2-eee068778cb28ecf3c14e1bf843a95547d72c42d.zip
Adding upstream version 2.2.40.upstream/2.2.40upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/fake-pinentries/fake-pinentry.sh')
-rwxr-xr-xtests/fake-pinentries/fake-pinentry.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/fake-pinentries/fake-pinentry.sh b/tests/fake-pinentries/fake-pinentry.sh
new file mode 100755
index 0000000..44aca21
--- /dev/null
+++ b/tests/fake-pinentries/fake-pinentry.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+# Use this for your test suites when a POSIX shell is available.
+#
+# The encrypted keys in your test suite that you expect to work must
+# be locked with a passphrase of "passphrase"
+#
+# Author: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
+#
+# License: Creative Commons Zero ("Public Domain Dedication") --
+# Anyone may reuse it, modify it, redistribute it for any purpose.
+
+echo "OK This is only for test suites, and should never be used in production"
+while read cmd rest; do
+ cmd=$(printf "%s" "$cmd" | tr 'A-Z' 'a-z')
+ if [ -z "$cmd" ]; then
+ continue;
+ fi
+ case "$cmd" in
+ \#*)
+ ;;
+ getpin)
+ echo "D passphrase"
+ echo "OK"
+ ;;
+ bye)
+ echo "OK"
+ exit 0
+ ;;
+ *)
+ echo "OK"
+ ;;
+ esac
+done