Repository navigation
Conversation
This reverts commit b964260.
There was a problem hiding this comment.
Pull request overview
This PR updates curl’s wolfSSL backend handshake error handling to recognize wolfSSL’s ASN_PARSE_E (seen with wolfSSL 5.9.2 on bad ASN input) and map it to CURLE_PEER_FAILED_VERIFICATION, aligning the return code with certificate/verification failures and restoring expected behavior for test 0311.
Changes:
- Add explicit handling for
ASN_PARSE_Ereturned bywolfSSL_get_error()duringwolfSSL_connect(). - Return
CURLE_PEER_FAILED_VERIFICATION(instead of falling through to the generic SSL error path) when ASN parsing fails.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I'm not sure treating such a generic ASN.1 problem as a failed verification is what we should do. It seems to be possible to get this error for a very large variety of different ASN1 errors. I would probably argue that it is wrong for wolfSSL to return this error for this problem as the ASN1 is fine, it just has a combo of data that does not match. |
|
This was based on the assumption that the wolfSSL fix is here to stay, as I guess then we just skip this wolfSSL version and bump once it's fixed? Closing this one, since I have no better proposal. edit: there were a number of changes to ASN handling and new conditions returning this error; it might not have been a CVE fix after all. |
Assuming they think it is a problem and will fix it, sure, otherwise we need to do something. |
Apply upstream patch to fix a regression in 5.9.2. Refs: wolfSSL/wolfssl#10790 wolfSSL/wolfssl#10793 wolfSSL/wolfssl@7dd269f Ref: #22175 (local mitigation attempt) Fixes #22160 Closes #22204
Homebrew is distributing v5.9.2 at the time of this commit, which contains known regression failing to parse the server certificate. The fix has been merged upstream. Till it makes it into a release and Homebrew, ignore test results for 311. Refs: wolfSSL/wolfssl#10793 wolfSSL/wolfssl@7dd269f Follow-up to 03f9751 #22204 #22175 #22160 Closes #22269
wolfSSL 5.9.2 started returning a new code on bad ASN input. Catch it in
curl and return
CURLE_PEER_FAILED_VERIFICATION, to avoid the genericerror handler path returning
CURLE_COULDNT_CONNECT, also breaking test311.
ASN_PARSE_Eis present in the earliest supported wolfSSL (5.0.0).Fixing:
In CI jobs:
Linux / AM wolfssl-all
Linux / AM wolfssl-opensslextra valgrind 1
Linux HTTP/3 / CM wolfssl
Bug: #22160 (comment)
Ref: #22160
Tested OK with #22160 applied:
https://github.com/curl/curl/actions/runs/28186561610/job/83489932278
https://github.com/curl/curl/actions/runs/28186561610/job/83489932261
https://github.com/curl/curl/actions/runs/28186561580/job/83490299954?pr=22175