summaryrefslogtreecommitdiffstats
path: root/src/qpack-dec.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:20:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:20:30 +0000
commitddfc40eabdbc59a607b568e946fb116dcd3439fd (patch)
treeb3253de65399448dbbf12e5b65d2da56c53d3af6 /src/qpack-dec.c
parentAdding upstream version 2.9.6. (diff)
downloadhaproxy-ddfc40eabdbc59a607b568e946fb116dcd3439fd.tar.xz
haproxy-ddfc40eabdbc59a607b568e946fb116dcd3439fd.zip
Adding upstream version 2.9.7.upstream/2.9.7
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/qpack-dec.c')
-rw-r--r--src/qpack-dec.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/qpack-dec.c b/src/qpack-dec.c
index 97392bb..7a8726f 100644
--- a/src/qpack-dec.c
+++ b/src/qpack-dec.c
@@ -135,6 +135,19 @@ int qpack_decode_enc(struct buffer *buf, int fin, void *ctx)
}
else if (inst & QPACK_ENC_INST_SDTC_BIT) {
/* Set dynamic table capacity */
+ int capacity = *b_head(buf) & 0x1f;
+
+ /* RFC 9204 4.3.1. Set Dynamic Table Capacity
+ *
+ * The decoder MUST treat a new dynamic table capacity
+ * value that exceeds this limit as a connection error of type
+ * QPACK_ENCODER_STREAM_ERROR.
+ */
+ if (capacity) {
+ qcc_set_error(qcs->qcc, QPACK_ENCODER_STREAM_ERROR, 1);
+ return -1;
+ }
+
}
return 0;
@@ -173,6 +186,18 @@ int qpack_decode_dec(struct buffer *buf, int fin, void *ctx)
inst = (unsigned char)*b_head(buf) & QPACK_DEC_INST_BITMASK;
if (inst == QPACK_DEC_INST_ICINC) {
/* Insert count increment */
+
+ /* RFC 9204 4.4.3. Insert Count Increment
+ *
+ * An encoder that receives an Increment field equal to zero, or one
+ * that increases the Known Received Count beyond what the encoder has
+ * sent, MUST treat this as a connection error of type
+ * QPACK_DECODER_STREAM_ERROR.
+ */
+
+ /* For the moment haproxy does not emit dynamic table insertion. */
+ qcc_set_error(qcs->qcc, QPACK_DECODER_STREAM_ERROR, 1);
+ return -1;
}
else if (inst & QPACK_DEC_INST_SACK) {
/* Section Acknowledgment */