mirror of
git://git.gnupg.org/gnupg.git
synced 2024-09-05 12:36:22 +02:00
![Daniel Kahn Gillmor](/assets/img/avatar_default.png)
* tests/fake-pinentries/README.txt and tests/fake-pinentries/fake-pinentry.{sh,py,pl,php}}: New public domain (CC0) files to encourage better test suite practices from downstream developers. * tests/fake-pinentries/COPYING (new): a copy of https://creativecommons.org/publicdomain/zero/1.0/legalcode.txt Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
28 lines
822 B
PHP
Executable File
28 lines
822 B
PHP
Executable File
#!/usr/bin/php
|
|
<?php
|
|
# Use this for your test suites when a PHP 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.
|
|
|
|
print("OK This is only for test suites, and should never be used in production\n");
|
|
while (true) {
|
|
$line = fgets(STDIN);
|
|
if (False === $line)
|
|
break;
|
|
$line = strtolower(trim($line));
|
|
if (($line === "") || ($line[0] == '#'))
|
|
continue;
|
|
if ((0 === strncmp("getpin", $line, 6)))
|
|
print("D passphrase\n");
|
|
print("OK\n");
|
|
if ((0 === strncmp("bye", $line, 3)))
|
|
break;
|
|
}
|
|
?>
|