Create pinentry-mock
This is a program which adheres to the pinentry protocol. It always provides the password located in /etc/mock-password.
This commit is contained in:
parent
4d23bbcf11
commit
3aefeeff0f
1 changed files with 12 additions and 0 deletions
12
test/pinentry-mock
Executable file
12
test/pinentry-mock
Executable file
|
@ -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
|
Loading…
Reference in a new issue