]>
Dogcows Code - chaz/p5-File-KDBX/blob - t/files/bin/ykchalresp
3 # This is a fake ykchalresp program that provides canned responses, for testing.
11 getopts
('12HNn:i:', \
%opts);
13 my ($device, $hmac, $nonblocking, $in) = @opts{qw(n H N i)};
16 print STDERR
"HMAC-SHA1 not requested\n";
19 elsif (!defined($in) || $in ne '-') {
21 print STDERR
"Unexpected input file: $in\n";
25 my $challenge = <STDIN
>;
27 my $mock = $ENV{YKCHALRESP_MOCK
} || '';
28 if ($mock eq 'block') {
30 print STDERR
"Yubikey core error: operation would block\n";
36 elsif ($mock eq 'error') {
37 my $resp = $ENV{YKCHALRESP_ERROR
} || 'not yet implemented';
38 print STDERR
"Yubikey core error: $resp\n";
41 elsif ($mock eq 'usberror') {
42 print STDERR
"USB error: something happened\n";
50 my $resp = $ENV{YKCHALRESP_RESPONSE
} || 'f000000000000000000000000000000000000000';
This page took 0.036557 seconds and 4 git commands to generate.