File: 0001-tests-add-a-http-1.1-header-to-the-ykval-mock.patch

package info (click to toggle)
yubico-pam 2.26-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 2,076 kB
  • sloc: sh: 12,129; ansic: 2,434; perl: 117; makefile: 114
file content (36 lines) | stat: -rw-r--r-- 1,044 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From 7926f8dd41c007cbe19751d4ecfd0618dd937962 Mon Sep 17 00:00:00 2001
From: Klas Lindfors <klas@yubico.com>
Date: Thu, 16 Apr 2020 10:59:35 +0200
Subject: tests: add a http/1.1 header to the ykval mock

it lies a bit more convincingly like this
fixes #202
---
 tests/aux/ykval.pl | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/aux/ykval.pl b/tests/aux/ykval.pl
index d7f2b1c..60f980d 100755
--- a/tests/aux/ykval.pl
+++ b/tests/aux/ykval.pl
@@ -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;
 }
-- 
2.20.1