mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2024-12-26 18:20:21 +00:00
create seedfile in compat.sh
And remove configuration option dependency. It only depends on if `MBEDTLS_PLATFORM_STD_NV_SEED_FILE` now. Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
parent
4070b42cda
commit
e579a4d6d5
@ -33,6 +33,7 @@ SRVMEM=0
|
||||
: ${M_SRV:=../programs/ssl/ssl_server2}
|
||||
: ${M_CLI:=../programs/ssl/ssl_client2}
|
||||
: ${OPENSSL:=openssl}
|
||||
: ${M_QUERY:=../programs/test/query_compile_time_config}
|
||||
: ${GNUTLS_CLI:=gnutls-cli}
|
||||
: ${GNUTLS_SERV:=gnutls-serv}
|
||||
|
||||
@ -1089,6 +1090,15 @@ else
|
||||
DOG_DELAY=10
|
||||
fi
|
||||
|
||||
# `$M_QUERY MBEDTLS_PLATFORM_STD_NV_SEED_FILE` will return `"seedfile"` and
|
||||
# `dd` will create file with double quotes. That's not expected, with `eval`
|
||||
# we can remove double quotes
|
||||
NV_SEED_FILE=$(eval "echo `$M_QUERY MBEDTLS_PLATFORM_STD_NV_SEED_FILE`")
|
||||
if [ -n "$NV_SEED_FILE" ] && [ ! -f $NV_SEED_FILE ]
|
||||
then
|
||||
dd if=/dev/urandom of=$NV_SEED_FILE bs=64 count=1 2>/dev/null
|
||||
fi
|
||||
|
||||
SKIP_NEXT="NO"
|
||||
|
||||
trap cleanup INT TERM HUP
|
||||
|
@ -2004,23 +2004,17 @@ CLI_OUT="cli_out.$$"
|
||||
PXY_OUT="pxy_out.$$"
|
||||
SESSION="session.$$"
|
||||
|
||||
# If MBEDTLS_ENTROPY_C && MBEDTLS_ENTROPY_NV_SEED && !MBEDTLS_NO_PLATFORM_ENTROPY
|
||||
# create seedfile to fix test fail.
|
||||
SKIP_NEXT="NO"
|
||||
requires_config_enabled MBEDTLS_ENTROPY_C
|
||||
requires_config_enabled MBEDTLS_ENTROPY_NV_SEED
|
||||
requires_config_disabled MBEDTLS_NO_PLATFORM_ENTROPY
|
||||
create_seedfile()
|
||||
{
|
||||
dd if=/dev/urandom of=$1 bs=64 count=1 2>/dev/null
|
||||
}
|
||||
if [ "${SKIP_NEXT:-}" != "YES" ]; then
|
||||
# `$P_QUERY MBEDTLS_PLATFORM_STD_NV_SEED_FILE` will return `"seedfile"` and
|
||||
# `dd` will create file with double quotes. That's not expected, with `eval`
|
||||
# we can remove double quotes
|
||||
eval "create_seedfile `$P_QUERY MBEDTLS_PLATFORM_STD_NV_SEED_FILE`"
|
||||
|
||||
# `$P_QUERY MBEDTLS_PLATFORM_STD_NV_SEED_FILE` will return `"seedfile"` and
|
||||
# `dd` will create file with double quotes. That's not expected, with `eval`
|
||||
# we can remove double quotes
|
||||
NV_SEED_FILE=$(eval "echo `$P_QUERY MBEDTLS_PLATFORM_STD_NV_SEED_FILE`")
|
||||
if [ -n "$NV_SEED_FILE" ] && [ ! -f $NV_SEED_FILE ]
|
||||
then
|
||||
dd if=/dev/urandom of=$NV_SEED_FILE bs=64 count=1 2>/dev/null
|
||||
fi
|
||||
|
||||
|
||||
SKIP_NEXT="NO"
|
||||
|
||||
trap cleanup INT TERM HUP
|
||||
|
Loading…
Reference in New Issue
Block a user