From bc3e4207c697f6380398138d8836fe4329e57207 Mon Sep 17 00:00:00 2001 From: Walid Boudebouda Date: Fri, 8 Sep 2023 17:54:43 +0200 Subject: [PATCH] vtc: More HPACK header validation coverage Adds coverage for tab characters at start/end of field value. Regarding the "fo o" " bar" header, it cumulates an error in the name and another in the value, but only one of them will trigger the expected PROTOCOL_ERROR. Only the invalid "fo o" is checked now, and the other error is part of the new coverage. Signed-off-by: Dridi Boukelmoune --- bin/varnishtest/tests/t02023.vtc | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/bin/varnishtest/tests/t02023.vtc b/bin/varnishtest/tests/t02023.vtc index 5f5f434bf55..388f3a70ad1 100644 --- a/bin/varnishtest/tests/t02023.vtc +++ b/bin/varnishtest/tests/t02023.vtc @@ -30,6 +30,7 @@ client c1 { stream 1 { txreq -url "" rxrst + expect rst.err == PROTOCOL_ERROR } -run } -run @@ -37,6 +38,7 @@ client c1 { stream 1 { txreq -scheme "" rxrst + expect rst.err == PROTOCOL_ERROR } -run } -run @@ -44,6 +46,7 @@ client c1 { stream 1 { txreq -req "" rxrst + expect rst.err == PROTOCOL_ERROR } -run } -run @@ -51,8 +54,9 @@ varnish v1 -vsl_catchup client c1 { stream 1 { - txreq -hdr "fo o" " bar" + txreq -hdr "foo" " bar" rxrst + expect rst.err == PROTOCOL_ERROR } -run } -run @@ -60,6 +64,7 @@ client c1 { stream 1 { txreq -hdr "foo" " " rxrst + expect rst.err == PROTOCOL_ERROR } -run } -run @@ -67,6 +72,7 @@ client c1 { stream 1 { txreq -hdr ":foo" "bar" rxrst + expect rst.err == PROTOCOL_ERROR } -run } -run @@ -74,6 +80,7 @@ client c1 { stream 1 { txreq -hdr "foo" "b\x0car" rxrst + expect rst.err == PROTOCOL_ERROR } -run } -run @@ -81,6 +88,7 @@ client c1 { stream 1 { txreq -hdr "f o" "bar" rxrst + expect rst.err == PROTOCOL_ERROR } -run } -run @@ -88,6 +96,7 @@ client c1 { stream 1 { txreq -hdr "f: o" "bar" rxrst + expect rst.err == PROTOCOL_ERROR } -run } -run @@ -95,5 +104,22 @@ client c1 { stream 1 { txreq -hdr "foo" "bar " rxrst + expect rst.err == PROTOCOL_ERROR + } -run +} -run + +client c1 { + stream 1 { + txreq -hdr "foo" " bar" + rxrst + expect rst.err == PROTOCOL_ERROR + } -run +} -run + +client c1 { + stream 1 { + txreq -hdr "foo" "bar " + rxrst + expect rst.err == PROTOCOL_ERROR } -run } -run