mbedtls: call psa_crypt_init() in global init

Run mbedtls' psa_crypt_init() in the general global init, optionally
protected by mbedtls locks when available.

CI: when building mbedtls, enabled thread safety

Reported-by: wxiaoguang on github
Fixes #15500
Closes #15505
This commit is contained in:
Stefan Eissing 2024-11-07 10:26:03 +01:00 committed by Daniel Stenberg
parent f5c616930b
commit bcf8a84881
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 19 additions and 13 deletions

View file

@ -407,7 +407,7 @@ jobs:
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
id: cache-mbedtls
env:
cache-name: cache-mbedtls
cache-name: cache-mbedtls-threadsafe
with:
path: /home/runner/mbedtls
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.mbedtls-version }}
@ -418,6 +418,8 @@ jobs:
git clone --quiet --depth=1 -b v${{ env.mbedtls-version }} https://github.com/Mbed-TLS/mbedtls
cd mbedtls
git submodule update --init --depth=1
./scripts/config.py set MBEDTLS_THREADING_C
./scripts/config.py set MBEDTLS_THREADING_PTHREAD
cmake -B . -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=$HOME/mbedtls \
-DENABLE_PROGRAMS=OFF -DENABLE_TESTING=OFF
cmake --build .