add exact-boundary tests at wolfssl_quic_max_record_capacity and cap+1 to catch off-by-onee mutations in the early data capacity check

This commit is contained in:
Reda Chouk
2026-04-15 14:36:35 +02:00
parent ef4e11b016
commit 1576cf9edc
+15 -1
View File
@@ -412,7 +412,21 @@ static int test_quic_record_cap(void) {
wolfSSL_free(ssl);
ssl = NULL;
/* early_data within cap must succeed */
/* early_data at exactly cap must succeed */
ExpectNotNull(ssl = wolfSSL_new(ctx));
ExpectTrue(provide_data(ssl, wolfssl_encryption_early_data, buf,
WOLFSSL_QUIC_MAX_RECORD_CAPACITY, 0));
wolfSSL_free(ssl);
ssl = NULL;
/* early_data at cap+1 must be rejected */
ExpectNotNull(ssl = wolfSSL_new(ctx));
ExpectTrue(provide_data(ssl, wolfssl_encryption_early_data, buf,
(size_t)WOLFSSL_QUIC_MAX_RECORD_CAPACITY + 1U, 1));
wolfSSL_free(ssl);
ssl = NULL;
/* early_data well within cap must succeed */
ExpectNotNull(ssl = wolfSSL_new(ctx));
ExpectTrue(provide_data(ssl, wolfssl_encryption_early_data, buf, 1024, 0));
wolfSSL_free(ssl);