From 3aefeeff0f82de97c2892cbb62f5100aaecf45e2 Mon Sep 17 00:00:00 2001 From: Tim Byrne Date: Sat, 30 Nov 2019 18:56:17 -0600 Subject: [PATCH] Create pinentry-mock This is a program which adheres to the pinentry protocol. It always provides the password located in /etc/mock-password. --- test/pinentry-mock | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 test/pinentry-mock diff --git a/test/pinentry-mock b/test/pinentry-mock new file mode 100755 index 0000000..d40033b --- /dev/null +++ b/test/pinentry-mock @@ -0,0 +1,12 @@ +#!/bin/bash +# This program is a custom mock pinentry program +# It always uses whatever password is found in the /tmp directory +password="$(cat /tmp/mock-password 2>/dev/null)" +echo "OK Pleased to meet you" +while read -r line; do + if [[ $line =~ GETPIN ]]; then + echo -n "D " + echo "$password" + fi + echo "OK"; +done