Repository navigation
Fix: Fenrir F-12569 - #11955
Draft
ohki-saito wants to merge 1 commit into
Draft
Fix: Fenrir F-12569#11955ohki-saito wants to merge 1 commit into
ohki-saito wants to merge 1 commit into
Conversation
|
Can one of the admins verify this patch? |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The fault-injection callbacks allocate pkey and cert with raw malloc, but restoring the tracked allocator causes incompatible frees and invalid memory access in WOLFSSL_TRACK_MEMORY builds.
1 open issue
What changed in this PR
Addresses Fenrir F-12569 by making wolfSSL_PKCS12_parse() report main-certificate parsing failures instead of returning success with a partially decoded X509.
Changes:
- Routes main-certificate parsing errors through existing cleanup logic.
- Adds and registers an allocation-failure regression test that checks returned certificates have a public key.
| File | Description |
|---|---|
tests/api/test_ossl_p7p12.h |
Declares and registers the new regression test. |
tests/api/test_ossl_p7p12.c |
Adds allocation-failure injection and certificate validation. |
src/ssl_p7p12.c |
Propagates main-certificate parsing failures through error handling. |
Review effort: Balanced
| pkcs12_fail_alloc_at = -1; | ||
| } | ||
|
|
||
| (void)wolfSSL_SetAllocators(prevM, prevF, prevR); |
Member
|
Okay to test. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Fenrir Finding F-12569
wolfSSL_PKCS12_parse()ignored aParseCertRelative()failure for the main certificate and returned success with a partially decoded X509. It now returns an error, as the CA certificate path already does. This failure is reachable through an allocation failure.Testing
Added
test_wolfSSL_PKCS12_parse_main_cert_oom, which fails each allocation in turn and checks that any returned certificate has a public key.Checklist