mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:41:40 +03:00
mbedtls: move the crypto init into the vtls init function
Follow-up to 3a305831d1
Closes #19108
This commit is contained in:
parent
d6c39cd2cb
commit
e29706d6e2
2 changed files with 5 additions and 29 deletions
29
lib/easy.c
29
lib/easy.c
|
|
@ -80,10 +80,6 @@
|
|||
|
||||
#include "easy_lock.h"
|
||||
|
||||
#ifdef USE_MBEDTLS
|
||||
#include <psa/crypto.h>
|
||||
#endif
|
||||
|
||||
/* The last 2 #include files should be in this order */
|
||||
#include "curl_memory.h"
|
||||
#include "memdebug.h"
|
||||
|
|
@ -141,24 +137,6 @@ curl_calloc_callback Curl_ccalloc = (curl_calloc_callback)calloc;
|
|||
static char *leakpointer;
|
||||
#endif
|
||||
|
||||
static CURLcode crypto_init(void)
|
||||
{
|
||||
#ifdef USE_MBEDTLS
|
||||
psa_status_t status;
|
||||
status = psa_crypto_init();
|
||||
if(status != PSA_SUCCESS)
|
||||
return CURLE_FAILED_INIT;
|
||||
#endif
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static void crypto_cleanup(void)
|
||||
{
|
||||
#ifdef USE_MBEDTLS
|
||||
mbedtls_psa_crypto_free();
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* curl_global_init() globally initializes curl given a bitwise set of the
|
||||
* different features of what to initialize.
|
||||
|
|
@ -182,11 +160,6 @@ static CURLcode global_init(long flags, bool memoryfuncs)
|
|||
goto fail;
|
||||
}
|
||||
|
||||
if(crypto_init()) {
|
||||
DEBUGF(curl_mfprintf(stderr, "Error: crypto_init failed\n"));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if(!Curl_ssl_init()) {
|
||||
DEBUGF(curl_mfprintf(stderr, "Error: Curl_ssl_init failed\n"));
|
||||
goto fail;
|
||||
|
|
@ -325,8 +298,6 @@ void curl_global_cleanup(void)
|
|||
|
||||
Curl_ssh_cleanup();
|
||||
|
||||
crypto_cleanup();
|
||||
|
||||
#ifdef DEBUGBUILD
|
||||
free(leakpointer);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue