tg.AddTestGroup(FlowControl())
tg.AddTestGroup(ConnectMethod())
tg.AddTestGroup(ExtendedConnectMethod())
+ tg.AddTestGroup(PingAnomaly())
return tg
}
return tg
}
+
+func PingAnomaly() *spec.TestGroup {
+ tg := NewTestGroup("4", "Data Leakage")
+ tg.AddTestCase(&spec.TestCase{
+ Desc: "1-byte extra",
+ Requirement: "The endpoint MUST terminate the connection with a connection error of type PROTOCOL_ERROR.",
+ Run: func(c *config.Config, conn *spec.Conn) error {
+ err := conn.Handshake()
+ if err != nil {
+ return err
+ }
+ conn.Send([]byte("\x00\x00\x08\x06\x00\x00\x00\x00\x00\x00\xDE\xAD\xBE\xEF\xDE\xAD\xBE\xEF"))
+ return spec.VerifyConnectionError(conn, http2.ErrCodeProtocol)
+ },
+ })
+ return tg
+}
http_io_ts_drain (hc, HTTP2_FRAME_HEADER_SIZE);
to_deq -= fh.length;
+ /* to prevent data leakage */
+ if (to_deq && to_deq < HTTP2_FRAME_HEADER_SIZE)
+ {
+ HTTP_DBG (1, "to_deq %u is less than frame header size", to_deq);
+ http2_connection_error (hc, HTTP2_ERROR_PROTOCOL_ERROR, 0);
+ return;
+ }
+
HTTP_DBG (1, "frame type 0x%02x len %u", fh.type, fh.length);
if ((h2c->flags & HTTP2_CONN_F_EXPECT_CONTINUATION) &&