BUG/MINOR: qpack: abort on dynamic index field line decoding

Add an ABORT_NOW() clause if indexed field line referred to the dynamic
table. This is required as current haproxy QPACK implementation does not
support the dynamic table.

Note that this should not happen as haproxy explicitely advertizes a
null-sized dynamic table to the other peer.

This shoud fix github issue #1753.

No need to backport as this was introduced by commit
  b666c6b26e
  MINOR: qpack: improve decoding function
This commit is contained in:
Amaury Denoyelle 2022-06-20 15:47:46 +02:00
parent 23f908ccd6
commit debaa04f9e
1 changed files with 12 additions and 3 deletions

View File

@ -289,10 +289,10 @@ int qpack_decode_fs(const unsigned char *raw, size_t len, struct buffer *tmp,
else if (efl_type & QPACK_IFL_BIT) {
/* Indexed field line */
uint64_t index;
unsigned int t;
unsigned int static_tbl;
qpack_debug_printf(stderr, "indexed field line:");
t = efl_type & 0x40;
static_tbl = efl_type & 0x40;
index = qpack_get_varint(&raw, &len, 6);
if (len == (uint64_t)-1) {
qpack_debug_printf(stderr, "##ERR@%d\n", __LINE__);
@ -300,10 +300,19 @@ int qpack_decode_fs(const unsigned char *raw, size_t len, struct buffer *tmp,
goto out;
}
if (t) {
if (static_tbl) {
name = qpack_sht[index].n;
value = qpack_sht[index].v;
}
else {
/* TODO not implemented
*
* For the moment, this should never happen as
* currently we do not support dynamic table insertion
* and specify an empty table size.
*/
ABORT_NOW();
}
qpack_debug_printf(stderr, " t=%d index=%llu", !!t, (unsigned long long)index);
}