Skip to content
Open
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
bdd4a5b
Cover both allocation failures in TLS DH parameter copying
danielinux Nov 27, 2026
4139704
Exercise TLS ChaCha and Poly1305 key allocation failures
danielinux Nov 27, 2026
9e078d4
Verify TLS DH parameter ownership across copies and failures
danielinux Nov 27, 2026
223c5d6
Exercise Extended Master Secret key derivation decisions
danielinux Nov 27, 2026
62e486c
Exercise TLS suite and handshake key ownership guards
danielinux Nov 27, 2026
1b1fe73
Exercise TLS reads after deterministic transport errors
danielinux Nov 27, 2026
221e021
Cover TLS protocol classifiers and fatal alert errors
danielinux Nov 27, 2026
a80ed8a
Cover TLS signature constraints, hash copy and DTLS sequence limits
danielinux Nov 27, 2026
9fbcca5
Cover TLS hash output guards and retained transcript copies
danielinux Nov 27, 2026
05664da
Cover TLS signature scheme encoding and DTLS message lists
danielinux Nov 27, 2026
28f469a
Exercise TLS FFDHE helper argument and capacity checks
danielinux Nov 27, 2026
6ba7455
Cover TLS ECC signature digest length bounds
danielinux Nov 27, 2026
03e493b
Exercise cleanup ownership for X25519 and X448 keys
danielinux Nov 27, 2026
959fd91
Cover TLS hostname and wildcard policy decisions
danielinux Nov 27, 2026
6d15a9d
Exercise TLS suite credentials and context ownership checks
danielinux Nov 27, 2026
5e04774
Exercise TLS RSA signature algorithm dispatch
danielinux Nov 27, 2026
cd2d0bf
Verify TLS handshake transcript copying and error propagation
danielinux Nov 27, 2026
939329f
Sweep allocation failures during native TLS handshakes
danielinux Nov 27, 2026
b009dc5
Test native TLS transport retry and buffer retention
danielinux Nov 27, 2026
8b0fa2e
Cover native peer key decoding and minimum size policy
danielinux Nov 27, 2026
599e4ac
Cover TLS RSA signature selection and PSS parameter policy
danielinux Nov 27, 2026
d137eed
Cover TLS key exchange and transcript preconditions
danielinux Nov 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions tests/unit-mcdc/test_internal_nullguard_whitebox.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
#include <wolfssl/options.h>

#include <src/internal.c>
#include "mcdc_fault_alloc.h"

#include <stdio.h>
#include <string.h>
Expand Down Expand Up @@ -95,6 +96,37 @@ static void wb_reset(WbFix* f)
f->ssl->version.minor = TLSv1_2_MINOR;
}

#if !defined(NO_DH) && !defined(MCDC_FA_UNAVAILABLE) && \
!defined(HAVE_FIPS) && !defined(HAVE_SELFTEST)
static int wb_copy_dh_params(WbFix* f)
{
byte prime = 23;
byte generator = 2;
int ret, firstError, secondError;

wb_reset(f);
f->ctx->serverDH_P.buffer = &prime;
f->ctx->serverDH_P.length = 1;
f->ctx->serverDH_G.buffer = &generator;
f->ctx->serverDH_G.length = 1;

mcdc_fa_install();
mcdc_fa_arm_only(1);
firstError = CopySSL_CTX_DhParams(f->ssl, f->ctx);
mcdc_fa_arm_only(2);
secondError = CopySSL_CTX_DhParams(f->ssl, f->ctx);
mcdc_fa_restore();

ret = CopySSL_CTX_DhParams(f->ssl, f->ctx);
if (f->ssl->buffers.weOwnDH) {
XFREE(f->ssl->buffers.serverDH_P.buffer, NULL, DYNAMIC_TYPE_PUBLIC_KEY);
XFREE(f->ssl->buffers.serverDH_G.buffer, NULL, DYNAMIC_TYPE_PUBLIC_KEY);
}
wb_reset(f);
return firstError == MEMORY_E && secondError == MEMORY_E && ret == 0;
}
#endif

/* ------------------------------------------------- SupportedHashSigAlgo
*
* `if (ssl == NULL || hashSigAlgo == NULL)` and, after WOLFSSL_SUITES(ssl),
Expand Down Expand Up @@ -560,6 +592,12 @@ int main(void)
wb_get_real_session_id(&f);
#endif

#if !defined(NO_DH) && !defined(MCDC_FA_UNAVAILABLE) && \
!defined(HAVE_FIPS) && !defined(HAVE_SELFTEST)
if (!wb_copy_dh_params(&f))
puts("internal null-guard white-box: with failures (DH param copy)");
#endif

printf("internal null-guard white-box: %d static-guard calls\n", g_calls);

done:
Expand Down
Loading