[prev in list] [next in list] [prev in thread] [next in thread] 

List:       varnish-commit
Subject:    [master] bc3e4207c vtc: More HPACK header validation coverage
From:       Dridi Boukelmoune <dridi.boukelmoune () gmail ! com>
Date:       2023-09-26 13:02:06
Message-ID: 20230926130206.DFEE91118BD () lists ! varnish-cache ! org
[Download RAW message or body]


commit bc3e4207c697f6380398138d8836fe4329e57207
Author: Walid Boudebouda <walid.boudebouda@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@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
_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic