mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-05 09:20:55 +02:00
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:
+15
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user