@@ -529,7 +529,6 @@ component_test_ref_configs () {
529
529
530
530
component_test_sslv3 () {
531
531
msg " build: Default + SSLv3 (ASan build)" # ~ 6 min
532
- cp " $CONFIG_H " " $CONFIG_BAK "
533
532
scripts/config.pl set MBEDTLS_SSL_PROTO_SSL3
534
533
CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
535
534
make
@@ -547,7 +546,6 @@ component_test_sslv3 () {
547
546
548
547
component_test_no_renegotiation () {
549
548
msg " build: Default + !MBEDTLS_SSL_RENEGOTIATION (ASan build)" # ~ 6 min
550
- cp " $CONFIG_H " " $CONFIG_BAK "
551
549
scripts/config.pl unset MBEDTLS_SSL_RENEGOTIATION
552
550
CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
553
551
make
@@ -561,7 +559,6 @@ component_test_no_renegotiation () {
561
559
562
560
component_test_rsa_no_crt () {
563
561
msg " build: Default + RSA_NO_CRT (ASan build)" # ~ 6 min
564
- cp " $CONFIG_H " " $CONFIG_BAK "
565
562
scripts/config.pl set MBEDTLS_RSA_NO_CRT
566
563
CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
567
564
make
@@ -578,7 +575,6 @@ component_test_rsa_no_crt () {
578
575
579
576
component_test_small_ssl_out_content_len () {
580
577
msg " build: small SSL_OUT_CONTENT_LEN (ASan build)"
581
- cp " $CONFIG_H " " $CONFIG_BAK "
582
578
scripts/config.pl set MBEDTLS_SSL_IN_CONTENT_LEN 16384
583
579
scripts/config.pl set MBEDTLS_SSL_OUT_CONTENT_LEN 4096
584
580
CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
@@ -590,7 +586,6 @@ component_test_small_ssl_out_content_len () {
590
586
591
587
component_test_small_ssl_in_content_len () {
592
588
msg " build: small SSL_IN_CONTENT_LEN (ASan build)"
593
- cp " $CONFIG_H " " $CONFIG_BAK "
594
589
scripts/config.pl set MBEDTLS_SSL_IN_CONTENT_LEN 4096
595
590
scripts/config.pl set MBEDTLS_SSL_OUT_CONTENT_LEN 16384
596
591
CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
@@ -602,7 +597,6 @@ component_test_small_ssl_in_content_len () {
602
597
603
598
component_test_small_ssl_dtls_max_buffering () {
604
599
msg " build: small MBEDTLS_SSL_DTLS_MAX_BUFFERING #0"
605
- cp " $CONFIG_H " " $CONFIG_BAK "
606
600
scripts/config.pl set MBEDTLS_SSL_DTLS_MAX_BUFFERING 1000
607
601
CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
608
602
make
@@ -613,7 +607,6 @@ component_test_small_ssl_dtls_max_buffering () {
613
607
614
608
component_test_small_mbedtls_ssl_dtls_max_buffering () {
615
609
msg " build: small MBEDTLS_SSL_DTLS_MAX_BUFFERING #1"
616
- cp " $CONFIG_H " " $CONFIG_BAK "
617
610
scripts/config.pl set MBEDTLS_SSL_DTLS_MAX_BUFFERING 240
618
611
CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
619
612
make
@@ -624,7 +617,6 @@ component_test_small_mbedtls_ssl_dtls_max_buffering () {
624
617
625
618
component_test_full_cmake_clang () {
626
619
msg " build: cmake, full config, clang" # ~ 50s
627
- cp " $CONFIG_H " " $CONFIG_BAK "
628
620
scripts/config.pl full
629
621
scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # too slow for tests
630
622
CC=clang cmake -D CMAKE_BUILD_TYPE:String=Check -D ENABLE_TESTING=On .
@@ -645,7 +637,6 @@ component_test_full_cmake_clang () {
645
637
646
638
component_build_deprecated () {
647
639
msg " build: make, full config + DEPRECATED_WARNING, gcc -O" # ~ 30s
648
- cp " $CONFIG_H " " $CONFIG_BAK "
649
640
scripts/config.pl full
650
641
scripts/config.pl set MBEDTLS_DEPRECATED_WARNING
651
642
# Build with -O -Wextra to catch a maximum of issues.
@@ -699,7 +690,6 @@ component_test_no_platform () {
699
690
# This should catch missing mbedtls_printf definitions, and by disabling file
700
691
# IO, it should catch missing '#include <stdio.h>'
701
692
msg " build: full config except platform/fsio/net, make, gcc, C99" # ~ 30s
702
- cp " $CONFIG_H " " $CONFIG_BAK "
703
693
scripts/config.pl full
704
694
scripts/config.pl unset MBEDTLS_PLATFORM_C
705
695
scripts/config.pl unset MBEDTLS_NET_C
@@ -721,7 +711,6 @@ component_test_no_platform () {
721
711
component_build_no_std_function () {
722
712
# catch compile bugs in _uninit functions
723
713
msg " build: full config with NO_STD_FUNCTION, make, gcc" # ~ 30s
724
- cp " $CONFIG_H " " $CONFIG_BAK "
725
714
scripts/config.pl full
726
715
scripts/config.pl set MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
727
716
scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED
@@ -730,15 +719,13 @@ component_build_no_std_function () {
730
719
731
720
component_build_no_ssl_srv () {
732
721
msg " build: full config except ssl_srv.c, make, gcc" # ~ 30s
733
- cp " $CONFIG_H " " $CONFIG_BAK "
734
722
scripts/config.pl full
735
723
scripts/config.pl unset MBEDTLS_SSL_SRV_C
736
724
make CC=gcc CFLAGS=' -Werror -Wall -Wextra -O0'
737
725
}
738
726
739
727
component_build_no_ssl_cli () {
740
728
msg " build: full config except ssl_cli.c, make, gcc" # ~ 30s
741
- cp " $CONFIG_H " " $CONFIG_BAK "
742
729
scripts/config.pl full
743
730
scripts/config.pl unset MBEDTLS_SSL_CLI_C
744
731
make CC=gcc CFLAGS=' -Werror -Wall -Wextra -O0'
@@ -748,7 +735,6 @@ component_build_no_sockets () {
748
735
# Note, C99 compliance can also be tested with the sockets support disabled,
749
736
# as that requires a POSIX platform (which isn't the same as C99).
750
737
msg " build: full config except net_sockets.c, make, gcc -std=c99 -pedantic" # ~ 30s
751
- cp " $CONFIG_H " " $CONFIG_BAK "
752
738
scripts/config.pl full
753
739
scripts/config.pl unset MBEDTLS_NET_C # getaddrinfo() undeclared, etc.
754
740
scripts/config.pl set MBEDTLS_NO_PLATFORM_ENTROPY # uses syscall() on GNU/Linux
@@ -758,7 +744,6 @@ component_build_no_sockets () {
758
744
component_test_no_max_fragment_length () {
759
745
# Run max fragment length tests with MFL disabled
760
746
msg " build: default config except MFL extension (ASan build)" # ~ 30s
761
- cp " $CONFIG_H " " $CONFIG_BAK "
762
747
scripts/config.pl unset MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
763
748
CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
764
749
make
@@ -769,7 +754,6 @@ component_test_no_max_fragment_length () {
769
754
770
755
component_test_no_max_fragment_length_small_ssl_out_content_len () {
771
756
msg " build: no MFL extension, small SSL_OUT_CONTENT_LEN (ASan build)"
772
- cp " $CONFIG_H " " $CONFIG_BAK "
773
757
scripts/config.pl unset MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
774
758
scripts/config.pl set MBEDTLS_SSL_IN_CONTENT_LEN 16384
775
759
scripts/config.pl set MBEDTLS_SSL_OUT_CONTENT_LEN 4096
@@ -782,7 +766,6 @@ component_test_no_max_fragment_length_small_ssl_out_content_len () {
782
766
783
767
component_test_null_entropy () {
784
768
msg " build: default config with MBEDTLS_TEST_NULL_ENTROPY (ASan build)"
785
- cp " $CONFIG_H " " $CONFIG_BAK "
786
769
scripts/config.pl set MBEDTLS_TEST_NULL_ENTROPY
787
770
scripts/config.pl set MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
788
771
scripts/config.pl set MBEDTLS_ENTROPY_C
@@ -798,7 +781,6 @@ component_test_null_entropy () {
798
781
799
782
component_test_platform_calloc_macro () {
800
783
msg " build: MBEDTLS_PLATFORM_{CALLOC/FREE}_MACRO enabled (ASan build)"
801
- cp " $CONFIG_H " " $CONFIG_BAK "
802
784
scripts/config.pl set MBEDTLS_PLATFORM_MEMORY
803
785
scripts/config.pl set MBEDTLS_PLATFORM_CALLOC_MACRO calloc
804
786
scripts/config.pl set MBEDTLS_PLATFORM_FREE_MACRO free
@@ -811,7 +793,6 @@ component_test_platform_calloc_macro () {
811
793
812
794
component_test_aes_fewer_tables () {
813
795
msg " build: default config with AES_FEWER_TABLES enabled"
814
- cp " $CONFIG_H " " $CONFIG_BAK "
815
796
scripts/config.pl set MBEDTLS_AES_FEWER_TABLES
816
797
make CC=gcc CFLAGS=' -Werror -Wall -Wextra'
817
798
@@ -821,7 +802,6 @@ component_test_aes_fewer_tables () {
821
802
822
803
component_test_aes_rom_tables () {
823
804
msg " build: default config with AES_ROM_TABLES enabled"
824
- cp " $CONFIG_H " " $CONFIG_BAK "
825
805
scripts/config.pl set MBEDTLS_AES_ROM_TABLES
826
806
make CC=gcc CFLAGS=' -Werror -Wall -Wextra'
827
807
@@ -831,7 +811,6 @@ component_test_aes_rom_tables () {
831
811
832
812
component_test_aes_fewer_tables_and_rom_tables () {
833
813
msg " build: default config with AES_ROM_TABLES and AES_FEWER_TABLES enabled"
834
- cp " $CONFIG_H " " $CONFIG_BAK "
835
814
scripts/config.pl set MBEDTLS_AES_FEWER_TABLES
836
815
scripts/config.pl set MBEDTLS_AES_ROM_TABLES
837
816
make CC=gcc CFLAGS=' -Werror -Wall -Wextra'
@@ -848,7 +827,6 @@ component_test_make_shared () {
848
827
component_test_m32_o0 () {
849
828
# Build once with -O0, to compile out the i386 specific inline assembly
850
829
msg " build: i386, make, gcc -O0 (ASan build)" # ~ 30s
851
- cp " $CONFIG_H " " $CONFIG_BAK "
852
830
scripts/config.pl full
853
831
make CC=gcc CFLAGS=' -O0 -Werror -Wall -Wextra -m32 -fsanitize=address'
854
832
@@ -859,7 +837,6 @@ component_test_m32_o0 () {
859
837
component_test_m32_o1 () {
860
838
# Build again with -O1, to compile in the i386 specific inline assembly
861
839
msg " build: i386, make, gcc -O1 (ASan build)" # ~ 30s
862
- cp " $CONFIG_H " " $CONFIG_BAK "
863
840
scripts/config.pl full
864
841
make CC=gcc CFLAGS=' -O1 -Werror -Wall -Wextra -m32 -fsanitize=address'
865
842
@@ -869,7 +846,6 @@ component_test_m32_o1 () {
869
846
870
847
component_test_mx32 () {
871
848
msg " build: 64-bit ILP32, make, gcc" # ~ 30s
872
- cp " $CONFIG_H " " $CONFIG_BAK "
873
849
scripts/config.pl full
874
850
make CC=gcc CFLAGS=' -Werror -Wall -Wextra -mx32'
875
851
@@ -879,7 +855,6 @@ component_test_mx32 () {
879
855
880
856
component_test_have_int32 () {
881
857
msg " build: gcc, force 32-bit bignum limbs"
882
- cp " $CONFIG_H " " $CONFIG_BAK "
883
858
scripts/config.pl unset MBEDTLS_HAVE_ASM
884
859
scripts/config.pl unset MBEDTLS_AESNI_C
885
860
scripts/config.pl unset MBEDTLS_PADLOCK_C
@@ -891,7 +866,6 @@ component_test_have_int32 () {
891
866
892
867
component_test_have_int64 () {
893
868
msg " build: gcc, force 64-bit bignum limbs"
894
- cp " $CONFIG_H " " $CONFIG_BAK "
895
869
scripts/config.pl unset MBEDTLS_HAVE_ASM
896
870
scripts/config.pl unset MBEDTLS_AESNI_C
897
871
scripts/config.pl unset MBEDTLS_PADLOCK_C
@@ -903,7 +877,6 @@ component_test_have_int64 () {
903
877
904
878
component_test_no_udbl_division () {
905
879
msg " build: MBEDTLS_NO_UDBL_DIVISION native" # ~ 10s
906
- cp " $CONFIG_H " " $CONFIG_BAK "
907
880
scripts/config.pl full
908
881
scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # too slow for tests
909
882
scripts/config.pl set MBEDTLS_NO_UDBL_DIVISION
@@ -915,7 +888,6 @@ component_test_no_udbl_division () {
915
888
916
889
component_test_no_64bit_multiplication () {
917
890
msg " build: MBEDTLS_NO_64BIT_MULTIPLICATION native" # ~ 10s
918
- cp " $CONFIG_H " " $CONFIG_BAK "
919
891
scripts/config.pl full
920
892
scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # too slow for tests
921
893
scripts/config.pl set MBEDTLS_NO_64BIT_MULTIPLICATION
@@ -927,7 +899,6 @@ component_test_no_64bit_multiplication () {
927
899
928
900
component_build_arm_none_eabi_gcc () {
929
901
msg " build: arm-none-eabi-gcc, make" # ~ 10s
930
- cp " $CONFIG_H " " $CONFIG_BAK "
931
902
scripts/config.pl full
932
903
scripts/config.pl unset MBEDTLS_NET_C
933
904
scripts/config.pl unset MBEDTLS_TIMING_C
@@ -945,7 +916,6 @@ component_build_arm_none_eabi_gcc () {
945
916
946
917
component_build_arm_none_eabi_gcc_no_udbl_division () {
947
918
msg " build: arm-none-eabi-gcc -DMBEDTLS_NO_UDBL_DIVISION, make" # ~ 10s
948
- cp " $CONFIG_H " " $CONFIG_BAK "
949
919
scripts/config.pl full
950
920
scripts/config.pl unset MBEDTLS_NET_C
951
921
scripts/config.pl unset MBEDTLS_TIMING_C
@@ -966,7 +936,6 @@ component_build_arm_none_eabi_gcc_no_udbl_division () {
966
936
967
937
component_build_arm_none_eabi_gcc_no_64bit_multiplication () {
968
938
msg " build: arm-none-eabi-gcc MBEDTLS_NO_64BIT_MULTIPLICATION, make" # ~ 10s
969
- cp " $CONFIG_H " " $CONFIG_BAK "
970
939
scripts/config.pl full
971
940
scripts/config.pl unset MBEDTLS_NET_C
972
941
scripts/config.pl unset MBEDTLS_TIMING_C
@@ -987,7 +956,6 @@ component_build_arm_none_eabi_gcc_no_64bit_multiplication () {
987
956
988
957
component_build_armcc () {
989
958
msg " build: ARM Compiler 5, make"
990
- cp " $CONFIG_H " " $CONFIG_BAK "
991
959
scripts/config.pl full
992
960
scripts/config.pl unset MBEDTLS_NET_C
993
961
scripts/config.pl unset MBEDTLS_TIMING_C
@@ -1028,7 +996,6 @@ component_build_armcc () {
1028
996
1029
997
component_test_allow_sha1 () {
1030
998
msg " build: allow SHA1 in certificates by default"
1031
- cp " $CONFIG_H " " $CONFIG_BAK "
1032
999
scripts/config.pl set MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES
1033
1000
make CFLAGS=' -Werror -Wall -Wextra'
1034
1001
msg " test: allow SHA1 in certificates by default"
@@ -1052,7 +1019,6 @@ component_build_mingw () {
1052
1019
1053
1020
component_test_memsan () {
1054
1021
msg " build: MSan (clang)" # ~ 1 min 20s
1055
- cp " $CONFIG_H " " $CONFIG_BAK "
1056
1022
scripts/config.pl unset MBEDTLS_AESNI_C # memsan doesn't grok asm
1057
1023
CC=clang cmake -D CMAKE_BUILD_TYPE:String=MemSan .
1058
1024
make
@@ -1242,6 +1208,9 @@ run_component () {
1242
1208
if [ $ALL_EXCEPT -ne 0 ] && component_is_excluded " $1 " ; then
1243
1209
return
1244
1210
fi
1211
+ # Back up the configuration in case the component modifies it.
1212
+ # The cleanup function will restore it.
1213
+ cp -p " $CONFIG_H " " $CONFIG_BAK "
1245
1214
current_component=" $1 "
1246
1215
" $@ "
1247
1216
cleanup
0 commit comments