aboutsummaryrefslogtreecommitdiffstats
path: root/test/mfail/mfail.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove remaining atoi()/atol() callsMounir IDRASSI2026-07-291-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the remaining direct atoi()/atol() uses across apps, libcrypto, libssl, providers, demos and tests, and route the replacements through checked helpers instead of open-coding the conversion at each call site: - apps use the existing opt_int()/opt_long()/opt_int_arg() parsers; - libcrypto and provider code use the new internal ossl_strtol()/ ossl_strtoint() helpers, a checked (and, for ossl_strtoint(), narrowing) signed counterpart to the public OPENSSL_strtoul(); - libssl, demos and tests use OPENSSL_strtoul(); the test code shares a single test_strtoint() helper rather than repeating the bound check and cast per file; - unsigned values use OPENSSL_strtoul(), with call-site-specific range checks before narrowing where the destination type requires it. Reject conversion failures and narrow through the helpers rather than acting on garbage, and preserve the signed RSA-PSS saltlen sentinels while rejecting invalid numeric strings. Add regression coverage for the invalid RSA-PSS saltlen string path. Fixes #8216 Assisted-by: OpenCode:GLM-5.2 Reviewed-by: Tom Cosgrove <[email protected]> Reviewed-by: Tim Hudson <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> MergeDate: Wed Jul 29 17:02:18 2026 (Merged from https://github.com/openssl/openssl/pull/31731)
* mfail: add sampled and count-only modes to test driverJakub Zelenka2026-07-131-4/+28
| | | | | | | | | | | | | | Sampled tests cap allocation-failure injection at a fixed number of sampled points, running exhaustively when the allocation count is below that. Non-sampled tests fall back to counting only on non-cached-fetch builds, where exhaustive injection is impractical. Assisted-by: Claude:claude-opus-4-8 Reviewed-by: Nikola Pajkovsky <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> MergeDate: Mon Jul 13 09:43:50 2026 (Merged from https://github.com/openssl/openssl/pull/31780)
* mfail: do not count allocations for no file when checkedJakub Zelenka2026-06-111-3/+8
| | | | | | | | | This skips some debug and error allocations that cannot be handled Reviewed-by: Norbert Pocs <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> MergeDate: Thu Jun 11 16:00:14 2026 (Merged from https://github.com/openssl/openssl/pull/31356)
* Extend and separate mfail test frameworkJakub Zelenka2026-05-181-0/+367
Separate the mfail framework so it can be used beyond testutil. Specifically, this is a step toward using it in fuzzing. This change also improves the way mfail tests are executed. It first counts the number of allocations and then iterates through them. This has a couple of advantages: - It allows removal of MFAIL_SLOW_TEST by identifying slow tests based on the number of allocations. - It allows non-failing tests to be ignored. In addition, it adds a new environment variable to print a backtrace on memory failure. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Nikola Pajkovsky <[email protected]> MergeDate: Mon May 18 07:23:52 2026 (Merged from https://github.com/openssl/openssl/pull/31144)