|
18 | 18 | my %configs = (
|
19 | 19 | 'config-ccm-psk-tls1_2.h' => {
|
20 | 20 | 'compat' => '-m tls12 -f \'^TLS_PSK_WITH_AES_..._CCM_8\'',
|
21 |
| - 'test_again_with_use_psa' => 1 |
22 | 21 | },
|
23 | 22 | 'config-ccm-psk-dtls1_2.h' => {
|
24 | 23 | 'compat' => '-m dtls12 -f \'^TLS_PSK_WITH_AES_..._CCM_8\'',
|
25 | 24 | 'opt' => ' ',
|
26 | 25 | 'opt_needs_debug' => 1,
|
27 |
| - 'test_again_with_use_psa' => 1 |
28 | 26 | },
|
29 | 27 | 'config-no-entropy.h' => {
|
30 | 28 | },
|
31 | 29 | 'config-suite-b.h' => {
|
32 | 30 | 'compat' => "-m tls12 -f 'ECDHE_ECDSA.*AES.*GCM' -p mbedTLS",
|
33 |
| - 'test_again_with_use_psa' => 1, |
34 | 31 | 'opt' => ' ',
|
35 | 32 | 'opt_needs_debug' => 1,
|
36 | 33 | },
|
37 | 34 | 'config-symmetric-only.h' => {
|
38 |
| - 'test_again_with_use_psa' => 0, # Uses PSA by default, no need to test it twice |
39 | 35 | },
|
40 | 36 | 'config-tfm.h' => {
|
41 |
| - 'test_again_with_use_psa' => 0, # Uses PSA by default, no need to test it twice |
42 | 37 | },
|
43 | 38 | 'config-thread.h' => {
|
44 | 39 | 'opt' => '-f ECJPAKE.*nolog',
|
45 |
| - 'test_again_with_use_psa' => 1, |
46 | 40 | },
|
47 | 41 | );
|
48 | 42 |
|
@@ -148,7 +142,17 @@ sub perform_test {
|
148 | 142 | }
|
149 | 143 |
|
150 | 144 | foreach my $conf ( @configs_to_test ) {
|
151 |
| - my $test_with_psa = $configs{$conf}{'test_again_with_use_psa'}; |
| 145 | + my $test_with_psa = 0; |
| 146 | + |
| 147 | + open(CONFIG_FILE, "<", "configs/$conf") or die "Opening config file '$conf': $!"; |
| 148 | + while (my $line = <CONFIG_FILE>) { |
| 149 | + if ($line =~ /^\/\/#define MBEDTLS_USE_PSA_CRYPTO/) { |
| 150 | + $test_with_psa = 1; |
| 151 | + last; |
| 152 | + } |
| 153 | + } |
| 154 | + close(CONFIG_FILE); |
| 155 | + |
152 | 156 | if ( $test_with_psa )
|
153 | 157 | {
|
154 | 158 | perform_test( $conf, $configs{$conf}, $test_with_psa );
|
|
0 commit comments