summaryrefslogtreecommitdiffstats
path: root/tests/fake-pinentries/fake-pinentry.pl
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fake-pinentries/fake-pinentry.pl')
-rwxr-xr-xtests/fake-pinentries/fake-pinentry.pl27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/fake-pinentries/fake-pinentry.pl b/tests/fake-pinentries/fake-pinentry.pl
new file mode 100755
index 0000000..8cb337d
--- /dev/null
+++ b/tests/fake-pinentries/fake-pinentry.pl
@@ -0,0 +1,27 @@
+#!/usr/bin/perl -w
+# Use this for your test suites when a perl interpreter 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.
+
+use strict;
+use warnings;
+
+# turn off buffering
+$| = 1;
+
+print "OK This is only for test suites, and should never be used in production\n";
+while (<STDIN>) {
+ chomp;
+ next if (/^$/);
+ next if (/^#/);
+ print ("D passphrase\n") if (/^getpin/i);
+ print "OK\n";
+ exit if (/^bye/i);
+}
+1;