From 8284f3dcbcca1aeeb6db4631a61f953bfd13a2a1 Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Mon, 8 Apr 2024 17:52:12 +0200 Subject: [PATCH] test: automatically generate test_certs.h and test_keys.h Ensure that when tests are built also test_certs.h and test_keys.h are generated. Signed-off-by: Valerio Setti --- CMakeLists.txt | 117 +++++++++++++++++++++++++++++++++++++- tests/Makefile | 67 ++++++++++++++++++++++ tests/data_files/Makefile | 69 ---------------------- tests/src/test_certs.h | 112 ++++++++++++++++++------------------ 4 files changed, 239 insertions(+), 126 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb9e1c31db..565e92e7a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -311,10 +311,125 @@ add_subdirectory(pkgconfig) # to define the test executables. # if(ENABLE_TESTING OR ENABLE_PROGRAMS) + add_custom_command( + OUTPUT + ./tests/src/test_keys.h + WORKING_DIRECTORY + ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND + ${MBEDTLS_PYTHON_EXECUTABLE} + "${CMAKE_CURRENT_SOURCE_DIR}/tests/scripts/generate_test_keys.py" + "--output" + "${CMAKE_CURRENT_SOURCE_DIR}/tests/src/test_keys.h" + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/tests/scripts/generate_test_keys.py + ) + add_custom_command( + OUTPUT + ./tests/src/test_certs.h + WORKING_DIRECTORY + ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND + "${MBEDTLS_PYTHON_EXECUTABLE}" + "${CMAKE_CURRENT_SOURCE_DIR}/tests/scripts/generate_test_cert_macros.py" + "--output" + "${CMAKE_CURRENT_SOURCE_DIR}/tests/src/test_certs.h" + "--string" + "TEST_CA_CRT_EC_PEM=${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/test-ca2.crt" + "--binary" + "TEST_CA_CRT_EC_DER=${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/test-ca2.crt.der" + "--string" + "TEST_CA_KEY_EC_PEM=${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/test-ca2.key.enc" + "--password" + "TEST_CA_PWD_EC_PEM=PolarSSLTest" + "--binary" + "TEST_CA_KEY_EC_DER=${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/test-ca2.key.der" + "--string" + "TEST_CA_CRT_RSA_SHA256_PEM=${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/test-ca-sha256.crt" + "--binary" + "TEST_CA_CRT_RSA_SHA256_DER=${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/test-ca-sha256.crt.der" + "--string" + "TEST_CA_CRT_RSA_SHA1_PEM=${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/test-ca-sha1.crt" + "--binary" + "TEST_CA_CRT_RSA_SHA1_DER=${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/test-ca-sha1.crt.der" + "--string" + "TEST_CA_KEY_RSA_PEM=${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/test-ca.key" + "--password" + "TEST_CA_PWD_RSA_PEM=PolarSSLTest" + "--binary" + "TEST_CA_KEY_RSA_DER=${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/test-ca.key.der" + "--string" + "TEST_SRV_CRT_EC_PEM=${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/server5.crt" + "--binary" + "TEST_SRV_CRT_EC_DER=${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/server5.crt.der" + "--string" + "TEST_SRV_KEY_EC_PEM=${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/server5.key" + "--binary" + "TEST_SRV_KEY_EC_DER=${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/server5.key.der" + "--string" + "TEST_SRV_CRT_RSA_SHA256_PEM=${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/server2-sha256.crt" + "--binary" + "TEST_SRV_CRT_RSA_SHA256_DER=${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/server2-sha256.crt.der" + "--string" + "TEST_SRV_CRT_RSA_SHA1_PEM=${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/server2.crt" + "--binary" + "TEST_SRV_CRT_RSA_SHA1_DER=${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/server2.crt.der" + "--string" + "TEST_SRV_KEY_RSA_PEM=${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/server2.key" + "--binary" + "TEST_SRV_KEY_RSA_DER=${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/server2.key.der" + "--string" + "TEST_CLI_CRT_EC_PEM=${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/cli2.crt" + "--binary" + "TEST_CLI_CRT_EC_DER=${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/cli2.crt.der" + "--string" + "TEST_CLI_KEY_EC_PEM=${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/cli2.key" + "--binary" + "TEST_CLI_KEY_EC_DER=${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/cli2.key.der" + "--string" + "TEST_CLI_CRT_RSA_PEM=${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/cli-rsa-sha256.crt" + "--binary" + "TEST_CLI_CRT_RSA_DER=${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/cli-rsa-sha256.crt.der" + "--string" + "TEST_CLI_KEY_RSA_PEM=${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/cli-rsa.key" + "--binary" + "TEST_CLI_KEY_RSA_DER=${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/cli-rsa.key.der" + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/tests/scripts/generate_test_cert_macros.py + ${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/test-ca2.crt + ${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/test-ca2.crt.der + ${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/test-ca2.key.enc + ${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/test-ca2.key.der + ${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/test-ca-sha256.crt + ${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/test-ca-sha256.crt.der + ${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/test-ca-sha1.crt + ${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/test-ca-sha1.crt.der + ${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/test-ca.key + ${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/test-ca.key.der + ${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/server5.crt + ${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/server5.crt.der + ${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/server5.key + ${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/server5.key.der + ${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/server2-sha256.crt + ${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/server2-sha256.crt.der + ${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/server2.crt + ${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/server2.crt.der + ${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/server2.key + ${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/server2.key.der + ${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/cli2.crt + ${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/cli2.crt.der + ${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/cli2.key + ${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/cli2.key.der + ${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/cli-rsa-sha256.crt + ${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/cli-rsa-sha256.crt.der + ${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/cli-rsa.key + ${CMAKE_CURRENT_SOURCE_DIR}/tests/data_files/cli-rsa.key.der + ) file(GLOB MBEDTLS_TEST_FILES ${CMAKE_CURRENT_SOURCE_DIR}/tests/src/*.c ${CMAKE_CURRENT_SOURCE_DIR}/tests/src/drivers/*.c) - add_library(mbedtls_test OBJECT ${MBEDTLS_TEST_FILES}) + add_library(mbedtls_test OBJECT ${MBEDTLS_TEST_FILES} + ./tests/src/test_keys.h ./tests/src/test_certs.h) target_include_directories(mbedtls_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests/include PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include diff --git a/tests/Makefile b/tests/Makefile index c2a0b84f07..5b2ee10256 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -112,6 +112,72 @@ all: $(BINARIES) mbedtls_test: $(MBEDTLS_TEST_OBJS) +TEST_CERTS_H_INPUT_FILES=\ + data_files/test-ca2.crt \ + data_files/test-ca2.crt.der \ + data_files/test-ca2.key.enc \ + data_files/test-ca2.key.der \ + data_files/test-ca-sha256.crt \ + data_files/test-ca-sha256.crt.der \ + data_files/test-ca-sha1.crt \ + data_files/test-ca-sha1.crt.der \ + data_files/test-ca.key \ + data_files/test-ca.key.der \ + data_files/server5.crt \ + data_files/server5.crt.der \ + data_files/server5.key \ + data_files/server5.key.der \ + data_files/server2-sha256.crt \ + data_files/server2-sha256.crt.der \ + data_files/server2.crt \ + data_files/server2.crt.der \ + data_files/server2.key \ + data_files/server2.key.der \ + data_files/cli2.crt \ + data_files/cli2.crt.der \ + data_files/cli2.key \ + data_files/cli2.key.der \ + data_files/cli-rsa-sha256.crt \ + data_files/cli-rsa-sha256.crt.der \ + data_files/cli-rsa.key \ + data_files/cli-rsa.key.der +src/test_certs.h: scripts/generate_test_cert_macros.py \ + $(TEST_CERTS_H_INPUT_FILES) + $(PYTHON) scripts/generate_test_cert_macros.py --output $@ \ + --string TEST_CA_CRT_EC_PEM=data_files/test-ca2.crt \ + --binary TEST_CA_CRT_EC_DER=data_files/test-ca2.crt.der \ + --string TEST_CA_KEY_EC_PEM=data_files/test-ca2.key.enc \ + --password TEST_CA_PWD_EC_PEM=PolarSSLTest \ + --binary TEST_CA_KEY_EC_DER=data_files/test-ca2.key.der \ + --string TEST_CA_CRT_RSA_SHA256_PEM=data_files/test-ca-sha256.crt \ + --binary TEST_CA_CRT_RSA_SHA256_DER=data_files/test-ca-sha256.crt.der \ + --string TEST_CA_CRT_RSA_SHA1_PEM=data_files/test-ca-sha1.crt \ + --binary TEST_CA_CRT_RSA_SHA1_DER=data_files/test-ca-sha1.crt.der \ + --string TEST_CA_KEY_RSA_PEM=data_files/test-ca.key \ + --password TEST_CA_PWD_RSA_PEM=PolarSSLTest \ + --binary TEST_CA_KEY_RSA_DER=data_files/test-ca.key.der \ + --string TEST_SRV_CRT_EC_PEM=data_files/server5.crt \ + --binary TEST_SRV_CRT_EC_DER=data_files/server5.crt.der \ + --string TEST_SRV_KEY_EC_PEM=data_files/server5.key \ + --binary TEST_SRV_KEY_EC_DER=data_files/server5.key.der \ + --string TEST_SRV_CRT_RSA_SHA256_PEM=data_files/server2-sha256.crt \ + --binary TEST_SRV_CRT_RSA_SHA256_DER=data_files/server2-sha256.crt.der \ + --string TEST_SRV_CRT_RSA_SHA1_PEM=data_files/server2.crt \ + --binary TEST_SRV_CRT_RSA_SHA1_DER=data_files/server2.crt.der \ + --string TEST_SRV_KEY_RSA_PEM=data_files/server2.key \ + --binary TEST_SRV_KEY_RSA_DER=data_files/server2.key.der \ + --string TEST_CLI_CRT_EC_PEM=data_files/cli2.crt \ + --binary TEST_CLI_CRT_EC_DER=data_files/cli2.crt.der \ + --string TEST_CLI_KEY_EC_PEM=data_files/cli2.key \ + --binary TEST_CLI_KEY_EC_DER=data_files/cli2.key.der \ + --string TEST_CLI_CRT_RSA_PEM=data_files/cli-rsa-sha256.crt \ + --binary TEST_CLI_CRT_RSA_DER=data_files/cli-rsa-sha256.crt.der \ + --string TEST_CLI_KEY_RSA_PEM=data_files/cli-rsa.key \ + --binary TEST_CLI_KEY_RSA_DER=data_files/cli-rsa.key.der + +src/test_keys.h: scripts/generate_test_keys.py + scripts/generate_test_keys.py --output $@ + TEST_OBJS_DEPS = $(wildcard include/test/*.h include/test/*/*.h) ifdef RECORD_PSA_STATUS_COVERAGE_LOG # Explicitly depend on this header because on a clean copy of the source tree, @@ -119,6 +185,7 @@ ifdef RECORD_PSA_STATUS_COVERAGE_LOG # therefore the wildcard enumeration above doesn't include it. TEST_OBJS_DEPS += include/test/instrument_record_status.h endif +TEST_OBJS_DEPS += src/test_certs.h src/test_keys.h # Rule to compile common test C files in src folder src/%.o : src/%.c $(TEST_OBJS_DEPS) diff --git a/tests/data_files/Makefile b/tests/data_files/Makefile index e8917f170f..68b3a05380 100644 --- a/tests/data_files/Makefile +++ b/tests/data_files/Makefile @@ -2091,75 +2091,6 @@ all_final += server2-v1.crt server2-v1-chain.crt: server2-v1.crt server1-v1.crt cat $^ > $@ -################################################################ -#### Generate C format test certs header -################################################################ - -TEST_CERTS_H_INPUT_FILES=test-ca2.crt \ - test-ca2.crt.der \ - test-ca2.key.enc \ - test-ca2.key.der \ - test-ca-sha256.crt \ - test-ca-sha256.crt.der \ - test-ca-sha1.crt \ - test-ca-sha1.crt.der \ - test-ca.key \ - test-ca.key.der \ - server5.crt \ - server5.crt.der \ - server5.key \ - server5.key.der \ - server2-sha256.crt \ - server2-sha256.crt.der \ - server2.crt \ - server2.crt.der \ - server2.key \ - server2.key.der \ - cli2.crt \ - cli2.crt.der \ - cli2.key \ - cli2.key.der \ - cli-rsa-sha256.crt \ - cli-rsa-sha256.crt.der \ - cli-rsa.key \ - cli-rsa.key.der -../src/test_certs.h: ../scripts/generate_test_cert_macros.py \ - $(TEST_CERTS_H_INPUT_FILES) - ../scripts/generate_test_cert_macros.py --output $@ \ - --string TEST_CA_CRT_EC_PEM=test-ca2.crt \ - --binary TEST_CA_CRT_EC_DER=test-ca2.crt.der \ - --string TEST_CA_KEY_EC_PEM=test-ca2.key.enc \ - --password TEST_CA_PWD_EC_PEM=PolarSSLTest \ - --binary TEST_CA_KEY_EC_DER=test-ca2.key.der \ - --string TEST_CA_CRT_RSA_SHA256_PEM=test-ca-sha256.crt \ - --binary TEST_CA_CRT_RSA_SHA256_DER=test-ca-sha256.crt.der \ - --string TEST_CA_CRT_RSA_SHA1_PEM=test-ca-sha1.crt \ - --binary TEST_CA_CRT_RSA_SHA1_DER=test-ca-sha1.crt.der \ - --string TEST_CA_KEY_RSA_PEM=test-ca.key \ - --password TEST_CA_PWD_RSA_PEM=PolarSSLTest \ - --binary TEST_CA_KEY_RSA_DER=test-ca.key.der \ - --string TEST_SRV_CRT_EC_PEM=server5.crt \ - --binary TEST_SRV_CRT_EC_DER=server5.crt.der \ - --string TEST_SRV_KEY_EC_PEM=server5.key \ - --binary TEST_SRV_KEY_EC_DER=server5.key.der \ - --string TEST_SRV_CRT_RSA_SHA256_PEM=server2-sha256.crt \ - --binary TEST_SRV_CRT_RSA_SHA256_DER=server2-sha256.crt.der \ - --string TEST_SRV_CRT_RSA_SHA1_PEM=server2.crt \ - --binary TEST_SRV_CRT_RSA_SHA1_DER=server2.crt.der \ - --string TEST_SRV_KEY_RSA_PEM=server2.key \ - --binary TEST_SRV_KEY_RSA_DER=server2.key.der \ - --string TEST_CLI_CRT_EC_PEM=cli2.crt \ - --binary TEST_CLI_CRT_EC_DER=cli2.crt.der \ - --string TEST_CLI_KEY_EC_PEM=cli2.key \ - --binary TEST_CLI_KEY_EC_DER=cli2.key.der \ - --string TEST_CLI_CRT_RSA_PEM=cli-rsa-sha256.crt \ - --binary TEST_CLI_CRT_RSA_DER=cli-rsa-sha256.crt.der \ - --string TEST_CLI_KEY_RSA_PEM=cli-rsa.key \ - --binary TEST_CLI_KEY_RSA_DER=cli-rsa.key.der - -../src/test_keys.h: ../scripts/generate_test_keys.py - ../scripts/generate_test_keys.py --output $@ - ################################################################ #### Diffie-Hellman parameters ################################################################ diff --git a/tests/src/test_certs.h b/tests/src/test_certs.h index b313ea88de..856d89960a 100644 --- a/tests/src/test_certs.h +++ b/tests/src/test_certs.h @@ -8,8 +8,8 @@ /* THIS FILE is generated by `tests/scripts/generate_test_cert_macros.py` */ /* *INDENT-OFF* */ -/* This is taken from test-ca2.crt. */ -/* BEGIN FILE string macro TEST_CA_CRT_EC_PEM test-ca2.crt */ +/* This is taken from data_files/test-ca2.crt. */ +/* BEGIN FILE string macro TEST_CA_CRT_EC_PEM data_files/test-ca2.crt */ #define TEST_CA_CRT_EC_PEM \ "-----BEGIN CERTIFICATE-----\r\n" \ "MIICBzCCAYugAwIBAgIJAMFD4n5iQ8zoMAwGCCqGSM49BAMCBQAwPjELMAkGA1UE\r\n" \ @@ -26,8 +26,8 @@ "-----END CERTIFICATE-----\r\n" /* END FILE */ -/* This is generated from test-ca2.crt.der. */ -/* BEGIN FILE binary macro TEST_CA_CRT_EC_DER test-ca2.crt.der */ +/* This is generated from data_files/test-ca2.crt.der. */ +/* BEGIN FILE binary macro TEST_CA_CRT_EC_DER data_files/test-ca2.crt.der */ #define TEST_CA_CRT_EC_DER { \ 0x30, 0x82, 0x02, 0x07, 0x30, 0x82, 0x01, 0x8b, 0xa0, 0x03, 0x02, 0x01, \ 0x02, 0x02, 0x09, 0x00, 0xc1, 0x43, 0xe2, 0x7e, 0x62, 0x43, 0xcc, 0xe8, \ @@ -76,8 +76,8 @@ } /* END FILE */ -/* This is taken from test-ca2.key.enc. */ -/* BEGIN FILE string macro TEST_CA_KEY_EC_PEM test-ca2.key.enc */ +/* This is taken from data_files/test-ca2.key.enc. */ +/* BEGIN FILE string macro TEST_CA_KEY_EC_PEM data_files/test-ca2.key.enc */ #define TEST_CA_KEY_EC_PEM \ "-----BEGIN EC PRIVATE KEY-----\r\n" \ "Proc-Type: 4,ENCRYPTED\r\n" \ @@ -92,8 +92,8 @@ #define TEST_CA_PWD_EC_PEM "PolarSSLTest" -/* This is generated from test-ca2.key.der. */ -/* BEGIN FILE binary macro TEST_CA_KEY_EC_DER test-ca2.key.der */ +/* This is generated from data_files/test-ca2.key.der. */ +/* BEGIN FILE binary macro TEST_CA_KEY_EC_DER data_files/test-ca2.key.der */ #define TEST_CA_KEY_EC_DER { \ 0x30, 0x81, 0xa4, 0x02, 0x01, 0x01, 0x04, 0x30, 0x83, 0xd9, 0x15, 0x0e, \ 0xa0, 0x71, 0xf0, 0x57, 0x10, 0x33, 0xa3, 0x38, 0xb8, 0x86, 0xc1, 0xa6, \ @@ -112,8 +112,8 @@ } /* END FILE */ -/* This is taken from test-ca-sha256.crt. */ -/* BEGIN FILE string macro TEST_CA_CRT_RSA_SHA256_PEM test-ca-sha256.crt */ +/* This is taken from data_files/test-ca-sha256.crt. */ +/* BEGIN FILE string macro TEST_CA_CRT_RSA_SHA256_PEM data_files/test-ca-sha256.crt */ #define TEST_CA_CRT_RSA_SHA256_PEM \ "-----BEGIN CERTIFICATE-----\r\n" \ "MIIDQTCCAimgAwIBAgIBAzANBgkqhkiG9w0BAQsFADA7MQswCQYDVQQGEwJOTDER\r\n" \ @@ -137,8 +137,8 @@ "-----END CERTIFICATE-----\r\n" /* END FILE */ -/* This is generated from test-ca-sha256.crt.der. */ -/* BEGIN FILE binary macro TEST_CA_CRT_RSA_SHA256_DER test-ca-sha256.crt.der */ +/* This is generated from data_files/test-ca-sha256.crt.der. */ +/* BEGIN FILE binary macro TEST_CA_CRT_RSA_SHA256_DER data_files/test-ca-sha256.crt.der */ #define TEST_CA_CRT_RSA_SHA256_DER { \ 0x30, 0x82, 0x03, 0x41, 0x30, 0x82, 0x02, 0x29, 0xa0, 0x03, 0x02, 0x01, \ 0x02, 0x02, 0x01, 0x03, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, \ @@ -213,8 +213,8 @@ } /* END FILE */ -/* This is taken from test-ca-sha1.crt. */ -/* BEGIN FILE string macro TEST_CA_CRT_RSA_SHA1_PEM test-ca-sha1.crt */ +/* This is taken from data_files/test-ca-sha1.crt. */ +/* BEGIN FILE string macro TEST_CA_CRT_RSA_SHA1_PEM data_files/test-ca-sha1.crt */ #define TEST_CA_CRT_RSA_SHA1_PEM \ "-----BEGIN CERTIFICATE-----\r\n" \ "MIIDQTCCAimgAwIBAgIBAzANBgkqhkiG9w0BAQUFADA7MQswCQYDVQQGEwJOTDER\r\n" \ @@ -238,8 +238,8 @@ "-----END CERTIFICATE-----\r\n" /* END FILE */ -/* This is generated from test-ca-sha1.crt.der. */ -/* BEGIN FILE binary macro TEST_CA_CRT_RSA_SHA1_DER test-ca-sha1.crt.der */ +/* This is generated from data_files/test-ca-sha1.crt.der. */ +/* BEGIN FILE binary macro TEST_CA_CRT_RSA_SHA1_DER data_files/test-ca-sha1.crt.der */ #define TEST_CA_CRT_RSA_SHA1_DER { \ 0x30, 0x82, 0x03, 0x41, 0x30, 0x82, 0x02, 0x29, 0xa0, 0x03, 0x02, 0x01, \ 0x02, 0x02, 0x01, 0x03, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, \ @@ -314,8 +314,8 @@ } /* END FILE */ -/* This is taken from test-ca.key. */ -/* BEGIN FILE string macro TEST_CA_KEY_RSA_PEM test-ca.key */ +/* This is taken from data_files/test-ca.key. */ +/* BEGIN FILE string macro TEST_CA_KEY_RSA_PEM data_files/test-ca.key */ #define TEST_CA_KEY_RSA_PEM \ "-----BEGIN RSA PRIVATE KEY-----\r\n" \ "Proc-Type: 4,ENCRYPTED\r\n" \ @@ -351,8 +351,8 @@ #define TEST_CA_PWD_RSA_PEM "PolarSSLTest" -/* This is generated from test-ca.key.der. */ -/* BEGIN FILE binary macro TEST_CA_KEY_RSA_DER test-ca.key.der */ +/* This is generated from data_files/test-ca.key.der. */ +/* BEGIN FILE binary macro TEST_CA_KEY_RSA_DER data_files/test-ca.key.der */ #define TEST_CA_KEY_RSA_DER { \ 0x30, 0x82, 0x04, 0xa4, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, 0x01, 0x00, \ 0xc0, 0xdf, 0x37, 0xfc, 0x17, 0xbb, 0xe0, 0x96, 0x9d, 0x3f, 0x86, 0xde, \ @@ -457,8 +457,8 @@ } /* END FILE */ -/* This is taken from server5.crt. */ -/* BEGIN FILE string macro TEST_SRV_CRT_EC_PEM server5.crt */ +/* This is taken from data_files/server5.crt. */ +/* BEGIN FILE string macro TEST_SRV_CRT_EC_PEM data_files/server5.crt */ #define TEST_SRV_CRT_EC_PEM \ "-----BEGIN CERTIFICATE-----\r\n" \ "MIICIDCCAaWgAwIBAgIBCTAKBggqhkjOPQQDAjA+MQswCQYDVQQGEwJOTDERMA8G\r\n" \ @@ -476,8 +476,8 @@ "-----END CERTIFICATE-----\r\n" /* END FILE */ -/* This is generated from server5.crt.der. */ -/* BEGIN FILE binary macro TEST_SRV_CRT_EC_DER server5.crt.der */ +/* This is generated from data_files/server5.crt.der. */ +/* BEGIN FILE binary macro TEST_SRV_CRT_EC_DER data_files/server5.crt.der */ #define TEST_SRV_CRT_EC_DER { \ 0x30, 0x82, 0x02, 0x20, 0x30, 0x82, 0x01, 0xa5, 0xa0, 0x03, 0x02, 0x01, \ 0x02, 0x02, 0x01, 0x09, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, \ @@ -528,8 +528,8 @@ } /* END FILE */ -/* This is taken from server5.key. */ -/* BEGIN FILE string macro TEST_SRV_KEY_EC_PEM server5.key */ +/* This is taken from data_files/server5.key. */ +/* BEGIN FILE string macro TEST_SRV_KEY_EC_PEM data_files/server5.key */ #define TEST_SRV_KEY_EC_PEM \ "-----BEGIN EC PRIVATE KEY-----\r\n" \ "MHcCAQEEIPEqEyB2AnCoPL/9U/YDHvdqXYbIogTywwyp6/UfDw6noAoGCCqGSM49\r\n" \ @@ -538,8 +538,8 @@ "-----END EC PRIVATE KEY-----\r\n" /* END FILE */ -/* This is generated from server5.key.der. */ -/* BEGIN FILE binary macro TEST_SRV_KEY_EC_DER server5.key.der */ +/* This is generated from data_files/server5.key.der. */ +/* BEGIN FILE binary macro TEST_SRV_KEY_EC_DER data_files/server5.key.der */ #define TEST_SRV_KEY_EC_DER { \ 0x30, 0x77, 0x02, 0x01, 0x01, 0x04, 0x20, 0xf1, 0x2a, 0x13, 0x20, 0x76, \ 0x02, 0x70, 0xa8, 0x3c, 0xbf, 0xfd, 0x53, 0xf6, 0x03, 0x1e, 0xf7, 0x6a, \ @@ -555,8 +555,8 @@ } /* END FILE */ -/* This is taken from server2-sha256.crt. */ -/* BEGIN FILE string macro TEST_SRV_CRT_RSA_SHA256_PEM server2-sha256.crt */ +/* This is taken from data_files/server2-sha256.crt. */ +/* BEGIN FILE string macro TEST_SRV_CRT_RSA_SHA256_PEM data_files/server2-sha256.crt */ #define TEST_SRV_CRT_RSA_SHA256_PEM \ "-----BEGIN CERTIFICATE-----\r\n" \ "MIIDNzCCAh+gAwIBAgIBAjANBgkqhkiG9w0BAQsFADA7MQswCQYDVQQGEwJOTDER\r\n" \ @@ -580,8 +580,8 @@ "-----END CERTIFICATE-----\r\n" /* END FILE */ -/* This is generated from server2-sha256.crt.der. */ -/* BEGIN FILE binary macro TEST_SRV_CRT_RSA_SHA256_DER server2-sha256.crt.der */ +/* This is generated from data_files/server2-sha256.crt.der. */ +/* BEGIN FILE binary macro TEST_SRV_CRT_RSA_SHA256_DER data_files/server2-sha256.crt.der */ #define TEST_SRV_CRT_RSA_SHA256_DER { \ 0x30, 0x82, 0x03, 0x37, 0x30, 0x82, 0x02, 0x1f, 0xa0, 0x03, 0x02, 0x01, \ 0x02, 0x02, 0x01, 0x02, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, \ @@ -655,8 +655,8 @@ } /* END FILE */ -/* This is taken from server2.crt. */ -/* BEGIN FILE string macro TEST_SRV_CRT_RSA_SHA1_PEM server2.crt */ +/* This is taken from data_files/server2.crt. */ +/* BEGIN FILE string macro TEST_SRV_CRT_RSA_SHA1_PEM data_files/server2.crt */ #define TEST_SRV_CRT_RSA_SHA1_PEM \ "-----BEGIN CERTIFICATE-----\r\n" \ "MIIDNzCCAh+gAwIBAgIBAjANBgkqhkiG9w0BAQUFADA7MQswCQYDVQQGEwJOTDER\r\n" \ @@ -680,8 +680,8 @@ "-----END CERTIFICATE-----\r\n" /* END FILE */ -/* This is generated from server2.crt.der. */ -/* BEGIN FILE binary macro TEST_SRV_CRT_RSA_SHA1_DER server2.crt.der */ +/* This is generated from data_files/server2.crt.der. */ +/* BEGIN FILE binary macro TEST_SRV_CRT_RSA_SHA1_DER data_files/server2.crt.der */ #define TEST_SRV_CRT_RSA_SHA1_DER { \ 0x30, 0x82, 0x03, 0x37, 0x30, 0x82, 0x02, 0x1f, 0xa0, 0x03, 0x02, 0x01, \ 0x02, 0x02, 0x01, 0x02, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, \ @@ -755,8 +755,8 @@ } /* END FILE */ -/* This is taken from server2.key. */ -/* BEGIN FILE string macro TEST_SRV_KEY_RSA_PEM server2.key */ +/* This is taken from data_files/server2.key. */ +/* BEGIN FILE string macro TEST_SRV_KEY_RSA_PEM data_files/server2.key */ #define TEST_SRV_KEY_RSA_PEM \ "-----BEGIN RSA PRIVATE KEY-----\r\n" \ "MIIEpAIBAAKCAQEAwU2j3efNHdEE10lyuJmsDnjkOjxKzzoTFtBa5M2jAIin7h5r\r\n" \ @@ -787,8 +787,8 @@ "-----END RSA PRIVATE KEY-----\r\n" /* END FILE */ -/* This is generated from server2.key.der. */ -/* BEGIN FILE binary macro TEST_SRV_KEY_RSA_DER server2.key.der */ +/* This is generated from data_files/server2.key.der. */ +/* BEGIN FILE binary macro TEST_SRV_KEY_RSA_DER data_files/server2.key.der */ #define TEST_SRV_KEY_RSA_DER { \ 0x30, 0x82, 0x04, 0xa4, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, 0x01, 0x00, \ 0xc1, 0x4d, 0xa3, 0xdd, 0xe7, 0xcd, 0x1d, 0xd1, 0x04, 0xd7, 0x49, 0x72, \ @@ -893,8 +893,8 @@ } /* END FILE */ -/* This is taken from cli2.crt. */ -/* BEGIN FILE string macro TEST_CLI_CRT_EC_PEM cli2.crt */ +/* This is taken from data_files/cli2.crt. */ +/* BEGIN FILE string macro TEST_CLI_CRT_EC_PEM data_files/cli2.crt */ #define TEST_CLI_CRT_EC_PEM \ "-----BEGIN CERTIFICATE-----\r\n" \ "MIIB3zCCAWOgAwIBAgIBDTAMBggqhkjOPQQDAgUAMD4xCzAJBgNVBAYTAk5MMREw\r\n" \ @@ -911,8 +911,8 @@ "-----END CERTIFICATE-----\r\n" /* END FILE */ -/* This is generated from cli2.crt.der. */ -/* BEGIN FILE binary macro TEST_CLI_CRT_EC_DER cli2.crt.der */ +/* This is generated from data_files/cli2.crt.der. */ +/* BEGIN FILE binary macro TEST_CLI_CRT_EC_DER data_files/cli2.crt.der */ #define TEST_CLI_CRT_EC_DER { \ 0x30, 0x82, 0x01, 0xdf, 0x30, 0x82, 0x01, 0x63, 0xa0, 0x03, 0x02, 0x01, \ 0x02, 0x02, 0x01, 0x0d, 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, \ @@ -958,8 +958,8 @@ } /* END FILE */ -/* This is taken from cli2.key. */ -/* BEGIN FILE string macro TEST_CLI_KEY_EC_PEM cli2.key */ +/* This is taken from data_files/cli2.key. */ +/* BEGIN FILE string macro TEST_CLI_KEY_EC_PEM data_files/cli2.key */ #define TEST_CLI_KEY_EC_PEM \ "-----BEGIN EC PRIVATE KEY-----\r\n" \ "MHcCAQEEIPb3hmTxZ3/mZI3vyk7p3U3wBf+WIop6hDhkFzJhmLcqoAoGCCqGSM49\r\n" \ @@ -968,8 +968,8 @@ "-----END EC PRIVATE KEY-----\r\n" /* END FILE */ -/* This is generated from cli2.key.der. */ -/* BEGIN FILE binary macro TEST_CLI_KEY_EC_DER cli2.key.der */ +/* This is generated from data_files/cli2.key.der. */ +/* BEGIN FILE binary macro TEST_CLI_KEY_EC_DER data_files/cli2.key.der */ #define TEST_CLI_KEY_EC_DER { \ 0x30, 0x77, 0x02, 0x01, 0x01, 0x04, 0x20, 0xf6, 0xf7, 0x86, 0x64, 0xf1, \ 0x67, 0x7f, 0xe6, 0x64, 0x8d, 0xef, 0xca, 0x4e, 0xe9, 0xdd, 0x4d, 0xf0, \ @@ -985,8 +985,8 @@ } /* END FILE */ -/* This is taken from cli-rsa-sha256.crt. */ -/* BEGIN FILE string macro TEST_CLI_CRT_RSA_PEM cli-rsa-sha256.crt */ +/* This is taken from data_files/cli-rsa-sha256.crt. */ +/* BEGIN FILE string macro TEST_CLI_CRT_RSA_PEM data_files/cli-rsa-sha256.crt */ #define TEST_CLI_CRT_RSA_PEM \ "-----BEGIN CERTIFICATE-----\r\n" \ "MIIDPzCCAiegAwIBAgIBBDANBgkqhkiG9w0BAQsFADA7MQswCQYDVQQGEwJOTDER\r\n" \ @@ -1010,8 +1010,8 @@ "-----END CERTIFICATE-----\r\n" /* END FILE */ -/* This is generated from cli-rsa-sha256.crt.der. */ -/* BEGIN FILE binary macro TEST_CLI_CRT_RSA_DER cli-rsa-sha256.crt.der */ +/* This is generated from data_files/cli-rsa-sha256.crt.der. */ +/* BEGIN FILE binary macro TEST_CLI_CRT_RSA_DER data_files/cli-rsa-sha256.crt.der */ #define TEST_CLI_CRT_RSA_DER { \ 0x30, 0x82, 0x03, 0x3f, 0x30, 0x82, 0x02, 0x27, 0xa0, 0x03, 0x02, 0x01, \ 0x02, 0x02, 0x01, 0x04, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, \ @@ -1086,8 +1086,8 @@ } /* END FILE */ -/* This is taken from cli-rsa.key. */ -/* BEGIN FILE string macro TEST_CLI_KEY_RSA_PEM cli-rsa.key */ +/* This is taken from data_files/cli-rsa.key. */ +/* BEGIN FILE string macro TEST_CLI_KEY_RSA_PEM data_files/cli-rsa.key */ #define TEST_CLI_KEY_RSA_PEM \ "-----BEGIN RSA PRIVATE KEY-----\r\n" \ "MIIEpAIBAAKCAQEAyHTEzLn5tXnpRdkUYLB9u5Pyax6fM60Nj4o8VmXl3ETZzGaF\r\n" \ @@ -1118,8 +1118,8 @@ "-----END RSA PRIVATE KEY-----\r\n" /* END FILE */ -/* This is generated from cli-rsa.key.der. */ -/* BEGIN FILE binary macro TEST_CLI_KEY_RSA_DER cli-rsa.key.der */ +/* This is generated from data_files/cli-rsa.key.der. */ +/* BEGIN FILE binary macro TEST_CLI_KEY_RSA_DER data_files/cli-rsa.key.der */ #define TEST_CLI_KEY_RSA_DER { \ 0x30, 0x82, 0x04, 0xa4, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, 0x01, 0x00, \ 0xc8, 0x74, 0xc4, 0xcc, 0xb9, 0xf9, 0xb5, 0x79, 0xe9, 0x45, 0xd9, 0x14, \