From 581bfcfc962e7c7a89092bd3ecc81e13190a7e9b Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Fri, 11 Oct 2019 17:19:45 +0200 Subject: [PATCH] Create seedfile in test-ref-configs.pl config-symmetric-only.h enables MBEDTLS_ENTROPY_NV_SEED so it needs a seedfile. Create it in test-ref-configs.pl so that the script works on its own, even if it is not invoked by all.sh. --- tests/scripts/test-ref-configs.pl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/scripts/test-ref-configs.pl b/tests/scripts/test-ref-configs.pl index bd11c093e..1e6596928 100755 --- a/tests/scripts/test-ref-configs.pl +++ b/tests/scripts/test-ref-configs.pl @@ -50,6 +50,15 @@ sub abort { exit 1; } +# Create a seedfile for configurations that enable MBEDTLS_ENTROPY_NV_SEED. +# For test purposes, this doesn't have to be cryptographically random. +if (!-e "tests/seedfile" || -s "tests/seedfile" < 64) { + local *SEEDFILE; + open SEEDFILE, ">tests/seedfile" or die; + print SEEDFILE "*" x 64 or die; + close SEEDFILE or die; +} + while( my ($conf, $data) = each %configs ) { system( "cp $config_h.bak $config_h" ) and die; system( "make clean" ) and die;