mirror of
https://github.com/curl/curl.git
synced 2026-08-24 19:03:40 +03:00
vtls_scache: check reentrancy
Track lock status of session cache, add DEBUGASSERT()s for proper calling sequences. Add check of lock status. Use lock status check to prevent reentry of import/export calls. Deny such calls with CURLE_RECURSIVE_API_CALL. Closes #21383
This commit is contained in:
parent
85e825770a
commit
5448495cfd
3 changed files with 29 additions and 9 deletions
|
|
@ -1339,6 +1339,8 @@ CURLcode curl_easy_ssls_import(CURL *curl, const char *session_key,
|
|||
struct Curl_easy *data = curl;
|
||||
if(!GOOD_EASY_HANDLE(data))
|
||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||
if(Curl_is_in_callback(data) || Curl_ssl_scache_is_locked(data))
|
||||
return CURLE_RECURSIVE_API_CALL;
|
||||
return Curl_ssl_session_import(data, session_key,
|
||||
shmac, shmac_len, sdata, sdata_len);
|
||||
#else
|
||||
|
|
@ -1360,6 +1362,8 @@ CURLcode curl_easy_ssls_export(CURL *curl,
|
|||
struct Curl_easy *data = curl;
|
||||
if(!GOOD_EASY_HANDLE(data))
|
||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||
if(Curl_is_in_callback(data) || Curl_ssl_scache_is_locked(data))
|
||||
return CURLE_RECURSIVE_API_CALL;
|
||||
return Curl_ssl_session_export(data, export_fn, userptr);
|
||||
#else
|
||||
(void)curl;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue