openssl: Fix openssl engines

- Return CURLE_OK if the engine successfully loaded.

Prior to this change:

When loading an openssl engine, the result code is initialized to
CURLE_SSL_ENGINE_NOTFOUND, but is never set to CURLE_OK when the engine
was successfully loaded. This causes curl to error out, falsely stating
engine not found when it actually was.

Broken since f2ce6c46 (precedes 8.14.0) which added support for using
engines and providers at the same time.

Fixes https://github.com/curl/curl/issues/17617
Closes https://github.com/curl/curl/pull/17618
This commit is contained in:
Theodore A. Roth 2025-06-12 11:36:02 -06:00 committed by Jay Satiro
parent 2f312a14da
commit 17f2a220a9

View file

@ -1907,6 +1907,9 @@ static CURLcode ossl_set_engine(struct Curl_easy *data, const char *name)
result = CURLE_SSL_ENGINE_INITFAILED;
e = NULL;
}
else {
result = CURLE_OK;
}
data->state.engine = e;
return result;
}