[7.4] 4224a78fa vtc: More HPACK header validation coverage

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Mon Oct 23 17:18:11 UTC 2023


commit 4224a78fa7932e35609ef8e4aa81a93e033ef696
Author: Walid Boudebouda <walid.boudebouda at gmail.com>
Date:   Fri Sep 8 17:54:43 2023 +0200

    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 <dridi.boukelmoune at gmail.com>

diff --git a/bin/varnishtest/tests/t02023.vtc b/bin/varnishtest/tests/t02023.vtc
index 5f5f434bf..388f3a70a 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


More information about the varnish-commit mailing list