1
0
mirror of https://github.com/Yubico/yubico-pam.git synced 2024-11-29 00:24:11 +01:00

tests: add a http/1.1 header to the ykval mock

it lies a bit more convincingly like this
fixes #202
This commit is contained in:
Klas Lindfors 2020-04-16 10:59:35 +02:00
parent 2cddac559c
commit 7926f8dd41
No known key found for this signature in database
GPG Key ID: BCA00FD4B2168C0A

View File

@ -54,7 +54,8 @@ warn "YKVAL mockup started on $port";
while(1) {
my $clientsocket = $socket->accept();
my $clientdata = <$clientsocket>;
my $ret = "h=ZrU7UfjwazJVf5ay1P/oC3XCQlI=\n";
my $ret = "HTTP/1.1 200 OK\n\n";
$ret .= "h=ZrU7UfjwazJVf5ay1P/oC3XCQlI=\n";
if($clientdata =~ m/nonce=([a-zA-Z0-9]+).*otp=([cbdefghijklnrtuv]+)/) {
my $nonce = $1;
@ -71,6 +72,6 @@ while(1) {
} else {
$ret .= "status=MISSING_PARAMETER";
}
print $clientsocket "\n$ret\n";
print $clientsocket "$ret\n";
close $clientsocket;
}