From 21daa3c1ee47a9b531050faaf22df89903273b7d Mon Sep 17 00:00:00 2001 From: k-stachowiak Date: Tue, 29 Jan 2019 10:19:49 +0100 Subject: [PATCH 01/61] Reduce the timing tests complexity --- ChangeLog | 2 + tests/suites/test_suite_timing.data | 54 +-- tests/suites/test_suite_timing.function | 433 +++--------------------- 3 files changed, 66 insertions(+), 423 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5cfd9a28b..096be4521 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22,6 +22,8 @@ Changes Inserted as an enhancement for #1371 * Add support for alternative CSR headers, as used by Microsoft and defined in RFC 7468. Found by Michael Ernst. Fixes #767. + * Reduced the complexity of the timing tests, as they were failing in less + reliable environments. = mbed TLS 2.16.0 branch released 2018-12-21 diff --git a/tests/suites/test_suite_timing.data b/tests/suites/test_suite_timing.data index 4dddcf7fc..2522da1ea 100644 --- a/tests/suites/test_suite_timing.data +++ b/tests/suites/test_suite_timing.data @@ -1,41 +1,17 @@ -Timing: basic timer operation -timing_timer_simple: - -Timing: timer reset -timing_timer_reset: - -Timing: two parallel timers, delay 0 -timing_two_timers:0: - -Timing: two parallel timers, delay 100 -timing_two_timers:100: - -Timing: two parallel timers, delay 1000 -timing_two_timers:1000: - -Timing: two parallel timers, delay 10000 -timing_two_timers:10000: - -Timing: delay 0ms, 0ms -timing_delay:0:0: - -Timing: delay 0ms, 50ms -timing_delay:0:50: - -Timing: delay 50ms, 50ms -timing_delay:50:50: - -Timing: delay 50ms, 100ms -timing_delay:50:100: - -Timing: delay 50ms, 200ms -timing_delay:50:200: - -Timing: alarm in 0 second -timing_alarm:0: - -Timing: alarm in 1 second -timing_alarm:1: - Timing: hardclock timing_hardclock: + +Timing: get timer +timing_get_timer: + +Timing: set alarm with no delay +timing_set_alarm:0: + +Timing: set alarm with 1s delay +timing_set_alarm:1: + +Timing: delay 0ms +timing_delay:0: + +Timing: delay 100ms +timing_delay:100: diff --git a/tests/suites/test_suite_timing.function b/tests/suites/test_suite_timing.function index 1610155fb..42d3da6ac 100644 --- a/tests/suites/test_suite_timing.function +++ b/tests/suites/test_suite_timing.function @@ -1,51 +1,14 @@ /* BEGIN_HEADER */ -/* This test module exercises the timing module. One of the expected failure - modes is for timers to never expire, which could lead to an infinite loop. - The function timing_timer_simple is protected against this failure mode and - checks that timers do expire. Other functions will terminate if their - timers do expire. Therefore it is recommended to run timing_timer_simple - first and run other test functions only if that timing_timer_simple - succeeded. */ +/* This test module exercises the timing module. Since, depending on the + * underlying operating system, the timing routines are not always reliable, + * this suite only performs very basic sanity checks of the timing API. + */ #include #include "mbedtls/timing.h" -/* Wait this many milliseconds for a short timing test. This duration - should be large enough that, in practice, if you read the timer - value twice in a row, it won't have jumped by that much. */ -#define TIMING_SHORT_TEST_MS 100 - -/* A loop that waits TIMING_SHORT_TEST_MS must not take more than this many - iterations. This value needs to be large enough to accommodate fast - platforms (e.g. at 4GHz and 10 cycles/iteration a CPU can run through 20 - million iterations in 50ms). The only motivation to keep this value low is - to avoid having an infinite loop if the timer functions are not implemented - correctly. Ideally this value should be based on the processor speed but we - don't have this information! */ -#define TIMING_SHORT_TEST_ITERATIONS_MAX 1e8 - -/* alarm(0) must fire in no longer than this amount of time. */ -#define TIMING_ALARM_0_DELAY_MS TIMING_SHORT_TEST_MS - -static int expected_delay_status( uint32_t int_ms, uint32_t fin_ms, - unsigned long actual_ms ) -{ - return( fin_ms == 0 ? -1 : - actual_ms >= fin_ms ? 2 : - actual_ms >= int_ms ? 1 : - 0 ); -} - -/* Some conditions in timing_timer_simple suggest that timers are unreliable. - Most other test cases rely on timers to terminate, and could loop - indefinitely if timers are too broken. So if timing_timer_simple detected a - timer that risks not terminating (going backwards, or not reaching the - desired count in the alloted clock cycles), set this flag to immediately - fail those other tests without running any timers. */ -static int timers_are_badly_broken = 0; - /* END_HEADER */ /* BEGIN_DEPENDENCIES @@ -53,351 +16,53 @@ static int timers_are_badly_broken = 0; * END_DEPENDENCIES */ -/* BEGIN_CASE */ -void timing_timer_simple( ) -{ - struct mbedtls_timing_hr_time timer; - unsigned long millis = 0; - unsigned long new_millis = 0; - unsigned long iterations = 0; - /* Start the timer. */ - (void) mbedtls_timing_get_timer( &timer, 1 ); - /* Busy-wait loop for a few milliseconds. */ - do - { - new_millis = mbedtls_timing_get_timer( &timer, 0 ); - ++iterations; - /* Check that the timer didn't go backwards */ - TEST_ASSERT( new_millis >= millis ); - millis = new_millis; - } - while( millis < TIMING_SHORT_TEST_MS && - iterations <= TIMING_SHORT_TEST_ITERATIONS_MAX ); - /* The wait duration should have been large enough for at least a - few runs through the loop, even on the slowest realistic platform. */ - TEST_ASSERT( iterations >= 2 ); - /* The wait duration shouldn't have overflowed the iteration count. */ - TEST_ASSERT( iterations < TIMING_SHORT_TEST_ITERATIONS_MAX ); - return; - -exit: - if( iterations >= TIMING_SHORT_TEST_ITERATIONS_MAX || - new_millis < millis ) - { - /* The timer was very unreliable: it didn't increment and the loop ran - out, or it went backwards. Other tests that use timers might go - into an infinite loop, so we'll skip them. */ - timers_are_badly_broken = 1; - } - - /* No cleanup needed, but show some diagnostic iterations, because timing - problems can be hard to reproduce. */ - mbedtls_fprintf( stdout, " Finished with millis=%lu new_millis=%lu get(timer)<=%lu iterations=%lu\n", - millis, new_millis, mbedtls_timing_get_timer( &timer, 0 ), - iterations ); -} -/* END_CASE */ - -/* BEGIN_CASE */ -void timing_timer_reset( ) -{ - struct mbedtls_timing_hr_time timer; - unsigned long millis = 0; - unsigned long iterations = 0; - - /* Skip this test if it looks like timers don't work at all, to avoid an - infinite loop below. */ - TEST_ASSERT( !timers_are_badly_broken ); - - /* Start the timer. Timers are always reset to 0. */ - TEST_ASSERT( mbedtls_timing_get_timer( &timer, 1 ) == 0 ); - /* Busy-wait loop for a few milliseconds */ - do - { - ++iterations; - millis = mbedtls_timing_get_timer( &timer, 0 ); - } - while( millis < TIMING_SHORT_TEST_MS ); - - /* Reset the timer and check that it has restarted. */ - TEST_ASSERT( mbedtls_timing_get_timer( &timer, 1 ) == 0 ); - /* Read the timer immediately after reset. It should be 0 or close - to it. */ - TEST_ASSERT( mbedtls_timing_get_timer( &timer, 0 ) < TIMING_SHORT_TEST_MS ); - return; - -exit: - /* No cleanup needed, but show some diagnostic information, because timing - problems can be hard to reproduce. */ - if( !timers_are_badly_broken ) - mbedtls_fprintf( stdout, " Finished with millis=%lu get(timer)<=%lu iterations=%lu\n", - millis, mbedtls_timing_get_timer( &timer, 0 ), - iterations ); -} -/* END_CASE */ - -/* BEGIN_CASE */ -void timing_two_timers( int delta ) -{ - struct mbedtls_timing_hr_time timer1, timer2; - unsigned long millis1 = 0, millis2 = 0; - - /* Skip this test if it looks like timers don't work at all, to avoid an - infinite loop below. */ - TEST_ASSERT( !timers_are_badly_broken ); - - /* Start the first timer and wait for a short time. */ - (void) mbedtls_timing_get_timer( &timer1, 1 ); - do - { - millis1 = mbedtls_timing_get_timer( &timer1, 0 ); - } - while( millis1 < TIMING_SHORT_TEST_MS ); - - /* Do a short busy-wait, so that the difference between timer1 and timer2 - doesn't practically always end up being very close to a whole number of - milliseconds. */ - while( delta > 0 ) - --delta; - - /* Start the second timer and compare it with the first. */ - mbedtls_timing_get_timer( &timer2, 1 ); - do - { - millis1 = mbedtls_timing_get_timer( &timer1, 0 ); - millis2 = mbedtls_timing_get_timer( &timer2, 0 ); - /* The first timer should always be ahead of the first. */ - TEST_ASSERT( millis1 > millis2 ); - /* The timers shouldn't drift apart, i.e. millis2-millis1 should stay - roughly constant, but this is hard to test reliably, especially in - a busy environment such as an overloaded continuous integration - system, so we don't test it it. */ - } - while( millis2 < TIMING_SHORT_TEST_MS ); - - return; - -exit: - /* No cleanup needed, but show some diagnostic iterations, because timing - problems can be hard to reproduce. */ - if( !timers_are_badly_broken ) - mbedtls_fprintf( stdout, " Finished with millis1=%lu get(timer1)<=%lu millis2=%lu get(timer2)<=%lu\n", - millis1, mbedtls_timing_get_timer( &timer1, 0 ), - millis2, mbedtls_timing_get_timer( &timer2, 0 ) ); -} -/* END_CASE */ - -/* BEGIN_CASE */ -void timing_alarm( int seconds ) -{ - struct mbedtls_timing_hr_time timer; - unsigned long millis = 0; - /* We check that about the desired number of seconds has elapsed. Be - slightly liberal with the lower bound, so as to allow platforms where - the alarm (with second resolution) and the timer (with millisecond - resolution) are based on different clocks. Be very liberal with the - upper bound, because the platform might be busy. */ - unsigned long millis_min = ( seconds > 0 ? - seconds * 900 : - 0 ); - unsigned long millis_max = ( seconds > 0 ? - seconds * 1100 + 400 : - TIMING_ALARM_0_DELAY_MS ); - unsigned long iterations = 0; - - /* Skip this test if it looks like timers don't work at all, to avoid an - infinite loop below. */ - TEST_ASSERT( !timers_are_badly_broken ); - - /* Set an alarm and count how long it takes with a timer. */ - (void) mbedtls_timing_get_timer( &timer, 1 ); - mbedtls_set_alarm( seconds ); - - if( seconds > 0 ) - { - /* We set the alarm for at least 1 second. It should not have fired - immediately, even on a slow and busy platform. */ - TEST_ASSERT( !mbedtls_timing_alarmed ); - } - /* A 0-second alarm should fire quickly, but we don't guarantee that it - fires immediately, so mbedtls_timing_alarmed may or may not be set at - this point. */ - - /* Busy-wait until the alarm rings */ - do - { - ++iterations; - millis = mbedtls_timing_get_timer( &timer, 0 ); - } - while( !mbedtls_timing_alarmed && millis <= millis_max ); - - TEST_ASSERT( mbedtls_timing_alarmed ); - TEST_ASSERT( millis >= millis_min ); - TEST_ASSERT( millis <= millis_max ); - - mbedtls_timing_alarmed = 0; - return; - -exit: - /* Show some diagnostic iterations, because timing - problems can be hard to reproduce. */ - if( !timers_are_badly_broken ) - mbedtls_fprintf( stdout, " Finished with alarmed=%d millis=%lu get(timer)<=%lu iterations=%lu\n", - mbedtls_timing_alarmed, - millis, mbedtls_timing_get_timer( &timer, 0 ), - iterations ); - /* Cleanup */ - mbedtls_timing_alarmed = 0; -} -/* END_CASE */ - -/* BEGIN_CASE */ -void timing_delay( int int_ms, int fin_ms ) -{ - /* This function assumes that if int_ms is nonzero then it is large - enough that we have time to read all timers at least once in an - interval of time lasting int_ms milliseconds, and likewise for (fin_ms - - int_ms). So don't call it with arguments that are too small. */ - - mbedtls_timing_delay_context delay; - struct mbedtls_timing_hr_time timer; - unsigned long delta = 0; /* delay started between timer=0 and timer=delta */ - unsigned long before = 0, after = 0; - unsigned long iterations = 0; - int status = -2; - int saw_status_1 = 0; - int warn_inconclusive = 0; - - assert( int_ms >= 0 ); - assert( fin_ms >= 0 ); - - /* Skip this test if it looks like timers don't work at all, to avoid an - infinite loop below. */ - TEST_ASSERT( !timers_are_badly_broken ); - - /* Start a reference timer. Program a delay, and verify that the status of - the delay is consistent with the time given by the reference timer. */ - (void) mbedtls_timing_get_timer( &timer, 1 ); - mbedtls_timing_set_delay( &delay, int_ms, fin_ms ); - /* Set delta to an upper bound for the interval between the start of timer - and the start of delay. Reading timer after starting delay gives us an - upper bound for the interval, rounded to a 1ms precision. Since this - might have been rounded down, but we need an upper bound, we add 1. */ - delta = mbedtls_timing_get_timer( &timer, 0 ) + 1; - - status = mbedtls_timing_get_delay( &delay ); - if( fin_ms == 0 ) - { - /* Cancelled timer. Just check the correct status for this case. */ - TEST_ASSERT( status == -1 ); - return; - } - - /* Initially, none of the delays must be passed yet if they're nonzero. - This could fail for very small values of int_ms and fin_ms, where "very - small" depends how fast and how busy the platform is. */ - if( int_ms > 0 ) - { - TEST_ASSERT( status == 0 ); - } - else - { - TEST_ASSERT( status == 1 ); - } - - do - { - unsigned long delay_min, delay_max; - int status_min, status_max; - ++iterations; - before = mbedtls_timing_get_timer( &timer, 0 ); - status = mbedtls_timing_get_delay( &delay ); - after = mbedtls_timing_get_timer( &timer, 0 ); - /* At a time between before and after, the delay's status was status. - Check that this is consistent given that the delay was started - between times 0 and delta. */ - delay_min = ( before > delta ? before - delta : 0 ); - status_min = expected_delay_status( int_ms, fin_ms, delay_min ); - delay_max = after; - status_max = expected_delay_status( int_ms, fin_ms, delay_max ); - TEST_ASSERT( status >= status_min ); - TEST_ASSERT( status <= status_max ); - if( status == 1 ) - saw_status_1 = 1; - } - while ( before <= fin_ms + delta && status != 2 ); - - /* Since we've waited at least fin_ms, the delay must have fully - expired. */ - TEST_ASSERT( status == 2 ); - - /* If the second delay is more than the first, then there must have been a - point in time when the first delay was passed but not the second delay. - This could fail for very small values of (fin_ms - int_ms), where "very - small" depends how fast and how busy the platform is. In practice, this - is the test that's most likely to fail on a heavily loaded machine. */ - if( fin_ms > int_ms ) - { - warn_inconclusive = 1; - TEST_ASSERT( saw_status_1 ); - } - - return; - -exit: - /* No cleanup needed, but show some diagnostic iterations, because timing - problems can be hard to reproduce. */ - if( !timers_are_badly_broken ) - mbedtls_fprintf( stdout, " Finished with delta=%lu before=%lu after=%lu status=%d iterations=%lu\n", - delta, before, after, status, iterations ); - if( warn_inconclusive ) - mbedtls_fprintf( stdout, " Inconclusive test, try running it on a less heavily loaded machine.\n" ); - } -/* END_CASE */ - /* BEGIN_CASE */ void timing_hardclock( ) { - /* We make very few guarantees about mbedtls_timing_hardclock: its rate is - platform-dependent, it can wrap around. So there isn't much we can - test. But we do at least test that it doesn't crash, stall or return - completely nonsensical values. */ - - struct mbedtls_timing_hr_time timer; - unsigned long hardclock0 = -1, hardclock1 = -1, delta1 = -1; - - /* Skip this test if it looks like timers don't work at all, to avoid an - infinite loop below. */ - TEST_ASSERT( !timers_are_badly_broken ); - - hardclock0 = mbedtls_timing_hardclock( ); - /* Wait 2ms to ensure a nonzero delay. Since the timer interface has 1ms - resolution and unspecified precision, waiting 1ms might be a very small - delay that's rounded up. */ - (void) mbedtls_timing_get_timer( &timer, 1 ); - while( mbedtls_timing_get_timer( &timer, 0 ) < 2 ) - /*busy-wait loop*/; - hardclock1 = mbedtls_timing_hardclock( ); - - /* Although the hardclock counter can wrap around, the difference - (hardclock1 - hardclock0) is taken modulo the type size, so it is - correct as long as the counter only wrapped around at most once. We - further require the difference to be nonzero (after a wait of more than - 1ms, the counter must have changed), and not to be overly large (after - a wait of less than 3ms, plus time lost because other processes were - scheduled on the CPU). If the hardclock counter runs at 4GHz, then - 1000000000 (which is 1/4 of the counter wraparound on a 32-bit machine) - allows 250ms. */ - delta1 = hardclock1 - hardclock0; - TEST_ASSERT( delta1 > 0 ); - TEST_ASSERT( delta1 < 1000000000 ); - return; - -exit: - /* No cleanup needed, but show some diagnostic iterations, because timing - problems can be hard to reproduce. */ - if( !timers_are_badly_broken ) - mbedtls_fprintf( stdout, " Finished with hardclock=%lu,%lu\n", - hardclock0, hardclock1 ); + (void) mbedtls_timing_hardclock(); + /* This goto is added to avoid warnings from the generated code. */ + goto exit; +} +/* END_CASE */ + +/* BEGIN_CASE */ +void timing_get_timer( ) +{ + struct mbedtls_timing_hr_time time; + (void) mbedtls_timing_get_timer( &time, 1 ); + (void) mbedtls_timing_get_timer( &time, 0 ); + /* This goto is added to avoid warnings from the generated code. */ + goto exit; +} +/* END_CASE */ + +/* BEGIN_CASE */ +void timing_set_alarm( int seconds ) +{ + if( seconds == 0 ) { + mbedtls_set_alarm( seconds ); + TEST_ASSERT( mbedtls_timing_alarmed == 1 ); + } else { + mbedtls_set_alarm( seconds ); + TEST_ASSERT( mbedtls_timing_alarmed == 0 || + mbedtls_timing_alarmed == 1 ); + } +} +/* END_CASE */ + +/* BEGIN_CASE */ +void timing_delay( int fin_ms ) +{ + mbedtls_timing_delay_context ctx; + int result; + if( fin_ms == 0 ) { + mbedtls_timing_set_delay( &ctx, 0, 0 ); + result = mbedtls_timing_get_delay( &ctx ); + TEST_ASSERT( result == -1 ); + } else { + mbedtls_timing_set_delay( &ctx, fin_ms / 2, fin_ms ); + result = mbedtls_timing_get_delay( &ctx ); + TEST_ASSERT( result >= 0 && result <= 2 ); + } } /* END_CASE */ From f4ab6b21bda3e73d5fedca6268a257a8890dbfb4 Mon Sep 17 00:00:00 2001 From: k-stachowiak Date: Tue, 29 Jan 2019 11:55:11 +0100 Subject: [PATCH 02/61] Improve wording in the ChangeLog --- ChangeLog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 096be4521..26c7cd325 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22,8 +22,8 @@ Changes Inserted as an enhancement for #1371 * Add support for alternative CSR headers, as used by Microsoft and defined in RFC 7468. Found by Michael Ernst. Fixes #767. - * Reduced the complexity of the timing tests, as they were failing in less - reliable environments. + * Reduced the complexity of the timing tests, as they were assuming more than + the underlying OS actually guarantees. = mbed TLS 2.16.0 branch released 2018-12-21 From 1bc1a4c639a9aa5f68261a48e7d0e172d4799537 Mon Sep 17 00:00:00 2001 From: Peter Kolbus Date: Fri, 1 Feb 2019 17:19:08 -0600 Subject: [PATCH 03/61] all.sh: Fix check_headers_in_cpp When all.sh invokes check_headers_in_cpp, a backup config.h exists. This causes a stray difference vs cpp_dummy_build.cpp. Fix by only collecting the *.h files in include/mbedtls. Change-Id: Ifd415027e856858579a6699538f06fc49c793570 --- tests/scripts/all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 182f7fff4..e7daa29f0 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -295,7 +295,7 @@ check_tools() } check_headers_in_cpp () { - ls include/mbedtls >headers.txt + ls include/mbedtls | grep "\.h$" >headers.txt Date: Sun, 3 Feb 2019 08:41:41 -0600 Subject: [PATCH 04/61] Add ChangeLog entry --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5c2fbbbd4..44dd5d26a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,8 @@ Bugfix in X.509 module. Fixes #2212. * Reduce stack usage of `mpi_write_hlp()` by eliminating recursion. Fixes #2190. + * Fix false failure in all.sh when backup files exist in include/mbedtls + (e.g. config.h.bak). Fixed by Peter Kolbus (Garmin) #2407. Changes * Include configuration file in all header files that use configuration, From c5a4a13a5c2d496ef5508527561e75ce359effd8 Mon Sep 17 00:00:00 2001 From: k-stachowiak Date: Tue, 5 Feb 2019 09:11:58 +0100 Subject: [PATCH 05/61] Apply imperative style in the changelog entry --- ChangeLog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 26c7cd325..f067bd387 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22,8 +22,8 @@ Changes Inserted as an enhancement for #1371 * Add support for alternative CSR headers, as used by Microsoft and defined in RFC 7468. Found by Michael Ernst. Fixes #767. - * Reduced the complexity of the timing tests, as they were assuming more than - the underlying OS actually guarantees. + * Reduce the complexity of the timing tests. They were assuming more than the + underlying OS actually guarantees. = mbed TLS 2.16.0 branch released 2018-12-21 From a1dc9117a7453cb1a95ce38c4fd1677db35525f6 Mon Sep 17 00:00:00 2001 From: k-stachowiak Date: Tue, 5 Feb 2019 09:22:20 +0100 Subject: [PATCH 06/61] Correct code formatting in the timing test suites --- tests/suites/test_suite_timing.function | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/suites/test_suite_timing.function b/tests/suites/test_suite_timing.function index 42d3da6ac..74dc82317 100644 --- a/tests/suites/test_suite_timing.function +++ b/tests/suites/test_suite_timing.function @@ -39,10 +39,13 @@ void timing_get_timer( ) /* BEGIN_CASE */ void timing_set_alarm( int seconds ) { - if( seconds == 0 ) { + if( seconds == 0 ) + { mbedtls_set_alarm( seconds ); TEST_ASSERT( mbedtls_timing_alarmed == 1 ); - } else { + } + else + { mbedtls_set_alarm( seconds ); TEST_ASSERT( mbedtls_timing_alarmed == 0 || mbedtls_timing_alarmed == 1 ); @@ -55,11 +58,14 @@ void timing_delay( int fin_ms ) { mbedtls_timing_delay_context ctx; int result; - if( fin_ms == 0 ) { + if( fin_ms == 0 ) + { mbedtls_timing_set_delay( &ctx, 0, 0 ); result = mbedtls_timing_get_delay( &ctx ); TEST_ASSERT( result == -1 ); - } else { + } + else + { mbedtls_timing_set_delay( &ctx, fin_ms / 2, fin_ms ); result = mbedtls_timing_get_delay( &ctx ); TEST_ASSERT( result >= 0 && result <= 2 ); From bc81884e3a3808c06a97043eb23b53bd0d2a4bfb Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Tue, 16 Oct 2018 21:08:38 +0100 Subject: [PATCH 07/61] Query config through ssl_server2 and ssl_client2 cmdline --- programs/Makefile | 8 +- programs/ssl/query_config.c | 2466 +++++++++++++++++++++++++++++++++++ programs/ssl/ssl_client2.c | 10 + programs/ssl/ssl_server2.c | 10 + 4 files changed, 2490 insertions(+), 4 deletions(-) create mode 100644 programs/ssl/query_config.c diff --git a/programs/Makefile b/programs/Makefile index b6d1fa25b..1d4a801c7 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -212,17 +212,17 @@ ssl/ssl_client1$(EXEXT): ssl/ssl_client1.c $(DEP) echo " CC ssl/ssl_client1.c" $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_client1.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ -ssl/ssl_client2$(EXEXT): ssl/ssl_client2.c $(DEP) +ssl/ssl_client2$(EXEXT): ssl/ssl_client2.c ssl/query_config.c $(DEP) echo " CC ssl/ssl_client2.c" - $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_client2.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ + $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_client2.c ssl/query_config.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ ssl/ssl_server$(EXEXT): ssl/ssl_server.c $(DEP) echo " CC ssl/ssl_server.c" $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_server.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ -ssl/ssl_server2$(EXEXT): ssl/ssl_server2.c $(DEP) +ssl/ssl_server2$(EXEXT): ssl/ssl_server2.c ssl/query_config.c $(DEP) echo " CC ssl/ssl_server2.c" - $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_server2.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ + $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_server2.c ssl/query_config.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ ssl/ssl_fork_server$(EXEXT): ssl/ssl_fork_server.c $(DEP) echo " CC ssl/ssl_fork_server.c" diff --git a/programs/ssl/query_config.c b/programs/ssl/query_config.c new file mode 100644 index 000000000..1a773c235 --- /dev/null +++ b/programs/ssl/query_config.c @@ -0,0 +1,2466 @@ +/* + * Query configuration information + * + * Copyright (C) 2018, Arm Limited, All Rights Reserved + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * This file is part of Mbed TLS (https://tls.mbed.org) + */ + +#if !defined(MBEDTLS_CONFIG_FILE) +#include "mbedtls/config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + +#if defined(MBEDTLS_PLATFORM_C) +#include "mbedtls/platform.h" +#else +#define mbedtls_printf printf +#endif /* MBEDTLS_PLATFORM_C */ + +/* Include all the headers with public APIs in case they modify any configs */ +#include "mbedtls/aes.h" +#include "mbedtls/aesni.h" +#include "mbedtls/arc4.h" +#include "mbedtls/aria.h" +#include "mbedtls/asn1.h" +#include "mbedtls/asn1write.h" +#include "mbedtls/base64.h" +#include "mbedtls/bignum.h" +#include "mbedtls/blowfish.h" +#include "mbedtls/camellia.h" +#include "mbedtls/ccm.h" +#include "mbedtls/certs.h" +#include "mbedtls/chacha20.h" +#include "mbedtls/chachapoly.h" +#include "mbedtls/cipher.h" +#include "mbedtls/cmac.h" +#include "mbedtls/ctr_drbg.h" +#include "mbedtls/debug.h" +#include "mbedtls/des.h" +#include "mbedtls/dhm.h" +#include "mbedtls/ecdh.h" +#include "mbedtls/ecdsa.h" +#include "mbedtls/ecjpake.h" +#include "mbedtls/ecp.h" +#include "mbedtls/entropy.h" +#include "mbedtls/entropy_poll.h" +#include "mbedtls/error.h" +#include "mbedtls/gcm.h" +#include "mbedtls/havege.h" +#include "mbedtls/hkdf.h" +#include "mbedtls/hmac_drbg.h" +#include "mbedtls/md.h" +#include "mbedtls/md2.h" +#include "mbedtls/md4.h" +#include "mbedtls/md5.h" +#include "mbedtls/memory_buffer_alloc.h" +#include "mbedtls/net_sockets.h" +#include "mbedtls/nist_kw.h" +#include "mbedtls/oid.h" +#include "mbedtls/padlock.h" +#include "mbedtls/pem.h" +#include "mbedtls/pk.h" +#include "mbedtls/pkcs11.h" +#include "mbedtls/pkcs12.h" +#include "mbedtls/pkcs5.h" +#include "mbedtls/platform.h" +#include "mbedtls/platform_time.h" +#include "mbedtls/platform_util.h" +#include "mbedtls/poly1305.h" +#include "mbedtls/ripemd160.h" +#include "mbedtls/rsa.h" +#include "mbedtls/sha1.h" +#include "mbedtls/sha256.h" +#include "mbedtls/sha512.h" +#include "mbedtls/ssl.h" +#include "mbedtls/ssl_cache.h" +#include "mbedtls/ssl_ciphersuites.h" +#include "mbedtls/ssl_cookie.h" +#include "mbedtls/ssl_internal.h" +#include "mbedtls/ssl_ticket.h" +#include "mbedtls/threading.h" +#include "mbedtls/timing.h" +#include "mbedtls/version.h" +#include "mbedtls/x509.h" +#include "mbedtls/x509_crl.h" +#include "mbedtls/x509_crt.h" +#include "mbedtls/x509_csr.h" +#include "mbedtls/xtea.h" + +#include +#include + +/* Helper macros to convert a macro or its expansion into a string */ +#define MACRO_EXPANSION_TO_STR(macro) MACRO_NAME_TO_STR(macro) +#define MACRO_NAME_TO_STR(macro) strlen( #macro ) > 0 ? #macro "\n" : "" + +int query_config( const char *config ) +{ +#if defined(MBEDTLS_HAVE_ASM) + if( strcmp( "MBEDTLS_HAVE_ASM", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_HAVE_ASM ) ); + return( 0 ); + } +#endif /* MBEDTLS_HAVE_ASM */ + +#if defined(MBEDTLS_NO_UDBL_DIVISION) + if( strcmp( "MBEDTLS_NO_UDBL_DIVISION", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_NO_UDBL_DIVISION ) ); + return( 0 ); + } +#endif /* MBEDTLS_NO_UDBL_DIVISION */ + +#if defined(MBEDTLS_NO_64BIT_MULTIPLICATION) + if( strcmp( "MBEDTLS_NO_64BIT_MULTIPLICATION", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_NO_64BIT_MULTIPLICATION ) ); + return( 0 ); + } +#endif /* MBEDTLS_NO_64BIT_MULTIPLICATION */ + +#if defined(MBEDTLS_HAVE_SSE2) + if( strcmp( "MBEDTLS_HAVE_SSE2", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_HAVE_SSE2 ) ); + return( 0 ); + } +#endif /* MBEDTLS_HAVE_SSE2 */ + +#if defined(MBEDTLS_HAVE_TIME) + if( strcmp( "MBEDTLS_HAVE_TIME", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_HAVE_TIME ) ); + return( 0 ); + } +#endif /* MBEDTLS_HAVE_TIME */ + +#if defined(MBEDTLS_HAVE_TIME_DATE) + if( strcmp( "MBEDTLS_HAVE_TIME_DATE", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_HAVE_TIME_DATE ) ); + return( 0 ); + } +#endif /* MBEDTLS_HAVE_TIME_DATE */ + +#if defined(MBEDTLS_PLATFORM_MEMORY) + if( strcmp( "MBEDTLS_PLATFORM_MEMORY", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_MEMORY ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_MEMORY */ + +#if defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS) + if( strcmp( "MBEDTLS_PLATFORM_NO_STD_FUNCTIONS", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_NO_STD_FUNCTIONS ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_NO_STD_FUNCTIONS */ + +#if defined(MBEDTLS_PLATFORM_EXIT_ALT) + if( strcmp( "MBEDTLS_PLATFORM_EXIT_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_EXIT_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_EXIT_ALT */ + +#if defined(MBEDTLS_PLATFORM_TIME_ALT) + if( strcmp( "MBEDTLS_PLATFORM_TIME_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_TIME_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_TIME_ALT */ + +#if defined(MBEDTLS_PLATFORM_FPRINTF_ALT) + if( strcmp( "MBEDTLS_PLATFORM_FPRINTF_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_FPRINTF_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_FPRINTF_ALT */ + +#if defined(MBEDTLS_PLATFORM_PRINTF_ALT) + if( strcmp( "MBEDTLS_PLATFORM_PRINTF_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_PRINTF_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_PRINTF_ALT */ + +#if defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) + if( strcmp( "MBEDTLS_PLATFORM_SNPRINTF_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_SNPRINTF_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_SNPRINTF_ALT */ + +#if defined(MBEDTLS_PLATFORM_NV_SEED_ALT) + if( strcmp( "MBEDTLS_PLATFORM_NV_SEED_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_NV_SEED_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_NV_SEED_ALT */ + +#if defined(MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT) + if( strcmp( "MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT */ + +#if defined(MBEDTLS_DEPRECATED_WARNING) + if( strcmp( "MBEDTLS_DEPRECATED_WARNING", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_DEPRECATED_WARNING ) ); + return( 0 ); + } +#endif /* MBEDTLS_DEPRECATED_WARNING */ + +#if defined(MBEDTLS_DEPRECATED_REMOVED) + if( strcmp( "MBEDTLS_DEPRECATED_REMOVED", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_DEPRECATED_REMOVED ) ); + return( 0 ); + } +#endif /* MBEDTLS_DEPRECATED_REMOVED */ + +#if defined(MBEDTLS_TIMING_ALT) + if( strcmp( "MBEDTLS_TIMING_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_TIMING_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_TIMING_ALT */ + +#if defined(MBEDTLS_AES_ALT) + if( strcmp( "MBEDTLS_AES_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_AES_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_AES_ALT */ + +#if defined(MBEDTLS_ARC4_ALT) + if( strcmp( "MBEDTLS_ARC4_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ARC4_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_ARC4_ALT */ + +#if defined(MBEDTLS_ARIA_ALT) + if( strcmp( "MBEDTLS_ARIA_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ARIA_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_ARIA_ALT */ + +#if defined(MBEDTLS_BLOWFISH_ALT) + if( strcmp( "MBEDTLS_BLOWFISH_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_BLOWFISH_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_BLOWFISH_ALT */ + +#if defined(MBEDTLS_CAMELLIA_ALT) + if( strcmp( "MBEDTLS_CAMELLIA_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CAMELLIA_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_CAMELLIA_ALT */ + +#if defined(MBEDTLS_CCM_ALT) + if( strcmp( "MBEDTLS_CCM_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CCM_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_CCM_ALT */ + +#if defined(MBEDTLS_CHACHA20_ALT) + if( strcmp( "MBEDTLS_CHACHA20_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CHACHA20_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_CHACHA20_ALT */ + +#if defined(MBEDTLS_CHACHAPOLY_ALT) + if( strcmp( "MBEDTLS_CHACHAPOLY_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CHACHAPOLY_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_CHACHAPOLY_ALT */ + +#if defined(MBEDTLS_CMAC_ALT) + if( strcmp( "MBEDTLS_CMAC_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CMAC_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_CMAC_ALT */ + +#if defined(MBEDTLS_DES_ALT) + if( strcmp( "MBEDTLS_DES_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_DES_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_DES_ALT */ + +#if defined(MBEDTLS_DHM_ALT) + if( strcmp( "MBEDTLS_DHM_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_DHM_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_DHM_ALT */ + +#if defined(MBEDTLS_ECJPAKE_ALT) + if( strcmp( "MBEDTLS_ECJPAKE_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECJPAKE_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECJPAKE_ALT */ + +#if defined(MBEDTLS_GCM_ALT) + if( strcmp( "MBEDTLS_GCM_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_GCM_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_GCM_ALT */ + +#if defined(MBEDTLS_NIST_KW_ALT) + if( strcmp( "MBEDTLS_NIST_KW_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_NIST_KW_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_NIST_KW_ALT */ + +#if defined(MBEDTLS_MD2_ALT) + if( strcmp( "MBEDTLS_MD2_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MD2_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_MD2_ALT */ + +#if defined(MBEDTLS_MD4_ALT) + if( strcmp( "MBEDTLS_MD4_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MD4_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_MD4_ALT */ + +#if defined(MBEDTLS_MD5_ALT) + if( strcmp( "MBEDTLS_MD5_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MD5_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_MD5_ALT */ + +#if defined(MBEDTLS_POLY1305_ALT) + if( strcmp( "MBEDTLS_POLY1305_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_POLY1305_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_POLY1305_ALT */ + +#if defined(MBEDTLS_RIPEMD160_ALT) + if( strcmp( "MBEDTLS_RIPEMD160_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_RIPEMD160_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_RIPEMD160_ALT */ + +#if defined(MBEDTLS_RSA_ALT) + if( strcmp( "MBEDTLS_RSA_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_RSA_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_RSA_ALT */ + +#if defined(MBEDTLS_SHA1_ALT) + if( strcmp( "MBEDTLS_SHA1_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SHA1_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_SHA1_ALT */ + +#if defined(MBEDTLS_SHA256_ALT) + if( strcmp( "MBEDTLS_SHA256_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SHA256_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_SHA256_ALT */ + +#if defined(MBEDTLS_SHA512_ALT) + if( strcmp( "MBEDTLS_SHA512_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SHA512_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_SHA512_ALT */ + +#if defined(MBEDTLS_XTEA_ALT) + if( strcmp( "MBEDTLS_XTEA_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_XTEA_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_XTEA_ALT */ + +#if defined(MBEDTLS_ECP_ALT) + if( strcmp( "MBEDTLS_ECP_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECP_ALT */ + +#if defined(MBEDTLS_MD2_PROCESS_ALT) + if( strcmp( "MBEDTLS_MD2_PROCESS_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MD2_PROCESS_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_MD2_PROCESS_ALT */ + +#if defined(MBEDTLS_MD4_PROCESS_ALT) + if( strcmp( "MBEDTLS_MD4_PROCESS_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MD4_PROCESS_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_MD4_PROCESS_ALT */ + +#if defined(MBEDTLS_MD5_PROCESS_ALT) + if( strcmp( "MBEDTLS_MD5_PROCESS_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MD5_PROCESS_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_MD5_PROCESS_ALT */ + +#if defined(MBEDTLS_RIPEMD160_PROCESS_ALT) + if( strcmp( "MBEDTLS_RIPEMD160_PROCESS_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_RIPEMD160_PROCESS_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_RIPEMD160_PROCESS_ALT */ + +#if defined(MBEDTLS_SHA1_PROCESS_ALT) + if( strcmp( "MBEDTLS_SHA1_PROCESS_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SHA1_PROCESS_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_SHA1_PROCESS_ALT */ + +#if defined(MBEDTLS_SHA256_PROCESS_ALT) + if( strcmp( "MBEDTLS_SHA256_PROCESS_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SHA256_PROCESS_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_SHA256_PROCESS_ALT */ + +#if defined(MBEDTLS_SHA512_PROCESS_ALT) + if( strcmp( "MBEDTLS_SHA512_PROCESS_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SHA512_PROCESS_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_SHA512_PROCESS_ALT */ + +#if defined(MBEDTLS_DES_SETKEY_ALT) + if( strcmp( "MBEDTLS_DES_SETKEY_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_DES_SETKEY_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_DES_SETKEY_ALT */ + +#if defined(MBEDTLS_DES_CRYPT_ECB_ALT) + if( strcmp( "MBEDTLS_DES_CRYPT_ECB_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_DES_CRYPT_ECB_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_DES_CRYPT_ECB_ALT */ + +#if defined(MBEDTLS_DES3_CRYPT_ECB_ALT) + if( strcmp( "MBEDTLS_DES3_CRYPT_ECB_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_DES3_CRYPT_ECB_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_DES3_CRYPT_ECB_ALT */ + +#if defined(MBEDTLS_AES_SETKEY_ENC_ALT) + if( strcmp( "MBEDTLS_AES_SETKEY_ENC_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_AES_SETKEY_ENC_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_AES_SETKEY_ENC_ALT */ + +#if defined(MBEDTLS_AES_SETKEY_DEC_ALT) + if( strcmp( "MBEDTLS_AES_SETKEY_DEC_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_AES_SETKEY_DEC_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_AES_SETKEY_DEC_ALT */ + +#if defined(MBEDTLS_AES_ENCRYPT_ALT) + if( strcmp( "MBEDTLS_AES_ENCRYPT_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_AES_ENCRYPT_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_AES_ENCRYPT_ALT */ + +#if defined(MBEDTLS_AES_DECRYPT_ALT) + if( strcmp( "MBEDTLS_AES_DECRYPT_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_AES_DECRYPT_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_AES_DECRYPT_ALT */ + +#if defined(MBEDTLS_ECDH_GEN_PUBLIC_ALT) + if( strcmp( "MBEDTLS_ECDH_GEN_PUBLIC_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECDH_GEN_PUBLIC_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECDH_GEN_PUBLIC_ALT */ + +#if defined(MBEDTLS_ECDH_COMPUTE_SHARED_ALT) + if( strcmp( "MBEDTLS_ECDH_COMPUTE_SHARED_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECDH_COMPUTE_SHARED_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECDH_COMPUTE_SHARED_ALT */ + +#if defined(MBEDTLS_ECDSA_VERIFY_ALT) + if( strcmp( "MBEDTLS_ECDSA_VERIFY_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECDSA_VERIFY_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECDSA_VERIFY_ALT */ + +#if defined(MBEDTLS_ECDSA_SIGN_ALT) + if( strcmp( "MBEDTLS_ECDSA_SIGN_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECDSA_SIGN_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECDSA_SIGN_ALT */ + +#if defined(MBEDTLS_ECDSA_GENKEY_ALT) + if( strcmp( "MBEDTLS_ECDSA_GENKEY_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECDSA_GENKEY_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECDSA_GENKEY_ALT */ + +#if defined(MBEDTLS_ECP_INTERNAL_ALT) + if( strcmp( "MBEDTLS_ECP_INTERNAL_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_INTERNAL_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECP_INTERNAL_ALT */ + +#if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT) + if( strcmp( "MBEDTLS_ECP_RANDOMIZE_JAC_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_RANDOMIZE_JAC_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECP_RANDOMIZE_JAC_ALT */ + +#if defined(MBEDTLS_ECP_ADD_MIXED_ALT) + if( strcmp( "MBEDTLS_ECP_ADD_MIXED_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_ADD_MIXED_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECP_ADD_MIXED_ALT */ + +#if defined(MBEDTLS_ECP_DOUBLE_JAC_ALT) + if( strcmp( "MBEDTLS_ECP_DOUBLE_JAC_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DOUBLE_JAC_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECP_DOUBLE_JAC_ALT */ + +#if defined(MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT) + if( strcmp( "MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT */ + +#if defined(MBEDTLS_ECP_NORMALIZE_JAC_ALT) + if( strcmp( "MBEDTLS_ECP_NORMALIZE_JAC_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_NORMALIZE_JAC_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECP_NORMALIZE_JAC_ALT */ + +#if defined(MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT) + if( strcmp( "MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT */ + +#if defined(MBEDTLS_ECP_RANDOMIZE_MXZ_ALT) + if( strcmp( "MBEDTLS_ECP_RANDOMIZE_MXZ_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_RANDOMIZE_MXZ_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECP_RANDOMIZE_MXZ_ALT */ + +#if defined(MBEDTLS_ECP_NORMALIZE_MXZ_ALT) + if( strcmp( "MBEDTLS_ECP_NORMALIZE_MXZ_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_NORMALIZE_MXZ_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECP_NORMALIZE_MXZ_ALT */ + +#if defined(MBEDTLS_TEST_NULL_ENTROPY) + if( strcmp( "MBEDTLS_TEST_NULL_ENTROPY", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_TEST_NULL_ENTROPY ) ); + return( 0 ); + } +#endif /* MBEDTLS_TEST_NULL_ENTROPY */ + +#if defined(MBEDTLS_ENTROPY_HARDWARE_ALT) + if( strcmp( "MBEDTLS_ENTROPY_HARDWARE_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_HARDWARE_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_ENTROPY_HARDWARE_ALT */ + +#if defined(MBEDTLS_AES_ROM_TABLES) + if( strcmp( "MBEDTLS_AES_ROM_TABLES", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_AES_ROM_TABLES ) ); + return( 0 ); + } +#endif /* MBEDTLS_AES_ROM_TABLES */ + +#if defined(MBEDTLS_AES_FEWER_TABLES) + if( strcmp( "MBEDTLS_AES_FEWER_TABLES", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_AES_FEWER_TABLES ) ); + return( 0 ); + } +#endif /* MBEDTLS_AES_FEWER_TABLES */ + +#if defined(MBEDTLS_CAMELLIA_SMALL_MEMORY) + if( strcmp( "MBEDTLS_CAMELLIA_SMALL_MEMORY", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CAMELLIA_SMALL_MEMORY ) ); + return( 0 ); + } +#endif /* MBEDTLS_CAMELLIA_SMALL_MEMORY */ + +#if defined(MBEDTLS_CIPHER_MODE_CBC) + if( strcmp( "MBEDTLS_CIPHER_MODE_CBC", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_MODE_CBC ) ); + return( 0 ); + } +#endif /* MBEDTLS_CIPHER_MODE_CBC */ + +#if defined(MBEDTLS_CIPHER_MODE_CFB) + if( strcmp( "MBEDTLS_CIPHER_MODE_CFB", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_MODE_CFB ) ); + return( 0 ); + } +#endif /* MBEDTLS_CIPHER_MODE_CFB */ + +#if defined(MBEDTLS_CIPHER_MODE_CTR) + if( strcmp( "MBEDTLS_CIPHER_MODE_CTR", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_MODE_CTR ) ); + return( 0 ); + } +#endif /* MBEDTLS_CIPHER_MODE_CTR */ + +#if defined(MBEDTLS_CIPHER_MODE_OFB) + if( strcmp( "MBEDTLS_CIPHER_MODE_OFB", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_MODE_OFB ) ); + return( 0 ); + } +#endif /* MBEDTLS_CIPHER_MODE_OFB */ + +#if defined(MBEDTLS_CIPHER_MODE_XTS) + if( strcmp( "MBEDTLS_CIPHER_MODE_XTS", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_MODE_XTS ) ); + return( 0 ); + } +#endif /* MBEDTLS_CIPHER_MODE_XTS */ + +#if defined(MBEDTLS_CIPHER_NULL_CIPHER) + if( strcmp( "MBEDTLS_CIPHER_NULL_CIPHER", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_NULL_CIPHER ) ); + return( 0 ); + } +#endif /* MBEDTLS_CIPHER_NULL_CIPHER */ + +#if defined(MBEDTLS_CIPHER_PADDING_PKCS7) + if( strcmp( "MBEDTLS_CIPHER_PADDING_PKCS7", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_PADDING_PKCS7 ) ); + return( 0 ); + } +#endif /* MBEDTLS_CIPHER_PADDING_PKCS7 */ + +#if defined(MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS) + if( strcmp( "MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS ) ); + return( 0 ); + } +#endif /* MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS */ + +#if defined(MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN) + if( strcmp( "MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN ) ); + return( 0 ); + } +#endif /* MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN */ + +#if defined(MBEDTLS_CIPHER_PADDING_ZEROS) + if( strcmp( "MBEDTLS_CIPHER_PADDING_ZEROS", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_PADDING_ZEROS ) ); + return( 0 ); + } +#endif /* MBEDTLS_CIPHER_PADDING_ZEROS */ + +#if defined(MBEDTLS_ENABLE_WEAK_CIPHERSUITES) + if( strcmp( "MBEDTLS_ENABLE_WEAK_CIPHERSUITES", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ENABLE_WEAK_CIPHERSUITES ) ); + return( 0 ); + } +#endif /* MBEDTLS_ENABLE_WEAK_CIPHERSUITES */ + +#if defined(MBEDTLS_REMOVE_ARC4_CIPHERSUITES) + if( strcmp( "MBEDTLS_REMOVE_ARC4_CIPHERSUITES", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_REMOVE_ARC4_CIPHERSUITES ) ); + return( 0 ); + } +#endif /* MBEDTLS_REMOVE_ARC4_CIPHERSUITES */ + +#if defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) + if( strcmp( "MBEDTLS_ECP_DP_SECP192R1_ENABLED", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP192R1_ENABLED ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECP_DP_SECP192R1_ENABLED */ + +#if defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED) + if( strcmp( "MBEDTLS_ECP_DP_SECP224R1_ENABLED", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP224R1_ENABLED ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECP_DP_SECP224R1_ENABLED */ + +#if defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) + if( strcmp( "MBEDTLS_ECP_DP_SECP256R1_ENABLED", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP256R1_ENABLED ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECP_DP_SECP256R1_ENABLED */ + +#if defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED) + if( strcmp( "MBEDTLS_ECP_DP_SECP384R1_ENABLED", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP384R1_ENABLED ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECP_DP_SECP384R1_ENABLED */ + +#if defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED) + if( strcmp( "MBEDTLS_ECP_DP_SECP521R1_ENABLED", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP521R1_ENABLED ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECP_DP_SECP521R1_ENABLED */ + +#if defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED) + if( strcmp( "MBEDTLS_ECP_DP_SECP192K1_ENABLED", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP192K1_ENABLED ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECP_DP_SECP192K1_ENABLED */ + +#if defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED) + if( strcmp( "MBEDTLS_ECP_DP_SECP224K1_ENABLED", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP224K1_ENABLED ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECP_DP_SECP224K1_ENABLED */ + +#if defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED) + if( strcmp( "MBEDTLS_ECP_DP_SECP256K1_ENABLED", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP256K1_ENABLED ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECP_DP_SECP256K1_ENABLED */ + +#if defined(MBEDTLS_ECP_DP_BP256R1_ENABLED) + if( strcmp( "MBEDTLS_ECP_DP_BP256R1_ENABLED", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_BP256R1_ENABLED ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECP_DP_BP256R1_ENABLED */ + +#if defined(MBEDTLS_ECP_DP_BP384R1_ENABLED) + if( strcmp( "MBEDTLS_ECP_DP_BP384R1_ENABLED", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_BP384R1_ENABLED ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECP_DP_BP384R1_ENABLED */ + +#if defined(MBEDTLS_ECP_DP_BP512R1_ENABLED) + if( strcmp( "MBEDTLS_ECP_DP_BP512R1_ENABLED", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_BP512R1_ENABLED ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECP_DP_BP512R1_ENABLED */ + +#if defined(MBEDTLS_ECP_DP_CURVE25519_ENABLED) + if( strcmp( "MBEDTLS_ECP_DP_CURVE25519_ENABLED", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_CURVE25519_ENABLED ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECP_DP_CURVE25519_ENABLED */ + +#if defined(MBEDTLS_ECP_DP_CURVE448_ENABLED) + if( strcmp( "MBEDTLS_ECP_DP_CURVE448_ENABLED", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_CURVE448_ENABLED ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECP_DP_CURVE448_ENABLED */ + +#if defined(MBEDTLS_ECP_NIST_OPTIM) + if( strcmp( "MBEDTLS_ECP_NIST_OPTIM", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_NIST_OPTIM ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECP_NIST_OPTIM */ + +#if defined(MBEDTLS_ECDSA_DETERMINISTIC) + if( strcmp( "MBEDTLS_ECDSA_DETERMINISTIC", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECDSA_DETERMINISTIC ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECDSA_DETERMINISTIC */ + +#if defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) + if( strcmp( "MBEDTLS_KEY_EXCHANGE_PSK_ENABLED", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_PSK_ENABLED ) ); + return( 0 ); + } +#endif /* MBEDTLS_KEY_EXCHANGE_PSK_ENABLED */ + +#if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) + if( strcmp( "MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED ) ); + return( 0 ); + } +#endif /* MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED */ + +#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) + if( strcmp( "MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED ) ); + return( 0 ); + } +#endif /* MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED */ + +#if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) + if( strcmp( "MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED ) ); + return( 0 ); + } +#endif /* MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED */ + +#if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) + if( strcmp( "MBEDTLS_KEY_EXCHANGE_RSA_ENABLED", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_RSA_ENABLED ) ); + return( 0 ); + } +#endif /* MBEDTLS_KEY_EXCHANGE_RSA_ENABLED */ + +#if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) + if( strcmp( "MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED ) ); + return( 0 ); + } +#endif /* MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED */ + +#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) + if( strcmp( "MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED ) ); + return( 0 ); + } +#endif /* MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED */ + +#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) + if( strcmp( "MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED ) ); + return( 0 ); + } +#endif /* MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED */ + +#if defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) + if( strcmp( "MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED ) ); + return( 0 ); + } +#endif /* MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED */ + +#if defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) + if( strcmp( "MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED ) ); + return( 0 ); + } +#endif /* MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED */ + +#if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) + if( strcmp( "MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED ) ); + return( 0 ); + } +#endif /* MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED */ + +#if defined(MBEDTLS_PK_PARSE_EC_EXTENDED) + if( strcmp( "MBEDTLS_PK_PARSE_EC_EXTENDED", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PK_PARSE_EC_EXTENDED ) ); + return( 0 ); + } +#endif /* MBEDTLS_PK_PARSE_EC_EXTENDED */ + +#if defined(MBEDTLS_ERROR_STRERROR_DUMMY) + if( strcmp( "MBEDTLS_ERROR_STRERROR_DUMMY", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ERROR_STRERROR_DUMMY ) ); + return( 0 ); + } +#endif /* MBEDTLS_ERROR_STRERROR_DUMMY */ + +#if defined(MBEDTLS_GENPRIME) + if( strcmp( "MBEDTLS_GENPRIME", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_GENPRIME ) ); + return( 0 ); + } +#endif /* MBEDTLS_GENPRIME */ + +#if defined(MBEDTLS_FS_IO) + if( strcmp( "MBEDTLS_FS_IO", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_FS_IO ) ); + return( 0 ); + } +#endif /* MBEDTLS_FS_IO */ + +#if defined(MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES) + if( strcmp( "MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES ) ); + return( 0 ); + } +#endif /* MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES */ + +#if defined(MBEDTLS_NO_PLATFORM_ENTROPY) + if( strcmp( "MBEDTLS_NO_PLATFORM_ENTROPY", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_NO_PLATFORM_ENTROPY ) ); + return( 0 ); + } +#endif /* MBEDTLS_NO_PLATFORM_ENTROPY */ + +#if defined(MBEDTLS_ENTROPY_FORCE_SHA256) + if( strcmp( "MBEDTLS_ENTROPY_FORCE_SHA256", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_FORCE_SHA256 ) ); + return( 0 ); + } +#endif /* MBEDTLS_ENTROPY_FORCE_SHA256 */ + +#if defined(MBEDTLS_ENTROPY_NV_SEED) + if( strcmp( "MBEDTLS_ENTROPY_NV_SEED", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_NV_SEED ) ); + return( 0 ); + } +#endif /* MBEDTLS_ENTROPY_NV_SEED */ + +#if defined(MBEDTLS_MEMORY_DEBUG) + if( strcmp( "MBEDTLS_MEMORY_DEBUG", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MEMORY_DEBUG ) ); + return( 0 ); + } +#endif /* MBEDTLS_MEMORY_DEBUG */ + +#if defined(MBEDTLS_MEMORY_BACKTRACE) + if( strcmp( "MBEDTLS_MEMORY_BACKTRACE", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MEMORY_BACKTRACE ) ); + return( 0 ); + } +#endif /* MBEDTLS_MEMORY_BACKTRACE */ + +#if defined(MBEDTLS_PK_RSA_ALT_SUPPORT) + if( strcmp( "MBEDTLS_PK_RSA_ALT_SUPPORT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PK_RSA_ALT_SUPPORT ) ); + return( 0 ); + } +#endif /* MBEDTLS_PK_RSA_ALT_SUPPORT */ + +#if defined(MBEDTLS_PKCS1_V15) + if( strcmp( "MBEDTLS_PKCS1_V15", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PKCS1_V15 ) ); + return( 0 ); + } +#endif /* MBEDTLS_PKCS1_V15 */ + +#if defined(MBEDTLS_PKCS1_V21) + if( strcmp( "MBEDTLS_PKCS1_V21", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PKCS1_V21 ) ); + return( 0 ); + } +#endif /* MBEDTLS_PKCS1_V21 */ + +#if defined(MBEDTLS_RSA_NO_CRT) + if( strcmp( "MBEDTLS_RSA_NO_CRT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_RSA_NO_CRT ) ); + return( 0 ); + } +#endif /* MBEDTLS_RSA_NO_CRT */ + +#if defined(MBEDTLS_SELF_TEST) + if( strcmp( "MBEDTLS_SELF_TEST", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SELF_TEST ) ); + return( 0 ); + } +#endif /* MBEDTLS_SELF_TEST */ + +#if defined(MBEDTLS_SHA256_SMALLER) + if( strcmp( "MBEDTLS_SHA256_SMALLER", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SHA256_SMALLER ) ); + return( 0 ); + } +#endif /* MBEDTLS_SHA256_SMALLER */ + +#if defined(MBEDTLS_SSL_ALL_ALERT_MESSAGES) + if( strcmp( "MBEDTLS_SSL_ALL_ALERT_MESSAGES", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_ALL_ALERT_MESSAGES ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_ALL_ALERT_MESSAGES */ + +#if defined(MBEDTLS_SSL_ASYNC_PRIVATE) + if( strcmp( "MBEDTLS_SSL_ASYNC_PRIVATE", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_ASYNC_PRIVATE ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_ASYNC_PRIVATE */ + +#if defined(MBEDTLS_SSL_DEBUG_ALL) + if( strcmp( "MBEDTLS_SSL_DEBUG_ALL", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DEBUG_ALL ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_DEBUG_ALL */ + +#if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC) + if( strcmp( "MBEDTLS_SSL_ENCRYPT_THEN_MAC", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_ENCRYPT_THEN_MAC ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_ENCRYPT_THEN_MAC */ + +#if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET) + if( strcmp( "MBEDTLS_SSL_EXTENDED_MASTER_SECRET", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_EXTENDED_MASTER_SECRET ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_EXTENDED_MASTER_SECRET */ + +#if defined(MBEDTLS_SSL_FALLBACK_SCSV) + if( strcmp( "MBEDTLS_SSL_FALLBACK_SCSV", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_FALLBACK_SCSV ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_FALLBACK_SCSV */ + +#if defined(MBEDTLS_SSL_HW_RECORD_ACCEL) + if( strcmp( "MBEDTLS_SSL_HW_RECORD_ACCEL", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_HW_RECORD_ACCEL ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_HW_RECORD_ACCEL */ + +#if defined(MBEDTLS_SSL_CBC_RECORD_SPLITTING) + if( strcmp( "MBEDTLS_SSL_CBC_RECORD_SPLITTING", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CBC_RECORD_SPLITTING ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_CBC_RECORD_SPLITTING */ + +#if defined(MBEDTLS_SSL_RENEGOTIATION) + if( strcmp( "MBEDTLS_SSL_RENEGOTIATION", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_RENEGOTIATION ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_RENEGOTIATION */ + +#if defined(MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO) + if( strcmp( "MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO */ + +#if defined(MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE) + if( strcmp( "MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE */ + +#if defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH) + if( strcmp( "MBEDTLS_SSL_MAX_FRAGMENT_LENGTH", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_MAX_FRAGMENT_LENGTH ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_MAX_FRAGMENT_LENGTH */ + +#if defined(MBEDTLS_SSL_PROTO_SSL3) + if( strcmp( "MBEDTLS_SSL_PROTO_SSL3", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_PROTO_SSL3 ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_PROTO_SSL3 */ + +#if defined(MBEDTLS_SSL_PROTO_TLS1) + if( strcmp( "MBEDTLS_SSL_PROTO_TLS1", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_PROTO_TLS1 ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_PROTO_TLS1 */ + +#if defined(MBEDTLS_SSL_PROTO_TLS1_1) + if( strcmp( "MBEDTLS_SSL_PROTO_TLS1_1", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_PROTO_TLS1_1 ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_PROTO_TLS1_1 */ + +#if defined(MBEDTLS_SSL_PROTO_TLS1_2) + if( strcmp( "MBEDTLS_SSL_PROTO_TLS1_2", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_PROTO_TLS1_2 ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_PROTO_TLS1_2 */ + +#if defined(MBEDTLS_SSL_PROTO_DTLS) + if( strcmp( "MBEDTLS_SSL_PROTO_DTLS", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_PROTO_DTLS ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_PROTO_DTLS */ + +#if defined(MBEDTLS_SSL_ALPN) + if( strcmp( "MBEDTLS_SSL_ALPN", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_ALPN ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_ALPN */ + +#if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY) + if( strcmp( "MBEDTLS_SSL_DTLS_ANTI_REPLAY", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DTLS_ANTI_REPLAY ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_DTLS_ANTI_REPLAY */ + +#if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) + if( strcmp( "MBEDTLS_SSL_DTLS_HELLO_VERIFY", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DTLS_HELLO_VERIFY ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_DTLS_HELLO_VERIFY */ + +#if defined(MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE) + if( strcmp( "MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE */ + +#if defined(MBEDTLS_SSL_DTLS_BADMAC_LIMIT) + if( strcmp( "MBEDTLS_SSL_DTLS_BADMAC_LIMIT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DTLS_BADMAC_LIMIT ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_DTLS_BADMAC_LIMIT */ + +#if defined(MBEDTLS_SSL_SESSION_TICKETS) + if( strcmp( "MBEDTLS_SSL_SESSION_TICKETS", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_SESSION_TICKETS ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_SESSION_TICKETS */ + +#if defined(MBEDTLS_SSL_EXPORT_KEYS) + if( strcmp( "MBEDTLS_SSL_EXPORT_KEYS", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_EXPORT_KEYS ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_EXPORT_KEYS */ + +#if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION) + if( strcmp( "MBEDTLS_SSL_SERVER_NAME_INDICATION", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_SERVER_NAME_INDICATION ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_SERVER_NAME_INDICATION */ + +#if defined(MBEDTLS_SSL_TRUNCATED_HMAC) + if( strcmp( "MBEDTLS_SSL_TRUNCATED_HMAC", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_TRUNCATED_HMAC ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_TRUNCATED_HMAC */ + +#if defined(MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT) + if( strcmp( "MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT */ + +#if defined(MBEDTLS_THREADING_ALT) + if( strcmp( "MBEDTLS_THREADING_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_THREADING_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_THREADING_ALT */ + +#if defined(MBEDTLS_THREADING_PTHREAD) + if( strcmp( "MBEDTLS_THREADING_PTHREAD", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_THREADING_PTHREAD ) ); + return( 0 ); + } +#endif /* MBEDTLS_THREADING_PTHREAD */ + +#if defined(MBEDTLS_VERSION_FEATURES) + if( strcmp( "MBEDTLS_VERSION_FEATURES", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_VERSION_FEATURES ) ); + return( 0 ); + } +#endif /* MBEDTLS_VERSION_FEATURES */ + +#if defined(MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3) + if( strcmp( "MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 ) ); + return( 0 ); + } +#endif /* MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 */ + +#if defined(MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION) + if( strcmp( "MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION ) ); + return( 0 ); + } +#endif /* MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION */ + +#if defined(MBEDTLS_X509_CHECK_KEY_USAGE) + if( strcmp( "MBEDTLS_X509_CHECK_KEY_USAGE", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CHECK_KEY_USAGE ) ); + return( 0 ); + } +#endif /* MBEDTLS_X509_CHECK_KEY_USAGE */ + +#if defined(MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE) + if( strcmp( "MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE ) ); + return( 0 ); + } +#endif /* MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE */ + +#if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT) + if( strcmp( "MBEDTLS_X509_RSASSA_PSS_SUPPORT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_X509_RSASSA_PSS_SUPPORT ) ); + return( 0 ); + } +#endif /* MBEDTLS_X509_RSASSA_PSS_SUPPORT */ + +#if defined(MBEDTLS_ZLIB_SUPPORT) + if( strcmp( "MBEDTLS_ZLIB_SUPPORT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ZLIB_SUPPORT ) ); + return( 0 ); + } +#endif /* MBEDTLS_ZLIB_SUPPORT */ + +#if defined(MBEDTLS_AESNI_C) + if( strcmp( "MBEDTLS_AESNI_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_AESNI_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_AESNI_C */ + +#if defined(MBEDTLS_AES_C) + if( strcmp( "MBEDTLS_AES_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_AES_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_AES_C */ + +#if defined(MBEDTLS_ARC4_C) + if( strcmp( "MBEDTLS_ARC4_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ARC4_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_ARC4_C */ + +#if defined(MBEDTLS_ASN1_PARSE_C) + if( strcmp( "MBEDTLS_ASN1_PARSE_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ASN1_PARSE_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_ASN1_PARSE_C */ + +#if defined(MBEDTLS_ASN1_WRITE_C) + if( strcmp( "MBEDTLS_ASN1_WRITE_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ASN1_WRITE_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_ASN1_WRITE_C */ + +#if defined(MBEDTLS_BASE64_C) + if( strcmp( "MBEDTLS_BASE64_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_BASE64_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_BASE64_C */ + +#if defined(MBEDTLS_BIGNUM_C) + if( strcmp( "MBEDTLS_BIGNUM_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_BIGNUM_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_BIGNUM_C */ + +#if defined(MBEDTLS_BLOWFISH_C) + if( strcmp( "MBEDTLS_BLOWFISH_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_BLOWFISH_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_BLOWFISH_C */ + +#if defined(MBEDTLS_CAMELLIA_C) + if( strcmp( "MBEDTLS_CAMELLIA_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CAMELLIA_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_CAMELLIA_C */ + +#if defined(MBEDTLS_ARIA_C) + if( strcmp( "MBEDTLS_ARIA_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ARIA_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_ARIA_C */ + +#if defined(MBEDTLS_CCM_C) + if( strcmp( "MBEDTLS_CCM_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CCM_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_CCM_C */ + +#if defined(MBEDTLS_CERTS_C) + if( strcmp( "MBEDTLS_CERTS_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CERTS_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_CERTS_C */ + +#if defined(MBEDTLS_CHACHA20_C) + if( strcmp( "MBEDTLS_CHACHA20_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CHACHA20_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_CHACHA20_C */ + +#if defined(MBEDTLS_CHACHAPOLY_C) + if( strcmp( "MBEDTLS_CHACHAPOLY_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CHACHAPOLY_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_CHACHAPOLY_C */ + +#if defined(MBEDTLS_CIPHER_C) + if( strcmp( "MBEDTLS_CIPHER_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_CIPHER_C */ + +#if defined(MBEDTLS_CMAC_C) + if( strcmp( "MBEDTLS_CMAC_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CMAC_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_CMAC_C */ + +#if defined(MBEDTLS_CTR_DRBG_C) + if( strcmp( "MBEDTLS_CTR_DRBG_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_CTR_DRBG_C */ + +#if defined(MBEDTLS_DEBUG_C) + if( strcmp( "MBEDTLS_DEBUG_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_DEBUG_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_DEBUG_C */ + +#if defined(MBEDTLS_DES_C) + if( strcmp( "MBEDTLS_DES_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_DES_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_DES_C */ + +#if defined(MBEDTLS_DHM_C) + if( strcmp( "MBEDTLS_DHM_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_DHM_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_DHM_C */ + +#if defined(MBEDTLS_ECDH_C) + if( strcmp( "MBEDTLS_ECDH_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECDH_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECDH_C */ + +#if defined(MBEDTLS_ECDSA_C) + if( strcmp( "MBEDTLS_ECDSA_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECDSA_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECDSA_C */ + +#if defined(MBEDTLS_ECJPAKE_C) + if( strcmp( "MBEDTLS_ECJPAKE_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECJPAKE_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECJPAKE_C */ + +#if defined(MBEDTLS_ECP_C) + if( strcmp( "MBEDTLS_ECP_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECP_C */ + +#if defined(MBEDTLS_ENTROPY_C) + if( strcmp( "MBEDTLS_ENTROPY_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_ENTROPY_C */ + +#if defined(MBEDTLS_ERROR_C) + if( strcmp( "MBEDTLS_ERROR_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ERROR_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_ERROR_C */ + +#if defined(MBEDTLS_GCM_C) + if( strcmp( "MBEDTLS_GCM_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_GCM_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_GCM_C */ + +#if defined(MBEDTLS_HAVEGE_C) + if( strcmp( "MBEDTLS_HAVEGE_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_HAVEGE_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_HAVEGE_C */ + +#if defined(MBEDTLS_HKDF_C) + if( strcmp( "MBEDTLS_HKDF_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_HKDF_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_HKDF_C */ + +#if defined(MBEDTLS_HMAC_DRBG_C) + if( strcmp( "MBEDTLS_HMAC_DRBG_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_HMAC_DRBG_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_HMAC_DRBG_C */ + +#if defined(MBEDTLS_NIST_KW_C) + if( strcmp( "MBEDTLS_NIST_KW_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_NIST_KW_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_NIST_KW_C */ + +#if defined(MBEDTLS_MD_C) + if( strcmp( "MBEDTLS_MD_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MD_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_MD_C */ + +#if defined(MBEDTLS_MD2_C) + if( strcmp( "MBEDTLS_MD2_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MD2_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_MD2_C */ + +#if defined(MBEDTLS_MD4_C) + if( strcmp( "MBEDTLS_MD4_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MD4_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_MD4_C */ + +#if defined(MBEDTLS_MD5_C) + if( strcmp( "MBEDTLS_MD5_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MD5_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_MD5_C */ + +#if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) + if( strcmp( "MBEDTLS_MEMORY_BUFFER_ALLOC_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MEMORY_BUFFER_ALLOC_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_MEMORY_BUFFER_ALLOC_C */ + +#if defined(MBEDTLS_NET_C) + if( strcmp( "MBEDTLS_NET_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_NET_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_NET_C */ + +#if defined(MBEDTLS_OID_C) + if( strcmp( "MBEDTLS_OID_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_OID_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_OID_C */ + +#if defined(MBEDTLS_PADLOCK_C) + if( strcmp( "MBEDTLS_PADLOCK_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PADLOCK_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_PADLOCK_C */ + +#if defined(MBEDTLS_PEM_PARSE_C) + if( strcmp( "MBEDTLS_PEM_PARSE_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PEM_PARSE_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_PEM_PARSE_C */ + +#if defined(MBEDTLS_PEM_WRITE_C) + if( strcmp( "MBEDTLS_PEM_WRITE_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PEM_WRITE_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_PEM_WRITE_C */ + +#if defined(MBEDTLS_PK_C) + if( strcmp( "MBEDTLS_PK_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PK_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_PK_C */ + +#if defined(MBEDTLS_PK_PARSE_C) + if( strcmp( "MBEDTLS_PK_PARSE_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PK_PARSE_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_PK_PARSE_C */ + +#if defined(MBEDTLS_PK_WRITE_C) + if( strcmp( "MBEDTLS_PK_WRITE_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PK_WRITE_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_PK_WRITE_C */ + +#if defined(MBEDTLS_PKCS5_C) + if( strcmp( "MBEDTLS_PKCS5_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PKCS5_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_PKCS5_C */ + +#if defined(MBEDTLS_PKCS11_C) + if( strcmp( "MBEDTLS_PKCS11_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PKCS11_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_PKCS11_C */ + +#if defined(MBEDTLS_PKCS12_C) + if( strcmp( "MBEDTLS_PKCS12_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PKCS12_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_PKCS12_C */ + +#if defined(MBEDTLS_PLATFORM_C) + if( strcmp( "MBEDTLS_PLATFORM_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_C */ + +#if defined(MBEDTLS_POLY1305_C) + if( strcmp( "MBEDTLS_POLY1305_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_POLY1305_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_POLY1305_C */ + +#if defined(MBEDTLS_RIPEMD160_C) + if( strcmp( "MBEDTLS_RIPEMD160_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_RIPEMD160_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_RIPEMD160_C */ + +#if defined(MBEDTLS_RSA_C) + if( strcmp( "MBEDTLS_RSA_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_RSA_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_RSA_C */ + +#if defined(MBEDTLS_SHA1_C) + if( strcmp( "MBEDTLS_SHA1_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SHA1_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_SHA1_C */ + +#if defined(MBEDTLS_SHA256_C) + if( strcmp( "MBEDTLS_SHA256_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SHA256_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_SHA256_C */ + +#if defined(MBEDTLS_SHA512_C) + if( strcmp( "MBEDTLS_SHA512_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SHA512_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_SHA512_C */ + +#if defined(MBEDTLS_SSL_CACHE_C) + if( strcmp( "MBEDTLS_SSL_CACHE_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CACHE_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_CACHE_C */ + +#if defined(MBEDTLS_SSL_COOKIE_C) + if( strcmp( "MBEDTLS_SSL_COOKIE_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_COOKIE_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_COOKIE_C */ + +#if defined(MBEDTLS_SSL_TICKET_C) + if( strcmp( "MBEDTLS_SSL_TICKET_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_TICKET_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_TICKET_C */ + +#if defined(MBEDTLS_SSL_CLI_C) + if( strcmp( "MBEDTLS_SSL_CLI_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CLI_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_CLI_C */ + +#if defined(MBEDTLS_SSL_SRV_C) + if( strcmp( "MBEDTLS_SSL_SRV_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_SRV_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_SRV_C */ + +#if defined(MBEDTLS_SSL_TLS_C) + if( strcmp( "MBEDTLS_SSL_TLS_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_TLS_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_TLS_C */ + +#if defined(MBEDTLS_THREADING_C) + if( strcmp( "MBEDTLS_THREADING_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_THREADING_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_THREADING_C */ + +#if defined(MBEDTLS_TIMING_C) + if( strcmp( "MBEDTLS_TIMING_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_TIMING_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_TIMING_C */ + +#if defined(MBEDTLS_VERSION_C) + if( strcmp( "MBEDTLS_VERSION_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_VERSION_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_VERSION_C */ + +#if defined(MBEDTLS_X509_USE_C) + if( strcmp( "MBEDTLS_X509_USE_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_X509_USE_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_X509_USE_C */ + +#if defined(MBEDTLS_X509_CRT_PARSE_C) + if( strcmp( "MBEDTLS_X509_CRT_PARSE_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CRT_PARSE_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_X509_CRT_PARSE_C */ + +#if defined(MBEDTLS_X509_CRL_PARSE_C) + if( strcmp( "MBEDTLS_X509_CRL_PARSE_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CRL_PARSE_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_X509_CRL_PARSE_C */ + +#if defined(MBEDTLS_X509_CSR_PARSE_C) + if( strcmp( "MBEDTLS_X509_CSR_PARSE_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CSR_PARSE_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_X509_CSR_PARSE_C */ + +#if defined(MBEDTLS_X509_CREATE_C) + if( strcmp( "MBEDTLS_X509_CREATE_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CREATE_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_X509_CREATE_C */ + +#if defined(MBEDTLS_X509_CRT_WRITE_C) + if( strcmp( "MBEDTLS_X509_CRT_WRITE_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CRT_WRITE_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_X509_CRT_WRITE_C */ + +#if defined(MBEDTLS_X509_CSR_WRITE_C) + if( strcmp( "MBEDTLS_X509_CSR_WRITE_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CSR_WRITE_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_X509_CSR_WRITE_C */ + +#if defined(MBEDTLS_XTEA_C) + if( strcmp( "MBEDTLS_XTEA_C", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_XTEA_C ) ); + return( 0 ); + } +#endif /* MBEDTLS_XTEA_C */ + +#if defined(MBEDTLS_MPI_WINDOW_SIZE) + if( strcmp( "MBEDTLS_MPI_WINDOW_SIZE", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MPI_WINDOW_SIZE ) ); + return( 0 ); + } +#endif /* MBEDTLS_MPI_WINDOW_SIZE */ + +#if defined(MBEDTLS_MPI_MAX_SIZE) + if( strcmp( "MBEDTLS_MPI_MAX_SIZE", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MPI_MAX_SIZE ) ); + return( 0 ); + } +#endif /* MBEDTLS_MPI_MAX_SIZE */ + +#if defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) + if( strcmp( "MBEDTLS_CTR_DRBG_ENTROPY_LEN", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_ENTROPY_LEN ) ); + return( 0 ); + } +#endif /* MBEDTLS_CTR_DRBG_ENTROPY_LEN */ + +#if defined(MBEDTLS_CTR_DRBG_RESEED_INTERVAL) + if( strcmp( "MBEDTLS_CTR_DRBG_RESEED_INTERVAL", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_RESEED_INTERVAL ) ); + return( 0 ); + } +#endif /* MBEDTLS_CTR_DRBG_RESEED_INTERVAL */ + +#if defined(MBEDTLS_CTR_DRBG_MAX_INPUT) + if( strcmp( "MBEDTLS_CTR_DRBG_MAX_INPUT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_MAX_INPUT ) ); + return( 0 ); + } +#endif /* MBEDTLS_CTR_DRBG_MAX_INPUT */ + +#if defined(MBEDTLS_CTR_DRBG_MAX_REQUEST) + if( strcmp( "MBEDTLS_CTR_DRBG_MAX_REQUEST", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_MAX_REQUEST ) ); + return( 0 ); + } +#endif /* MBEDTLS_CTR_DRBG_MAX_REQUEST */ + +#if defined(MBEDTLS_CTR_DRBG_MAX_SEED_INPUT) + if( strcmp( "MBEDTLS_CTR_DRBG_MAX_SEED_INPUT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_MAX_SEED_INPUT ) ); + return( 0 ); + } +#endif /* MBEDTLS_CTR_DRBG_MAX_SEED_INPUT */ + +#if defined(MBEDTLS_HMAC_DRBG_RESEED_INTERVAL) + if( strcmp( "MBEDTLS_HMAC_DRBG_RESEED_INTERVAL", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_HMAC_DRBG_RESEED_INTERVAL ) ); + return( 0 ); + } +#endif /* MBEDTLS_HMAC_DRBG_RESEED_INTERVAL */ + +#if defined(MBEDTLS_HMAC_DRBG_MAX_INPUT) + if( strcmp( "MBEDTLS_HMAC_DRBG_MAX_INPUT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_HMAC_DRBG_MAX_INPUT ) ); + return( 0 ); + } +#endif /* MBEDTLS_HMAC_DRBG_MAX_INPUT */ + +#if defined(MBEDTLS_HMAC_DRBG_MAX_REQUEST) + if( strcmp( "MBEDTLS_HMAC_DRBG_MAX_REQUEST", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_HMAC_DRBG_MAX_REQUEST ) ); + return( 0 ); + } +#endif /* MBEDTLS_HMAC_DRBG_MAX_REQUEST */ + +#if defined(MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT) + if( strcmp( "MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT ) ); + return( 0 ); + } +#endif /* MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT */ + +#if defined(MBEDTLS_ECP_MAX_BITS) + if( strcmp( "MBEDTLS_ECP_MAX_BITS", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_MAX_BITS ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECP_MAX_BITS */ + +#if defined(MBEDTLS_ECP_WINDOW_SIZE) + if( strcmp( "MBEDTLS_ECP_WINDOW_SIZE", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_WINDOW_SIZE ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECP_WINDOW_SIZE */ + +#if defined(MBEDTLS_ECP_FIXED_POINT_OPTIM) + if( strcmp( "MBEDTLS_ECP_FIXED_POINT_OPTIM", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_FIXED_POINT_OPTIM ) ); + return( 0 ); + } +#endif /* MBEDTLS_ECP_FIXED_POINT_OPTIM */ + +#if defined(MBEDTLS_ENTROPY_MAX_SOURCES) + if( strcmp( "MBEDTLS_ENTROPY_MAX_SOURCES", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_MAX_SOURCES ) ); + return( 0 ); + } +#endif /* MBEDTLS_ENTROPY_MAX_SOURCES */ + +#if defined(MBEDTLS_ENTROPY_MAX_GATHER) + if( strcmp( "MBEDTLS_ENTROPY_MAX_GATHER", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_MAX_GATHER ) ); + return( 0 ); + } +#endif /* MBEDTLS_ENTROPY_MAX_GATHER */ + +#if defined(MBEDTLS_ENTROPY_MIN_HARDWARE) + if( strcmp( "MBEDTLS_ENTROPY_MIN_HARDWARE", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_MIN_HARDWARE ) ); + return( 0 ); + } +#endif /* MBEDTLS_ENTROPY_MIN_HARDWARE */ + +#if defined(MBEDTLS_MEMORY_ALIGN_MULTIPLE) + if( strcmp( "MBEDTLS_MEMORY_ALIGN_MULTIPLE", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MEMORY_ALIGN_MULTIPLE ) ); + return( 0 ); + } +#endif /* MBEDTLS_MEMORY_ALIGN_MULTIPLE */ + +#if defined(MBEDTLS_PLATFORM_STD_MEM_HDR) + if( strcmp( "MBEDTLS_PLATFORM_STD_MEM_HDR", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_MEM_HDR ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_STD_MEM_HDR */ + +#if defined(MBEDTLS_PLATFORM_STD_CALLOC) + if( strcmp( "MBEDTLS_PLATFORM_STD_CALLOC", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_CALLOC ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_STD_CALLOC */ + +#if defined(MBEDTLS_PLATFORM_STD_FREE) + if( strcmp( "MBEDTLS_PLATFORM_STD_FREE", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_FREE ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_STD_FREE */ + +#if defined(MBEDTLS_PLATFORM_STD_EXIT) + if( strcmp( "MBEDTLS_PLATFORM_STD_EXIT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_EXIT ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_STD_EXIT */ + +#if defined(MBEDTLS_PLATFORM_STD_TIME) + if( strcmp( "MBEDTLS_PLATFORM_STD_TIME", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_TIME ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_STD_TIME */ + +#if defined(MBEDTLS_PLATFORM_STD_FPRINTF) + if( strcmp( "MBEDTLS_PLATFORM_STD_FPRINTF", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_FPRINTF ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_STD_FPRINTF */ + +#if defined(MBEDTLS_PLATFORM_STD_PRINTF) + if( strcmp( "MBEDTLS_PLATFORM_STD_PRINTF", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_PRINTF ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_STD_PRINTF */ + +#if defined(MBEDTLS_PLATFORM_STD_SNPRINTF) + if( strcmp( "MBEDTLS_PLATFORM_STD_SNPRINTF", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_SNPRINTF ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_STD_SNPRINTF */ + +#if defined(MBEDTLS_PLATFORM_STD_EXIT_SUCCESS) + if( strcmp( "MBEDTLS_PLATFORM_STD_EXIT_SUCCESS", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_EXIT_SUCCESS ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_STD_EXIT_SUCCESS */ + +#if defined(MBEDTLS_PLATFORM_STD_EXIT_FAILURE) + if( strcmp( "MBEDTLS_PLATFORM_STD_EXIT_FAILURE", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_EXIT_FAILURE ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_STD_EXIT_FAILURE */ + +#if defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) + if( strcmp( "MBEDTLS_PLATFORM_STD_NV_SEED_READ", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_NV_SEED_READ ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_STD_NV_SEED_READ */ + +#if defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) + if( strcmp( "MBEDTLS_PLATFORM_STD_NV_SEED_WRITE", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_NV_SEED_WRITE ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_STD_NV_SEED_WRITE */ + +#if defined(MBEDTLS_PLATFORM_STD_NV_SEED_FILE) + if( strcmp( "MBEDTLS_PLATFORM_STD_NV_SEED_FILE", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_NV_SEED_FILE ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_STD_NV_SEED_FILE */ + +#if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) + if( strcmp( "MBEDTLS_PLATFORM_CALLOC_MACRO", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_CALLOC_MACRO ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_CALLOC_MACRO */ + +#if defined(MBEDTLS_PLATFORM_FREE_MACRO) + if( strcmp( "MBEDTLS_PLATFORM_FREE_MACRO", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_FREE_MACRO ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_FREE_MACRO */ + +#if defined(MBEDTLS_PLATFORM_EXIT_MACRO) + if( strcmp( "MBEDTLS_PLATFORM_EXIT_MACRO", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_EXIT_MACRO ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_EXIT_MACRO */ + +#if defined(MBEDTLS_PLATFORM_TIME_MACRO) + if( strcmp( "MBEDTLS_PLATFORM_TIME_MACRO", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_TIME_MACRO ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_TIME_MACRO */ + +#if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) + if( strcmp( "MBEDTLS_PLATFORM_TIME_TYPE_MACRO", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_TIME_TYPE_MACRO ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_TIME_TYPE_MACRO */ + +#if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) + if( strcmp( "MBEDTLS_PLATFORM_FPRINTF_MACRO", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_FPRINTF_MACRO ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_FPRINTF_MACRO */ + +#if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) + if( strcmp( "MBEDTLS_PLATFORM_PRINTF_MACRO", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_PRINTF_MACRO ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_PRINTF_MACRO */ + +#if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) + if( strcmp( "MBEDTLS_PLATFORM_SNPRINTF_MACRO", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_SNPRINTF_MACRO ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_SNPRINTF_MACRO */ + +#if defined(MBEDTLS_PLATFORM_NV_SEED_READ_MACRO) + if( strcmp( "MBEDTLS_PLATFORM_NV_SEED_READ_MACRO", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_NV_SEED_READ_MACRO ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_NV_SEED_READ_MACRO */ + +#if defined(MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO) + if( strcmp( "MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO */ + +#if defined(MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT) + if( strcmp( "MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT */ + +#if defined(MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES) + if( strcmp( "MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES */ + +#if defined(MBEDTLS_SSL_MAX_CONTENT_LEN) + if( strcmp( "MBEDTLS_SSL_MAX_CONTENT_LEN", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_MAX_CONTENT_LEN ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_MAX_CONTENT_LEN */ + +#if defined(MBEDTLS_SSL_IN_CONTENT_LEN) + if( strcmp( "MBEDTLS_SSL_IN_CONTENT_LEN", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_IN_CONTENT_LEN ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_IN_CONTENT_LEN */ + +#if defined(MBEDTLS_SSL_OUT_CONTENT_LEN) + if( strcmp( "MBEDTLS_SSL_OUT_CONTENT_LEN", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_OUT_CONTENT_LEN ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_OUT_CONTENT_LEN */ + +#if defined(MBEDTLS_SSL_DTLS_MAX_BUFFERING) + if( strcmp( "MBEDTLS_SSL_DTLS_MAX_BUFFERING", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DTLS_MAX_BUFFERING ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_DTLS_MAX_BUFFERING */ + +#if defined(MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME) + if( strcmp( "MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME */ + +#if defined(MBEDTLS_PSK_MAX_LEN) + if( strcmp( "MBEDTLS_PSK_MAX_LEN", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PSK_MAX_LEN ) ); + return( 0 ); + } +#endif /* MBEDTLS_PSK_MAX_LEN */ + +#if defined(MBEDTLS_SSL_COOKIE_TIMEOUT) + if( strcmp( "MBEDTLS_SSL_COOKIE_TIMEOUT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_COOKIE_TIMEOUT ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_COOKIE_TIMEOUT */ + +#if defined(MBEDTLS_SSL_CIPHERSUITES) + if( strcmp( "MBEDTLS_SSL_CIPHERSUITES", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CIPHERSUITES ) ); + return( 0 ); + } +#endif /* MBEDTLS_SSL_CIPHERSUITES */ + +#if defined(MBEDTLS_X509_MAX_INTERMEDIATE_CA) + if( strcmp( "MBEDTLS_X509_MAX_INTERMEDIATE_CA", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_X509_MAX_INTERMEDIATE_CA ) ); + return( 0 ); + } +#endif /* MBEDTLS_X509_MAX_INTERMEDIATE_CA */ + +#if defined(MBEDTLS_X509_MAX_FILE_PATH_LEN) + if( strcmp( "MBEDTLS_X509_MAX_FILE_PATH_LEN", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_X509_MAX_FILE_PATH_LEN ) ); + return( 0 ); + } +#endif /* MBEDTLS_X509_MAX_FILE_PATH_LEN */ + +#if defined(MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES) + if( strcmp( "MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES ) ); + return( 0 ); + } +#endif /* MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES */ + +#if defined(MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE) + if( strcmp( "MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE ) ); + return( 0 ); + } +#endif /* MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE */ + +#if defined(MBEDTLS_PLATFORM_ZEROIZE_ALT) + if( strcmp( "MBEDTLS_PLATFORM_ZEROIZE_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_ZEROIZE_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_ZEROIZE_ALT */ + +#if defined(MBEDTLS_PLATFORM_GMTIME_R_ALT) + if( strcmp( "MBEDTLS_PLATFORM_GMTIME_R_ALT", config ) == 0 ) + { + mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_GMTIME_R_ALT ) ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_GMTIME_R_ALT */ + + return( 1 ); +} diff --git a/programs/ssl/ssl_client2.c b/programs/ssl/ssl_client2.c index 1ce10b62e..13439702e 100644 --- a/programs/ssl/ssl_client2.c +++ b/programs/ssl/ssl_client2.c @@ -312,6 +312,10 @@ int main( void ) " options: ssl3, tls1, tls1_1, tls1_2, dtls1, dtls1_2\n" \ "\n" \ " force_ciphersuite= default: all enabled\n"\ + " query_config= return 0 if the specified\n" \ + " configuration macro is defined and 1\n" \ + " otherwise. The expansion of the macro\n" \ + " is printed if it is defined\n" \ " acceptable ciphersuite names:\n" #define ALPN_LIST_SIZE 10 @@ -383,6 +387,8 @@ struct options int etm; /* negotiate encrypt then mac? */ } opt; +int query_config( const char *config ); + static void my_debug( void *ctx, int level, const char *file, int line, const char *str ) @@ -992,6 +998,10 @@ int main( int argc, char *argv[] ) if( opt.dhmlen < 0 ) goto usage; } + else if( strcmp( p, "query_config" ) == 0 ) + { + return query_config( q ); + } else goto usage; } diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c index f654e6642..2a499adf9 100644 --- a/programs/ssl/ssl_server2.c +++ b/programs/ssl/ssl_server2.c @@ -415,6 +415,10 @@ int main( void ) " in order from ssl3 to tls1_2\n" \ " default: all enabled\n" \ " force_ciphersuite= default: all enabled\n" \ + " query_config= return 0 if the specified\n" \ + " configuration macro is defined and 1\n" \ + " otherwise. The expansion of the macro\n" \ + " is printed if it is defined\n" \ " acceptable ciphersuite names:\n" @@ -508,6 +512,8 @@ struct options int badmac_limit; /* Limit of records with bad MAC */ } opt; +int query_config( const char *config ); + static void my_debug( void *ctx, int level, const char *file, int line, const char *str ) @@ -1756,6 +1762,10 @@ int main( int argc, char *argv[] ) { opt.sni = q; } + else if( strcmp( p, "query_config" ) == 0 ) + { + return query_config( q ); + } else goto usage; } From 3169dc0619f6a4c0b141e46eeda8dfcdebc75312 Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Tue, 16 Oct 2018 21:29:07 +0100 Subject: [PATCH 08/61] ssl-opt: Use ssl_server2 to query config instead of grep and sed --- tests/ssl-opt.sh | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh index bc783103a..b9aefab3e 100755 --- a/tests/ssl-opt.sh +++ b/tests/ssl-opt.sh @@ -165,22 +165,34 @@ requires_config_disabled() { } get_config_value_or_default() { - NAME="$1" - DEF_VAL=$( grep ".*#define.*${NAME}" ../include/mbedtls/config.h | - sed 's/^.* \([0-9]*\)$/\1/' ) - ../scripts/config.pl get $NAME || echo "$DEF_VAL" + # This function uses the query_config command line option to query the + # required Mbed TLS compile time configuration from the ssl_server2 + # program. The command will always return a success value if the + # configuration is defined and the value will be printed to stdout. + # + # Note that if the configuration is not defined or is defined to nothing, + # the output of this function will be an empty string. + ${P_SRV} "query_config=${1}" } requires_config_value_at_least() { - VAL=$( get_config_value_or_default "$1" ) - if [ "$VAL" -lt "$2" ]; then + VAL="$( get_config_value_or_default "$1" )" + if [ -z "$VAL" ]; then + # Should never happen + echo "Mbed TLS configuration $1 is not defined" + exit 1 + elif [ "$VAL" -lt "$2" ]; then SKIP_NEXT="YES" fi } requires_config_value_at_most() { VAL=$( get_config_value_or_default "$1" ) - if [ "$VAL" -gt "$2" ]; then + if [ -z "$VAL" ]; then + # Should never happen + echo "Mbed TLS configuration $1 is not defined" + exit 1 + elif [ "$VAL" -gt "$2" ]; then SKIP_NEXT="YES" fi } From 3b2f9d3ca85a51f6e5ed2b046a9c2ad73f0d613a Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Tue, 16 Oct 2018 21:31:29 +0100 Subject: [PATCH 09/61] query_config.c: remove duplicated inc of platform.h --- programs/ssl/query_config.c | 1 - 1 file changed, 1 deletion(-) diff --git a/programs/ssl/query_config.c b/programs/ssl/query_config.c index 1a773c235..43da6d6da 100644 --- a/programs/ssl/query_config.c +++ b/programs/ssl/query_config.c @@ -77,7 +77,6 @@ #include "mbedtls/pkcs11.h" #include "mbedtls/pkcs12.h" #include "mbedtls/pkcs5.h" -#include "mbedtls/platform.h" #include "mbedtls/platform_time.h" #include "mbedtls/platform_util.h" #include "mbedtls/poly1305.h" From 88121a96f68c67b0160d88ec78165d8536de4d3f Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Tue, 16 Oct 2018 22:00:13 +0100 Subject: [PATCH 10/61] Script generation of query_config.c file --- scripts/data_files/query_config.fmt | 113 ++++++++++++++++++++++++++++ scripts/generate_query_config.pl | 62 +++++++++++++++ 2 files changed, 175 insertions(+) create mode 100644 scripts/data_files/query_config.fmt create mode 100755 scripts/generate_query_config.pl diff --git a/scripts/data_files/query_config.fmt b/scripts/data_files/query_config.fmt new file mode 100644 index 000000000..d8e3c7b38 --- /dev/null +++ b/scripts/data_files/query_config.fmt @@ -0,0 +1,113 @@ +/* + * Query configuration information + * + * Copyright (C) 2018, Arm Limited, All Rights Reserved + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * This file is part of Mbed TLS (https://tls.mbed.org) + */ + +#if !defined(MBEDTLS_CONFIG_FILE) +#include "mbedtls/config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + +#if defined(MBEDTLS_PLATFORM_C) +#include "mbedtls/platform.h" +#else +#define mbedtls_printf printf +#endif /* MBEDTLS_PLATFORM_C */ + +/* Include all the headers with public APIs in case they modify any configs */ +#include "mbedtls/aes.h" +#include "mbedtls/aesni.h" +#include "mbedtls/arc4.h" +#include "mbedtls/aria.h" +#include "mbedtls/asn1.h" +#include "mbedtls/asn1write.h" +#include "mbedtls/base64.h" +#include "mbedtls/bignum.h" +#include "mbedtls/blowfish.h" +#include "mbedtls/camellia.h" +#include "mbedtls/ccm.h" +#include "mbedtls/certs.h" +#include "mbedtls/chacha20.h" +#include "mbedtls/chachapoly.h" +#include "mbedtls/cipher.h" +#include "mbedtls/cmac.h" +#include "mbedtls/ctr_drbg.h" +#include "mbedtls/debug.h" +#include "mbedtls/des.h" +#include "mbedtls/dhm.h" +#include "mbedtls/ecdh.h" +#include "mbedtls/ecdsa.h" +#include "mbedtls/ecjpake.h" +#include "mbedtls/ecp.h" +#include "mbedtls/entropy.h" +#include "mbedtls/entropy_poll.h" +#include "mbedtls/error.h" +#include "mbedtls/gcm.h" +#include "mbedtls/havege.h" +#include "mbedtls/hkdf.h" +#include "mbedtls/hmac_drbg.h" +#include "mbedtls/md.h" +#include "mbedtls/md2.h" +#include "mbedtls/md4.h" +#include "mbedtls/md5.h" +#include "mbedtls/memory_buffer_alloc.h" +#include "mbedtls/net_sockets.h" +#include "mbedtls/nist_kw.h" +#include "mbedtls/oid.h" +#include "mbedtls/padlock.h" +#include "mbedtls/pem.h" +#include "mbedtls/pk.h" +#include "mbedtls/pkcs11.h" +#include "mbedtls/pkcs12.h" +#include "mbedtls/pkcs5.h" +#include "mbedtls/platform_time.h" +#include "mbedtls/platform_util.h" +#include "mbedtls/poly1305.h" +#include "mbedtls/ripemd160.h" +#include "mbedtls/rsa.h" +#include "mbedtls/sha1.h" +#include "mbedtls/sha256.h" +#include "mbedtls/sha512.h" +#include "mbedtls/ssl.h" +#include "mbedtls/ssl_cache.h" +#include "mbedtls/ssl_ciphersuites.h" +#include "mbedtls/ssl_cookie.h" +#include "mbedtls/ssl_internal.h" +#include "mbedtls/ssl_ticket.h" +#include "mbedtls/threading.h" +#include "mbedtls/timing.h" +#include "mbedtls/version.h" +#include "mbedtls/x509.h" +#include "mbedtls/x509_crl.h" +#include "mbedtls/x509_crt.h" +#include "mbedtls/x509_csr.h" +#include "mbedtls/xtea.h" + +#include +#include + +/* Helper macros to convert a macro or its expansion into a string */ +#define MACRO_EXPANSION_TO_STR(macro) MACRO_NAME_TO_STR(macro) +#define MACRO_NAME_TO_STR(macro) strlen( #macro ) > 0 ? #macro "\n" : "" + +int query_config( const char *config ) +{ +CHECK_CONFIG return( 1 ); +} diff --git a/scripts/generate_query_config.pl b/scripts/generate_query_config.pl new file mode 100755 index 000000000..af485ce0c --- /dev/null +++ b/scripts/generate_query_config.pl @@ -0,0 +1,62 @@ +#! /usr/bin/env perl + +# Generate query_config.c +# +# The file query_config.c contains a C function that can be used to check if +# a configuration macro is defined and to retrieve its expansion in string +# form (if any). This facilitates querying the compile time configuration of +# the library, for example, for testing. +# +# The query_config.c is generated from the current configuration at +# include/mbedtls/config.h. The idea is that the config.h contains ALL the +# compile time configurations available in Mbed TLS (commented or uncommented). +# This script extracts the configuration macros from the config.h and this +# information is used to automatically generate the body of the query_config() +# function by using the template in scripts/data_files/query_config.fmt. +# +# Usage: ./scripts/generate_query_config.pl without arguments + +use strict; + +my $config_file = "./include/mbedtls/config.h"; + +my $query_config_format_file = "./scripts/data_files/query_config.fmt"; +my $query_config_file = "./programs/ssl/query_config.c"; + +open(CONFIG_FILE, "$config_file") or die "Opening config file '$config_file': $!"; + +# This variable will contain the string to replace in the CHECK_CONFIG of the +# format file +my $config_check = ""; + +while (my $line = ) { + if ($line =~ /^(\/\/)?\s*#\s*define\s+(MBEDTLS_\w+).*/) { + my $name = $2; + + # Skip over the macro that prevents multiple inclusion + next if "MBEDTLS_CONFIG_H" eq $name; + + $config_check .= "#if defined($name)\n"; + $config_check .= " if( strcmp( \"$name\", config ) == 0 )\n"; + $config_check .= " {\n"; + $config_check .= " mbedtls_printf( MACRO_EXPANSION_TO_STR( $name ) );\n"; + $config_check .= " return( 0 );\n"; + $config_check .= " }\n"; + $config_check .= "#endif /* $name */\n"; + $config_check .= "\n"; + } +} + +# Read the fill format file into a string +local $/; +open(FORMAT_FILE, "$query_config_format_file") or die "Opening query config format file '$query_config_format_file': $!"; +my $query_config_format = ; +close(FORMAT_FILE); + +# Replace the body of the query_config() function with the code we just wrote +$query_config_format =~ s/CHECK_CONFIG/$config_check/g; + +# Rewrite the query_config.c file +open(QUERY_CONFIG_FILE, ">$query_config_file") or die "Opening destination file '$query_config_file': $!"; +print QUERY_CONFIG_FILE $query_config_format; +close(QUERY_CONFIG_FILE); From 4c981a09e83b73cfba1358faf671134ebb68b013 Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Tue, 16 Oct 2018 22:13:57 +0100 Subject: [PATCH 11/61] Add gen_query_config.pl to check-gen-files and bump_version --- scripts/bump_version.sh | 3 +++ tests/scripts/check-generated-files.sh | 1 + 2 files changed, 4 insertions(+) diff --git a/scripts/bump_version.sh b/scripts/bump_version.sh index fc8b800c4..c39a86a5e 100755 --- a/scripts/bump_version.sh +++ b/scripts/bump_version.sh @@ -132,6 +132,9 @@ done [ $VERBOSE ] && echo "Re-generating library/error.c" scripts/generate_errors.pl +[ $VERBOSE ] && echo "Re-generating programs/ssl/query_config.c" +scripts/generate_query_config.pl + [ $VERBOSE ] && echo "Re-generating library/version_features.c" scripts/generate_features.pl diff --git a/tests/scripts/check-generated-files.sh b/tests/scripts/check-generated-files.sh index 4976bacf5..065ea33a2 100755 --- a/tests/scripts/check-generated-files.sh +++ b/tests/scripts/check-generated-files.sh @@ -65,5 +65,6 @@ check() } check scripts/generate_errors.pl library/error.c +check scripts/generate_query_config.pl programs/ssl/query_config.c check scripts/generate_features.pl library/version_features.c check scripts/generate_visualc_files.pl visualc/VS2010 From aabe52f036def2c8ab8d571168f1440af4e0b99f Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Tue, 16 Oct 2018 22:18:53 +0100 Subject: [PATCH 12/61] Add ChangeLog entries --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5c2fbbbd4..5b203bcf7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -35,6 +35,8 @@ Changes produced by some optimizing compilers, showing up as failures in e.g. RSA or ECC signature operations. Reported in #1722, fix suggested by Aurelien Jarno and submitted by Jeffrey Martin. + * Fix configuration queries in ssl-opt.h. #2030 + * Ensure that ssl-opt.h can be run in OS X. #2029 = mbed TLS 2.16.0 branch released 2018-12-21 From bb923642c3df678e33597d5087ab46b337e2a0fb Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Wed, 17 Oct 2018 09:47:00 +0100 Subject: [PATCH 13/61] Update programs/ssl/CMakeLists.txt with query_config.c dep --- programs/ssl/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/ssl/CMakeLists.txt b/programs/ssl/CMakeLists.txt index 1e6563341..0a36bd675 100644 --- a/programs/ssl/CMakeLists.txt +++ b/programs/ssl/CMakeLists.txt @@ -33,13 +33,13 @@ target_link_libraries(dtls_server ${libs}) add_executable(ssl_client1 ssl_client1.c) target_link_libraries(ssl_client1 ${libs}) -add_executable(ssl_client2 ssl_client2.c) +add_executable(ssl_client2 ssl_client2.c query_config.c) target_link_libraries(ssl_client2 ${libs}) add_executable(ssl_server ssl_server.c) target_link_libraries(ssl_server ${libs}) -add_executable(ssl_server2 ssl_server2.c) +add_executable(ssl_server2 ssl_server2.c query_config.c) target_link_libraries(ssl_server2 ${libs}) add_executable(ssl_fork_server ssl_fork_server.c) From 109f8b6100166d0105156ca0e34f9934ca67dda8 Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Tue, 23 Oct 2018 19:53:14 +0100 Subject: [PATCH 14/61] Fix typo in quenerate_query_config.pl comment --- scripts/generate_query_config.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/generate_query_config.pl b/scripts/generate_query_config.pl index af485ce0c..e99542d7c 100755 --- a/scripts/generate_query_config.pl +++ b/scripts/generate_query_config.pl @@ -47,7 +47,7 @@ while (my $line = ) { } } -# Read the fill format file into a string +# Read the full format file into a string local $/; open(FORMAT_FILE, "$query_config_format_file") or die "Opening query config format file '$query_config_format_file': $!"; my $query_config_format = ; From 458148681de5099f6c666f5adb312e50f2c2ae73 Mon Sep 17 00:00:00 2001 From: Andres AG Date: Fri, 26 Oct 2018 18:37:38 +0100 Subject: [PATCH 15/61] Ensure query_config.c includes stdio only when needed --- programs/ssl/query_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/ssl/query_config.c b/programs/ssl/query_config.c index 43da6d6da..b523b78f1 100644 --- a/programs/ssl/query_config.c +++ b/programs/ssl/query_config.c @@ -28,6 +28,7 @@ #if defined(MBEDTLS_PLATFORM_C) #include "mbedtls/platform.h" #else +#include #define mbedtls_printf printf #endif /* MBEDTLS_PLATFORM_C */ @@ -100,7 +101,6 @@ #include "mbedtls/x509_csr.h" #include "mbedtls/xtea.h" -#include #include /* Helper macros to convert a macro or its expansion into a string */ From 509ba69e16783ddd2c3012f9297e90a8161151f5 Mon Sep 17 00:00:00 2001 From: Andres AG Date: Fri, 26 Oct 2018 18:41:08 +0100 Subject: [PATCH 16/61] Create programs/test/query_compile_time_config app --- programs/.gitignore | 1 + programs/Makefile | 5 + programs/test/CMakeLists.txt | 5 +- programs/test/query_compile_time_config.c | 56 ++++++ visualc/VS2010/mbedTLS.sln | 13 ++ .../VS2010/query_compile_time_config.vcxproj | 174 ++++++++++++++++++ 6 files changed, 253 insertions(+), 1 deletion(-) create mode 100644 programs/test/query_compile_time_config.c create mode 100644 visualc/VS2010/query_compile_time_config.vcxproj diff --git a/programs/.gitignore b/programs/.gitignore index 02418966f..4d789309d 100644 --- a/programs/.gitignore +++ b/programs/.gitignore @@ -49,6 +49,7 @@ test/cpp_dummy_build test/ssl_cert_test test/udp_proxy test/zeroize +test/query_compile_time_config util/pem2der util/strerror x509/cert_app diff --git a/programs/Makefile b/programs/Makefile index 1d4a801c7..7d9affc5c 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -70,6 +70,7 @@ APPS = aes/aescrypt2$(EXEXT) aes/crypt_and_hash$(EXEXT) \ test/ssl_cert_test$(EXEXT) test/benchmark$(EXEXT) \ test/selftest$(EXEXT) test/udp_proxy$(EXEXT) \ test/zeroize$(EXEXT) \ + test/query_compile_time_config$(EXEXT) \ util/pem2der$(EXEXT) util/strerror$(EXEXT) \ x509/cert_app$(EXEXT) x509/crl_app$(EXEXT) \ x509/cert_req$(EXEXT) x509/cert_write$(EXEXT) \ @@ -264,6 +265,10 @@ test/zeroize$(EXEXT): test/zeroize.c $(DEP) echo " CC test/zeroize.c" $(CC) $(LOCAL_CFLAGS) $(CFLAGS) test/zeroize.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ +test/query_compile_time_config$(EXEXT): test/query_compile_time_config.c ssl/query_config.c $(DEP) + echo " CC test/query_compile_time_config.c" + $(CC) $(LOCAL_CFLAGS) $(CFLAGS) test/query_compile_time_config.c ssl/query_config.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ + util/pem2der$(EXEXT): util/pem2der.c $(DEP) echo " CC util/pem2der.c" $(CC) $(LOCAL_CFLAGS) $(CFLAGS) util/pem2der.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ diff --git a/programs/test/CMakeLists.txt b/programs/test/CMakeLists.txt index 9ca0cb222..8af02da1b 100644 --- a/programs/test/CMakeLists.txt +++ b/programs/test/CMakeLists.txt @@ -30,6 +30,9 @@ target_link_libraries(udp_proxy ${libs}) add_executable(zeroize zeroize.c) target_link_libraries(zeroize ${libs}) -install(TARGETS selftest benchmark ssl_cert_test udp_proxy +add_executable(query_compile_time_config query_compile_time_config.c ../ssl/query_config.c) +target_link_libraries(query_compile_time_config ${libs}) + +install(TARGETS selftest benchmark ssl_cert_test udp_proxy query_compile_time_config DESTINATION "bin" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) diff --git a/programs/test/query_compile_time_config.c b/programs/test/query_compile_time_config.c new file mode 100644 index 000000000..f02c52d91 --- /dev/null +++ b/programs/test/query_compile_time_config.c @@ -0,0 +1,56 @@ +/* + * Query the Mbed TLS compile time configuration + * + * Copyright (C) 2018, Arm Limited, All Rights Reserved + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * This file is part of Mbed TLS (https://tls.mbed.org) + */ + +#if !defined(MBEDTLS_CONFIG_FILE) +#include "mbedtls/config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + +#if defined(MBEDTLS_PLATFORM_C) +#include "mbedtls/platform.h" +#else +#include +#include +#define mbedtls_printf printf +#define MBEDTLS_EXIT_FAILURE EXIT_FAILURE +#endif + +#define USAGE \ + "usage: %s \n\n" \ + "This program takes one command line argument which corresponds to\n" \ + "the string representation of a Mbed TLS compile time configuration.\n" \ + "The value 0 will be returned if this configuration is defined in the\n" \ + "Mbed TLS build and the macro expansion of that configuration will be\n" \ + "printed (if any). Otherwise, 1 will be returned.\n" + +int query_config( const char *config ); + +int main( int argc, char *argv[] ) +{ + if ( argc != 2 ) + { + mbedtls_printf( USAGE, argv[0] ); + return( MBEDTLS_EXIT_FAILURE ); + } + + return( query_config( argv[1] ) ); +} diff --git a/visualc/VS2010/mbedTLS.sln b/visualc/VS2010/mbedTLS.sln index 66b96c3a3..85429b837 100644 --- a/visualc/VS2010/mbedTLS.sln +++ b/visualc/VS2010/mbedTLS.sln @@ -208,6 +208,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zeroize", "zeroize.vcxproj" {46CF2D25-6A36-4189-B59C-E4815388E554} = {46CF2D25-6A36-4189-B59C-E4815388E554} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "query_compile_time_config", "query_compile_time_config.vcxproj", "{D6F58AF2-9D80-562A-E2B0-F743281522B9}" + ProjectSection(ProjectDependencies) = postProject + {46CF2D25-6A36-4189-B59C-E4815388E554} = {46CF2D25-6A36-4189-B59C-E4815388E554} + EndProjectSection +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pem2der", "pem2der.vcxproj", "{D3C6FBD6-D78E-7180-8345-5E09B492DBEC}" ProjectSection(ProjectDependencies) = postProject {46CF2D25-6A36-4189-B59C-E4815388E554} = {46CF2D25-6A36-4189-B59C-E4815388E554} @@ -587,6 +592,14 @@ Global {10C01E94-4926-063E-9F56-C84ED190D349}.Release|Win32.Build.0 = Release|Win32 {10C01E94-4926-063E-9F56-C84ED190D349}.Release|x64.ActiveCfg = Release|x64 {10C01E94-4926-063E-9F56-C84ED190D349}.Release|x64.Build.0 = Release|x64 + {D6F58AF2-9D80-562A-E2B0-F743281522B9}.Debug|Win32.ActiveCfg = Debug|Win32 + {D6F58AF2-9D80-562A-E2B0-F743281522B9}.Debug|Win32.Build.0 = Debug|Win32 + {D6F58AF2-9D80-562A-E2B0-F743281522B9}.Debug|x64.ActiveCfg = Debug|x64 + {D6F58AF2-9D80-562A-E2B0-F743281522B9}.Debug|x64.Build.0 = Debug|x64 + {D6F58AF2-9D80-562A-E2B0-F743281522B9}.Release|Win32.ActiveCfg = Release|Win32 + {D6F58AF2-9D80-562A-E2B0-F743281522B9}.Release|Win32.Build.0 = Release|Win32 + {D6F58AF2-9D80-562A-E2B0-F743281522B9}.Release|x64.ActiveCfg = Release|x64 + {D6F58AF2-9D80-562A-E2B0-F743281522B9}.Release|x64.Build.0 = Release|x64 {D3C6FBD6-D78E-7180-8345-5E09B492DBEC}.Debug|Win32.ActiveCfg = Debug|Win32 {D3C6FBD6-D78E-7180-8345-5E09B492DBEC}.Debug|Win32.Build.0 = Debug|Win32 {D3C6FBD6-D78E-7180-8345-5E09B492DBEC}.Debug|x64.ActiveCfg = Debug|x64 diff --git a/visualc/VS2010/query_compile_time_config.vcxproj b/visualc/VS2010/query_compile_time_config.vcxproj new file mode 100644 index 000000000..f8ec62a26 --- /dev/null +++ b/visualc/VS2010/query_compile_time_config.vcxproj @@ -0,0 +1,174 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + + + + + {46cf2d25-6a36-4189-b59c-e4815388e554} + true + + + + {D6F58AF2-9D80-562A-E2B0-F743281522B9} + Win32Proj + query_compile_time_config + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + Windows7.1SDK + + + + + + + + + + + + + + + + + + + true + $(Configuration)\$(TargetName)\ + + + true + $(Configuration)\$(TargetName)\ + + + false + $(Configuration)\$(TargetName)\ + + + false + $(Configuration)\$(TargetName)\ + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + ../../include + + + Console + true + NotSet + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + Debug + + + false + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + ../../include + + + Console + true + NotSet + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + Debug + + + false + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + ../../include + + + Console + true + true + true + Release + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + Level3 + + + MaxSpeed + true + true + WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + ../../include + + + Console + true + true + true + Release + %(AdditionalDependencies); + + + + + + From 08457ce76bb8bcda8ee37aead76f7d0f44fe2a2b Mon Sep 17 00:00:00 2001 From: Andres AG Date: Fri, 26 Oct 2018 18:45:45 +0100 Subject: [PATCH 17/61] Fix aligment in programs/test/query_compile_time_config.c --- programs/test/query_compile_time_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/test/query_compile_time_config.c b/programs/test/query_compile_time_config.c index f02c52d91..17becf27f 100644 --- a/programs/test/query_compile_time_config.c +++ b/programs/test/query_compile_time_config.c @@ -35,7 +35,7 @@ #endif #define USAGE \ - "usage: %s \n\n" \ + "usage: %s \n\n" \ "This program takes one command line argument which corresponds to\n" \ "the string representation of a Mbed TLS compile time configuration.\n" \ "The value 0 will be returned if this configuration is defined in the\n" \ From 2fdc2c299f98219c1c9826aa3b719925c75a3e0e Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Mon, 29 Oct 2018 18:38:36 +0000 Subject: [PATCH 18/61] Fix multiple stdio.h inclusion in query_config.c --- scripts/data_files/query_config.fmt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/data_files/query_config.fmt b/scripts/data_files/query_config.fmt index d8e3c7b38..3d62ebe9c 100644 --- a/scripts/data_files/query_config.fmt +++ b/scripts/data_files/query_config.fmt @@ -28,6 +28,7 @@ #if defined(MBEDTLS_PLATFORM_C) #include "mbedtls/platform.h" #else +#include #define mbedtls_printf printf #endif /* MBEDTLS_PLATFORM_C */ @@ -100,7 +101,6 @@ #include "mbedtls/x509_csr.h" #include "mbedtls/xtea.h" -#include #include /* Helper macros to convert a macro or its expansion into a string */ From 5aca5553919b6b979b1fa45b4d50c3481c43729e Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Mon, 29 Oct 2018 18:52:59 +0000 Subject: [PATCH 19/61] Fix GCC 0-length printf format string error --- programs/ssl/query_config.c | 588 +++++++++++++++---------------- scripts/generate_query_config.pl | 2 +- 2 files changed, 295 insertions(+), 295 deletions(-) diff --git a/programs/ssl/query_config.c b/programs/ssl/query_config.c index b523b78f1..774acdf0a 100644 --- a/programs/ssl/query_config.c +++ b/programs/ssl/query_config.c @@ -112,7 +112,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_HAVE_ASM) if( strcmp( "MBEDTLS_HAVE_ASM", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_HAVE_ASM ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_HAVE_ASM ) ); return( 0 ); } #endif /* MBEDTLS_HAVE_ASM */ @@ -120,7 +120,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_NO_UDBL_DIVISION) if( strcmp( "MBEDTLS_NO_UDBL_DIVISION", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_NO_UDBL_DIVISION ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_NO_UDBL_DIVISION ) ); return( 0 ); } #endif /* MBEDTLS_NO_UDBL_DIVISION */ @@ -128,7 +128,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_NO_64BIT_MULTIPLICATION) if( strcmp( "MBEDTLS_NO_64BIT_MULTIPLICATION", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_NO_64BIT_MULTIPLICATION ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_NO_64BIT_MULTIPLICATION ) ); return( 0 ); } #endif /* MBEDTLS_NO_64BIT_MULTIPLICATION */ @@ -136,7 +136,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_HAVE_SSE2) if( strcmp( "MBEDTLS_HAVE_SSE2", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_HAVE_SSE2 ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_HAVE_SSE2 ) ); return( 0 ); } #endif /* MBEDTLS_HAVE_SSE2 */ @@ -144,7 +144,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_HAVE_TIME) if( strcmp( "MBEDTLS_HAVE_TIME", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_HAVE_TIME ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_HAVE_TIME ) ); return( 0 ); } #endif /* MBEDTLS_HAVE_TIME */ @@ -152,7 +152,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_HAVE_TIME_DATE) if( strcmp( "MBEDTLS_HAVE_TIME_DATE", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_HAVE_TIME_DATE ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_HAVE_TIME_DATE ) ); return( 0 ); } #endif /* MBEDTLS_HAVE_TIME_DATE */ @@ -160,7 +160,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_MEMORY) if( strcmp( "MBEDTLS_PLATFORM_MEMORY", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_MEMORY ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_MEMORY ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_MEMORY */ @@ -168,7 +168,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS) if( strcmp( "MBEDTLS_PLATFORM_NO_STD_FUNCTIONS", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_NO_STD_FUNCTIONS ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_NO_STD_FUNCTIONS ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_NO_STD_FUNCTIONS */ @@ -176,7 +176,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_EXIT_ALT) if( strcmp( "MBEDTLS_PLATFORM_EXIT_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_EXIT_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_EXIT_ALT ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_EXIT_ALT */ @@ -184,7 +184,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_TIME_ALT) if( strcmp( "MBEDTLS_PLATFORM_TIME_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_TIME_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_TIME_ALT ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_TIME_ALT */ @@ -192,7 +192,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_FPRINTF_ALT) if( strcmp( "MBEDTLS_PLATFORM_FPRINTF_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_FPRINTF_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_FPRINTF_ALT ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_FPRINTF_ALT */ @@ -200,7 +200,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_PRINTF_ALT) if( strcmp( "MBEDTLS_PLATFORM_PRINTF_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_PRINTF_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_PRINTF_ALT ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_PRINTF_ALT */ @@ -208,7 +208,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) if( strcmp( "MBEDTLS_PLATFORM_SNPRINTF_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_SNPRINTF_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_SNPRINTF_ALT ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_SNPRINTF_ALT */ @@ -216,7 +216,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_NV_SEED_ALT) if( strcmp( "MBEDTLS_PLATFORM_NV_SEED_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_NV_SEED_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_NV_SEED_ALT ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_NV_SEED_ALT */ @@ -224,7 +224,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT) if( strcmp( "MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT */ @@ -232,7 +232,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_DEPRECATED_WARNING) if( strcmp( "MBEDTLS_DEPRECATED_WARNING", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_DEPRECATED_WARNING ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_DEPRECATED_WARNING ) ); return( 0 ); } #endif /* MBEDTLS_DEPRECATED_WARNING */ @@ -240,7 +240,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_DEPRECATED_REMOVED) if( strcmp( "MBEDTLS_DEPRECATED_REMOVED", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_DEPRECATED_REMOVED ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_DEPRECATED_REMOVED ) ); return( 0 ); } #endif /* MBEDTLS_DEPRECATED_REMOVED */ @@ -248,7 +248,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_TIMING_ALT) if( strcmp( "MBEDTLS_TIMING_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_TIMING_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_TIMING_ALT ) ); return( 0 ); } #endif /* MBEDTLS_TIMING_ALT */ @@ -256,7 +256,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_AES_ALT) if( strcmp( "MBEDTLS_AES_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_AES_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_AES_ALT ) ); return( 0 ); } #endif /* MBEDTLS_AES_ALT */ @@ -264,7 +264,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ARC4_ALT) if( strcmp( "MBEDTLS_ARC4_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ARC4_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ARC4_ALT ) ); return( 0 ); } #endif /* MBEDTLS_ARC4_ALT */ @@ -272,7 +272,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ARIA_ALT) if( strcmp( "MBEDTLS_ARIA_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ARIA_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ARIA_ALT ) ); return( 0 ); } #endif /* MBEDTLS_ARIA_ALT */ @@ -280,7 +280,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_BLOWFISH_ALT) if( strcmp( "MBEDTLS_BLOWFISH_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_BLOWFISH_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_BLOWFISH_ALT ) ); return( 0 ); } #endif /* MBEDTLS_BLOWFISH_ALT */ @@ -288,7 +288,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CAMELLIA_ALT) if( strcmp( "MBEDTLS_CAMELLIA_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CAMELLIA_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CAMELLIA_ALT ) ); return( 0 ); } #endif /* MBEDTLS_CAMELLIA_ALT */ @@ -296,7 +296,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CCM_ALT) if( strcmp( "MBEDTLS_CCM_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CCM_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CCM_ALT ) ); return( 0 ); } #endif /* MBEDTLS_CCM_ALT */ @@ -304,7 +304,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CHACHA20_ALT) if( strcmp( "MBEDTLS_CHACHA20_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CHACHA20_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CHACHA20_ALT ) ); return( 0 ); } #endif /* MBEDTLS_CHACHA20_ALT */ @@ -312,7 +312,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CHACHAPOLY_ALT) if( strcmp( "MBEDTLS_CHACHAPOLY_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CHACHAPOLY_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CHACHAPOLY_ALT ) ); return( 0 ); } #endif /* MBEDTLS_CHACHAPOLY_ALT */ @@ -320,7 +320,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CMAC_ALT) if( strcmp( "MBEDTLS_CMAC_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CMAC_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CMAC_ALT ) ); return( 0 ); } #endif /* MBEDTLS_CMAC_ALT */ @@ -328,7 +328,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_DES_ALT) if( strcmp( "MBEDTLS_DES_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_DES_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_DES_ALT ) ); return( 0 ); } #endif /* MBEDTLS_DES_ALT */ @@ -336,7 +336,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_DHM_ALT) if( strcmp( "MBEDTLS_DHM_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_DHM_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_DHM_ALT ) ); return( 0 ); } #endif /* MBEDTLS_DHM_ALT */ @@ -344,7 +344,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECJPAKE_ALT) if( strcmp( "MBEDTLS_ECJPAKE_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECJPAKE_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECJPAKE_ALT ) ); return( 0 ); } #endif /* MBEDTLS_ECJPAKE_ALT */ @@ -352,7 +352,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_GCM_ALT) if( strcmp( "MBEDTLS_GCM_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_GCM_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_GCM_ALT ) ); return( 0 ); } #endif /* MBEDTLS_GCM_ALT */ @@ -360,7 +360,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_NIST_KW_ALT) if( strcmp( "MBEDTLS_NIST_KW_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_NIST_KW_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_NIST_KW_ALT ) ); return( 0 ); } #endif /* MBEDTLS_NIST_KW_ALT */ @@ -368,7 +368,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MD2_ALT) if( strcmp( "MBEDTLS_MD2_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MD2_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MD2_ALT ) ); return( 0 ); } #endif /* MBEDTLS_MD2_ALT */ @@ -376,7 +376,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MD4_ALT) if( strcmp( "MBEDTLS_MD4_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MD4_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MD4_ALT ) ); return( 0 ); } #endif /* MBEDTLS_MD4_ALT */ @@ -384,7 +384,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MD5_ALT) if( strcmp( "MBEDTLS_MD5_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MD5_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MD5_ALT ) ); return( 0 ); } #endif /* MBEDTLS_MD5_ALT */ @@ -392,7 +392,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_POLY1305_ALT) if( strcmp( "MBEDTLS_POLY1305_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_POLY1305_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_POLY1305_ALT ) ); return( 0 ); } #endif /* MBEDTLS_POLY1305_ALT */ @@ -400,7 +400,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_RIPEMD160_ALT) if( strcmp( "MBEDTLS_RIPEMD160_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_RIPEMD160_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_RIPEMD160_ALT ) ); return( 0 ); } #endif /* MBEDTLS_RIPEMD160_ALT */ @@ -408,7 +408,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_RSA_ALT) if( strcmp( "MBEDTLS_RSA_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_RSA_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_RSA_ALT ) ); return( 0 ); } #endif /* MBEDTLS_RSA_ALT */ @@ -416,7 +416,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SHA1_ALT) if( strcmp( "MBEDTLS_SHA1_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SHA1_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SHA1_ALT ) ); return( 0 ); } #endif /* MBEDTLS_SHA1_ALT */ @@ -424,7 +424,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SHA256_ALT) if( strcmp( "MBEDTLS_SHA256_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SHA256_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SHA256_ALT ) ); return( 0 ); } #endif /* MBEDTLS_SHA256_ALT */ @@ -432,7 +432,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SHA512_ALT) if( strcmp( "MBEDTLS_SHA512_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SHA512_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SHA512_ALT ) ); return( 0 ); } #endif /* MBEDTLS_SHA512_ALT */ @@ -440,7 +440,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_XTEA_ALT) if( strcmp( "MBEDTLS_XTEA_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_XTEA_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_XTEA_ALT ) ); return( 0 ); } #endif /* MBEDTLS_XTEA_ALT */ @@ -448,7 +448,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_ALT) if( strcmp( "MBEDTLS_ECP_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_ALT ) ); return( 0 ); } #endif /* MBEDTLS_ECP_ALT */ @@ -456,7 +456,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MD2_PROCESS_ALT) if( strcmp( "MBEDTLS_MD2_PROCESS_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MD2_PROCESS_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MD2_PROCESS_ALT ) ); return( 0 ); } #endif /* MBEDTLS_MD2_PROCESS_ALT */ @@ -464,7 +464,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MD4_PROCESS_ALT) if( strcmp( "MBEDTLS_MD4_PROCESS_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MD4_PROCESS_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MD4_PROCESS_ALT ) ); return( 0 ); } #endif /* MBEDTLS_MD4_PROCESS_ALT */ @@ -472,7 +472,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MD5_PROCESS_ALT) if( strcmp( "MBEDTLS_MD5_PROCESS_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MD5_PROCESS_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MD5_PROCESS_ALT ) ); return( 0 ); } #endif /* MBEDTLS_MD5_PROCESS_ALT */ @@ -480,7 +480,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_RIPEMD160_PROCESS_ALT) if( strcmp( "MBEDTLS_RIPEMD160_PROCESS_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_RIPEMD160_PROCESS_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_RIPEMD160_PROCESS_ALT ) ); return( 0 ); } #endif /* MBEDTLS_RIPEMD160_PROCESS_ALT */ @@ -488,7 +488,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SHA1_PROCESS_ALT) if( strcmp( "MBEDTLS_SHA1_PROCESS_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SHA1_PROCESS_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SHA1_PROCESS_ALT ) ); return( 0 ); } #endif /* MBEDTLS_SHA1_PROCESS_ALT */ @@ -496,7 +496,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SHA256_PROCESS_ALT) if( strcmp( "MBEDTLS_SHA256_PROCESS_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SHA256_PROCESS_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SHA256_PROCESS_ALT ) ); return( 0 ); } #endif /* MBEDTLS_SHA256_PROCESS_ALT */ @@ -504,7 +504,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SHA512_PROCESS_ALT) if( strcmp( "MBEDTLS_SHA512_PROCESS_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SHA512_PROCESS_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SHA512_PROCESS_ALT ) ); return( 0 ); } #endif /* MBEDTLS_SHA512_PROCESS_ALT */ @@ -512,7 +512,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_DES_SETKEY_ALT) if( strcmp( "MBEDTLS_DES_SETKEY_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_DES_SETKEY_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_DES_SETKEY_ALT ) ); return( 0 ); } #endif /* MBEDTLS_DES_SETKEY_ALT */ @@ -520,7 +520,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_DES_CRYPT_ECB_ALT) if( strcmp( "MBEDTLS_DES_CRYPT_ECB_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_DES_CRYPT_ECB_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_DES_CRYPT_ECB_ALT ) ); return( 0 ); } #endif /* MBEDTLS_DES_CRYPT_ECB_ALT */ @@ -528,7 +528,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_DES3_CRYPT_ECB_ALT) if( strcmp( "MBEDTLS_DES3_CRYPT_ECB_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_DES3_CRYPT_ECB_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_DES3_CRYPT_ECB_ALT ) ); return( 0 ); } #endif /* MBEDTLS_DES3_CRYPT_ECB_ALT */ @@ -536,7 +536,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_AES_SETKEY_ENC_ALT) if( strcmp( "MBEDTLS_AES_SETKEY_ENC_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_AES_SETKEY_ENC_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_AES_SETKEY_ENC_ALT ) ); return( 0 ); } #endif /* MBEDTLS_AES_SETKEY_ENC_ALT */ @@ -544,7 +544,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_AES_SETKEY_DEC_ALT) if( strcmp( "MBEDTLS_AES_SETKEY_DEC_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_AES_SETKEY_DEC_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_AES_SETKEY_DEC_ALT ) ); return( 0 ); } #endif /* MBEDTLS_AES_SETKEY_DEC_ALT */ @@ -552,7 +552,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_AES_ENCRYPT_ALT) if( strcmp( "MBEDTLS_AES_ENCRYPT_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_AES_ENCRYPT_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_AES_ENCRYPT_ALT ) ); return( 0 ); } #endif /* MBEDTLS_AES_ENCRYPT_ALT */ @@ -560,7 +560,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_AES_DECRYPT_ALT) if( strcmp( "MBEDTLS_AES_DECRYPT_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_AES_DECRYPT_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_AES_DECRYPT_ALT ) ); return( 0 ); } #endif /* MBEDTLS_AES_DECRYPT_ALT */ @@ -568,7 +568,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECDH_GEN_PUBLIC_ALT) if( strcmp( "MBEDTLS_ECDH_GEN_PUBLIC_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECDH_GEN_PUBLIC_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECDH_GEN_PUBLIC_ALT ) ); return( 0 ); } #endif /* MBEDTLS_ECDH_GEN_PUBLIC_ALT */ @@ -576,7 +576,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECDH_COMPUTE_SHARED_ALT) if( strcmp( "MBEDTLS_ECDH_COMPUTE_SHARED_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECDH_COMPUTE_SHARED_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECDH_COMPUTE_SHARED_ALT ) ); return( 0 ); } #endif /* MBEDTLS_ECDH_COMPUTE_SHARED_ALT */ @@ -584,7 +584,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECDSA_VERIFY_ALT) if( strcmp( "MBEDTLS_ECDSA_VERIFY_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECDSA_VERIFY_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECDSA_VERIFY_ALT ) ); return( 0 ); } #endif /* MBEDTLS_ECDSA_VERIFY_ALT */ @@ -592,7 +592,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECDSA_SIGN_ALT) if( strcmp( "MBEDTLS_ECDSA_SIGN_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECDSA_SIGN_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECDSA_SIGN_ALT ) ); return( 0 ); } #endif /* MBEDTLS_ECDSA_SIGN_ALT */ @@ -600,7 +600,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECDSA_GENKEY_ALT) if( strcmp( "MBEDTLS_ECDSA_GENKEY_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECDSA_GENKEY_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECDSA_GENKEY_ALT ) ); return( 0 ); } #endif /* MBEDTLS_ECDSA_GENKEY_ALT */ @@ -608,7 +608,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_INTERNAL_ALT) if( strcmp( "MBEDTLS_ECP_INTERNAL_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_INTERNAL_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_INTERNAL_ALT ) ); return( 0 ); } #endif /* MBEDTLS_ECP_INTERNAL_ALT */ @@ -616,7 +616,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT) if( strcmp( "MBEDTLS_ECP_RANDOMIZE_JAC_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_RANDOMIZE_JAC_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_RANDOMIZE_JAC_ALT ) ); return( 0 ); } #endif /* MBEDTLS_ECP_RANDOMIZE_JAC_ALT */ @@ -624,7 +624,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_ADD_MIXED_ALT) if( strcmp( "MBEDTLS_ECP_ADD_MIXED_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_ADD_MIXED_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_ADD_MIXED_ALT ) ); return( 0 ); } #endif /* MBEDTLS_ECP_ADD_MIXED_ALT */ @@ -632,7 +632,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DOUBLE_JAC_ALT) if( strcmp( "MBEDTLS_ECP_DOUBLE_JAC_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DOUBLE_JAC_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DOUBLE_JAC_ALT ) ); return( 0 ); } #endif /* MBEDTLS_ECP_DOUBLE_JAC_ALT */ @@ -640,7 +640,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT) if( strcmp( "MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT ) ); return( 0 ); } #endif /* MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT */ @@ -648,7 +648,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_NORMALIZE_JAC_ALT) if( strcmp( "MBEDTLS_ECP_NORMALIZE_JAC_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_NORMALIZE_JAC_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_NORMALIZE_JAC_ALT ) ); return( 0 ); } #endif /* MBEDTLS_ECP_NORMALIZE_JAC_ALT */ @@ -656,7 +656,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT) if( strcmp( "MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT ) ); return( 0 ); } #endif /* MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT */ @@ -664,7 +664,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_RANDOMIZE_MXZ_ALT) if( strcmp( "MBEDTLS_ECP_RANDOMIZE_MXZ_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_RANDOMIZE_MXZ_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_RANDOMIZE_MXZ_ALT ) ); return( 0 ); } #endif /* MBEDTLS_ECP_RANDOMIZE_MXZ_ALT */ @@ -672,7 +672,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_NORMALIZE_MXZ_ALT) if( strcmp( "MBEDTLS_ECP_NORMALIZE_MXZ_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_NORMALIZE_MXZ_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_NORMALIZE_MXZ_ALT ) ); return( 0 ); } #endif /* MBEDTLS_ECP_NORMALIZE_MXZ_ALT */ @@ -680,7 +680,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_TEST_NULL_ENTROPY) if( strcmp( "MBEDTLS_TEST_NULL_ENTROPY", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_TEST_NULL_ENTROPY ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_TEST_NULL_ENTROPY ) ); return( 0 ); } #endif /* MBEDTLS_TEST_NULL_ENTROPY */ @@ -688,7 +688,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ENTROPY_HARDWARE_ALT) if( strcmp( "MBEDTLS_ENTROPY_HARDWARE_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_HARDWARE_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_HARDWARE_ALT ) ); return( 0 ); } #endif /* MBEDTLS_ENTROPY_HARDWARE_ALT */ @@ -696,7 +696,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_AES_ROM_TABLES) if( strcmp( "MBEDTLS_AES_ROM_TABLES", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_AES_ROM_TABLES ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_AES_ROM_TABLES ) ); return( 0 ); } #endif /* MBEDTLS_AES_ROM_TABLES */ @@ -704,7 +704,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_AES_FEWER_TABLES) if( strcmp( "MBEDTLS_AES_FEWER_TABLES", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_AES_FEWER_TABLES ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_AES_FEWER_TABLES ) ); return( 0 ); } #endif /* MBEDTLS_AES_FEWER_TABLES */ @@ -712,7 +712,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CAMELLIA_SMALL_MEMORY) if( strcmp( "MBEDTLS_CAMELLIA_SMALL_MEMORY", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CAMELLIA_SMALL_MEMORY ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CAMELLIA_SMALL_MEMORY ) ); return( 0 ); } #endif /* MBEDTLS_CAMELLIA_SMALL_MEMORY */ @@ -720,7 +720,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CIPHER_MODE_CBC) if( strcmp( "MBEDTLS_CIPHER_MODE_CBC", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_MODE_CBC ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_MODE_CBC ) ); return( 0 ); } #endif /* MBEDTLS_CIPHER_MODE_CBC */ @@ -728,7 +728,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CIPHER_MODE_CFB) if( strcmp( "MBEDTLS_CIPHER_MODE_CFB", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_MODE_CFB ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_MODE_CFB ) ); return( 0 ); } #endif /* MBEDTLS_CIPHER_MODE_CFB */ @@ -736,7 +736,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CIPHER_MODE_CTR) if( strcmp( "MBEDTLS_CIPHER_MODE_CTR", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_MODE_CTR ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_MODE_CTR ) ); return( 0 ); } #endif /* MBEDTLS_CIPHER_MODE_CTR */ @@ -744,7 +744,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CIPHER_MODE_OFB) if( strcmp( "MBEDTLS_CIPHER_MODE_OFB", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_MODE_OFB ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_MODE_OFB ) ); return( 0 ); } #endif /* MBEDTLS_CIPHER_MODE_OFB */ @@ -752,7 +752,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CIPHER_MODE_XTS) if( strcmp( "MBEDTLS_CIPHER_MODE_XTS", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_MODE_XTS ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_MODE_XTS ) ); return( 0 ); } #endif /* MBEDTLS_CIPHER_MODE_XTS */ @@ -760,7 +760,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CIPHER_NULL_CIPHER) if( strcmp( "MBEDTLS_CIPHER_NULL_CIPHER", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_NULL_CIPHER ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_NULL_CIPHER ) ); return( 0 ); } #endif /* MBEDTLS_CIPHER_NULL_CIPHER */ @@ -768,7 +768,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CIPHER_PADDING_PKCS7) if( strcmp( "MBEDTLS_CIPHER_PADDING_PKCS7", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_PADDING_PKCS7 ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_PADDING_PKCS7 ) ); return( 0 ); } #endif /* MBEDTLS_CIPHER_PADDING_PKCS7 */ @@ -776,7 +776,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS) if( strcmp( "MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS ) ); return( 0 ); } #endif /* MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS */ @@ -784,7 +784,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN) if( strcmp( "MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN ) ); return( 0 ); } #endif /* MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN */ @@ -792,7 +792,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CIPHER_PADDING_ZEROS) if( strcmp( "MBEDTLS_CIPHER_PADDING_ZEROS", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_PADDING_ZEROS ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_PADDING_ZEROS ) ); return( 0 ); } #endif /* MBEDTLS_CIPHER_PADDING_ZEROS */ @@ -800,7 +800,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ENABLE_WEAK_CIPHERSUITES) if( strcmp( "MBEDTLS_ENABLE_WEAK_CIPHERSUITES", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ENABLE_WEAK_CIPHERSUITES ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ENABLE_WEAK_CIPHERSUITES ) ); return( 0 ); } #endif /* MBEDTLS_ENABLE_WEAK_CIPHERSUITES */ @@ -808,7 +808,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_REMOVE_ARC4_CIPHERSUITES) if( strcmp( "MBEDTLS_REMOVE_ARC4_CIPHERSUITES", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_REMOVE_ARC4_CIPHERSUITES ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_REMOVE_ARC4_CIPHERSUITES ) ); return( 0 ); } #endif /* MBEDTLS_REMOVE_ARC4_CIPHERSUITES */ @@ -816,7 +816,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) if( strcmp( "MBEDTLS_ECP_DP_SECP192R1_ENABLED", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP192R1_ENABLED ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP192R1_ENABLED ) ); return( 0 ); } #endif /* MBEDTLS_ECP_DP_SECP192R1_ENABLED */ @@ -824,7 +824,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED) if( strcmp( "MBEDTLS_ECP_DP_SECP224R1_ENABLED", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP224R1_ENABLED ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP224R1_ENABLED ) ); return( 0 ); } #endif /* MBEDTLS_ECP_DP_SECP224R1_ENABLED */ @@ -832,7 +832,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) if( strcmp( "MBEDTLS_ECP_DP_SECP256R1_ENABLED", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP256R1_ENABLED ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP256R1_ENABLED ) ); return( 0 ); } #endif /* MBEDTLS_ECP_DP_SECP256R1_ENABLED */ @@ -840,7 +840,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED) if( strcmp( "MBEDTLS_ECP_DP_SECP384R1_ENABLED", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP384R1_ENABLED ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP384R1_ENABLED ) ); return( 0 ); } #endif /* MBEDTLS_ECP_DP_SECP384R1_ENABLED */ @@ -848,7 +848,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED) if( strcmp( "MBEDTLS_ECP_DP_SECP521R1_ENABLED", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP521R1_ENABLED ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP521R1_ENABLED ) ); return( 0 ); } #endif /* MBEDTLS_ECP_DP_SECP521R1_ENABLED */ @@ -856,7 +856,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED) if( strcmp( "MBEDTLS_ECP_DP_SECP192K1_ENABLED", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP192K1_ENABLED ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP192K1_ENABLED ) ); return( 0 ); } #endif /* MBEDTLS_ECP_DP_SECP192K1_ENABLED */ @@ -864,7 +864,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED) if( strcmp( "MBEDTLS_ECP_DP_SECP224K1_ENABLED", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP224K1_ENABLED ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP224K1_ENABLED ) ); return( 0 ); } #endif /* MBEDTLS_ECP_DP_SECP224K1_ENABLED */ @@ -872,7 +872,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED) if( strcmp( "MBEDTLS_ECP_DP_SECP256K1_ENABLED", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP256K1_ENABLED ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP256K1_ENABLED ) ); return( 0 ); } #endif /* MBEDTLS_ECP_DP_SECP256K1_ENABLED */ @@ -880,7 +880,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DP_BP256R1_ENABLED) if( strcmp( "MBEDTLS_ECP_DP_BP256R1_ENABLED", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_BP256R1_ENABLED ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_BP256R1_ENABLED ) ); return( 0 ); } #endif /* MBEDTLS_ECP_DP_BP256R1_ENABLED */ @@ -888,7 +888,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DP_BP384R1_ENABLED) if( strcmp( "MBEDTLS_ECP_DP_BP384R1_ENABLED", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_BP384R1_ENABLED ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_BP384R1_ENABLED ) ); return( 0 ); } #endif /* MBEDTLS_ECP_DP_BP384R1_ENABLED */ @@ -896,7 +896,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DP_BP512R1_ENABLED) if( strcmp( "MBEDTLS_ECP_DP_BP512R1_ENABLED", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_BP512R1_ENABLED ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_BP512R1_ENABLED ) ); return( 0 ); } #endif /* MBEDTLS_ECP_DP_BP512R1_ENABLED */ @@ -904,7 +904,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DP_CURVE25519_ENABLED) if( strcmp( "MBEDTLS_ECP_DP_CURVE25519_ENABLED", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_CURVE25519_ENABLED ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_CURVE25519_ENABLED ) ); return( 0 ); } #endif /* MBEDTLS_ECP_DP_CURVE25519_ENABLED */ @@ -912,7 +912,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DP_CURVE448_ENABLED) if( strcmp( "MBEDTLS_ECP_DP_CURVE448_ENABLED", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_CURVE448_ENABLED ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_CURVE448_ENABLED ) ); return( 0 ); } #endif /* MBEDTLS_ECP_DP_CURVE448_ENABLED */ @@ -920,7 +920,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_NIST_OPTIM) if( strcmp( "MBEDTLS_ECP_NIST_OPTIM", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_NIST_OPTIM ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_NIST_OPTIM ) ); return( 0 ); } #endif /* MBEDTLS_ECP_NIST_OPTIM */ @@ -928,7 +928,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECDSA_DETERMINISTIC) if( strcmp( "MBEDTLS_ECDSA_DETERMINISTIC", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECDSA_DETERMINISTIC ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECDSA_DETERMINISTIC ) ); return( 0 ); } #endif /* MBEDTLS_ECDSA_DETERMINISTIC */ @@ -936,7 +936,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) if( strcmp( "MBEDTLS_KEY_EXCHANGE_PSK_ENABLED", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_PSK_ENABLED ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_PSK_ENABLED ) ); return( 0 ); } #endif /* MBEDTLS_KEY_EXCHANGE_PSK_ENABLED */ @@ -944,7 +944,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) if( strcmp( "MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED ) ); return( 0 ); } #endif /* MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED */ @@ -952,7 +952,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) if( strcmp( "MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED ) ); return( 0 ); } #endif /* MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED */ @@ -960,7 +960,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) if( strcmp( "MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED ) ); return( 0 ); } #endif /* MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED */ @@ -968,7 +968,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) if( strcmp( "MBEDTLS_KEY_EXCHANGE_RSA_ENABLED", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_RSA_ENABLED ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_RSA_ENABLED ) ); return( 0 ); } #endif /* MBEDTLS_KEY_EXCHANGE_RSA_ENABLED */ @@ -976,7 +976,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) if( strcmp( "MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED ) ); return( 0 ); } #endif /* MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED */ @@ -984,7 +984,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) if( strcmp( "MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED ) ); return( 0 ); } #endif /* MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED */ @@ -992,7 +992,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) if( strcmp( "MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED ) ); return( 0 ); } #endif /* MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED */ @@ -1000,7 +1000,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) if( strcmp( "MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED ) ); return( 0 ); } #endif /* MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED */ @@ -1008,7 +1008,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) if( strcmp( "MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED ) ); return( 0 ); } #endif /* MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED */ @@ -1016,7 +1016,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) if( strcmp( "MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED ) ); return( 0 ); } #endif /* MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED */ @@ -1024,7 +1024,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PK_PARSE_EC_EXTENDED) if( strcmp( "MBEDTLS_PK_PARSE_EC_EXTENDED", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PK_PARSE_EC_EXTENDED ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PK_PARSE_EC_EXTENDED ) ); return( 0 ); } #endif /* MBEDTLS_PK_PARSE_EC_EXTENDED */ @@ -1032,7 +1032,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ERROR_STRERROR_DUMMY) if( strcmp( "MBEDTLS_ERROR_STRERROR_DUMMY", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ERROR_STRERROR_DUMMY ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ERROR_STRERROR_DUMMY ) ); return( 0 ); } #endif /* MBEDTLS_ERROR_STRERROR_DUMMY */ @@ -1040,7 +1040,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_GENPRIME) if( strcmp( "MBEDTLS_GENPRIME", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_GENPRIME ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_GENPRIME ) ); return( 0 ); } #endif /* MBEDTLS_GENPRIME */ @@ -1048,7 +1048,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_FS_IO) if( strcmp( "MBEDTLS_FS_IO", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_FS_IO ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_FS_IO ) ); return( 0 ); } #endif /* MBEDTLS_FS_IO */ @@ -1056,7 +1056,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES) if( strcmp( "MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES ) ); return( 0 ); } #endif /* MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES */ @@ -1064,7 +1064,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_NO_PLATFORM_ENTROPY) if( strcmp( "MBEDTLS_NO_PLATFORM_ENTROPY", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_NO_PLATFORM_ENTROPY ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_NO_PLATFORM_ENTROPY ) ); return( 0 ); } #endif /* MBEDTLS_NO_PLATFORM_ENTROPY */ @@ -1072,7 +1072,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ENTROPY_FORCE_SHA256) if( strcmp( "MBEDTLS_ENTROPY_FORCE_SHA256", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_FORCE_SHA256 ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_FORCE_SHA256 ) ); return( 0 ); } #endif /* MBEDTLS_ENTROPY_FORCE_SHA256 */ @@ -1080,7 +1080,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ENTROPY_NV_SEED) if( strcmp( "MBEDTLS_ENTROPY_NV_SEED", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_NV_SEED ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_NV_SEED ) ); return( 0 ); } #endif /* MBEDTLS_ENTROPY_NV_SEED */ @@ -1088,7 +1088,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MEMORY_DEBUG) if( strcmp( "MBEDTLS_MEMORY_DEBUG", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MEMORY_DEBUG ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MEMORY_DEBUG ) ); return( 0 ); } #endif /* MBEDTLS_MEMORY_DEBUG */ @@ -1096,7 +1096,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MEMORY_BACKTRACE) if( strcmp( "MBEDTLS_MEMORY_BACKTRACE", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MEMORY_BACKTRACE ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MEMORY_BACKTRACE ) ); return( 0 ); } #endif /* MBEDTLS_MEMORY_BACKTRACE */ @@ -1104,7 +1104,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PK_RSA_ALT_SUPPORT) if( strcmp( "MBEDTLS_PK_RSA_ALT_SUPPORT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PK_RSA_ALT_SUPPORT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PK_RSA_ALT_SUPPORT ) ); return( 0 ); } #endif /* MBEDTLS_PK_RSA_ALT_SUPPORT */ @@ -1112,7 +1112,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PKCS1_V15) if( strcmp( "MBEDTLS_PKCS1_V15", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PKCS1_V15 ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PKCS1_V15 ) ); return( 0 ); } #endif /* MBEDTLS_PKCS1_V15 */ @@ -1120,7 +1120,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PKCS1_V21) if( strcmp( "MBEDTLS_PKCS1_V21", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PKCS1_V21 ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PKCS1_V21 ) ); return( 0 ); } #endif /* MBEDTLS_PKCS1_V21 */ @@ -1128,7 +1128,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_RSA_NO_CRT) if( strcmp( "MBEDTLS_RSA_NO_CRT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_RSA_NO_CRT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_RSA_NO_CRT ) ); return( 0 ); } #endif /* MBEDTLS_RSA_NO_CRT */ @@ -1136,7 +1136,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SELF_TEST) if( strcmp( "MBEDTLS_SELF_TEST", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SELF_TEST ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SELF_TEST ) ); return( 0 ); } #endif /* MBEDTLS_SELF_TEST */ @@ -1144,7 +1144,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SHA256_SMALLER) if( strcmp( "MBEDTLS_SHA256_SMALLER", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SHA256_SMALLER ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SHA256_SMALLER ) ); return( 0 ); } #endif /* MBEDTLS_SHA256_SMALLER */ @@ -1152,7 +1152,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_ALL_ALERT_MESSAGES) if( strcmp( "MBEDTLS_SSL_ALL_ALERT_MESSAGES", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_ALL_ALERT_MESSAGES ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_ALL_ALERT_MESSAGES ) ); return( 0 ); } #endif /* MBEDTLS_SSL_ALL_ALERT_MESSAGES */ @@ -1160,7 +1160,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_ASYNC_PRIVATE) if( strcmp( "MBEDTLS_SSL_ASYNC_PRIVATE", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_ASYNC_PRIVATE ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_ASYNC_PRIVATE ) ); return( 0 ); } #endif /* MBEDTLS_SSL_ASYNC_PRIVATE */ @@ -1168,7 +1168,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_DEBUG_ALL) if( strcmp( "MBEDTLS_SSL_DEBUG_ALL", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DEBUG_ALL ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DEBUG_ALL ) ); return( 0 ); } #endif /* MBEDTLS_SSL_DEBUG_ALL */ @@ -1176,7 +1176,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC) if( strcmp( "MBEDTLS_SSL_ENCRYPT_THEN_MAC", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_ENCRYPT_THEN_MAC ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_ENCRYPT_THEN_MAC ) ); return( 0 ); } #endif /* MBEDTLS_SSL_ENCRYPT_THEN_MAC */ @@ -1184,7 +1184,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET) if( strcmp( "MBEDTLS_SSL_EXTENDED_MASTER_SECRET", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_EXTENDED_MASTER_SECRET ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_EXTENDED_MASTER_SECRET ) ); return( 0 ); } #endif /* MBEDTLS_SSL_EXTENDED_MASTER_SECRET */ @@ -1192,7 +1192,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_FALLBACK_SCSV) if( strcmp( "MBEDTLS_SSL_FALLBACK_SCSV", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_FALLBACK_SCSV ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_FALLBACK_SCSV ) ); return( 0 ); } #endif /* MBEDTLS_SSL_FALLBACK_SCSV */ @@ -1200,7 +1200,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_HW_RECORD_ACCEL) if( strcmp( "MBEDTLS_SSL_HW_RECORD_ACCEL", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_HW_RECORD_ACCEL ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_HW_RECORD_ACCEL ) ); return( 0 ); } #endif /* MBEDTLS_SSL_HW_RECORD_ACCEL */ @@ -1208,7 +1208,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_CBC_RECORD_SPLITTING) if( strcmp( "MBEDTLS_SSL_CBC_RECORD_SPLITTING", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CBC_RECORD_SPLITTING ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CBC_RECORD_SPLITTING ) ); return( 0 ); } #endif /* MBEDTLS_SSL_CBC_RECORD_SPLITTING */ @@ -1216,7 +1216,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_RENEGOTIATION) if( strcmp( "MBEDTLS_SSL_RENEGOTIATION", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_RENEGOTIATION ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_RENEGOTIATION ) ); return( 0 ); } #endif /* MBEDTLS_SSL_RENEGOTIATION */ @@ -1224,7 +1224,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO) if( strcmp( "MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO ) ); return( 0 ); } #endif /* MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO */ @@ -1232,7 +1232,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE) if( strcmp( "MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE ) ); return( 0 ); } #endif /* MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE */ @@ -1240,7 +1240,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH) if( strcmp( "MBEDTLS_SSL_MAX_FRAGMENT_LENGTH", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_MAX_FRAGMENT_LENGTH ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_MAX_FRAGMENT_LENGTH ) ); return( 0 ); } #endif /* MBEDTLS_SSL_MAX_FRAGMENT_LENGTH */ @@ -1248,7 +1248,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_PROTO_SSL3) if( strcmp( "MBEDTLS_SSL_PROTO_SSL3", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_PROTO_SSL3 ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_PROTO_SSL3 ) ); return( 0 ); } #endif /* MBEDTLS_SSL_PROTO_SSL3 */ @@ -1256,7 +1256,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_PROTO_TLS1) if( strcmp( "MBEDTLS_SSL_PROTO_TLS1", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_PROTO_TLS1 ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_PROTO_TLS1 ) ); return( 0 ); } #endif /* MBEDTLS_SSL_PROTO_TLS1 */ @@ -1264,7 +1264,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_PROTO_TLS1_1) if( strcmp( "MBEDTLS_SSL_PROTO_TLS1_1", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_PROTO_TLS1_1 ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_PROTO_TLS1_1 ) ); return( 0 ); } #endif /* MBEDTLS_SSL_PROTO_TLS1_1 */ @@ -1272,7 +1272,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_PROTO_TLS1_2) if( strcmp( "MBEDTLS_SSL_PROTO_TLS1_2", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_PROTO_TLS1_2 ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_PROTO_TLS1_2 ) ); return( 0 ); } #endif /* MBEDTLS_SSL_PROTO_TLS1_2 */ @@ -1280,7 +1280,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_PROTO_DTLS) if( strcmp( "MBEDTLS_SSL_PROTO_DTLS", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_PROTO_DTLS ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_PROTO_DTLS ) ); return( 0 ); } #endif /* MBEDTLS_SSL_PROTO_DTLS */ @@ -1288,7 +1288,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_ALPN) if( strcmp( "MBEDTLS_SSL_ALPN", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_ALPN ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_ALPN ) ); return( 0 ); } #endif /* MBEDTLS_SSL_ALPN */ @@ -1296,7 +1296,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY) if( strcmp( "MBEDTLS_SSL_DTLS_ANTI_REPLAY", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DTLS_ANTI_REPLAY ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DTLS_ANTI_REPLAY ) ); return( 0 ); } #endif /* MBEDTLS_SSL_DTLS_ANTI_REPLAY */ @@ -1304,7 +1304,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) if( strcmp( "MBEDTLS_SSL_DTLS_HELLO_VERIFY", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DTLS_HELLO_VERIFY ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DTLS_HELLO_VERIFY ) ); return( 0 ); } #endif /* MBEDTLS_SSL_DTLS_HELLO_VERIFY */ @@ -1312,7 +1312,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE) if( strcmp( "MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE ) ); return( 0 ); } #endif /* MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE */ @@ -1320,7 +1320,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_DTLS_BADMAC_LIMIT) if( strcmp( "MBEDTLS_SSL_DTLS_BADMAC_LIMIT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DTLS_BADMAC_LIMIT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DTLS_BADMAC_LIMIT ) ); return( 0 ); } #endif /* MBEDTLS_SSL_DTLS_BADMAC_LIMIT */ @@ -1328,7 +1328,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_SESSION_TICKETS) if( strcmp( "MBEDTLS_SSL_SESSION_TICKETS", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_SESSION_TICKETS ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_SESSION_TICKETS ) ); return( 0 ); } #endif /* MBEDTLS_SSL_SESSION_TICKETS */ @@ -1336,7 +1336,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_EXPORT_KEYS) if( strcmp( "MBEDTLS_SSL_EXPORT_KEYS", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_EXPORT_KEYS ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_EXPORT_KEYS ) ); return( 0 ); } #endif /* MBEDTLS_SSL_EXPORT_KEYS */ @@ -1344,7 +1344,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION) if( strcmp( "MBEDTLS_SSL_SERVER_NAME_INDICATION", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_SERVER_NAME_INDICATION ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_SERVER_NAME_INDICATION ) ); return( 0 ); } #endif /* MBEDTLS_SSL_SERVER_NAME_INDICATION */ @@ -1352,7 +1352,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_TRUNCATED_HMAC) if( strcmp( "MBEDTLS_SSL_TRUNCATED_HMAC", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_TRUNCATED_HMAC ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_TRUNCATED_HMAC ) ); return( 0 ); } #endif /* MBEDTLS_SSL_TRUNCATED_HMAC */ @@ -1360,7 +1360,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT) if( strcmp( "MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT ) ); return( 0 ); } #endif /* MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT */ @@ -1368,7 +1368,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_THREADING_ALT) if( strcmp( "MBEDTLS_THREADING_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_THREADING_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_THREADING_ALT ) ); return( 0 ); } #endif /* MBEDTLS_THREADING_ALT */ @@ -1376,7 +1376,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_THREADING_PTHREAD) if( strcmp( "MBEDTLS_THREADING_PTHREAD", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_THREADING_PTHREAD ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_THREADING_PTHREAD ) ); return( 0 ); } #endif /* MBEDTLS_THREADING_PTHREAD */ @@ -1384,7 +1384,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_VERSION_FEATURES) if( strcmp( "MBEDTLS_VERSION_FEATURES", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_VERSION_FEATURES ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_VERSION_FEATURES ) ); return( 0 ); } #endif /* MBEDTLS_VERSION_FEATURES */ @@ -1392,7 +1392,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3) if( strcmp( "MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 ) ); return( 0 ); } #endif /* MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 */ @@ -1400,7 +1400,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION) if( strcmp( "MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION ) ); return( 0 ); } #endif /* MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION */ @@ -1408,7 +1408,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_X509_CHECK_KEY_USAGE) if( strcmp( "MBEDTLS_X509_CHECK_KEY_USAGE", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CHECK_KEY_USAGE ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CHECK_KEY_USAGE ) ); return( 0 ); } #endif /* MBEDTLS_X509_CHECK_KEY_USAGE */ @@ -1416,7 +1416,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE) if( strcmp( "MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE ) ); return( 0 ); } #endif /* MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE */ @@ -1424,7 +1424,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT) if( strcmp( "MBEDTLS_X509_RSASSA_PSS_SUPPORT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_X509_RSASSA_PSS_SUPPORT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_X509_RSASSA_PSS_SUPPORT ) ); return( 0 ); } #endif /* MBEDTLS_X509_RSASSA_PSS_SUPPORT */ @@ -1432,7 +1432,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ZLIB_SUPPORT) if( strcmp( "MBEDTLS_ZLIB_SUPPORT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ZLIB_SUPPORT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ZLIB_SUPPORT ) ); return( 0 ); } #endif /* MBEDTLS_ZLIB_SUPPORT */ @@ -1440,7 +1440,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_AESNI_C) if( strcmp( "MBEDTLS_AESNI_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_AESNI_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_AESNI_C ) ); return( 0 ); } #endif /* MBEDTLS_AESNI_C */ @@ -1448,7 +1448,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_AES_C) if( strcmp( "MBEDTLS_AES_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_AES_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_AES_C ) ); return( 0 ); } #endif /* MBEDTLS_AES_C */ @@ -1456,7 +1456,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ARC4_C) if( strcmp( "MBEDTLS_ARC4_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ARC4_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ARC4_C ) ); return( 0 ); } #endif /* MBEDTLS_ARC4_C */ @@ -1464,7 +1464,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ASN1_PARSE_C) if( strcmp( "MBEDTLS_ASN1_PARSE_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ASN1_PARSE_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ASN1_PARSE_C ) ); return( 0 ); } #endif /* MBEDTLS_ASN1_PARSE_C */ @@ -1472,7 +1472,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ASN1_WRITE_C) if( strcmp( "MBEDTLS_ASN1_WRITE_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ASN1_WRITE_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ASN1_WRITE_C ) ); return( 0 ); } #endif /* MBEDTLS_ASN1_WRITE_C */ @@ -1480,7 +1480,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_BASE64_C) if( strcmp( "MBEDTLS_BASE64_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_BASE64_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_BASE64_C ) ); return( 0 ); } #endif /* MBEDTLS_BASE64_C */ @@ -1488,7 +1488,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_BIGNUM_C) if( strcmp( "MBEDTLS_BIGNUM_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_BIGNUM_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_BIGNUM_C ) ); return( 0 ); } #endif /* MBEDTLS_BIGNUM_C */ @@ -1496,7 +1496,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_BLOWFISH_C) if( strcmp( "MBEDTLS_BLOWFISH_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_BLOWFISH_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_BLOWFISH_C ) ); return( 0 ); } #endif /* MBEDTLS_BLOWFISH_C */ @@ -1504,7 +1504,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CAMELLIA_C) if( strcmp( "MBEDTLS_CAMELLIA_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CAMELLIA_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CAMELLIA_C ) ); return( 0 ); } #endif /* MBEDTLS_CAMELLIA_C */ @@ -1512,7 +1512,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ARIA_C) if( strcmp( "MBEDTLS_ARIA_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ARIA_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ARIA_C ) ); return( 0 ); } #endif /* MBEDTLS_ARIA_C */ @@ -1520,7 +1520,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CCM_C) if( strcmp( "MBEDTLS_CCM_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CCM_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CCM_C ) ); return( 0 ); } #endif /* MBEDTLS_CCM_C */ @@ -1528,7 +1528,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CERTS_C) if( strcmp( "MBEDTLS_CERTS_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CERTS_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CERTS_C ) ); return( 0 ); } #endif /* MBEDTLS_CERTS_C */ @@ -1536,7 +1536,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CHACHA20_C) if( strcmp( "MBEDTLS_CHACHA20_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CHACHA20_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CHACHA20_C ) ); return( 0 ); } #endif /* MBEDTLS_CHACHA20_C */ @@ -1544,7 +1544,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CHACHAPOLY_C) if( strcmp( "MBEDTLS_CHACHAPOLY_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CHACHAPOLY_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CHACHAPOLY_C ) ); return( 0 ); } #endif /* MBEDTLS_CHACHAPOLY_C */ @@ -1552,7 +1552,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CIPHER_C) if( strcmp( "MBEDTLS_CIPHER_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_C ) ); return( 0 ); } #endif /* MBEDTLS_CIPHER_C */ @@ -1560,7 +1560,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CMAC_C) if( strcmp( "MBEDTLS_CMAC_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CMAC_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CMAC_C ) ); return( 0 ); } #endif /* MBEDTLS_CMAC_C */ @@ -1568,7 +1568,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CTR_DRBG_C) if( strcmp( "MBEDTLS_CTR_DRBG_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_C ) ); return( 0 ); } #endif /* MBEDTLS_CTR_DRBG_C */ @@ -1576,7 +1576,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_DEBUG_C) if( strcmp( "MBEDTLS_DEBUG_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_DEBUG_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_DEBUG_C ) ); return( 0 ); } #endif /* MBEDTLS_DEBUG_C */ @@ -1584,7 +1584,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_DES_C) if( strcmp( "MBEDTLS_DES_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_DES_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_DES_C ) ); return( 0 ); } #endif /* MBEDTLS_DES_C */ @@ -1592,7 +1592,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_DHM_C) if( strcmp( "MBEDTLS_DHM_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_DHM_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_DHM_C ) ); return( 0 ); } #endif /* MBEDTLS_DHM_C */ @@ -1600,7 +1600,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECDH_C) if( strcmp( "MBEDTLS_ECDH_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECDH_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECDH_C ) ); return( 0 ); } #endif /* MBEDTLS_ECDH_C */ @@ -1608,7 +1608,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECDSA_C) if( strcmp( "MBEDTLS_ECDSA_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECDSA_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECDSA_C ) ); return( 0 ); } #endif /* MBEDTLS_ECDSA_C */ @@ -1616,7 +1616,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECJPAKE_C) if( strcmp( "MBEDTLS_ECJPAKE_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECJPAKE_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECJPAKE_C ) ); return( 0 ); } #endif /* MBEDTLS_ECJPAKE_C */ @@ -1624,7 +1624,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_C) if( strcmp( "MBEDTLS_ECP_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_C ) ); return( 0 ); } #endif /* MBEDTLS_ECP_C */ @@ -1632,7 +1632,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ENTROPY_C) if( strcmp( "MBEDTLS_ENTROPY_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_C ) ); return( 0 ); } #endif /* MBEDTLS_ENTROPY_C */ @@ -1640,7 +1640,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ERROR_C) if( strcmp( "MBEDTLS_ERROR_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ERROR_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ERROR_C ) ); return( 0 ); } #endif /* MBEDTLS_ERROR_C */ @@ -1648,7 +1648,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_GCM_C) if( strcmp( "MBEDTLS_GCM_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_GCM_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_GCM_C ) ); return( 0 ); } #endif /* MBEDTLS_GCM_C */ @@ -1656,7 +1656,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_HAVEGE_C) if( strcmp( "MBEDTLS_HAVEGE_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_HAVEGE_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_HAVEGE_C ) ); return( 0 ); } #endif /* MBEDTLS_HAVEGE_C */ @@ -1664,7 +1664,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_HKDF_C) if( strcmp( "MBEDTLS_HKDF_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_HKDF_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_HKDF_C ) ); return( 0 ); } #endif /* MBEDTLS_HKDF_C */ @@ -1672,7 +1672,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_HMAC_DRBG_C) if( strcmp( "MBEDTLS_HMAC_DRBG_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_HMAC_DRBG_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_HMAC_DRBG_C ) ); return( 0 ); } #endif /* MBEDTLS_HMAC_DRBG_C */ @@ -1680,7 +1680,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_NIST_KW_C) if( strcmp( "MBEDTLS_NIST_KW_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_NIST_KW_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_NIST_KW_C ) ); return( 0 ); } #endif /* MBEDTLS_NIST_KW_C */ @@ -1688,7 +1688,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MD_C) if( strcmp( "MBEDTLS_MD_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MD_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MD_C ) ); return( 0 ); } #endif /* MBEDTLS_MD_C */ @@ -1696,7 +1696,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MD2_C) if( strcmp( "MBEDTLS_MD2_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MD2_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MD2_C ) ); return( 0 ); } #endif /* MBEDTLS_MD2_C */ @@ -1704,7 +1704,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MD4_C) if( strcmp( "MBEDTLS_MD4_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MD4_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MD4_C ) ); return( 0 ); } #endif /* MBEDTLS_MD4_C */ @@ -1712,7 +1712,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MD5_C) if( strcmp( "MBEDTLS_MD5_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MD5_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MD5_C ) ); return( 0 ); } #endif /* MBEDTLS_MD5_C */ @@ -1720,7 +1720,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) if( strcmp( "MBEDTLS_MEMORY_BUFFER_ALLOC_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MEMORY_BUFFER_ALLOC_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MEMORY_BUFFER_ALLOC_C ) ); return( 0 ); } #endif /* MBEDTLS_MEMORY_BUFFER_ALLOC_C */ @@ -1728,7 +1728,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_NET_C) if( strcmp( "MBEDTLS_NET_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_NET_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_NET_C ) ); return( 0 ); } #endif /* MBEDTLS_NET_C */ @@ -1736,7 +1736,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_OID_C) if( strcmp( "MBEDTLS_OID_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_OID_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_OID_C ) ); return( 0 ); } #endif /* MBEDTLS_OID_C */ @@ -1744,7 +1744,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PADLOCK_C) if( strcmp( "MBEDTLS_PADLOCK_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PADLOCK_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PADLOCK_C ) ); return( 0 ); } #endif /* MBEDTLS_PADLOCK_C */ @@ -1752,7 +1752,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PEM_PARSE_C) if( strcmp( "MBEDTLS_PEM_PARSE_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PEM_PARSE_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PEM_PARSE_C ) ); return( 0 ); } #endif /* MBEDTLS_PEM_PARSE_C */ @@ -1760,7 +1760,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PEM_WRITE_C) if( strcmp( "MBEDTLS_PEM_WRITE_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PEM_WRITE_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PEM_WRITE_C ) ); return( 0 ); } #endif /* MBEDTLS_PEM_WRITE_C */ @@ -1768,7 +1768,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PK_C) if( strcmp( "MBEDTLS_PK_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PK_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PK_C ) ); return( 0 ); } #endif /* MBEDTLS_PK_C */ @@ -1776,7 +1776,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PK_PARSE_C) if( strcmp( "MBEDTLS_PK_PARSE_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PK_PARSE_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PK_PARSE_C ) ); return( 0 ); } #endif /* MBEDTLS_PK_PARSE_C */ @@ -1784,7 +1784,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PK_WRITE_C) if( strcmp( "MBEDTLS_PK_WRITE_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PK_WRITE_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PK_WRITE_C ) ); return( 0 ); } #endif /* MBEDTLS_PK_WRITE_C */ @@ -1792,7 +1792,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PKCS5_C) if( strcmp( "MBEDTLS_PKCS5_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PKCS5_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PKCS5_C ) ); return( 0 ); } #endif /* MBEDTLS_PKCS5_C */ @@ -1800,7 +1800,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PKCS11_C) if( strcmp( "MBEDTLS_PKCS11_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PKCS11_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PKCS11_C ) ); return( 0 ); } #endif /* MBEDTLS_PKCS11_C */ @@ -1808,7 +1808,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PKCS12_C) if( strcmp( "MBEDTLS_PKCS12_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PKCS12_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PKCS12_C ) ); return( 0 ); } #endif /* MBEDTLS_PKCS12_C */ @@ -1816,7 +1816,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_C) if( strcmp( "MBEDTLS_PLATFORM_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_C ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_C */ @@ -1824,7 +1824,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_POLY1305_C) if( strcmp( "MBEDTLS_POLY1305_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_POLY1305_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_POLY1305_C ) ); return( 0 ); } #endif /* MBEDTLS_POLY1305_C */ @@ -1832,7 +1832,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_RIPEMD160_C) if( strcmp( "MBEDTLS_RIPEMD160_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_RIPEMD160_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_RIPEMD160_C ) ); return( 0 ); } #endif /* MBEDTLS_RIPEMD160_C */ @@ -1840,7 +1840,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_RSA_C) if( strcmp( "MBEDTLS_RSA_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_RSA_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_RSA_C ) ); return( 0 ); } #endif /* MBEDTLS_RSA_C */ @@ -1848,7 +1848,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SHA1_C) if( strcmp( "MBEDTLS_SHA1_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SHA1_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SHA1_C ) ); return( 0 ); } #endif /* MBEDTLS_SHA1_C */ @@ -1856,7 +1856,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SHA256_C) if( strcmp( "MBEDTLS_SHA256_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SHA256_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SHA256_C ) ); return( 0 ); } #endif /* MBEDTLS_SHA256_C */ @@ -1864,7 +1864,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SHA512_C) if( strcmp( "MBEDTLS_SHA512_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SHA512_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SHA512_C ) ); return( 0 ); } #endif /* MBEDTLS_SHA512_C */ @@ -1872,7 +1872,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_CACHE_C) if( strcmp( "MBEDTLS_SSL_CACHE_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CACHE_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CACHE_C ) ); return( 0 ); } #endif /* MBEDTLS_SSL_CACHE_C */ @@ -1880,7 +1880,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_COOKIE_C) if( strcmp( "MBEDTLS_SSL_COOKIE_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_COOKIE_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_COOKIE_C ) ); return( 0 ); } #endif /* MBEDTLS_SSL_COOKIE_C */ @@ -1888,7 +1888,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_TICKET_C) if( strcmp( "MBEDTLS_SSL_TICKET_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_TICKET_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_TICKET_C ) ); return( 0 ); } #endif /* MBEDTLS_SSL_TICKET_C */ @@ -1896,7 +1896,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_CLI_C) if( strcmp( "MBEDTLS_SSL_CLI_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CLI_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CLI_C ) ); return( 0 ); } #endif /* MBEDTLS_SSL_CLI_C */ @@ -1904,7 +1904,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_SRV_C) if( strcmp( "MBEDTLS_SSL_SRV_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_SRV_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_SRV_C ) ); return( 0 ); } #endif /* MBEDTLS_SSL_SRV_C */ @@ -1912,7 +1912,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_TLS_C) if( strcmp( "MBEDTLS_SSL_TLS_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_TLS_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_TLS_C ) ); return( 0 ); } #endif /* MBEDTLS_SSL_TLS_C */ @@ -1920,7 +1920,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_THREADING_C) if( strcmp( "MBEDTLS_THREADING_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_THREADING_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_THREADING_C ) ); return( 0 ); } #endif /* MBEDTLS_THREADING_C */ @@ -1928,7 +1928,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_TIMING_C) if( strcmp( "MBEDTLS_TIMING_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_TIMING_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_TIMING_C ) ); return( 0 ); } #endif /* MBEDTLS_TIMING_C */ @@ -1936,7 +1936,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_VERSION_C) if( strcmp( "MBEDTLS_VERSION_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_VERSION_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_VERSION_C ) ); return( 0 ); } #endif /* MBEDTLS_VERSION_C */ @@ -1944,7 +1944,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_X509_USE_C) if( strcmp( "MBEDTLS_X509_USE_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_X509_USE_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_X509_USE_C ) ); return( 0 ); } #endif /* MBEDTLS_X509_USE_C */ @@ -1952,7 +1952,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_X509_CRT_PARSE_C) if( strcmp( "MBEDTLS_X509_CRT_PARSE_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CRT_PARSE_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CRT_PARSE_C ) ); return( 0 ); } #endif /* MBEDTLS_X509_CRT_PARSE_C */ @@ -1960,7 +1960,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_X509_CRL_PARSE_C) if( strcmp( "MBEDTLS_X509_CRL_PARSE_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CRL_PARSE_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CRL_PARSE_C ) ); return( 0 ); } #endif /* MBEDTLS_X509_CRL_PARSE_C */ @@ -1968,7 +1968,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_X509_CSR_PARSE_C) if( strcmp( "MBEDTLS_X509_CSR_PARSE_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CSR_PARSE_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CSR_PARSE_C ) ); return( 0 ); } #endif /* MBEDTLS_X509_CSR_PARSE_C */ @@ -1976,7 +1976,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_X509_CREATE_C) if( strcmp( "MBEDTLS_X509_CREATE_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CREATE_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CREATE_C ) ); return( 0 ); } #endif /* MBEDTLS_X509_CREATE_C */ @@ -1984,7 +1984,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_X509_CRT_WRITE_C) if( strcmp( "MBEDTLS_X509_CRT_WRITE_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CRT_WRITE_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CRT_WRITE_C ) ); return( 0 ); } #endif /* MBEDTLS_X509_CRT_WRITE_C */ @@ -1992,7 +1992,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_X509_CSR_WRITE_C) if( strcmp( "MBEDTLS_X509_CSR_WRITE_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CSR_WRITE_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CSR_WRITE_C ) ); return( 0 ); } #endif /* MBEDTLS_X509_CSR_WRITE_C */ @@ -2000,7 +2000,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_XTEA_C) if( strcmp( "MBEDTLS_XTEA_C", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_XTEA_C ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_XTEA_C ) ); return( 0 ); } #endif /* MBEDTLS_XTEA_C */ @@ -2008,7 +2008,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MPI_WINDOW_SIZE) if( strcmp( "MBEDTLS_MPI_WINDOW_SIZE", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MPI_WINDOW_SIZE ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MPI_WINDOW_SIZE ) ); return( 0 ); } #endif /* MBEDTLS_MPI_WINDOW_SIZE */ @@ -2016,7 +2016,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MPI_MAX_SIZE) if( strcmp( "MBEDTLS_MPI_MAX_SIZE", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MPI_MAX_SIZE ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MPI_MAX_SIZE ) ); return( 0 ); } #endif /* MBEDTLS_MPI_MAX_SIZE */ @@ -2024,7 +2024,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) if( strcmp( "MBEDTLS_CTR_DRBG_ENTROPY_LEN", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_ENTROPY_LEN ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_ENTROPY_LEN ) ); return( 0 ); } #endif /* MBEDTLS_CTR_DRBG_ENTROPY_LEN */ @@ -2032,7 +2032,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CTR_DRBG_RESEED_INTERVAL) if( strcmp( "MBEDTLS_CTR_DRBG_RESEED_INTERVAL", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_RESEED_INTERVAL ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_RESEED_INTERVAL ) ); return( 0 ); } #endif /* MBEDTLS_CTR_DRBG_RESEED_INTERVAL */ @@ -2040,7 +2040,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CTR_DRBG_MAX_INPUT) if( strcmp( "MBEDTLS_CTR_DRBG_MAX_INPUT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_MAX_INPUT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_MAX_INPUT ) ); return( 0 ); } #endif /* MBEDTLS_CTR_DRBG_MAX_INPUT */ @@ -2048,7 +2048,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CTR_DRBG_MAX_REQUEST) if( strcmp( "MBEDTLS_CTR_DRBG_MAX_REQUEST", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_MAX_REQUEST ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_MAX_REQUEST ) ); return( 0 ); } #endif /* MBEDTLS_CTR_DRBG_MAX_REQUEST */ @@ -2056,7 +2056,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CTR_DRBG_MAX_SEED_INPUT) if( strcmp( "MBEDTLS_CTR_DRBG_MAX_SEED_INPUT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_MAX_SEED_INPUT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_MAX_SEED_INPUT ) ); return( 0 ); } #endif /* MBEDTLS_CTR_DRBG_MAX_SEED_INPUT */ @@ -2064,7 +2064,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_HMAC_DRBG_RESEED_INTERVAL) if( strcmp( "MBEDTLS_HMAC_DRBG_RESEED_INTERVAL", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_HMAC_DRBG_RESEED_INTERVAL ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_HMAC_DRBG_RESEED_INTERVAL ) ); return( 0 ); } #endif /* MBEDTLS_HMAC_DRBG_RESEED_INTERVAL */ @@ -2072,7 +2072,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_HMAC_DRBG_MAX_INPUT) if( strcmp( "MBEDTLS_HMAC_DRBG_MAX_INPUT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_HMAC_DRBG_MAX_INPUT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_HMAC_DRBG_MAX_INPUT ) ); return( 0 ); } #endif /* MBEDTLS_HMAC_DRBG_MAX_INPUT */ @@ -2080,7 +2080,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_HMAC_DRBG_MAX_REQUEST) if( strcmp( "MBEDTLS_HMAC_DRBG_MAX_REQUEST", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_HMAC_DRBG_MAX_REQUEST ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_HMAC_DRBG_MAX_REQUEST ) ); return( 0 ); } #endif /* MBEDTLS_HMAC_DRBG_MAX_REQUEST */ @@ -2088,7 +2088,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT) if( strcmp( "MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT ) ); return( 0 ); } #endif /* MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT */ @@ -2096,7 +2096,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_MAX_BITS) if( strcmp( "MBEDTLS_ECP_MAX_BITS", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_MAX_BITS ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_MAX_BITS ) ); return( 0 ); } #endif /* MBEDTLS_ECP_MAX_BITS */ @@ -2104,7 +2104,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_WINDOW_SIZE) if( strcmp( "MBEDTLS_ECP_WINDOW_SIZE", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_WINDOW_SIZE ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_WINDOW_SIZE ) ); return( 0 ); } #endif /* MBEDTLS_ECP_WINDOW_SIZE */ @@ -2112,7 +2112,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_FIXED_POINT_OPTIM) if( strcmp( "MBEDTLS_ECP_FIXED_POINT_OPTIM", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_FIXED_POINT_OPTIM ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_FIXED_POINT_OPTIM ) ); return( 0 ); } #endif /* MBEDTLS_ECP_FIXED_POINT_OPTIM */ @@ -2120,7 +2120,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ENTROPY_MAX_SOURCES) if( strcmp( "MBEDTLS_ENTROPY_MAX_SOURCES", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_MAX_SOURCES ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_MAX_SOURCES ) ); return( 0 ); } #endif /* MBEDTLS_ENTROPY_MAX_SOURCES */ @@ -2128,7 +2128,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ENTROPY_MAX_GATHER) if( strcmp( "MBEDTLS_ENTROPY_MAX_GATHER", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_MAX_GATHER ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_MAX_GATHER ) ); return( 0 ); } #endif /* MBEDTLS_ENTROPY_MAX_GATHER */ @@ -2136,7 +2136,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ENTROPY_MIN_HARDWARE) if( strcmp( "MBEDTLS_ENTROPY_MIN_HARDWARE", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_MIN_HARDWARE ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_MIN_HARDWARE ) ); return( 0 ); } #endif /* MBEDTLS_ENTROPY_MIN_HARDWARE */ @@ -2144,7 +2144,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MEMORY_ALIGN_MULTIPLE) if( strcmp( "MBEDTLS_MEMORY_ALIGN_MULTIPLE", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_MEMORY_ALIGN_MULTIPLE ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MEMORY_ALIGN_MULTIPLE ) ); return( 0 ); } #endif /* MBEDTLS_MEMORY_ALIGN_MULTIPLE */ @@ -2152,7 +2152,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_STD_MEM_HDR) if( strcmp( "MBEDTLS_PLATFORM_STD_MEM_HDR", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_MEM_HDR ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_MEM_HDR ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_STD_MEM_HDR */ @@ -2160,7 +2160,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_STD_CALLOC) if( strcmp( "MBEDTLS_PLATFORM_STD_CALLOC", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_CALLOC ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_CALLOC ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_STD_CALLOC */ @@ -2168,7 +2168,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_STD_FREE) if( strcmp( "MBEDTLS_PLATFORM_STD_FREE", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_FREE ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_FREE ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_STD_FREE */ @@ -2176,7 +2176,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_STD_EXIT) if( strcmp( "MBEDTLS_PLATFORM_STD_EXIT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_EXIT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_EXIT ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_STD_EXIT */ @@ -2184,7 +2184,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_STD_TIME) if( strcmp( "MBEDTLS_PLATFORM_STD_TIME", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_TIME ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_TIME ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_STD_TIME */ @@ -2192,7 +2192,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_STD_FPRINTF) if( strcmp( "MBEDTLS_PLATFORM_STD_FPRINTF", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_FPRINTF ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_FPRINTF ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_STD_FPRINTF */ @@ -2200,7 +2200,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_STD_PRINTF) if( strcmp( "MBEDTLS_PLATFORM_STD_PRINTF", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_PRINTF ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_PRINTF ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_STD_PRINTF */ @@ -2208,7 +2208,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_STD_SNPRINTF) if( strcmp( "MBEDTLS_PLATFORM_STD_SNPRINTF", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_SNPRINTF ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_SNPRINTF ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_STD_SNPRINTF */ @@ -2216,7 +2216,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_STD_EXIT_SUCCESS) if( strcmp( "MBEDTLS_PLATFORM_STD_EXIT_SUCCESS", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_EXIT_SUCCESS ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_EXIT_SUCCESS ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_STD_EXIT_SUCCESS */ @@ -2224,7 +2224,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_STD_EXIT_FAILURE) if( strcmp( "MBEDTLS_PLATFORM_STD_EXIT_FAILURE", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_EXIT_FAILURE ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_EXIT_FAILURE ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_STD_EXIT_FAILURE */ @@ -2232,7 +2232,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) if( strcmp( "MBEDTLS_PLATFORM_STD_NV_SEED_READ", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_NV_SEED_READ ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_NV_SEED_READ ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_STD_NV_SEED_READ */ @@ -2240,7 +2240,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) if( strcmp( "MBEDTLS_PLATFORM_STD_NV_SEED_WRITE", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_NV_SEED_WRITE ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_NV_SEED_WRITE ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_STD_NV_SEED_WRITE */ @@ -2248,7 +2248,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_STD_NV_SEED_FILE) if( strcmp( "MBEDTLS_PLATFORM_STD_NV_SEED_FILE", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_NV_SEED_FILE ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_NV_SEED_FILE ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_STD_NV_SEED_FILE */ @@ -2256,7 +2256,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) if( strcmp( "MBEDTLS_PLATFORM_CALLOC_MACRO", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_CALLOC_MACRO ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_CALLOC_MACRO ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_CALLOC_MACRO */ @@ -2264,7 +2264,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_FREE_MACRO) if( strcmp( "MBEDTLS_PLATFORM_FREE_MACRO", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_FREE_MACRO ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_FREE_MACRO ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_FREE_MACRO */ @@ -2272,7 +2272,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_EXIT_MACRO) if( strcmp( "MBEDTLS_PLATFORM_EXIT_MACRO", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_EXIT_MACRO ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_EXIT_MACRO ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_EXIT_MACRO */ @@ -2280,7 +2280,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_TIME_MACRO) if( strcmp( "MBEDTLS_PLATFORM_TIME_MACRO", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_TIME_MACRO ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_TIME_MACRO ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_TIME_MACRO */ @@ -2288,7 +2288,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) if( strcmp( "MBEDTLS_PLATFORM_TIME_TYPE_MACRO", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_TIME_TYPE_MACRO ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_TIME_TYPE_MACRO ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_TIME_TYPE_MACRO */ @@ -2296,7 +2296,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) if( strcmp( "MBEDTLS_PLATFORM_FPRINTF_MACRO", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_FPRINTF_MACRO ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_FPRINTF_MACRO ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_FPRINTF_MACRO */ @@ -2304,7 +2304,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) if( strcmp( "MBEDTLS_PLATFORM_PRINTF_MACRO", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_PRINTF_MACRO ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_PRINTF_MACRO ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_PRINTF_MACRO */ @@ -2312,7 +2312,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) if( strcmp( "MBEDTLS_PLATFORM_SNPRINTF_MACRO", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_SNPRINTF_MACRO ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_SNPRINTF_MACRO ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_SNPRINTF_MACRO */ @@ -2320,7 +2320,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_NV_SEED_READ_MACRO) if( strcmp( "MBEDTLS_PLATFORM_NV_SEED_READ_MACRO", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_NV_SEED_READ_MACRO ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_NV_SEED_READ_MACRO ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_NV_SEED_READ_MACRO */ @@ -2328,7 +2328,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO) if( strcmp( "MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO */ @@ -2336,7 +2336,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT) if( strcmp( "MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT ) ); return( 0 ); } #endif /* MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT */ @@ -2344,7 +2344,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES) if( strcmp( "MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES ) ); return( 0 ); } #endif /* MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES */ @@ -2352,7 +2352,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_MAX_CONTENT_LEN) if( strcmp( "MBEDTLS_SSL_MAX_CONTENT_LEN", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_MAX_CONTENT_LEN ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_MAX_CONTENT_LEN ) ); return( 0 ); } #endif /* MBEDTLS_SSL_MAX_CONTENT_LEN */ @@ -2360,7 +2360,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_IN_CONTENT_LEN) if( strcmp( "MBEDTLS_SSL_IN_CONTENT_LEN", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_IN_CONTENT_LEN ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_IN_CONTENT_LEN ) ); return( 0 ); } #endif /* MBEDTLS_SSL_IN_CONTENT_LEN */ @@ -2368,7 +2368,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_OUT_CONTENT_LEN) if( strcmp( "MBEDTLS_SSL_OUT_CONTENT_LEN", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_OUT_CONTENT_LEN ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_OUT_CONTENT_LEN ) ); return( 0 ); } #endif /* MBEDTLS_SSL_OUT_CONTENT_LEN */ @@ -2376,7 +2376,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_DTLS_MAX_BUFFERING) if( strcmp( "MBEDTLS_SSL_DTLS_MAX_BUFFERING", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DTLS_MAX_BUFFERING ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DTLS_MAX_BUFFERING ) ); return( 0 ); } #endif /* MBEDTLS_SSL_DTLS_MAX_BUFFERING */ @@ -2384,7 +2384,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME) if( strcmp( "MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME ) ); return( 0 ); } #endif /* MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME */ @@ -2392,7 +2392,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PSK_MAX_LEN) if( strcmp( "MBEDTLS_PSK_MAX_LEN", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PSK_MAX_LEN ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PSK_MAX_LEN ) ); return( 0 ); } #endif /* MBEDTLS_PSK_MAX_LEN */ @@ -2400,7 +2400,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_COOKIE_TIMEOUT) if( strcmp( "MBEDTLS_SSL_COOKIE_TIMEOUT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_COOKIE_TIMEOUT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_COOKIE_TIMEOUT ) ); return( 0 ); } #endif /* MBEDTLS_SSL_COOKIE_TIMEOUT */ @@ -2408,7 +2408,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_CIPHERSUITES) if( strcmp( "MBEDTLS_SSL_CIPHERSUITES", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CIPHERSUITES ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CIPHERSUITES ) ); return( 0 ); } #endif /* MBEDTLS_SSL_CIPHERSUITES */ @@ -2416,7 +2416,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_X509_MAX_INTERMEDIATE_CA) if( strcmp( "MBEDTLS_X509_MAX_INTERMEDIATE_CA", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_X509_MAX_INTERMEDIATE_CA ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_X509_MAX_INTERMEDIATE_CA ) ); return( 0 ); } #endif /* MBEDTLS_X509_MAX_INTERMEDIATE_CA */ @@ -2424,7 +2424,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_X509_MAX_FILE_PATH_LEN) if( strcmp( "MBEDTLS_X509_MAX_FILE_PATH_LEN", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_X509_MAX_FILE_PATH_LEN ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_X509_MAX_FILE_PATH_LEN ) ); return( 0 ); } #endif /* MBEDTLS_X509_MAX_FILE_PATH_LEN */ @@ -2432,7 +2432,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES) if( strcmp( "MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES ) ); return( 0 ); } #endif /* MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES */ @@ -2440,7 +2440,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE) if( strcmp( "MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE ) ); return( 0 ); } #endif /* MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE */ @@ -2448,7 +2448,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_ZEROIZE_ALT) if( strcmp( "MBEDTLS_PLATFORM_ZEROIZE_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_ZEROIZE_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_ZEROIZE_ALT ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_ZEROIZE_ALT */ @@ -2456,7 +2456,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_GMTIME_R_ALT) if( strcmp( "MBEDTLS_PLATFORM_GMTIME_R_ALT", config ) == 0 ) { - mbedtls_printf( MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_GMTIME_R_ALT ) ); + mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_GMTIME_R_ALT ) ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_GMTIME_R_ALT */ diff --git a/scripts/generate_query_config.pl b/scripts/generate_query_config.pl index e99542d7c..492780d99 100755 --- a/scripts/generate_query_config.pl +++ b/scripts/generate_query_config.pl @@ -39,7 +39,7 @@ while (my $line = ) { $config_check .= "#if defined($name)\n"; $config_check .= " if( strcmp( \"$name\", config ) == 0 )\n"; $config_check .= " {\n"; - $config_check .= " mbedtls_printf( MACRO_EXPANSION_TO_STR( $name ) );\n"; + $config_check .= " mbedtls_printf( \"%s\", MACRO_EXPANSION_TO_STR( $name ) );\n"; $config_check .= " return( 0 );\n"; $config_check .= " }\n"; $config_check .= "#endif /* $name */\n"; From c28da7ea4317dbd6310d82d249b7df9c004fc702 Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Mon, 29 Oct 2018 18:58:41 +0000 Subject: [PATCH 20/61] Improve comments in query_config.fmt --- programs/ssl/query_config.c | 8 ++++++-- scripts/data_files/query_config.fmt | 10 +++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/programs/ssl/query_config.c b/programs/ssl/query_config.c index 774acdf0a..8ef5d3739 100644 --- a/programs/ssl/query_config.c +++ b/programs/ssl/query_config.c @@ -1,5 +1,5 @@ /* - * Query configuration information + * Query Mbed TLS compile time configurations from config.h * * Copyright (C) 2018, Arm Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 @@ -32,7 +32,10 @@ #define mbedtls_printf printf #endif /* MBEDTLS_PLATFORM_C */ -/* Include all the headers with public APIs in case they modify any configs */ +/* + * Include all the headers with public APIs in case they define a macro to its + * default value when that configuration is not set in the config.h. + */ #include "mbedtls/aes.h" #include "mbedtls/aesni.h" #include "mbedtls/arc4.h" @@ -2461,5 +2464,6 @@ int query_config( const char *config ) } #endif /* MBEDTLS_PLATFORM_GMTIME_R_ALT */ + /* If the symbol is not found, return an error */ return( 1 ); } diff --git a/scripts/data_files/query_config.fmt b/scripts/data_files/query_config.fmt index 3d62ebe9c..ef57a7c6f 100644 --- a/scripts/data_files/query_config.fmt +++ b/scripts/data_files/query_config.fmt @@ -1,5 +1,5 @@ /* - * Query configuration information + * Query Mbed TLS compile time configurations from config.h * * Copyright (C) 2018, Arm Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 @@ -32,7 +32,10 @@ #define mbedtls_printf printf #endif /* MBEDTLS_PLATFORM_C */ -/* Include all the headers with public APIs in case they modify any configs */ +/* + * Include all the headers with public APIs in case they define a macro to its + * default value when that configuration is not set in the config.h. + */ #include "mbedtls/aes.h" #include "mbedtls/aesni.h" #include "mbedtls/arc4.h" @@ -109,5 +112,6 @@ int query_config( const char *config ) { -CHECK_CONFIG return( 1 ); +CHECK_CONFIG /* If the symbol is not found, return an error */ + return( 1 ); } From cb9c01555810458a301ecbd6ab0bde29924daeb1 Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Tue, 30 Oct 2018 21:21:08 +0000 Subject: [PATCH 21/61] Improve cmake inclusion of query_config.c when building apps --- programs/ssl/CMakeLists.txt | 6 ++++-- programs/test/CMakeLists.txt | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/programs/ssl/CMakeLists.txt b/programs/ssl/CMakeLists.txt index 0a36bd675..803920cde 100644 --- a/programs/ssl/CMakeLists.txt +++ b/programs/ssl/CMakeLists.txt @@ -33,13 +33,15 @@ target_link_libraries(dtls_server ${libs}) add_executable(ssl_client1 ssl_client1.c) target_link_libraries(ssl_client1 ${libs}) -add_executable(ssl_client2 ssl_client2.c query_config.c) +add_executable(ssl_client2 ssl_client2.c) +target_sources(ssl_client2 PUBLIC query_config.c) target_link_libraries(ssl_client2 ${libs}) add_executable(ssl_server ssl_server.c) target_link_libraries(ssl_server ${libs}) -add_executable(ssl_server2 ssl_server2.c query_config.c) +add_executable(ssl_server2 ssl_server2.c) +target_sources(ssl_server2 PUBLIC query_config.c) target_link_libraries(ssl_server2 ${libs}) add_executable(ssl_fork_server ssl_fork_server.c) diff --git a/programs/test/CMakeLists.txt b/programs/test/CMakeLists.txt index 8af02da1b..65ff24948 100644 --- a/programs/test/CMakeLists.txt +++ b/programs/test/CMakeLists.txt @@ -30,7 +30,8 @@ target_link_libraries(udp_proxy ${libs}) add_executable(zeroize zeroize.c) target_link_libraries(zeroize ${libs}) -add_executable(query_compile_time_config query_compile_time_config.c ../ssl/query_config.c) +add_executable(query_compile_time_config query_compile_time_config.c) +target_sources(query_compile_time_config PUBLIC ../ssl/query_config.c) target_link_libraries(query_compile_time_config ${libs}) install(TARGETS selftest benchmark ssl_cert_test udp_proxy query_compile_time_config From c84a65da9d56f67ebe050013d871681892d066ab Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Tue, 30 Oct 2018 21:46:21 +0000 Subject: [PATCH 22/61] Fix missing include in vs proj files for query programs --- scripts/data_files/vs2010-app-template.vcxproj | 3 +-- scripts/generate_visualc_files.pl | 8 +++++++- visualc/VS2010/query_compile_time_config.vcxproj | 1 + visualc/VS2010/ssl_client2.vcxproj | 1 + visualc/VS2010/ssl_server2.vcxproj | 1 + 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/data_files/vs2010-app-template.vcxproj b/scripts/data_files/vs2010-app-template.vcxproj index de18f9d85..fac9812e6 100644 --- a/scripts/data_files/vs2010-app-template.vcxproj +++ b/scripts/data_files/vs2010-app-template.vcxproj @@ -18,8 +18,7 @@ x64 - - + diff --git a/scripts/generate_visualc_files.pl b/scripts/generate_visualc_files.pl index 811c71f47..b2990de5a 100755 --- a/scripts/generate_visualc_files.pl +++ b/scripts/generate_visualc_files.pl @@ -93,8 +93,14 @@ sub gen_app { $path =~ s!/!\\!g; (my $appname = $path) =~ s/.*\\//; + my $srcs = "\n "; + if( $appname eq "ssl_client2" or $appname eq "ssl_server2" or + $appname eq "query_compile_time_config" ) { + $srcs .= "\n "; + } + my $content = $template; - $content =~ s//$path/g; + $content =~ s//$srcs/g; $content =~ s//$appname/g; $content =~ s//$guid/g; diff --git a/visualc/VS2010/query_compile_time_config.vcxproj b/visualc/VS2010/query_compile_time_config.vcxproj index f8ec62a26..83a29f067 100644 --- a/visualc/VS2010/query_compile_time_config.vcxproj +++ b/visualc/VS2010/query_compile_time_config.vcxproj @@ -20,6 +20,7 @@ + diff --git a/visualc/VS2010/ssl_client2.vcxproj b/visualc/VS2010/ssl_client2.vcxproj index 1d44fa783..a960facf0 100644 --- a/visualc/VS2010/ssl_client2.vcxproj +++ b/visualc/VS2010/ssl_client2.vcxproj @@ -20,6 +20,7 @@ + diff --git a/visualc/VS2010/ssl_server2.vcxproj b/visualc/VS2010/ssl_server2.vcxproj index d06e0628e..06a91cb49 100644 --- a/visualc/VS2010/ssl_server2.vcxproj +++ b/visualc/VS2010/ssl_server2.vcxproj @@ -20,6 +20,7 @@ + From 5bc6e92b70256bd88e587e280db50f8a9501455a Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Tue, 30 Oct 2018 21:52:53 +0000 Subject: [PATCH 23/61] Fix query_config macro expansion for windows --- programs/ssl/query_config.c | 4 ++++ scripts/data_files/query_config.fmt | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/programs/ssl/query_config.c b/programs/ssl/query_config.c index 8ef5d3739..f560943e4 100644 --- a/programs/ssl/query_config.c +++ b/programs/ssl/query_config.c @@ -107,8 +107,12 @@ #include /* Helper macros to convert a macro or its expansion into a string */ +#if defined(_MSC_VER) +#define MACRO_EXPANSION_TO_STR(macro) strlen( #macro ) > 0 ? #macro "\n" : "" +#else #define MACRO_EXPANSION_TO_STR(macro) MACRO_NAME_TO_STR(macro) #define MACRO_NAME_TO_STR(macro) strlen( #macro ) > 0 ? #macro "\n" : "" +#endif /* _MSC_VER */ int query_config( const char *config ) { diff --git a/scripts/data_files/query_config.fmt b/scripts/data_files/query_config.fmt index ef57a7c6f..7ea4b5ab4 100644 --- a/scripts/data_files/query_config.fmt +++ b/scripts/data_files/query_config.fmt @@ -107,8 +107,12 @@ #include /* Helper macros to convert a macro or its expansion into a string */ +#if defined(_MSC_VER) +#define MACRO_EXPANSION_TO_STR(macro) strlen( #macro ) > 0 ? #macro "\n" : "" +#else #define MACRO_EXPANSION_TO_STR(macro) MACRO_NAME_TO_STR(macro) #define MACRO_NAME_TO_STR(macro) strlen( #macro ) > 0 ? #macro "\n" : "" +#endif /* _MSC_VER */ int query_config( const char *config ) { From 27b3372c45a7f9d03110dd581d61bd09db3902d5 Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Wed, 5 Dec 2018 10:47:31 +0000 Subject: [PATCH 24/61] Fix query_config macro expansion for windows --- programs/ssl/query_config.c | 601 ++++++++++++++-------------- scripts/data_files/query_config.fmt | 13 +- scripts/generate_query_config.pl | 2 +- 3 files changed, 309 insertions(+), 307 deletions(-) diff --git a/programs/ssl/query_config.c b/programs/ssl/query_config.c index f560943e4..c3cf1f857 100644 --- a/programs/ssl/query_config.c +++ b/programs/ssl/query_config.c @@ -106,20 +106,21 @@ #include -/* Helper macros to convert a macro or its expansion into a string */ -#if defined(_MSC_VER) -#define MACRO_EXPANSION_TO_STR(macro) strlen( #macro ) > 0 ? #macro "\n" : "" -#else +/* + * Helper macros to convert a macro or its expansion into a string + * WARNING: This does not work for expanding function-like macros. However, + * Mbed TLS does not currently have configuration options used in this fashion. + */ #define MACRO_EXPANSION_TO_STR(macro) MACRO_NAME_TO_STR(macro) -#define MACRO_NAME_TO_STR(macro) strlen( #macro ) > 0 ? #macro "\n" : "" -#endif /* _MSC_VER */ +#define MACRO_NAME_TO_STR(macro) \ + mbedtls_printf( "%s", strlen( #macro "" ) > 0 ? #macro "\n" : "" ) int query_config( const char *config ) { #if defined(MBEDTLS_HAVE_ASM) if( strcmp( "MBEDTLS_HAVE_ASM", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_HAVE_ASM ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_HAVE_ASM ); return( 0 ); } #endif /* MBEDTLS_HAVE_ASM */ @@ -127,7 +128,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_NO_UDBL_DIVISION) if( strcmp( "MBEDTLS_NO_UDBL_DIVISION", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_NO_UDBL_DIVISION ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_NO_UDBL_DIVISION ); return( 0 ); } #endif /* MBEDTLS_NO_UDBL_DIVISION */ @@ -135,7 +136,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_NO_64BIT_MULTIPLICATION) if( strcmp( "MBEDTLS_NO_64BIT_MULTIPLICATION", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_NO_64BIT_MULTIPLICATION ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_NO_64BIT_MULTIPLICATION ); return( 0 ); } #endif /* MBEDTLS_NO_64BIT_MULTIPLICATION */ @@ -143,7 +144,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_HAVE_SSE2) if( strcmp( "MBEDTLS_HAVE_SSE2", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_HAVE_SSE2 ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_HAVE_SSE2 ); return( 0 ); } #endif /* MBEDTLS_HAVE_SSE2 */ @@ -151,7 +152,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_HAVE_TIME) if( strcmp( "MBEDTLS_HAVE_TIME", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_HAVE_TIME ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_HAVE_TIME ); return( 0 ); } #endif /* MBEDTLS_HAVE_TIME */ @@ -159,7 +160,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_HAVE_TIME_DATE) if( strcmp( "MBEDTLS_HAVE_TIME_DATE", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_HAVE_TIME_DATE ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_HAVE_TIME_DATE ); return( 0 ); } #endif /* MBEDTLS_HAVE_TIME_DATE */ @@ -167,7 +168,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_MEMORY) if( strcmp( "MBEDTLS_PLATFORM_MEMORY", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_MEMORY ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_MEMORY ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_MEMORY */ @@ -175,7 +176,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS) if( strcmp( "MBEDTLS_PLATFORM_NO_STD_FUNCTIONS", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_NO_STD_FUNCTIONS ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_NO_STD_FUNCTIONS ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_NO_STD_FUNCTIONS */ @@ -183,7 +184,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_EXIT_ALT) if( strcmp( "MBEDTLS_PLATFORM_EXIT_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_EXIT_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_EXIT_ALT ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_EXIT_ALT */ @@ -191,7 +192,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_TIME_ALT) if( strcmp( "MBEDTLS_PLATFORM_TIME_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_TIME_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_TIME_ALT ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_TIME_ALT */ @@ -199,7 +200,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_FPRINTF_ALT) if( strcmp( "MBEDTLS_PLATFORM_FPRINTF_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_FPRINTF_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_FPRINTF_ALT ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_FPRINTF_ALT */ @@ -207,7 +208,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_PRINTF_ALT) if( strcmp( "MBEDTLS_PLATFORM_PRINTF_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_PRINTF_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_PRINTF_ALT ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_PRINTF_ALT */ @@ -215,7 +216,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) if( strcmp( "MBEDTLS_PLATFORM_SNPRINTF_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_SNPRINTF_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_SNPRINTF_ALT ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_SNPRINTF_ALT */ @@ -223,7 +224,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_NV_SEED_ALT) if( strcmp( "MBEDTLS_PLATFORM_NV_SEED_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_NV_SEED_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_NV_SEED_ALT ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_NV_SEED_ALT */ @@ -231,7 +232,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT) if( strcmp( "MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT */ @@ -239,7 +240,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_DEPRECATED_WARNING) if( strcmp( "MBEDTLS_DEPRECATED_WARNING", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_DEPRECATED_WARNING ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_DEPRECATED_WARNING ); return( 0 ); } #endif /* MBEDTLS_DEPRECATED_WARNING */ @@ -247,7 +248,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_DEPRECATED_REMOVED) if( strcmp( "MBEDTLS_DEPRECATED_REMOVED", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_DEPRECATED_REMOVED ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_DEPRECATED_REMOVED ); return( 0 ); } #endif /* MBEDTLS_DEPRECATED_REMOVED */ @@ -255,7 +256,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_TIMING_ALT) if( strcmp( "MBEDTLS_TIMING_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_TIMING_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_TIMING_ALT ); return( 0 ); } #endif /* MBEDTLS_TIMING_ALT */ @@ -263,7 +264,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_AES_ALT) if( strcmp( "MBEDTLS_AES_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_AES_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_AES_ALT ); return( 0 ); } #endif /* MBEDTLS_AES_ALT */ @@ -271,7 +272,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ARC4_ALT) if( strcmp( "MBEDTLS_ARC4_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ARC4_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ARC4_ALT ); return( 0 ); } #endif /* MBEDTLS_ARC4_ALT */ @@ -279,7 +280,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ARIA_ALT) if( strcmp( "MBEDTLS_ARIA_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ARIA_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ARIA_ALT ); return( 0 ); } #endif /* MBEDTLS_ARIA_ALT */ @@ -287,7 +288,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_BLOWFISH_ALT) if( strcmp( "MBEDTLS_BLOWFISH_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_BLOWFISH_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_BLOWFISH_ALT ); return( 0 ); } #endif /* MBEDTLS_BLOWFISH_ALT */ @@ -295,7 +296,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CAMELLIA_ALT) if( strcmp( "MBEDTLS_CAMELLIA_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CAMELLIA_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_CAMELLIA_ALT ); return( 0 ); } #endif /* MBEDTLS_CAMELLIA_ALT */ @@ -303,7 +304,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CCM_ALT) if( strcmp( "MBEDTLS_CCM_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CCM_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_CCM_ALT ); return( 0 ); } #endif /* MBEDTLS_CCM_ALT */ @@ -311,7 +312,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CHACHA20_ALT) if( strcmp( "MBEDTLS_CHACHA20_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CHACHA20_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_CHACHA20_ALT ); return( 0 ); } #endif /* MBEDTLS_CHACHA20_ALT */ @@ -319,7 +320,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CHACHAPOLY_ALT) if( strcmp( "MBEDTLS_CHACHAPOLY_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CHACHAPOLY_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_CHACHAPOLY_ALT ); return( 0 ); } #endif /* MBEDTLS_CHACHAPOLY_ALT */ @@ -327,7 +328,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CMAC_ALT) if( strcmp( "MBEDTLS_CMAC_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CMAC_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_CMAC_ALT ); return( 0 ); } #endif /* MBEDTLS_CMAC_ALT */ @@ -335,7 +336,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_DES_ALT) if( strcmp( "MBEDTLS_DES_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_DES_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_DES_ALT ); return( 0 ); } #endif /* MBEDTLS_DES_ALT */ @@ -343,7 +344,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_DHM_ALT) if( strcmp( "MBEDTLS_DHM_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_DHM_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_DHM_ALT ); return( 0 ); } #endif /* MBEDTLS_DHM_ALT */ @@ -351,7 +352,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECJPAKE_ALT) if( strcmp( "MBEDTLS_ECJPAKE_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECJPAKE_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECJPAKE_ALT ); return( 0 ); } #endif /* MBEDTLS_ECJPAKE_ALT */ @@ -359,7 +360,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_GCM_ALT) if( strcmp( "MBEDTLS_GCM_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_GCM_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_GCM_ALT ); return( 0 ); } #endif /* MBEDTLS_GCM_ALT */ @@ -367,7 +368,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_NIST_KW_ALT) if( strcmp( "MBEDTLS_NIST_KW_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_NIST_KW_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_NIST_KW_ALT ); return( 0 ); } #endif /* MBEDTLS_NIST_KW_ALT */ @@ -375,7 +376,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MD2_ALT) if( strcmp( "MBEDTLS_MD2_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MD2_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_MD2_ALT ); return( 0 ); } #endif /* MBEDTLS_MD2_ALT */ @@ -383,7 +384,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MD4_ALT) if( strcmp( "MBEDTLS_MD4_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MD4_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_MD4_ALT ); return( 0 ); } #endif /* MBEDTLS_MD4_ALT */ @@ -391,7 +392,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MD5_ALT) if( strcmp( "MBEDTLS_MD5_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MD5_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_MD5_ALT ); return( 0 ); } #endif /* MBEDTLS_MD5_ALT */ @@ -399,7 +400,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_POLY1305_ALT) if( strcmp( "MBEDTLS_POLY1305_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_POLY1305_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_POLY1305_ALT ); return( 0 ); } #endif /* MBEDTLS_POLY1305_ALT */ @@ -407,7 +408,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_RIPEMD160_ALT) if( strcmp( "MBEDTLS_RIPEMD160_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_RIPEMD160_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_RIPEMD160_ALT ); return( 0 ); } #endif /* MBEDTLS_RIPEMD160_ALT */ @@ -415,7 +416,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_RSA_ALT) if( strcmp( "MBEDTLS_RSA_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_RSA_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_RSA_ALT ); return( 0 ); } #endif /* MBEDTLS_RSA_ALT */ @@ -423,7 +424,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SHA1_ALT) if( strcmp( "MBEDTLS_SHA1_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SHA1_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SHA1_ALT ); return( 0 ); } #endif /* MBEDTLS_SHA1_ALT */ @@ -431,7 +432,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SHA256_ALT) if( strcmp( "MBEDTLS_SHA256_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SHA256_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SHA256_ALT ); return( 0 ); } #endif /* MBEDTLS_SHA256_ALT */ @@ -439,7 +440,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SHA512_ALT) if( strcmp( "MBEDTLS_SHA512_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SHA512_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SHA512_ALT ); return( 0 ); } #endif /* MBEDTLS_SHA512_ALT */ @@ -447,7 +448,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_XTEA_ALT) if( strcmp( "MBEDTLS_XTEA_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_XTEA_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_XTEA_ALT ); return( 0 ); } #endif /* MBEDTLS_XTEA_ALT */ @@ -455,7 +456,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_ALT) if( strcmp( "MBEDTLS_ECP_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_ALT ); return( 0 ); } #endif /* MBEDTLS_ECP_ALT */ @@ -463,7 +464,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MD2_PROCESS_ALT) if( strcmp( "MBEDTLS_MD2_PROCESS_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MD2_PROCESS_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_MD2_PROCESS_ALT ); return( 0 ); } #endif /* MBEDTLS_MD2_PROCESS_ALT */ @@ -471,7 +472,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MD4_PROCESS_ALT) if( strcmp( "MBEDTLS_MD4_PROCESS_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MD4_PROCESS_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_MD4_PROCESS_ALT ); return( 0 ); } #endif /* MBEDTLS_MD4_PROCESS_ALT */ @@ -479,7 +480,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MD5_PROCESS_ALT) if( strcmp( "MBEDTLS_MD5_PROCESS_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MD5_PROCESS_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_MD5_PROCESS_ALT ); return( 0 ); } #endif /* MBEDTLS_MD5_PROCESS_ALT */ @@ -487,7 +488,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_RIPEMD160_PROCESS_ALT) if( strcmp( "MBEDTLS_RIPEMD160_PROCESS_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_RIPEMD160_PROCESS_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_RIPEMD160_PROCESS_ALT ); return( 0 ); } #endif /* MBEDTLS_RIPEMD160_PROCESS_ALT */ @@ -495,7 +496,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SHA1_PROCESS_ALT) if( strcmp( "MBEDTLS_SHA1_PROCESS_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SHA1_PROCESS_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SHA1_PROCESS_ALT ); return( 0 ); } #endif /* MBEDTLS_SHA1_PROCESS_ALT */ @@ -503,7 +504,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SHA256_PROCESS_ALT) if( strcmp( "MBEDTLS_SHA256_PROCESS_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SHA256_PROCESS_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SHA256_PROCESS_ALT ); return( 0 ); } #endif /* MBEDTLS_SHA256_PROCESS_ALT */ @@ -511,7 +512,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SHA512_PROCESS_ALT) if( strcmp( "MBEDTLS_SHA512_PROCESS_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SHA512_PROCESS_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SHA512_PROCESS_ALT ); return( 0 ); } #endif /* MBEDTLS_SHA512_PROCESS_ALT */ @@ -519,7 +520,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_DES_SETKEY_ALT) if( strcmp( "MBEDTLS_DES_SETKEY_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_DES_SETKEY_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_DES_SETKEY_ALT ); return( 0 ); } #endif /* MBEDTLS_DES_SETKEY_ALT */ @@ -527,7 +528,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_DES_CRYPT_ECB_ALT) if( strcmp( "MBEDTLS_DES_CRYPT_ECB_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_DES_CRYPT_ECB_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_DES_CRYPT_ECB_ALT ); return( 0 ); } #endif /* MBEDTLS_DES_CRYPT_ECB_ALT */ @@ -535,7 +536,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_DES3_CRYPT_ECB_ALT) if( strcmp( "MBEDTLS_DES3_CRYPT_ECB_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_DES3_CRYPT_ECB_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_DES3_CRYPT_ECB_ALT ); return( 0 ); } #endif /* MBEDTLS_DES3_CRYPT_ECB_ALT */ @@ -543,7 +544,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_AES_SETKEY_ENC_ALT) if( strcmp( "MBEDTLS_AES_SETKEY_ENC_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_AES_SETKEY_ENC_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_AES_SETKEY_ENC_ALT ); return( 0 ); } #endif /* MBEDTLS_AES_SETKEY_ENC_ALT */ @@ -551,7 +552,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_AES_SETKEY_DEC_ALT) if( strcmp( "MBEDTLS_AES_SETKEY_DEC_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_AES_SETKEY_DEC_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_AES_SETKEY_DEC_ALT ); return( 0 ); } #endif /* MBEDTLS_AES_SETKEY_DEC_ALT */ @@ -559,7 +560,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_AES_ENCRYPT_ALT) if( strcmp( "MBEDTLS_AES_ENCRYPT_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_AES_ENCRYPT_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_AES_ENCRYPT_ALT ); return( 0 ); } #endif /* MBEDTLS_AES_ENCRYPT_ALT */ @@ -567,7 +568,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_AES_DECRYPT_ALT) if( strcmp( "MBEDTLS_AES_DECRYPT_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_AES_DECRYPT_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_AES_DECRYPT_ALT ); return( 0 ); } #endif /* MBEDTLS_AES_DECRYPT_ALT */ @@ -575,7 +576,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECDH_GEN_PUBLIC_ALT) if( strcmp( "MBEDTLS_ECDH_GEN_PUBLIC_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECDH_GEN_PUBLIC_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECDH_GEN_PUBLIC_ALT ); return( 0 ); } #endif /* MBEDTLS_ECDH_GEN_PUBLIC_ALT */ @@ -583,7 +584,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECDH_COMPUTE_SHARED_ALT) if( strcmp( "MBEDTLS_ECDH_COMPUTE_SHARED_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECDH_COMPUTE_SHARED_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECDH_COMPUTE_SHARED_ALT ); return( 0 ); } #endif /* MBEDTLS_ECDH_COMPUTE_SHARED_ALT */ @@ -591,7 +592,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECDSA_VERIFY_ALT) if( strcmp( "MBEDTLS_ECDSA_VERIFY_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECDSA_VERIFY_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECDSA_VERIFY_ALT ); return( 0 ); } #endif /* MBEDTLS_ECDSA_VERIFY_ALT */ @@ -599,7 +600,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECDSA_SIGN_ALT) if( strcmp( "MBEDTLS_ECDSA_SIGN_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECDSA_SIGN_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECDSA_SIGN_ALT ); return( 0 ); } #endif /* MBEDTLS_ECDSA_SIGN_ALT */ @@ -607,7 +608,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECDSA_GENKEY_ALT) if( strcmp( "MBEDTLS_ECDSA_GENKEY_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECDSA_GENKEY_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECDSA_GENKEY_ALT ); return( 0 ); } #endif /* MBEDTLS_ECDSA_GENKEY_ALT */ @@ -615,7 +616,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_INTERNAL_ALT) if( strcmp( "MBEDTLS_ECP_INTERNAL_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_INTERNAL_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_INTERNAL_ALT ); return( 0 ); } #endif /* MBEDTLS_ECP_INTERNAL_ALT */ @@ -623,7 +624,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT) if( strcmp( "MBEDTLS_ECP_RANDOMIZE_JAC_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_RANDOMIZE_JAC_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_RANDOMIZE_JAC_ALT ); return( 0 ); } #endif /* MBEDTLS_ECP_RANDOMIZE_JAC_ALT */ @@ -631,7 +632,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_ADD_MIXED_ALT) if( strcmp( "MBEDTLS_ECP_ADD_MIXED_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_ADD_MIXED_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_ADD_MIXED_ALT ); return( 0 ); } #endif /* MBEDTLS_ECP_ADD_MIXED_ALT */ @@ -639,7 +640,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DOUBLE_JAC_ALT) if( strcmp( "MBEDTLS_ECP_DOUBLE_JAC_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DOUBLE_JAC_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DOUBLE_JAC_ALT ); return( 0 ); } #endif /* MBEDTLS_ECP_DOUBLE_JAC_ALT */ @@ -647,7 +648,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT) if( strcmp( "MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT ); return( 0 ); } #endif /* MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT */ @@ -655,7 +656,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_NORMALIZE_JAC_ALT) if( strcmp( "MBEDTLS_ECP_NORMALIZE_JAC_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_NORMALIZE_JAC_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_NORMALIZE_JAC_ALT ); return( 0 ); } #endif /* MBEDTLS_ECP_NORMALIZE_JAC_ALT */ @@ -663,7 +664,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT) if( strcmp( "MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT ); return( 0 ); } #endif /* MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT */ @@ -671,7 +672,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_RANDOMIZE_MXZ_ALT) if( strcmp( "MBEDTLS_ECP_RANDOMIZE_MXZ_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_RANDOMIZE_MXZ_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_RANDOMIZE_MXZ_ALT ); return( 0 ); } #endif /* MBEDTLS_ECP_RANDOMIZE_MXZ_ALT */ @@ -679,7 +680,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_NORMALIZE_MXZ_ALT) if( strcmp( "MBEDTLS_ECP_NORMALIZE_MXZ_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_NORMALIZE_MXZ_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_NORMALIZE_MXZ_ALT ); return( 0 ); } #endif /* MBEDTLS_ECP_NORMALIZE_MXZ_ALT */ @@ -687,7 +688,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_TEST_NULL_ENTROPY) if( strcmp( "MBEDTLS_TEST_NULL_ENTROPY", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_TEST_NULL_ENTROPY ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_TEST_NULL_ENTROPY ); return( 0 ); } #endif /* MBEDTLS_TEST_NULL_ENTROPY */ @@ -695,7 +696,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ENTROPY_HARDWARE_ALT) if( strcmp( "MBEDTLS_ENTROPY_HARDWARE_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_HARDWARE_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_HARDWARE_ALT ); return( 0 ); } #endif /* MBEDTLS_ENTROPY_HARDWARE_ALT */ @@ -703,7 +704,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_AES_ROM_TABLES) if( strcmp( "MBEDTLS_AES_ROM_TABLES", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_AES_ROM_TABLES ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_AES_ROM_TABLES ); return( 0 ); } #endif /* MBEDTLS_AES_ROM_TABLES */ @@ -711,7 +712,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_AES_FEWER_TABLES) if( strcmp( "MBEDTLS_AES_FEWER_TABLES", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_AES_FEWER_TABLES ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_AES_FEWER_TABLES ); return( 0 ); } #endif /* MBEDTLS_AES_FEWER_TABLES */ @@ -719,7 +720,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CAMELLIA_SMALL_MEMORY) if( strcmp( "MBEDTLS_CAMELLIA_SMALL_MEMORY", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CAMELLIA_SMALL_MEMORY ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_CAMELLIA_SMALL_MEMORY ); return( 0 ); } #endif /* MBEDTLS_CAMELLIA_SMALL_MEMORY */ @@ -727,7 +728,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CIPHER_MODE_CBC) if( strcmp( "MBEDTLS_CIPHER_MODE_CBC", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_MODE_CBC ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_MODE_CBC ); return( 0 ); } #endif /* MBEDTLS_CIPHER_MODE_CBC */ @@ -735,7 +736,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CIPHER_MODE_CFB) if( strcmp( "MBEDTLS_CIPHER_MODE_CFB", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_MODE_CFB ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_MODE_CFB ); return( 0 ); } #endif /* MBEDTLS_CIPHER_MODE_CFB */ @@ -743,7 +744,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CIPHER_MODE_CTR) if( strcmp( "MBEDTLS_CIPHER_MODE_CTR", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_MODE_CTR ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_MODE_CTR ); return( 0 ); } #endif /* MBEDTLS_CIPHER_MODE_CTR */ @@ -751,7 +752,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CIPHER_MODE_OFB) if( strcmp( "MBEDTLS_CIPHER_MODE_OFB", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_MODE_OFB ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_MODE_OFB ); return( 0 ); } #endif /* MBEDTLS_CIPHER_MODE_OFB */ @@ -759,7 +760,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CIPHER_MODE_XTS) if( strcmp( "MBEDTLS_CIPHER_MODE_XTS", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_MODE_XTS ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_MODE_XTS ); return( 0 ); } #endif /* MBEDTLS_CIPHER_MODE_XTS */ @@ -767,7 +768,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CIPHER_NULL_CIPHER) if( strcmp( "MBEDTLS_CIPHER_NULL_CIPHER", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_NULL_CIPHER ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_NULL_CIPHER ); return( 0 ); } #endif /* MBEDTLS_CIPHER_NULL_CIPHER */ @@ -775,7 +776,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CIPHER_PADDING_PKCS7) if( strcmp( "MBEDTLS_CIPHER_PADDING_PKCS7", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_PADDING_PKCS7 ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_PADDING_PKCS7 ); return( 0 ); } #endif /* MBEDTLS_CIPHER_PADDING_PKCS7 */ @@ -783,7 +784,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS) if( strcmp( "MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS ); return( 0 ); } #endif /* MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS */ @@ -791,7 +792,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN) if( strcmp( "MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN ); return( 0 ); } #endif /* MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN */ @@ -799,7 +800,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CIPHER_PADDING_ZEROS) if( strcmp( "MBEDTLS_CIPHER_PADDING_ZEROS", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_PADDING_ZEROS ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_PADDING_ZEROS ); return( 0 ); } #endif /* MBEDTLS_CIPHER_PADDING_ZEROS */ @@ -807,7 +808,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ENABLE_WEAK_CIPHERSUITES) if( strcmp( "MBEDTLS_ENABLE_WEAK_CIPHERSUITES", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ENABLE_WEAK_CIPHERSUITES ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ENABLE_WEAK_CIPHERSUITES ); return( 0 ); } #endif /* MBEDTLS_ENABLE_WEAK_CIPHERSUITES */ @@ -815,7 +816,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_REMOVE_ARC4_CIPHERSUITES) if( strcmp( "MBEDTLS_REMOVE_ARC4_CIPHERSUITES", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_REMOVE_ARC4_CIPHERSUITES ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_REMOVE_ARC4_CIPHERSUITES ); return( 0 ); } #endif /* MBEDTLS_REMOVE_ARC4_CIPHERSUITES */ @@ -823,7 +824,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) if( strcmp( "MBEDTLS_ECP_DP_SECP192R1_ENABLED", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP192R1_ENABLED ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP192R1_ENABLED ); return( 0 ); } #endif /* MBEDTLS_ECP_DP_SECP192R1_ENABLED */ @@ -831,7 +832,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED) if( strcmp( "MBEDTLS_ECP_DP_SECP224R1_ENABLED", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP224R1_ENABLED ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP224R1_ENABLED ); return( 0 ); } #endif /* MBEDTLS_ECP_DP_SECP224R1_ENABLED */ @@ -839,7 +840,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) if( strcmp( "MBEDTLS_ECP_DP_SECP256R1_ENABLED", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP256R1_ENABLED ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP256R1_ENABLED ); return( 0 ); } #endif /* MBEDTLS_ECP_DP_SECP256R1_ENABLED */ @@ -847,7 +848,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED) if( strcmp( "MBEDTLS_ECP_DP_SECP384R1_ENABLED", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP384R1_ENABLED ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP384R1_ENABLED ); return( 0 ); } #endif /* MBEDTLS_ECP_DP_SECP384R1_ENABLED */ @@ -855,7 +856,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED) if( strcmp( "MBEDTLS_ECP_DP_SECP521R1_ENABLED", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP521R1_ENABLED ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP521R1_ENABLED ); return( 0 ); } #endif /* MBEDTLS_ECP_DP_SECP521R1_ENABLED */ @@ -863,7 +864,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED) if( strcmp( "MBEDTLS_ECP_DP_SECP192K1_ENABLED", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP192K1_ENABLED ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP192K1_ENABLED ); return( 0 ); } #endif /* MBEDTLS_ECP_DP_SECP192K1_ENABLED */ @@ -871,7 +872,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED) if( strcmp( "MBEDTLS_ECP_DP_SECP224K1_ENABLED", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP224K1_ENABLED ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP224K1_ENABLED ); return( 0 ); } #endif /* MBEDTLS_ECP_DP_SECP224K1_ENABLED */ @@ -879,7 +880,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED) if( strcmp( "MBEDTLS_ECP_DP_SECP256K1_ENABLED", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP256K1_ENABLED ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_SECP256K1_ENABLED ); return( 0 ); } #endif /* MBEDTLS_ECP_DP_SECP256K1_ENABLED */ @@ -887,7 +888,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DP_BP256R1_ENABLED) if( strcmp( "MBEDTLS_ECP_DP_BP256R1_ENABLED", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_BP256R1_ENABLED ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_BP256R1_ENABLED ); return( 0 ); } #endif /* MBEDTLS_ECP_DP_BP256R1_ENABLED */ @@ -895,7 +896,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DP_BP384R1_ENABLED) if( strcmp( "MBEDTLS_ECP_DP_BP384R1_ENABLED", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_BP384R1_ENABLED ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_BP384R1_ENABLED ); return( 0 ); } #endif /* MBEDTLS_ECP_DP_BP384R1_ENABLED */ @@ -903,7 +904,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DP_BP512R1_ENABLED) if( strcmp( "MBEDTLS_ECP_DP_BP512R1_ENABLED", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_BP512R1_ENABLED ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_BP512R1_ENABLED ); return( 0 ); } #endif /* MBEDTLS_ECP_DP_BP512R1_ENABLED */ @@ -911,7 +912,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DP_CURVE25519_ENABLED) if( strcmp( "MBEDTLS_ECP_DP_CURVE25519_ENABLED", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_CURVE25519_ENABLED ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_CURVE25519_ENABLED ); return( 0 ); } #endif /* MBEDTLS_ECP_DP_CURVE25519_ENABLED */ @@ -919,7 +920,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_DP_CURVE448_ENABLED) if( strcmp( "MBEDTLS_ECP_DP_CURVE448_ENABLED", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_CURVE448_ENABLED ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_DP_CURVE448_ENABLED ); return( 0 ); } #endif /* MBEDTLS_ECP_DP_CURVE448_ENABLED */ @@ -927,7 +928,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_NIST_OPTIM) if( strcmp( "MBEDTLS_ECP_NIST_OPTIM", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_NIST_OPTIM ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_NIST_OPTIM ); return( 0 ); } #endif /* MBEDTLS_ECP_NIST_OPTIM */ @@ -935,7 +936,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECDSA_DETERMINISTIC) if( strcmp( "MBEDTLS_ECDSA_DETERMINISTIC", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECDSA_DETERMINISTIC ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECDSA_DETERMINISTIC ); return( 0 ); } #endif /* MBEDTLS_ECDSA_DETERMINISTIC */ @@ -943,7 +944,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) if( strcmp( "MBEDTLS_KEY_EXCHANGE_PSK_ENABLED", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_PSK_ENABLED ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_PSK_ENABLED ); return( 0 ); } #endif /* MBEDTLS_KEY_EXCHANGE_PSK_ENABLED */ @@ -951,7 +952,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) if( strcmp( "MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED ); return( 0 ); } #endif /* MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED */ @@ -959,7 +960,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) if( strcmp( "MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED ); return( 0 ); } #endif /* MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED */ @@ -967,7 +968,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) if( strcmp( "MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED ); return( 0 ); } #endif /* MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED */ @@ -975,7 +976,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) if( strcmp( "MBEDTLS_KEY_EXCHANGE_RSA_ENABLED", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_RSA_ENABLED ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_RSA_ENABLED ); return( 0 ); } #endif /* MBEDTLS_KEY_EXCHANGE_RSA_ENABLED */ @@ -983,7 +984,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) if( strcmp( "MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED ); return( 0 ); } #endif /* MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED */ @@ -991,7 +992,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) if( strcmp( "MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED ); return( 0 ); } #endif /* MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED */ @@ -999,7 +1000,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) if( strcmp( "MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED ); return( 0 ); } #endif /* MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED */ @@ -1007,7 +1008,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) if( strcmp( "MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED ); return( 0 ); } #endif /* MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED */ @@ -1015,7 +1016,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) if( strcmp( "MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED ); return( 0 ); } #endif /* MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED */ @@ -1023,7 +1024,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) if( strcmp( "MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED ); return( 0 ); } #endif /* MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED */ @@ -1031,7 +1032,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PK_PARSE_EC_EXTENDED) if( strcmp( "MBEDTLS_PK_PARSE_EC_EXTENDED", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PK_PARSE_EC_EXTENDED ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PK_PARSE_EC_EXTENDED ); return( 0 ); } #endif /* MBEDTLS_PK_PARSE_EC_EXTENDED */ @@ -1039,7 +1040,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ERROR_STRERROR_DUMMY) if( strcmp( "MBEDTLS_ERROR_STRERROR_DUMMY", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ERROR_STRERROR_DUMMY ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ERROR_STRERROR_DUMMY ); return( 0 ); } #endif /* MBEDTLS_ERROR_STRERROR_DUMMY */ @@ -1047,7 +1048,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_GENPRIME) if( strcmp( "MBEDTLS_GENPRIME", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_GENPRIME ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_GENPRIME ); return( 0 ); } #endif /* MBEDTLS_GENPRIME */ @@ -1055,7 +1056,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_FS_IO) if( strcmp( "MBEDTLS_FS_IO", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_FS_IO ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_FS_IO ); return( 0 ); } #endif /* MBEDTLS_FS_IO */ @@ -1063,7 +1064,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES) if( strcmp( "MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES ); return( 0 ); } #endif /* MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES */ @@ -1071,7 +1072,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_NO_PLATFORM_ENTROPY) if( strcmp( "MBEDTLS_NO_PLATFORM_ENTROPY", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_NO_PLATFORM_ENTROPY ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_NO_PLATFORM_ENTROPY ); return( 0 ); } #endif /* MBEDTLS_NO_PLATFORM_ENTROPY */ @@ -1079,7 +1080,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ENTROPY_FORCE_SHA256) if( strcmp( "MBEDTLS_ENTROPY_FORCE_SHA256", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_FORCE_SHA256 ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_FORCE_SHA256 ); return( 0 ); } #endif /* MBEDTLS_ENTROPY_FORCE_SHA256 */ @@ -1087,7 +1088,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ENTROPY_NV_SEED) if( strcmp( "MBEDTLS_ENTROPY_NV_SEED", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_NV_SEED ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_NV_SEED ); return( 0 ); } #endif /* MBEDTLS_ENTROPY_NV_SEED */ @@ -1095,7 +1096,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MEMORY_DEBUG) if( strcmp( "MBEDTLS_MEMORY_DEBUG", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MEMORY_DEBUG ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_MEMORY_DEBUG ); return( 0 ); } #endif /* MBEDTLS_MEMORY_DEBUG */ @@ -1103,7 +1104,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MEMORY_BACKTRACE) if( strcmp( "MBEDTLS_MEMORY_BACKTRACE", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MEMORY_BACKTRACE ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_MEMORY_BACKTRACE ); return( 0 ); } #endif /* MBEDTLS_MEMORY_BACKTRACE */ @@ -1111,7 +1112,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PK_RSA_ALT_SUPPORT) if( strcmp( "MBEDTLS_PK_RSA_ALT_SUPPORT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PK_RSA_ALT_SUPPORT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PK_RSA_ALT_SUPPORT ); return( 0 ); } #endif /* MBEDTLS_PK_RSA_ALT_SUPPORT */ @@ -1119,7 +1120,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PKCS1_V15) if( strcmp( "MBEDTLS_PKCS1_V15", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PKCS1_V15 ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PKCS1_V15 ); return( 0 ); } #endif /* MBEDTLS_PKCS1_V15 */ @@ -1127,7 +1128,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PKCS1_V21) if( strcmp( "MBEDTLS_PKCS1_V21", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PKCS1_V21 ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PKCS1_V21 ); return( 0 ); } #endif /* MBEDTLS_PKCS1_V21 */ @@ -1135,7 +1136,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_RSA_NO_CRT) if( strcmp( "MBEDTLS_RSA_NO_CRT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_RSA_NO_CRT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_RSA_NO_CRT ); return( 0 ); } #endif /* MBEDTLS_RSA_NO_CRT */ @@ -1143,7 +1144,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SELF_TEST) if( strcmp( "MBEDTLS_SELF_TEST", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SELF_TEST ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SELF_TEST ); return( 0 ); } #endif /* MBEDTLS_SELF_TEST */ @@ -1151,7 +1152,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SHA256_SMALLER) if( strcmp( "MBEDTLS_SHA256_SMALLER", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SHA256_SMALLER ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SHA256_SMALLER ); return( 0 ); } #endif /* MBEDTLS_SHA256_SMALLER */ @@ -1159,7 +1160,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_ALL_ALERT_MESSAGES) if( strcmp( "MBEDTLS_SSL_ALL_ALERT_MESSAGES", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_ALL_ALERT_MESSAGES ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_ALL_ALERT_MESSAGES ); return( 0 ); } #endif /* MBEDTLS_SSL_ALL_ALERT_MESSAGES */ @@ -1167,7 +1168,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_ASYNC_PRIVATE) if( strcmp( "MBEDTLS_SSL_ASYNC_PRIVATE", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_ASYNC_PRIVATE ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_ASYNC_PRIVATE ); return( 0 ); } #endif /* MBEDTLS_SSL_ASYNC_PRIVATE */ @@ -1175,7 +1176,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_DEBUG_ALL) if( strcmp( "MBEDTLS_SSL_DEBUG_ALL", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DEBUG_ALL ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DEBUG_ALL ); return( 0 ); } #endif /* MBEDTLS_SSL_DEBUG_ALL */ @@ -1183,7 +1184,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC) if( strcmp( "MBEDTLS_SSL_ENCRYPT_THEN_MAC", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_ENCRYPT_THEN_MAC ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_ENCRYPT_THEN_MAC ); return( 0 ); } #endif /* MBEDTLS_SSL_ENCRYPT_THEN_MAC */ @@ -1191,7 +1192,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET) if( strcmp( "MBEDTLS_SSL_EXTENDED_MASTER_SECRET", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_EXTENDED_MASTER_SECRET ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_EXTENDED_MASTER_SECRET ); return( 0 ); } #endif /* MBEDTLS_SSL_EXTENDED_MASTER_SECRET */ @@ -1199,7 +1200,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_FALLBACK_SCSV) if( strcmp( "MBEDTLS_SSL_FALLBACK_SCSV", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_FALLBACK_SCSV ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_FALLBACK_SCSV ); return( 0 ); } #endif /* MBEDTLS_SSL_FALLBACK_SCSV */ @@ -1207,7 +1208,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_HW_RECORD_ACCEL) if( strcmp( "MBEDTLS_SSL_HW_RECORD_ACCEL", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_HW_RECORD_ACCEL ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_HW_RECORD_ACCEL ); return( 0 ); } #endif /* MBEDTLS_SSL_HW_RECORD_ACCEL */ @@ -1215,7 +1216,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_CBC_RECORD_SPLITTING) if( strcmp( "MBEDTLS_SSL_CBC_RECORD_SPLITTING", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CBC_RECORD_SPLITTING ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CBC_RECORD_SPLITTING ); return( 0 ); } #endif /* MBEDTLS_SSL_CBC_RECORD_SPLITTING */ @@ -1223,7 +1224,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_RENEGOTIATION) if( strcmp( "MBEDTLS_SSL_RENEGOTIATION", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_RENEGOTIATION ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_RENEGOTIATION ); return( 0 ); } #endif /* MBEDTLS_SSL_RENEGOTIATION */ @@ -1231,7 +1232,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO) if( strcmp( "MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO ); return( 0 ); } #endif /* MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO */ @@ -1239,7 +1240,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE) if( strcmp( "MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE ); return( 0 ); } #endif /* MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE */ @@ -1247,7 +1248,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH) if( strcmp( "MBEDTLS_SSL_MAX_FRAGMENT_LENGTH", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_MAX_FRAGMENT_LENGTH ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_MAX_FRAGMENT_LENGTH ); return( 0 ); } #endif /* MBEDTLS_SSL_MAX_FRAGMENT_LENGTH */ @@ -1255,7 +1256,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_PROTO_SSL3) if( strcmp( "MBEDTLS_SSL_PROTO_SSL3", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_PROTO_SSL3 ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_PROTO_SSL3 ); return( 0 ); } #endif /* MBEDTLS_SSL_PROTO_SSL3 */ @@ -1263,7 +1264,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_PROTO_TLS1) if( strcmp( "MBEDTLS_SSL_PROTO_TLS1", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_PROTO_TLS1 ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_PROTO_TLS1 ); return( 0 ); } #endif /* MBEDTLS_SSL_PROTO_TLS1 */ @@ -1271,7 +1272,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_PROTO_TLS1_1) if( strcmp( "MBEDTLS_SSL_PROTO_TLS1_1", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_PROTO_TLS1_1 ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_PROTO_TLS1_1 ); return( 0 ); } #endif /* MBEDTLS_SSL_PROTO_TLS1_1 */ @@ -1279,7 +1280,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_PROTO_TLS1_2) if( strcmp( "MBEDTLS_SSL_PROTO_TLS1_2", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_PROTO_TLS1_2 ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_PROTO_TLS1_2 ); return( 0 ); } #endif /* MBEDTLS_SSL_PROTO_TLS1_2 */ @@ -1287,7 +1288,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_PROTO_DTLS) if( strcmp( "MBEDTLS_SSL_PROTO_DTLS", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_PROTO_DTLS ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_PROTO_DTLS ); return( 0 ); } #endif /* MBEDTLS_SSL_PROTO_DTLS */ @@ -1295,7 +1296,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_ALPN) if( strcmp( "MBEDTLS_SSL_ALPN", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_ALPN ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_ALPN ); return( 0 ); } #endif /* MBEDTLS_SSL_ALPN */ @@ -1303,7 +1304,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY) if( strcmp( "MBEDTLS_SSL_DTLS_ANTI_REPLAY", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DTLS_ANTI_REPLAY ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DTLS_ANTI_REPLAY ); return( 0 ); } #endif /* MBEDTLS_SSL_DTLS_ANTI_REPLAY */ @@ -1311,7 +1312,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) if( strcmp( "MBEDTLS_SSL_DTLS_HELLO_VERIFY", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DTLS_HELLO_VERIFY ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DTLS_HELLO_VERIFY ); return( 0 ); } #endif /* MBEDTLS_SSL_DTLS_HELLO_VERIFY */ @@ -1319,7 +1320,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE) if( strcmp( "MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE ); return( 0 ); } #endif /* MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE */ @@ -1327,7 +1328,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_DTLS_BADMAC_LIMIT) if( strcmp( "MBEDTLS_SSL_DTLS_BADMAC_LIMIT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DTLS_BADMAC_LIMIT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DTLS_BADMAC_LIMIT ); return( 0 ); } #endif /* MBEDTLS_SSL_DTLS_BADMAC_LIMIT */ @@ -1335,7 +1336,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_SESSION_TICKETS) if( strcmp( "MBEDTLS_SSL_SESSION_TICKETS", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_SESSION_TICKETS ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_SESSION_TICKETS ); return( 0 ); } #endif /* MBEDTLS_SSL_SESSION_TICKETS */ @@ -1343,7 +1344,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_EXPORT_KEYS) if( strcmp( "MBEDTLS_SSL_EXPORT_KEYS", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_EXPORT_KEYS ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_EXPORT_KEYS ); return( 0 ); } #endif /* MBEDTLS_SSL_EXPORT_KEYS */ @@ -1351,7 +1352,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION) if( strcmp( "MBEDTLS_SSL_SERVER_NAME_INDICATION", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_SERVER_NAME_INDICATION ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_SERVER_NAME_INDICATION ); return( 0 ); } #endif /* MBEDTLS_SSL_SERVER_NAME_INDICATION */ @@ -1359,7 +1360,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_TRUNCATED_HMAC) if( strcmp( "MBEDTLS_SSL_TRUNCATED_HMAC", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_TRUNCATED_HMAC ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_TRUNCATED_HMAC ); return( 0 ); } #endif /* MBEDTLS_SSL_TRUNCATED_HMAC */ @@ -1367,7 +1368,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT) if( strcmp( "MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT ); return( 0 ); } #endif /* MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT */ @@ -1375,7 +1376,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_THREADING_ALT) if( strcmp( "MBEDTLS_THREADING_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_THREADING_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_THREADING_ALT ); return( 0 ); } #endif /* MBEDTLS_THREADING_ALT */ @@ -1383,7 +1384,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_THREADING_PTHREAD) if( strcmp( "MBEDTLS_THREADING_PTHREAD", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_THREADING_PTHREAD ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_THREADING_PTHREAD ); return( 0 ); } #endif /* MBEDTLS_THREADING_PTHREAD */ @@ -1391,7 +1392,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_VERSION_FEATURES) if( strcmp( "MBEDTLS_VERSION_FEATURES", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_VERSION_FEATURES ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_VERSION_FEATURES ); return( 0 ); } #endif /* MBEDTLS_VERSION_FEATURES */ @@ -1399,7 +1400,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3) if( strcmp( "MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 ); return( 0 ); } #endif /* MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 */ @@ -1407,7 +1408,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION) if( strcmp( "MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION ); return( 0 ); } #endif /* MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION */ @@ -1415,7 +1416,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_X509_CHECK_KEY_USAGE) if( strcmp( "MBEDTLS_X509_CHECK_KEY_USAGE", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CHECK_KEY_USAGE ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CHECK_KEY_USAGE ); return( 0 ); } #endif /* MBEDTLS_X509_CHECK_KEY_USAGE */ @@ -1423,7 +1424,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE) if( strcmp( "MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE ); return( 0 ); } #endif /* MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE */ @@ -1431,7 +1432,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT) if( strcmp( "MBEDTLS_X509_RSASSA_PSS_SUPPORT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_X509_RSASSA_PSS_SUPPORT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_X509_RSASSA_PSS_SUPPORT ); return( 0 ); } #endif /* MBEDTLS_X509_RSASSA_PSS_SUPPORT */ @@ -1439,7 +1440,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ZLIB_SUPPORT) if( strcmp( "MBEDTLS_ZLIB_SUPPORT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ZLIB_SUPPORT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ZLIB_SUPPORT ); return( 0 ); } #endif /* MBEDTLS_ZLIB_SUPPORT */ @@ -1447,7 +1448,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_AESNI_C) if( strcmp( "MBEDTLS_AESNI_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_AESNI_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_AESNI_C ); return( 0 ); } #endif /* MBEDTLS_AESNI_C */ @@ -1455,7 +1456,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_AES_C) if( strcmp( "MBEDTLS_AES_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_AES_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_AES_C ); return( 0 ); } #endif /* MBEDTLS_AES_C */ @@ -1463,7 +1464,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ARC4_C) if( strcmp( "MBEDTLS_ARC4_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ARC4_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ARC4_C ); return( 0 ); } #endif /* MBEDTLS_ARC4_C */ @@ -1471,7 +1472,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ASN1_PARSE_C) if( strcmp( "MBEDTLS_ASN1_PARSE_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ASN1_PARSE_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ASN1_PARSE_C ); return( 0 ); } #endif /* MBEDTLS_ASN1_PARSE_C */ @@ -1479,7 +1480,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ASN1_WRITE_C) if( strcmp( "MBEDTLS_ASN1_WRITE_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ASN1_WRITE_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ASN1_WRITE_C ); return( 0 ); } #endif /* MBEDTLS_ASN1_WRITE_C */ @@ -1487,7 +1488,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_BASE64_C) if( strcmp( "MBEDTLS_BASE64_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_BASE64_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_BASE64_C ); return( 0 ); } #endif /* MBEDTLS_BASE64_C */ @@ -1495,7 +1496,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_BIGNUM_C) if( strcmp( "MBEDTLS_BIGNUM_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_BIGNUM_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_BIGNUM_C ); return( 0 ); } #endif /* MBEDTLS_BIGNUM_C */ @@ -1503,7 +1504,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_BLOWFISH_C) if( strcmp( "MBEDTLS_BLOWFISH_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_BLOWFISH_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_BLOWFISH_C ); return( 0 ); } #endif /* MBEDTLS_BLOWFISH_C */ @@ -1511,7 +1512,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CAMELLIA_C) if( strcmp( "MBEDTLS_CAMELLIA_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CAMELLIA_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_CAMELLIA_C ); return( 0 ); } #endif /* MBEDTLS_CAMELLIA_C */ @@ -1519,7 +1520,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ARIA_C) if( strcmp( "MBEDTLS_ARIA_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ARIA_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ARIA_C ); return( 0 ); } #endif /* MBEDTLS_ARIA_C */ @@ -1527,7 +1528,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CCM_C) if( strcmp( "MBEDTLS_CCM_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CCM_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_CCM_C ); return( 0 ); } #endif /* MBEDTLS_CCM_C */ @@ -1535,7 +1536,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CERTS_C) if( strcmp( "MBEDTLS_CERTS_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CERTS_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_CERTS_C ); return( 0 ); } #endif /* MBEDTLS_CERTS_C */ @@ -1543,7 +1544,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CHACHA20_C) if( strcmp( "MBEDTLS_CHACHA20_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CHACHA20_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_CHACHA20_C ); return( 0 ); } #endif /* MBEDTLS_CHACHA20_C */ @@ -1551,7 +1552,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CHACHAPOLY_C) if( strcmp( "MBEDTLS_CHACHAPOLY_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CHACHAPOLY_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_CHACHAPOLY_C ); return( 0 ); } #endif /* MBEDTLS_CHACHAPOLY_C */ @@ -1559,7 +1560,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CIPHER_C) if( strcmp( "MBEDTLS_CIPHER_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_CIPHER_C ); return( 0 ); } #endif /* MBEDTLS_CIPHER_C */ @@ -1567,7 +1568,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CMAC_C) if( strcmp( "MBEDTLS_CMAC_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CMAC_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_CMAC_C ); return( 0 ); } #endif /* MBEDTLS_CMAC_C */ @@ -1575,7 +1576,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CTR_DRBG_C) if( strcmp( "MBEDTLS_CTR_DRBG_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_C ); return( 0 ); } #endif /* MBEDTLS_CTR_DRBG_C */ @@ -1583,7 +1584,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_DEBUG_C) if( strcmp( "MBEDTLS_DEBUG_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_DEBUG_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_DEBUG_C ); return( 0 ); } #endif /* MBEDTLS_DEBUG_C */ @@ -1591,7 +1592,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_DES_C) if( strcmp( "MBEDTLS_DES_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_DES_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_DES_C ); return( 0 ); } #endif /* MBEDTLS_DES_C */ @@ -1599,7 +1600,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_DHM_C) if( strcmp( "MBEDTLS_DHM_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_DHM_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_DHM_C ); return( 0 ); } #endif /* MBEDTLS_DHM_C */ @@ -1607,7 +1608,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECDH_C) if( strcmp( "MBEDTLS_ECDH_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECDH_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECDH_C ); return( 0 ); } #endif /* MBEDTLS_ECDH_C */ @@ -1615,7 +1616,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECDSA_C) if( strcmp( "MBEDTLS_ECDSA_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECDSA_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECDSA_C ); return( 0 ); } #endif /* MBEDTLS_ECDSA_C */ @@ -1623,7 +1624,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECJPAKE_C) if( strcmp( "MBEDTLS_ECJPAKE_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECJPAKE_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECJPAKE_C ); return( 0 ); } #endif /* MBEDTLS_ECJPAKE_C */ @@ -1631,7 +1632,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_C) if( strcmp( "MBEDTLS_ECP_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_C ); return( 0 ); } #endif /* MBEDTLS_ECP_C */ @@ -1639,7 +1640,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ENTROPY_C) if( strcmp( "MBEDTLS_ENTROPY_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_C ); return( 0 ); } #endif /* MBEDTLS_ENTROPY_C */ @@ -1647,7 +1648,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ERROR_C) if( strcmp( "MBEDTLS_ERROR_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ERROR_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ERROR_C ); return( 0 ); } #endif /* MBEDTLS_ERROR_C */ @@ -1655,7 +1656,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_GCM_C) if( strcmp( "MBEDTLS_GCM_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_GCM_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_GCM_C ); return( 0 ); } #endif /* MBEDTLS_GCM_C */ @@ -1663,7 +1664,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_HAVEGE_C) if( strcmp( "MBEDTLS_HAVEGE_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_HAVEGE_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_HAVEGE_C ); return( 0 ); } #endif /* MBEDTLS_HAVEGE_C */ @@ -1671,7 +1672,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_HKDF_C) if( strcmp( "MBEDTLS_HKDF_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_HKDF_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_HKDF_C ); return( 0 ); } #endif /* MBEDTLS_HKDF_C */ @@ -1679,7 +1680,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_HMAC_DRBG_C) if( strcmp( "MBEDTLS_HMAC_DRBG_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_HMAC_DRBG_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_HMAC_DRBG_C ); return( 0 ); } #endif /* MBEDTLS_HMAC_DRBG_C */ @@ -1687,7 +1688,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_NIST_KW_C) if( strcmp( "MBEDTLS_NIST_KW_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_NIST_KW_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_NIST_KW_C ); return( 0 ); } #endif /* MBEDTLS_NIST_KW_C */ @@ -1695,7 +1696,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MD_C) if( strcmp( "MBEDTLS_MD_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MD_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_MD_C ); return( 0 ); } #endif /* MBEDTLS_MD_C */ @@ -1703,7 +1704,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MD2_C) if( strcmp( "MBEDTLS_MD2_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MD2_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_MD2_C ); return( 0 ); } #endif /* MBEDTLS_MD2_C */ @@ -1711,7 +1712,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MD4_C) if( strcmp( "MBEDTLS_MD4_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MD4_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_MD4_C ); return( 0 ); } #endif /* MBEDTLS_MD4_C */ @@ -1719,7 +1720,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MD5_C) if( strcmp( "MBEDTLS_MD5_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MD5_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_MD5_C ); return( 0 ); } #endif /* MBEDTLS_MD5_C */ @@ -1727,7 +1728,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) if( strcmp( "MBEDTLS_MEMORY_BUFFER_ALLOC_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MEMORY_BUFFER_ALLOC_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_MEMORY_BUFFER_ALLOC_C ); return( 0 ); } #endif /* MBEDTLS_MEMORY_BUFFER_ALLOC_C */ @@ -1735,7 +1736,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_NET_C) if( strcmp( "MBEDTLS_NET_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_NET_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_NET_C ); return( 0 ); } #endif /* MBEDTLS_NET_C */ @@ -1743,7 +1744,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_OID_C) if( strcmp( "MBEDTLS_OID_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_OID_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_OID_C ); return( 0 ); } #endif /* MBEDTLS_OID_C */ @@ -1751,7 +1752,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PADLOCK_C) if( strcmp( "MBEDTLS_PADLOCK_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PADLOCK_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PADLOCK_C ); return( 0 ); } #endif /* MBEDTLS_PADLOCK_C */ @@ -1759,7 +1760,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PEM_PARSE_C) if( strcmp( "MBEDTLS_PEM_PARSE_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PEM_PARSE_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PEM_PARSE_C ); return( 0 ); } #endif /* MBEDTLS_PEM_PARSE_C */ @@ -1767,7 +1768,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PEM_WRITE_C) if( strcmp( "MBEDTLS_PEM_WRITE_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PEM_WRITE_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PEM_WRITE_C ); return( 0 ); } #endif /* MBEDTLS_PEM_WRITE_C */ @@ -1775,7 +1776,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PK_C) if( strcmp( "MBEDTLS_PK_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PK_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PK_C ); return( 0 ); } #endif /* MBEDTLS_PK_C */ @@ -1783,7 +1784,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PK_PARSE_C) if( strcmp( "MBEDTLS_PK_PARSE_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PK_PARSE_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PK_PARSE_C ); return( 0 ); } #endif /* MBEDTLS_PK_PARSE_C */ @@ -1791,7 +1792,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PK_WRITE_C) if( strcmp( "MBEDTLS_PK_WRITE_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PK_WRITE_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PK_WRITE_C ); return( 0 ); } #endif /* MBEDTLS_PK_WRITE_C */ @@ -1799,7 +1800,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PKCS5_C) if( strcmp( "MBEDTLS_PKCS5_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PKCS5_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PKCS5_C ); return( 0 ); } #endif /* MBEDTLS_PKCS5_C */ @@ -1807,7 +1808,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PKCS11_C) if( strcmp( "MBEDTLS_PKCS11_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PKCS11_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PKCS11_C ); return( 0 ); } #endif /* MBEDTLS_PKCS11_C */ @@ -1815,7 +1816,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PKCS12_C) if( strcmp( "MBEDTLS_PKCS12_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PKCS12_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PKCS12_C ); return( 0 ); } #endif /* MBEDTLS_PKCS12_C */ @@ -1823,7 +1824,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_C) if( strcmp( "MBEDTLS_PLATFORM_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_C ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_C */ @@ -1831,7 +1832,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_POLY1305_C) if( strcmp( "MBEDTLS_POLY1305_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_POLY1305_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_POLY1305_C ); return( 0 ); } #endif /* MBEDTLS_POLY1305_C */ @@ -1839,7 +1840,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_RIPEMD160_C) if( strcmp( "MBEDTLS_RIPEMD160_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_RIPEMD160_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_RIPEMD160_C ); return( 0 ); } #endif /* MBEDTLS_RIPEMD160_C */ @@ -1847,7 +1848,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_RSA_C) if( strcmp( "MBEDTLS_RSA_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_RSA_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_RSA_C ); return( 0 ); } #endif /* MBEDTLS_RSA_C */ @@ -1855,7 +1856,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SHA1_C) if( strcmp( "MBEDTLS_SHA1_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SHA1_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SHA1_C ); return( 0 ); } #endif /* MBEDTLS_SHA1_C */ @@ -1863,7 +1864,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SHA256_C) if( strcmp( "MBEDTLS_SHA256_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SHA256_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SHA256_C ); return( 0 ); } #endif /* MBEDTLS_SHA256_C */ @@ -1871,7 +1872,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SHA512_C) if( strcmp( "MBEDTLS_SHA512_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SHA512_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SHA512_C ); return( 0 ); } #endif /* MBEDTLS_SHA512_C */ @@ -1879,7 +1880,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_CACHE_C) if( strcmp( "MBEDTLS_SSL_CACHE_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CACHE_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CACHE_C ); return( 0 ); } #endif /* MBEDTLS_SSL_CACHE_C */ @@ -1887,7 +1888,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_COOKIE_C) if( strcmp( "MBEDTLS_SSL_COOKIE_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_COOKIE_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_COOKIE_C ); return( 0 ); } #endif /* MBEDTLS_SSL_COOKIE_C */ @@ -1895,7 +1896,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_TICKET_C) if( strcmp( "MBEDTLS_SSL_TICKET_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_TICKET_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_TICKET_C ); return( 0 ); } #endif /* MBEDTLS_SSL_TICKET_C */ @@ -1903,7 +1904,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_CLI_C) if( strcmp( "MBEDTLS_SSL_CLI_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CLI_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CLI_C ); return( 0 ); } #endif /* MBEDTLS_SSL_CLI_C */ @@ -1911,7 +1912,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_SRV_C) if( strcmp( "MBEDTLS_SSL_SRV_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_SRV_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_SRV_C ); return( 0 ); } #endif /* MBEDTLS_SSL_SRV_C */ @@ -1919,7 +1920,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_TLS_C) if( strcmp( "MBEDTLS_SSL_TLS_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_TLS_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_TLS_C ); return( 0 ); } #endif /* MBEDTLS_SSL_TLS_C */ @@ -1927,7 +1928,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_THREADING_C) if( strcmp( "MBEDTLS_THREADING_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_THREADING_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_THREADING_C ); return( 0 ); } #endif /* MBEDTLS_THREADING_C */ @@ -1935,7 +1936,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_TIMING_C) if( strcmp( "MBEDTLS_TIMING_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_TIMING_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_TIMING_C ); return( 0 ); } #endif /* MBEDTLS_TIMING_C */ @@ -1943,7 +1944,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_VERSION_C) if( strcmp( "MBEDTLS_VERSION_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_VERSION_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_VERSION_C ); return( 0 ); } #endif /* MBEDTLS_VERSION_C */ @@ -1951,7 +1952,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_X509_USE_C) if( strcmp( "MBEDTLS_X509_USE_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_X509_USE_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_X509_USE_C ); return( 0 ); } #endif /* MBEDTLS_X509_USE_C */ @@ -1959,7 +1960,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_X509_CRT_PARSE_C) if( strcmp( "MBEDTLS_X509_CRT_PARSE_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CRT_PARSE_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CRT_PARSE_C ); return( 0 ); } #endif /* MBEDTLS_X509_CRT_PARSE_C */ @@ -1967,7 +1968,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_X509_CRL_PARSE_C) if( strcmp( "MBEDTLS_X509_CRL_PARSE_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CRL_PARSE_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CRL_PARSE_C ); return( 0 ); } #endif /* MBEDTLS_X509_CRL_PARSE_C */ @@ -1975,7 +1976,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_X509_CSR_PARSE_C) if( strcmp( "MBEDTLS_X509_CSR_PARSE_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CSR_PARSE_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CSR_PARSE_C ); return( 0 ); } #endif /* MBEDTLS_X509_CSR_PARSE_C */ @@ -1983,7 +1984,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_X509_CREATE_C) if( strcmp( "MBEDTLS_X509_CREATE_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CREATE_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CREATE_C ); return( 0 ); } #endif /* MBEDTLS_X509_CREATE_C */ @@ -1991,7 +1992,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_X509_CRT_WRITE_C) if( strcmp( "MBEDTLS_X509_CRT_WRITE_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CRT_WRITE_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CRT_WRITE_C ); return( 0 ); } #endif /* MBEDTLS_X509_CRT_WRITE_C */ @@ -1999,7 +2000,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_X509_CSR_WRITE_C) if( strcmp( "MBEDTLS_X509_CSR_WRITE_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CSR_WRITE_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_X509_CSR_WRITE_C ); return( 0 ); } #endif /* MBEDTLS_X509_CSR_WRITE_C */ @@ -2007,7 +2008,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_XTEA_C) if( strcmp( "MBEDTLS_XTEA_C", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_XTEA_C ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_XTEA_C ); return( 0 ); } #endif /* MBEDTLS_XTEA_C */ @@ -2015,7 +2016,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MPI_WINDOW_SIZE) if( strcmp( "MBEDTLS_MPI_WINDOW_SIZE", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MPI_WINDOW_SIZE ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_MPI_WINDOW_SIZE ); return( 0 ); } #endif /* MBEDTLS_MPI_WINDOW_SIZE */ @@ -2023,7 +2024,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MPI_MAX_SIZE) if( strcmp( "MBEDTLS_MPI_MAX_SIZE", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MPI_MAX_SIZE ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_MPI_MAX_SIZE ); return( 0 ); } #endif /* MBEDTLS_MPI_MAX_SIZE */ @@ -2031,7 +2032,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) if( strcmp( "MBEDTLS_CTR_DRBG_ENTROPY_LEN", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_ENTROPY_LEN ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_ENTROPY_LEN ); return( 0 ); } #endif /* MBEDTLS_CTR_DRBG_ENTROPY_LEN */ @@ -2039,7 +2040,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CTR_DRBG_RESEED_INTERVAL) if( strcmp( "MBEDTLS_CTR_DRBG_RESEED_INTERVAL", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_RESEED_INTERVAL ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_RESEED_INTERVAL ); return( 0 ); } #endif /* MBEDTLS_CTR_DRBG_RESEED_INTERVAL */ @@ -2047,7 +2048,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CTR_DRBG_MAX_INPUT) if( strcmp( "MBEDTLS_CTR_DRBG_MAX_INPUT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_MAX_INPUT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_MAX_INPUT ); return( 0 ); } #endif /* MBEDTLS_CTR_DRBG_MAX_INPUT */ @@ -2055,7 +2056,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CTR_DRBG_MAX_REQUEST) if( strcmp( "MBEDTLS_CTR_DRBG_MAX_REQUEST", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_MAX_REQUEST ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_MAX_REQUEST ); return( 0 ); } #endif /* MBEDTLS_CTR_DRBG_MAX_REQUEST */ @@ -2063,7 +2064,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_CTR_DRBG_MAX_SEED_INPUT) if( strcmp( "MBEDTLS_CTR_DRBG_MAX_SEED_INPUT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_MAX_SEED_INPUT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_MAX_SEED_INPUT ); return( 0 ); } #endif /* MBEDTLS_CTR_DRBG_MAX_SEED_INPUT */ @@ -2071,7 +2072,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_HMAC_DRBG_RESEED_INTERVAL) if( strcmp( "MBEDTLS_HMAC_DRBG_RESEED_INTERVAL", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_HMAC_DRBG_RESEED_INTERVAL ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_HMAC_DRBG_RESEED_INTERVAL ); return( 0 ); } #endif /* MBEDTLS_HMAC_DRBG_RESEED_INTERVAL */ @@ -2079,7 +2080,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_HMAC_DRBG_MAX_INPUT) if( strcmp( "MBEDTLS_HMAC_DRBG_MAX_INPUT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_HMAC_DRBG_MAX_INPUT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_HMAC_DRBG_MAX_INPUT ); return( 0 ); } #endif /* MBEDTLS_HMAC_DRBG_MAX_INPUT */ @@ -2087,7 +2088,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_HMAC_DRBG_MAX_REQUEST) if( strcmp( "MBEDTLS_HMAC_DRBG_MAX_REQUEST", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_HMAC_DRBG_MAX_REQUEST ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_HMAC_DRBG_MAX_REQUEST ); return( 0 ); } #endif /* MBEDTLS_HMAC_DRBG_MAX_REQUEST */ @@ -2095,7 +2096,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT) if( strcmp( "MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT ); return( 0 ); } #endif /* MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT */ @@ -2103,7 +2104,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_MAX_BITS) if( strcmp( "MBEDTLS_ECP_MAX_BITS", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_MAX_BITS ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_MAX_BITS ); return( 0 ); } #endif /* MBEDTLS_ECP_MAX_BITS */ @@ -2111,7 +2112,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_WINDOW_SIZE) if( strcmp( "MBEDTLS_ECP_WINDOW_SIZE", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_WINDOW_SIZE ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_WINDOW_SIZE ); return( 0 ); } #endif /* MBEDTLS_ECP_WINDOW_SIZE */ @@ -2119,7 +2120,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ECP_FIXED_POINT_OPTIM) if( strcmp( "MBEDTLS_ECP_FIXED_POINT_OPTIM", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_FIXED_POINT_OPTIM ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_FIXED_POINT_OPTIM ); return( 0 ); } #endif /* MBEDTLS_ECP_FIXED_POINT_OPTIM */ @@ -2127,7 +2128,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ENTROPY_MAX_SOURCES) if( strcmp( "MBEDTLS_ENTROPY_MAX_SOURCES", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_MAX_SOURCES ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_MAX_SOURCES ); return( 0 ); } #endif /* MBEDTLS_ENTROPY_MAX_SOURCES */ @@ -2135,7 +2136,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ENTROPY_MAX_GATHER) if( strcmp( "MBEDTLS_ENTROPY_MAX_GATHER", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_MAX_GATHER ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_MAX_GATHER ); return( 0 ); } #endif /* MBEDTLS_ENTROPY_MAX_GATHER */ @@ -2143,7 +2144,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_ENTROPY_MIN_HARDWARE) if( strcmp( "MBEDTLS_ENTROPY_MIN_HARDWARE", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_MIN_HARDWARE ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_ENTROPY_MIN_HARDWARE ); return( 0 ); } #endif /* MBEDTLS_ENTROPY_MIN_HARDWARE */ @@ -2151,7 +2152,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_MEMORY_ALIGN_MULTIPLE) if( strcmp( "MBEDTLS_MEMORY_ALIGN_MULTIPLE", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_MEMORY_ALIGN_MULTIPLE ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_MEMORY_ALIGN_MULTIPLE ); return( 0 ); } #endif /* MBEDTLS_MEMORY_ALIGN_MULTIPLE */ @@ -2159,7 +2160,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_STD_MEM_HDR) if( strcmp( "MBEDTLS_PLATFORM_STD_MEM_HDR", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_MEM_HDR ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_MEM_HDR ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_STD_MEM_HDR */ @@ -2167,7 +2168,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_STD_CALLOC) if( strcmp( "MBEDTLS_PLATFORM_STD_CALLOC", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_CALLOC ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_CALLOC ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_STD_CALLOC */ @@ -2175,7 +2176,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_STD_FREE) if( strcmp( "MBEDTLS_PLATFORM_STD_FREE", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_FREE ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_FREE ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_STD_FREE */ @@ -2183,7 +2184,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_STD_EXIT) if( strcmp( "MBEDTLS_PLATFORM_STD_EXIT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_EXIT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_EXIT ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_STD_EXIT */ @@ -2191,7 +2192,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_STD_TIME) if( strcmp( "MBEDTLS_PLATFORM_STD_TIME", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_TIME ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_TIME ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_STD_TIME */ @@ -2199,7 +2200,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_STD_FPRINTF) if( strcmp( "MBEDTLS_PLATFORM_STD_FPRINTF", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_FPRINTF ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_FPRINTF ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_STD_FPRINTF */ @@ -2207,7 +2208,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_STD_PRINTF) if( strcmp( "MBEDTLS_PLATFORM_STD_PRINTF", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_PRINTF ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_PRINTF ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_STD_PRINTF */ @@ -2215,7 +2216,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_STD_SNPRINTF) if( strcmp( "MBEDTLS_PLATFORM_STD_SNPRINTF", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_SNPRINTF ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_SNPRINTF ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_STD_SNPRINTF */ @@ -2223,7 +2224,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_STD_EXIT_SUCCESS) if( strcmp( "MBEDTLS_PLATFORM_STD_EXIT_SUCCESS", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_EXIT_SUCCESS ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_EXIT_SUCCESS ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_STD_EXIT_SUCCESS */ @@ -2231,7 +2232,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_STD_EXIT_FAILURE) if( strcmp( "MBEDTLS_PLATFORM_STD_EXIT_FAILURE", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_EXIT_FAILURE ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_EXIT_FAILURE ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_STD_EXIT_FAILURE */ @@ -2239,7 +2240,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) if( strcmp( "MBEDTLS_PLATFORM_STD_NV_SEED_READ", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_NV_SEED_READ ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_NV_SEED_READ ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_STD_NV_SEED_READ */ @@ -2247,7 +2248,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) if( strcmp( "MBEDTLS_PLATFORM_STD_NV_SEED_WRITE", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_NV_SEED_WRITE ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_NV_SEED_WRITE ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_STD_NV_SEED_WRITE */ @@ -2255,7 +2256,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_STD_NV_SEED_FILE) if( strcmp( "MBEDTLS_PLATFORM_STD_NV_SEED_FILE", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_NV_SEED_FILE ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_STD_NV_SEED_FILE ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_STD_NV_SEED_FILE */ @@ -2263,7 +2264,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) if( strcmp( "MBEDTLS_PLATFORM_CALLOC_MACRO", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_CALLOC_MACRO ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_CALLOC_MACRO ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_CALLOC_MACRO */ @@ -2271,7 +2272,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_FREE_MACRO) if( strcmp( "MBEDTLS_PLATFORM_FREE_MACRO", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_FREE_MACRO ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_FREE_MACRO ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_FREE_MACRO */ @@ -2279,7 +2280,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_EXIT_MACRO) if( strcmp( "MBEDTLS_PLATFORM_EXIT_MACRO", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_EXIT_MACRO ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_EXIT_MACRO ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_EXIT_MACRO */ @@ -2287,7 +2288,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_TIME_MACRO) if( strcmp( "MBEDTLS_PLATFORM_TIME_MACRO", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_TIME_MACRO ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_TIME_MACRO ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_TIME_MACRO */ @@ -2295,7 +2296,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) if( strcmp( "MBEDTLS_PLATFORM_TIME_TYPE_MACRO", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_TIME_TYPE_MACRO ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_TIME_TYPE_MACRO ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_TIME_TYPE_MACRO */ @@ -2303,7 +2304,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) if( strcmp( "MBEDTLS_PLATFORM_FPRINTF_MACRO", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_FPRINTF_MACRO ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_FPRINTF_MACRO ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_FPRINTF_MACRO */ @@ -2311,7 +2312,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) if( strcmp( "MBEDTLS_PLATFORM_PRINTF_MACRO", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_PRINTF_MACRO ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_PRINTF_MACRO ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_PRINTF_MACRO */ @@ -2319,7 +2320,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) if( strcmp( "MBEDTLS_PLATFORM_SNPRINTF_MACRO", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_SNPRINTF_MACRO ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_SNPRINTF_MACRO ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_SNPRINTF_MACRO */ @@ -2327,7 +2328,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_NV_SEED_READ_MACRO) if( strcmp( "MBEDTLS_PLATFORM_NV_SEED_READ_MACRO", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_NV_SEED_READ_MACRO ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_NV_SEED_READ_MACRO ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_NV_SEED_READ_MACRO */ @@ -2335,7 +2336,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO) if( strcmp( "MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO */ @@ -2343,7 +2344,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT) if( strcmp( "MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT ); return( 0 ); } #endif /* MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT */ @@ -2351,7 +2352,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES) if( strcmp( "MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES ); return( 0 ); } #endif /* MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES */ @@ -2359,7 +2360,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_MAX_CONTENT_LEN) if( strcmp( "MBEDTLS_SSL_MAX_CONTENT_LEN", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_MAX_CONTENT_LEN ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_MAX_CONTENT_LEN ); return( 0 ); } #endif /* MBEDTLS_SSL_MAX_CONTENT_LEN */ @@ -2367,7 +2368,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_IN_CONTENT_LEN) if( strcmp( "MBEDTLS_SSL_IN_CONTENT_LEN", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_IN_CONTENT_LEN ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_IN_CONTENT_LEN ); return( 0 ); } #endif /* MBEDTLS_SSL_IN_CONTENT_LEN */ @@ -2375,7 +2376,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_OUT_CONTENT_LEN) if( strcmp( "MBEDTLS_SSL_OUT_CONTENT_LEN", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_OUT_CONTENT_LEN ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_OUT_CONTENT_LEN ); return( 0 ); } #endif /* MBEDTLS_SSL_OUT_CONTENT_LEN */ @@ -2383,7 +2384,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_DTLS_MAX_BUFFERING) if( strcmp( "MBEDTLS_SSL_DTLS_MAX_BUFFERING", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DTLS_MAX_BUFFERING ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DTLS_MAX_BUFFERING ); return( 0 ); } #endif /* MBEDTLS_SSL_DTLS_MAX_BUFFERING */ @@ -2391,7 +2392,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME) if( strcmp( "MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME ); return( 0 ); } #endif /* MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME */ @@ -2399,7 +2400,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PSK_MAX_LEN) if( strcmp( "MBEDTLS_PSK_MAX_LEN", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PSK_MAX_LEN ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PSK_MAX_LEN ); return( 0 ); } #endif /* MBEDTLS_PSK_MAX_LEN */ @@ -2407,7 +2408,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_COOKIE_TIMEOUT) if( strcmp( "MBEDTLS_SSL_COOKIE_TIMEOUT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_COOKIE_TIMEOUT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_COOKIE_TIMEOUT ); return( 0 ); } #endif /* MBEDTLS_SSL_COOKIE_TIMEOUT */ @@ -2415,7 +2416,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_SSL_CIPHERSUITES) if( strcmp( "MBEDTLS_SSL_CIPHERSUITES", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CIPHERSUITES ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CIPHERSUITES ); return( 0 ); } #endif /* MBEDTLS_SSL_CIPHERSUITES */ @@ -2423,7 +2424,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_X509_MAX_INTERMEDIATE_CA) if( strcmp( "MBEDTLS_X509_MAX_INTERMEDIATE_CA", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_X509_MAX_INTERMEDIATE_CA ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_X509_MAX_INTERMEDIATE_CA ); return( 0 ); } #endif /* MBEDTLS_X509_MAX_INTERMEDIATE_CA */ @@ -2431,7 +2432,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_X509_MAX_FILE_PATH_LEN) if( strcmp( "MBEDTLS_X509_MAX_FILE_PATH_LEN", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_X509_MAX_FILE_PATH_LEN ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_X509_MAX_FILE_PATH_LEN ); return( 0 ); } #endif /* MBEDTLS_X509_MAX_FILE_PATH_LEN */ @@ -2439,7 +2440,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES) if( strcmp( "MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES ); return( 0 ); } #endif /* MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES */ @@ -2447,7 +2448,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE) if( strcmp( "MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE ); return( 0 ); } #endif /* MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE */ @@ -2455,7 +2456,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_ZEROIZE_ALT) if( strcmp( "MBEDTLS_PLATFORM_ZEROIZE_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_ZEROIZE_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_ZEROIZE_ALT ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_ZEROIZE_ALT */ @@ -2463,7 +2464,7 @@ int query_config( const char *config ) #if defined(MBEDTLS_PLATFORM_GMTIME_R_ALT) if( strcmp( "MBEDTLS_PLATFORM_GMTIME_R_ALT", config ) == 0 ) { - mbedtls_printf( "%s", MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_GMTIME_R_ALT ) ); + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_GMTIME_R_ALT ); return( 0 ); } #endif /* MBEDTLS_PLATFORM_GMTIME_R_ALT */ diff --git a/scripts/data_files/query_config.fmt b/scripts/data_files/query_config.fmt index 7ea4b5ab4..0e4659aae 100644 --- a/scripts/data_files/query_config.fmt +++ b/scripts/data_files/query_config.fmt @@ -106,13 +106,14 @@ #include -/* Helper macros to convert a macro or its expansion into a string */ -#if defined(_MSC_VER) -#define MACRO_EXPANSION_TO_STR(macro) strlen( #macro ) > 0 ? #macro "\n" : "" -#else +/* + * Helper macros to convert a macro or its expansion into a string + * WARNING: This does not work for expanding function-like macros. However, + * Mbed TLS does not currently have configuration options used in this fashion. + */ #define MACRO_EXPANSION_TO_STR(macro) MACRO_NAME_TO_STR(macro) -#define MACRO_NAME_TO_STR(macro) strlen( #macro ) > 0 ? #macro "\n" : "" -#endif /* _MSC_VER */ +#define MACRO_NAME_TO_STR(macro) \ + mbedtls_printf( "%s", strlen( #macro "" ) > 0 ? #macro "\n" : "" ) int query_config( const char *config ) { diff --git a/scripts/generate_query_config.pl b/scripts/generate_query_config.pl index 492780d99..747001a03 100755 --- a/scripts/generate_query_config.pl +++ b/scripts/generate_query_config.pl @@ -39,7 +39,7 @@ while (my $line = ) { $config_check .= "#if defined($name)\n"; $config_check .= " if( strcmp( \"$name\", config ) == 0 )\n"; $config_check .= " {\n"; - $config_check .= " mbedtls_printf( \"%s\", MACRO_EXPANSION_TO_STR( $name ) );\n"; + $config_check .= " MACRO_EXPANSION_TO_STR( $name );\n"; $config_check .= " return( 0 );\n"; $config_check .= " }\n"; $config_check .= "#endif /* $name */\n"; From ef672f0319aa988eea511eb4f2e47e77c3405111 Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Thu, 3 Jan 2019 20:16:43 +0000 Subject: [PATCH 25/61] Exclude macros from query_config.c generation --- programs/ssl/query_config.c | 8 -------- scripts/generate_query_config.pl | 12 ++++++++++++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/programs/ssl/query_config.c b/programs/ssl/query_config.c index c3cf1f857..af518e8ba 100644 --- a/programs/ssl/query_config.c +++ b/programs/ssl/query_config.c @@ -2413,14 +2413,6 @@ int query_config( const char *config ) } #endif /* MBEDTLS_SSL_COOKIE_TIMEOUT */ -#if defined(MBEDTLS_SSL_CIPHERSUITES) - if( strcmp( "MBEDTLS_SSL_CIPHERSUITES", config ) == 0 ) - { - MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_CIPHERSUITES ); - return( 0 ); - } -#endif /* MBEDTLS_SSL_CIPHERSUITES */ - #if defined(MBEDTLS_X509_MAX_INTERMEDIATE_CA) if( strcmp( "MBEDTLS_X509_MAX_INTERMEDIATE_CA", config ) == 0 ) { diff --git a/scripts/generate_query_config.pl b/scripts/generate_query_config.pl index 747001a03..651f0d4d7 100755 --- a/scripts/generate_query_config.pl +++ b/scripts/generate_query_config.pl @@ -23,6 +23,15 @@ my $config_file = "./include/mbedtls/config.h"; my $query_config_format_file = "./scripts/data_files/query_config.fmt"; my $query_config_file = "./programs/ssl/query_config.c"; +# Excluded macros from the generated query_config.c. For example, macros that +# have commas or function-like macros cannot be transformed into strings easily +# using the preprocessor, so they should be excluded or the preprocessor will +# throw errors. +my @excluded = qw( +MBEDTLS_SSL_CIPHERSUITES +); +my $excluded_re = join '|', @excluded; + open(CONFIG_FILE, "$config_file") or die "Opening config file '$config_file': $!"; # This variable will contain the string to replace in the CHECK_CONFIG of the @@ -36,6 +45,9 @@ while (my $line = ) { # Skip over the macro that prevents multiple inclusion next if "MBEDTLS_CONFIG_H" eq $name; + # Skip over the macro if it is in the ecluded list + next if $name =~ /$excluded_re/; + $config_check .= "#if defined($name)\n"; $config_check .= " if( strcmp( \"$name\", config ) == 0 )\n"; $config_check .= " {\n"; From 8645f733cfb0f8dff9d4bab03b6b29fab40415b8 Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Tue, 8 Jan 2019 20:02:48 +0000 Subject: [PATCH 26/61] Update query_config.c with new macros --- programs/ssl/query_config.c | 24 ++++++++++++++++++++++++ scripts/generate_query_config.pl | 1 + 2 files changed, 25 insertions(+) diff --git a/programs/ssl/query_config.c b/programs/ssl/query_config.c index af518e8ba..b2b1f1687 100644 --- a/programs/ssl/query_config.c +++ b/programs/ssl/query_config.c @@ -253,6 +253,14 @@ int query_config( const char *config ) } #endif /* MBEDTLS_DEPRECATED_REMOVED */ +#if defined(MBEDTLS_CHECK_PARAMS) + if( strcmp( "MBEDTLS_CHECK_PARAMS", config ) == 0 ) + { + MACRO_EXPANSION_TO_STR( MBEDTLS_CHECK_PARAMS ); + return( 0 ); + } +#endif /* MBEDTLS_CHECK_PARAMS */ + #if defined(MBEDTLS_TIMING_ALT) if( strcmp( "MBEDTLS_TIMING_ALT", config ) == 0 ) { @@ -933,6 +941,14 @@ int query_config( const char *config ) } #endif /* MBEDTLS_ECP_NIST_OPTIM */ +#if defined(MBEDTLS_ECP_RESTARTABLE) + if( strcmp( "MBEDTLS_ECP_RESTARTABLE", config ) == 0 ) + { + MACRO_EXPANSION_TO_STR( MBEDTLS_ECP_RESTARTABLE ); + return( 0 ); + } +#endif /* MBEDTLS_ECP_RESTARTABLE */ + #if defined(MBEDTLS_ECDSA_DETERMINISTIC) if( strcmp( "MBEDTLS_ECDSA_DETERMINISTIC", config ) == 0 ) { @@ -2069,6 +2085,14 @@ int query_config( const char *config ) } #endif /* MBEDTLS_CTR_DRBG_MAX_SEED_INPUT */ +#if defined(MBEDTLS_CTR_DRBG_USE_128_BIT_KEY) + if( strcmp( "MBEDTLS_CTR_DRBG_USE_128_BIT_KEY", config ) == 0 ) + { + MACRO_EXPANSION_TO_STR( MBEDTLS_CTR_DRBG_USE_128_BIT_KEY ); + return( 0 ); + } +#endif /* MBEDTLS_CTR_DRBG_USE_128_BIT_KEY */ + #if defined(MBEDTLS_HMAC_DRBG_RESEED_INTERVAL) if( strcmp( "MBEDTLS_HMAC_DRBG_RESEED_INTERVAL", config ) == 0 ) { diff --git a/scripts/generate_query_config.pl b/scripts/generate_query_config.pl index 651f0d4d7..f15e03a35 100755 --- a/scripts/generate_query_config.pl +++ b/scripts/generate_query_config.pl @@ -29,6 +29,7 @@ my $query_config_file = "./programs/ssl/query_config.c"; # throw errors. my @excluded = qw( MBEDTLS_SSL_CIPHERSUITES +MBEDTLS_PARAM_FAILED ); my $excluded_re = join '|', @excluded; From bc432b8232f7c7be45cbe659ba9451586af7a84a Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Tue, 8 Jan 2019 20:05:18 +0000 Subject: [PATCH 27/61] Use \r instead of 0xD in generate_visualc_files.pl --- scripts/generate_visualc_files.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/generate_visualc_files.pl b/scripts/generate_visualc_files.pl index b2990de5a..991397674 100755 --- a/scripts/generate_visualc_files.pl +++ b/scripts/generate_visualc_files.pl @@ -93,10 +93,10 @@ sub gen_app { $path =~ s!/!\\!g; (my $appname = $path) =~ s/.*\\//; - my $srcs = "\n "; + my $srcs = "\n \r"; if( $appname eq "ssl_client2" or $appname eq "ssl_server2" or $appname eq "query_compile_time_config" ) { - $srcs .= "\n "; + $srcs .= "\n \r"; } my $content = $template; From e7856bfc6d3b27f616f996059d98ff73909abec5 Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Tue, 15 Jan 2019 20:08:12 +0000 Subject: [PATCH 28/61] Suppress visual studio preprocessor warnings on query_config.c --- programs/ssl/query_config.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/programs/ssl/query_config.c b/programs/ssl/query_config.c index b2b1f1687..afbb09cc2 100644 --- a/programs/ssl/query_config.c +++ b/programs/ssl/query_config.c @@ -115,6 +115,19 @@ #define MACRO_NAME_TO_STR(macro) \ mbedtls_printf( "%s", strlen( #macro "" ) > 0 ? #macro "\n" : "" ) +#if defined(_MSC_VER) +/* + * Visual Studio throws the warning 4003 because many Mbed TLS feature macros + * are defined empty. This means that from the preprocessor's point of view + * the macro MBEDTLS_EXPANSION_TO_STR is being invoked without arguments as + * some macros expand to nothing. We suppress that specific warning to get a + * clean build and to ensure that tests treating warnings as errors do not + * fail. + */ +#pragma warning(push) +#pragma warning(disable:4003) +#endif /* _MSC_VER */ + int query_config( const char *config ) { #if defined(MBEDTLS_HAVE_ASM) @@ -2488,3 +2501,7 @@ int query_config( const char *config ) /* If the symbol is not found, return an error */ return( 1 ); } + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ From 17c53c5c1e7fb48eee9e6db9da4bf2ffc8eea33b Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Thu, 24 Jan 2019 09:55:14 +0000 Subject: [PATCH 29/61] Fix check-generated-files.sh failure with query_config --- scripts/data_files/query_config.fmt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/data_files/query_config.fmt b/scripts/data_files/query_config.fmt index 0e4659aae..064da4c38 100644 --- a/scripts/data_files/query_config.fmt +++ b/scripts/data_files/query_config.fmt @@ -115,8 +115,25 @@ #define MACRO_NAME_TO_STR(macro) \ mbedtls_printf( "%s", strlen( #macro "" ) > 0 ? #macro "\n" : "" ) +#if defined(_MSC_VER) +/* + * Visual Studio throws the warning 4003 because many Mbed TLS feature macros + * are defined empty. This means that from the preprocessor's point of view + * the macro MBEDTLS_EXPANSION_TO_STR is being invoked without arguments as + * some macros expand to nothing. We suppress that specific warning to get a + * clean build and to ensure that tests treating warnings as errors do not + * fail. + */ +#pragma warning(push) +#pragma warning(disable:4003) +#endif /* _MSC_VER */ + int query_config( const char *config ) { CHECK_CONFIG /* If the symbol is not found, return an error */ return( 1 ); } + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ From 1a65dcd44fe2f45a085f35425138eeed289f94c2 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Thu, 31 Jan 2019 08:57:44 +0000 Subject: [PATCH 30/61] Add a new X.509 API call for copy-less parsing of CRTs Context: The existing API `mbedtls_x509_parse_crt_der()` for parsing DER encoded X.509 CRTs unconditionally makes creates a copy of the input buffer in RAM. While this comes at the benefit of easy use, -- specifically: allowing the user to free or re-use the input buffer right after the call -- it creates a significant memory overhead, as the CRT is duplicated in memory (at least temporarily). This might not be tolerable a resource constrained device. As a remedy, this commit adds a new X.509 API call `mbedtls_x509_parse_crt_der_nocopy()` which has the same signature as `mbedtls_x509_parse_crt_der()` and almost the same semantics, with one difference: The input buffer must persist and be unmodified for the lifetime of the established instance of `mbedtls_x509_crt`, that is, until `mbedtls_x509_crt_free()` is called. --- include/mbedtls/x509_crt.h | 58 ++++++++++++++++++++++++++---- library/x509_crt.c | 73 ++++++++++++++++++++++++-------------- 2 files changed, 98 insertions(+), 33 deletions(-) diff --git a/include/mbedtls/x509_crt.h b/include/mbedtls/x509_crt.h index 3dd592248..72c39019b 100644 --- a/include/mbedtls/x509_crt.h +++ b/include/mbedtls/x509_crt.h @@ -52,6 +52,8 @@ extern "C" { */ typedef struct mbedtls_x509_crt { + int own_buffer; /**< Indicates if \c raw is owned + * by the structure or not. */ mbedtls_x509_buf raw; /**< The raw certificate data (DER). */ mbedtls_x509_buf tbs; /**< The raw certificate body (DER). The part that is To Be Signed. */ @@ -220,16 +222,58 @@ extern const mbedtls_x509_crt_profile mbedtls_x509_crt_profile_suiteb; /** * \brief Parse a single DER formatted certificate and add it - * to the chained list. + * to the end of the provided chained list. * - * \param chain points to the start of the chain - * \param buf buffer holding the certificate DER data - * \param buflen size of the buffer + * \param chain The pointer to the start of the CRT chain to attach to. + * When parsing the first CRT in a chain, this should point + * to an instance of ::mbedtls_x509_crt initialized through + * mbedtls_x509_crt_init(). + * \param buf The buffer holding the DER encoded certificate. + * \param buflen The size in Bytes of \p buf. * - * \return 0 if successful, or a specific X509 or PEM error code + * \note This function makes an internal copy of the CRT buffer + * \p buf. In particular, \p buf may be destroyed or reused + * after this call returns. To avoid duplicating the CRT + * buffer (at the cost of stricter lifetime constraints), + * use mbedtls_x509_crt_parse_der_nocopy() instead. + * + * \return \c 0 if successful. + * \return A negative error code on failure. */ -int mbedtls_x509_crt_parse_der( mbedtls_x509_crt *chain, const unsigned char *buf, - size_t buflen ); +int mbedtls_x509_crt_parse_der( mbedtls_x509_crt *chain, + const unsigned char *buf, + size_t buflen ); + +/** + * \brief Parse a single DER formatted certificate and add it + * to the end of the provided chained list. This is a + * variant of mbedtls_x509_crt_parse_der() which takes + * temporary ownership of the CRT buffer until the CRT + * is destroyed. + * + * \param chain The pointer to the start of the CRT chain to attach to. + * When parsing the first CRT in a chain, this should point + * to an instance of ::mbedtls_x509_crt initialized through + * mbedtls_x509_crt_init(). + * \param buf The address of the readable buffer holding the DER encoded + * certificate to use. On success, this buffer must be + * retained and not be changed for the liftetime of the + * CRT chain \p chain, that is, until \p chain is destroyed + * through a call to mbedtls_x509_crt_free(). + * \param buflen The size in Bytes of \p buf. + * + * \note This call is functionally equivalent to + * mbedtls_x509_crt_parse_der(), but it avoids creating a + * copy of the input buffer at the cost of stronger lifetime + * constraints. This is useful in constrained environments + * where duplication of the CRT cannot be tolerated. + * + * \return \c 0 if successful. + * \return A negative error code on failure. + */ +int mbedtls_x509_crt_parse_der_nocopy( mbedtls_x509_crt *chain, + const unsigned char *buf, + size_t buflen ); /** * \brief Parse one DER-encoded or one or more concatenated PEM-encoded diff --git a/library/x509_crt.c b/library/x509_crt.c index 32aca012b..2c1170323 100644 --- a/library/x509_crt.c +++ b/library/x509_crt.c @@ -829,8 +829,10 @@ static int x509_get_crt_ext( unsigned char **p, /* * Parse and fill a single X.509 certificate in DER format */ -static int x509_crt_parse_der_core( mbedtls_x509_crt *crt, const unsigned char *buf, - size_t buflen ) +static int x509_crt_parse_der_core( mbedtls_x509_crt *crt, + const unsigned char *buf, + size_t buflen, + int make_copy ) { int ret; size_t len; @@ -847,7 +849,7 @@ static int x509_crt_parse_der_core( mbedtls_x509_crt *crt, const unsigned char * if( crt == NULL || buf == NULL ) return( MBEDTLS_ERR_X509_BAD_INPUT_DATA ); - // Use the original buffer until we figure out actual length + /* Use the original buffer until we figure out actual length. */ p = (unsigned char*) buf; len = buflen; end = p + len; @@ -865,25 +867,26 @@ static int x509_crt_parse_der_core( mbedtls_x509_crt *crt, const unsigned char * return( MBEDTLS_ERR_X509_INVALID_FORMAT ); } - if( len > (size_t) ( end - p ) ) - { - mbedtls_x509_crt_free( crt ); - return( MBEDTLS_ERR_X509_INVALID_FORMAT + - MBEDTLS_ERR_ASN1_LENGTH_MISMATCH ); - } - crt_end = p + len; - - // Create and populate a new buffer for the raw field - crt->raw.len = crt_end - buf; - crt->raw.p = p = mbedtls_calloc( 1, crt->raw.len ); - if( p == NULL ) - return( MBEDTLS_ERR_X509_ALLOC_FAILED ); - - memcpy( p, buf, crt->raw.len ); - - // Direct pointers to the new buffer - p += crt->raw.len - len; end = crt_end = p + len; + crt->raw.len = crt_end - buf; + if( make_copy != 0 ) + { + /* Create and populate a new buffer for the raw field. */ + crt->raw.p = p = mbedtls_calloc( 1, crt->raw.len ); + if( crt->raw.p == NULL ) + return( MBEDTLS_ERR_X509_ALLOC_FAILED ); + + memcpy( crt->raw.p, buf, crt->raw.len ); + crt->own_buffer = 1; + + p += crt->raw.len - len; + end = crt_end = p + len; + } + else + { + crt->raw.p = (unsigned char*) buf; + crt->own_buffer = 0; + } /* * TBSCertificate ::= SEQUENCE { @@ -1086,8 +1089,10 @@ static int x509_crt_parse_der_core( mbedtls_x509_crt *crt, const unsigned char * * Parse one X.509 certificate in DER format from a buffer and add them to a * chained list */ -int mbedtls_x509_crt_parse_der( mbedtls_x509_crt *chain, const unsigned char *buf, - size_t buflen ) +static int mbedtls_x509_crt_parse_der_internal( mbedtls_x509_crt *chain, + const unsigned char *buf, + size_t buflen, + int make_copy ) { int ret; mbedtls_x509_crt *crt = chain, *prev = NULL; @@ -1119,7 +1124,7 @@ int mbedtls_x509_crt_parse_der( mbedtls_x509_crt *chain, const unsigned char *bu crt = crt->next; } - if( ( ret = x509_crt_parse_der_core( crt, buf, buflen ) ) != 0 ) + if( ( ret = x509_crt_parse_der_core( crt, buf, buflen, make_copy ) ) != 0 ) { if( prev ) prev->next = NULL; @@ -1133,11 +1138,27 @@ int mbedtls_x509_crt_parse_der( mbedtls_x509_crt *chain, const unsigned char *bu return( 0 ); } +int mbedtls_x509_crt_parse_der_nocopy( mbedtls_x509_crt *chain, + const unsigned char *buf, + size_t buflen ) +{ + return( mbedtls_x509_crt_parse_der_internal( chain, buf, buflen, 0 ) ); +} + +int mbedtls_x509_crt_parse_der( mbedtls_x509_crt *chain, + const unsigned char *buf, + size_t buflen ) +{ + return( mbedtls_x509_crt_parse_der_internal( chain, buf, buflen, 1 ) ); +} + /* * Parse one or more PEM certificates from a buffer and add them to the chained * list */ -int mbedtls_x509_crt_parse( mbedtls_x509_crt *chain, const unsigned char *buf, size_t buflen ) +int mbedtls_x509_crt_parse( mbedtls_x509_crt *chain, + const unsigned char *buf, + size_t buflen ) { #if defined(MBEDTLS_PEM_PARSE_C) int success = 0, first_error = 0, total_failed = 0; @@ -2675,7 +2696,7 @@ void mbedtls_x509_crt_free( mbedtls_x509_crt *crt ) mbedtls_free( seq_prv ); } - if( cert_cur->raw.p != NULL ) + if( cert_cur->raw.p != NULL && cert_cur->own_buffer ) { mbedtls_platform_zeroize( cert_cur->raw.p, cert_cur->raw.len ); mbedtls_free( cert_cur->raw.p ); From 462c3e5210aa89d931341576541bd58f9ef7bba0 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Thu, 31 Jan 2019 10:55:42 +0000 Subject: [PATCH 31/61] Add test for mbedtls_x509_parse_file() with DER encoded CRT --- tests/data_files/Makefile | 8 ++++++-- tests/data_files/server1.der | Bin 0 -> 835 bytes tests/data_files/server2.der | Bin 0 -> 827 bytes tests/data_files/test-ca.der | Bin 0 -> 837 bytes tests/suites/test_suite_x509parse.data | 12 ++++++++++++ 5 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 tests/data_files/server1.der create mode 100644 tests/data_files/server2.der create mode 100644 tests/data_files/test-ca.der diff --git a/tests/data_files/Makefile b/tests/data_files/Makefile index 2ed32e689..ff8947686 100644 --- a/tests/data_files/Makefile +++ b/tests/data_files/Makefile @@ -45,7 +45,9 @@ all_intermediate += test-ca.req.sha256 test-ca.crt: $(test_ca_key_file_rsa) test-ca.req.sha256 $(MBEDTLS_CERT_WRITE) is_ca=1 serial=3 request_file=test-ca.req.sha256 selfsign=1 issuer_name="C=NL,O=PolarSSL,CN=PolarSSL Test CA" issuer_key=$(test_ca_key_file_rsa) issuer_pwd=$(test_ca_pwd_rsa) not_before=20110212144400 not_after=20210212144400 md=SHA1 version=3 output_file=$@ -all_final += test-ca.crt +test-ca.der: test-ca.crt + $(OPENSSL) x509 -inform PEM -in $< -outform DER -out $@ +all_final += test-ca.crt test-ca.der test-ca-sha1.crt: $(test_ca_key_file_rsa) test-ca.req.sha256 $(MBEDTLS_CERT_WRITE) is_ca=1 serial=3 request_file=test-ca.req.sha256 selfsign=1 issuer_name="C=NL,O=PolarSSL,CN=PolarSSL Test CA" issuer_key=$(test_ca_key_file_rsa) issuer_pwd=$(test_ca_pwd_rsa) not_before=20110212144400 not_after=20210212144400 md=SHA1 version=3 output_file=$@ @@ -873,7 +875,9 @@ server1_all: server1.crt server1.noauthid.crt server1.crt.openssl server1.v1.crt server2.crt: server2.req.sha256 $(MBEDTLS_CERT_WRITE) request_file=server2.req.sha256 serial=2 issuer_crt=$(test_ca_crt) issuer_key=$(test_ca_key_file_rsa) issuer_pwd=$(test_ca_pwd_rsa) not_before=20110212144406 not_after=20210212144406 md=SHA1 version=3 output_file=$@ -all_final += server2.crt +server2.der: server2.crt + $(OPENSSL) x509 -inform PEM -in $< -outform DER -out $@ +all_final += server2.crt server2.der server2-sha256.crt: server2.req.sha256 $(MBEDTLS_CERT_WRITE) request_file=server2.req.sha256 serial=2 issuer_crt=$(test_ca_crt) issuer_key=$(test_ca_key_file_rsa) issuer_pwd=$(test_ca_pwd_rsa) not_before=20110212144406 not_after=20210212144406 md=SHA256 version=3 output_file=$@ diff --git a/tests/data_files/server1.der b/tests/data_files/server1.der new file mode 100644 index 0000000000000000000000000000000000000000..fcf45cd7cc3886757acfafa089118900184195e4 GIT binary patch literal 835 zcmXqLVzxJEVp3ng%*4pV#K>sC%f_kI=F#?@mywZ`mBGN;klTQhjX9KsO_<5g$57CK zAH?C};RwjjNh}Hu_A!(+5C;h{^9aC%6hcyqOB9?P4dldm4Gj&942=v;OiT>SqQrTP zkhumn1PzxmkboF22sb=9wWut$NWsvciBSpJwT!F`%uS5^3_x)%rY1&4hLue6whmcW zLxa2jn!RgE)e}vO>)gNNh3kad?>fYSE`M|maGxd=nbMy9SNnn6&*FV|&rfK`77Q9{jMpRO6g)xWwK~|@ge|-*bxqp{U-d7;d zA-!0b-{D7YqiQ_Y#^7THb)uGQen!2kpEPe7YxHyB>8)FpC*8cF!giHYwX>A{?lP%< zdrrxHYg2VnUQeBU=bvMo__A9$(V1tMc8TbSsm$@ZbN0gbp!DL8x(k&5)_pNNrCV^S zlbhwX-ZKA!ym{yLMsz+3j+~blH7WH`hds{}$;Ee{zL+~z_^syc)dfO#qE2OtuMTPo z*~rAq$iTSR*T5SbfwICZOa=@FvcTY!FH%ccPe~-etutVQ*+wqDnp6m_JcfzA8T@! z2_4#?pxHEGwy}oaoy!&9XSv6&+kN)tBZ-cE+n*oVexg{pW2@8JB_Rtuw_Njkbn3>( zwTEW^|4}IR@x>9_+>%qXcl|gs)nv~rr=WGNJp6ong3V9&{W4z|@u*t-)+TEX&O+Zs z<;vTH)_U*$ac;Ll%;nGDGb%sa5T9cm5d2X3+f|2et~z@4x6W7p4 literal 0 HcmV?d00001 diff --git a/tests/data_files/server2.der b/tests/data_files/server2.der new file mode 100644 index 0000000000000000000000000000000000000000..ec03190e12610688838c1ff3f27b0fb26632885d GIT binary patch literal 827 zcmXqLVm3EuVv=9L%*4n9LZ#K0^{oYx4M zYhXgqa3KQ$h~b<$`N@en8TrK}22G4g$gX5$WngY%%5h)*oCMkXBRVcEPp4LJ#Bf=mI?25i>mBYX8qY_vPR`=`2)3- zo;e#dY8T#m)${D6%(OlK4zdJoHoLO;*TaovHzpiR+>#b#wn!~_)#{Qs_FBoN+gdl| z7u@8P(e+IG9<5sJ_JX_1Ka*!G!-R*ongr5n*M(?zr&dl}_$cx4SqD#!cNsh%yW1|g z?Z2>Nl_0ZReb@>qITs0j{?_hW-7ayDB#tHNA5ZK36?>!hvwEi{6u~JpTQa5Tn6# zCT2zk#>Kt{-r$In6=q>FU@(vc2BRz=ix`W@Qq~tKJMP?1;13Y;O<0k#-nZL%vVlBE zTA4+{K&(MzOVpF4o9|r;`nL1xvZ?&9?e-l1`yV;Lfyn|G;6OWyxxJ2_UU2VYvP>C^ zwlMF37Qv(aR?CmhF|8`!p&-)qF66_f4MC?X&PB5O2WI}etpAepdF!MbyEeW)S{9qA z`?788J*}Vi!5U6&&Be|SSmN0yh@{TX6R6q~A*poewPjJ@r0ZK`OZ6{XX)`{*9kA}v z$1A?kHoG0QwU#{cVtSe&qBBQ+*%>x()lR=@21;{cB76_ux{wzj*OU77rnu>{2Wt7#C=BTy4jaQ zS-KblwmeR%$PpA>swH^PQ)c!Nfz*Wdn{t_ve*M|65B|%3lw2`2?}6_1<>o5@#6dhp literal 0 HcmV?d00001 diff --git a/tests/data_files/test-ca.der b/tests/data_files/test-ca.der new file mode 100644 index 0000000000000000000000000000000000000000..039fb9e43004e622bd1404116f68208800005c6d GIT binary patch literal 837 zcmXqLVs&G%f_kI=F#?@mywZ`mBGN;klTQhjX9KsO_<5g$57CK zAH?C};RwjjNh}Hu_A!(+5C;h{^9aC%6hcyqOB9?P4dldm4Gj&942=v;OiT<6qQrTP zkhzo@-o&Vc>{v!t2IeM4eg=akMlPl%Mn;AM_s#!^?|v|Cu6^6RX-2g!OT`wPRs1;f z%9~fGYa}8#rYwCk`)K!lDY=;zGu!2=5A<5zw}>sMV81-?=HwSUivo|HTWk=t^3!vN z0+G`$i;B1pJ$3kL_jDQG=AUo8k`L_AWGI;vZoOhD%Y?#@dz)|CUt9XfMyvn5dcxsj z^H1-3lTf?;S&Pv=|KAa6O3cw$wp{)F_3<>lf&)+V_Wsd(_sB8yfQeqMN>S!%_l+VB z&9&)Y+P)dC{#dzW(^fs9pDp4alJeExvi&hv5v`G zd4cFBi_{d(S3G%r(&7sWPi&rja`nr@pU$^W>u+E(nm02df6-MYW=00a#Q_F>20Xy{ zkrifPHDG3B{BIx&;_TP!7QC4hV&D%ba$=(yp zSf5T{U|xOMYODB`ORhngYUdu$ke${2W5Fa@4<>WHgK<+21^?T)$E3-`#B5?uM^*ZC z6Nm2K9(kA78#MN@`c78-w( Date: Thu, 31 Jan 2019 09:15:53 +0000 Subject: [PATCH 32/61] Modify existing X.509 test for also test new copyless API The existing test `x509parse_crt()` for X.509 CRT parsing so far used the generic parsing API `mbedtls_x509_crt_parse()` capable of parsing both PEM encoded and DER encoded certficates, but was actually only used with DER encoded input data. Moreover, as the purpose of the test is the testing of the core DER X.509 parsing functionality, not the PEM vs. DER dispatch (which is now already tested in the various `x509_crt_info()` tests), the call can be replaced with a direct call to `mbedtls_x509_parse_crt_der()`. This commit does that, and further adds to the test an analogous call to the new API `mbedtls_x509_parse_crt_der_nocopy()` to test copyless parsing of X.509 certificates. --- tests/suites/test_suite_x509parse.function | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/suites/test_suite_x509parse.function b/tests/suites/test_suite_x509parse.function index 552c494b0..a921310c6 100644 --- a/tests/suites/test_suite_x509parse.function +++ b/tests/suites/test_suite_x509parse.function @@ -505,8 +505,22 @@ void x509parse_crt( data_t * buf, char * result_str, int result ) mbedtls_x509_crt_init( &crt ); memset( output, 0, 2000 ); + TEST_ASSERT( mbedtls_x509_crt_parse_der( &crt, buf->x, buf->len ) == ( result ) ); + if( ( result ) == 0 ) + { + res = mbedtls_x509_crt_info( (char *) output, 2000, "", &crt ); - TEST_ASSERT( mbedtls_x509_crt_parse( &crt, buf->x, buf->len ) == ( result ) ); + TEST_ASSERT( res != -1 ); + TEST_ASSERT( res != -2 ); + + TEST_ASSERT( strcmp( (char *) output, result_str ) == 0 ); + } + + mbedtls_x509_crt_free( &crt ); + mbedtls_x509_crt_init( &crt ); + memset( output, 0, 2000 ); + + TEST_ASSERT( mbedtls_x509_crt_parse_der_nocopy( &crt, buf->x, buf->len ) == ( result ) ); if( ( result ) == 0 ) { res = mbedtls_x509_crt_info( (char *) output, 2000, "", &crt ); From ac4172c5bb619c5b96699294012d7629acaf38b3 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Thu, 31 Jan 2019 09:27:04 +0000 Subject: [PATCH 33/61] Adapt ChangeLog --- ChangeLog | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5c2fbbbd4..6c3e4763e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,16 @@ mbed TLS ChangeLog (Sorted per branch, date) = mbed TLS 2.x.x branch released xxxx-xx-xx +Features + * Add a new X.509 API call `mbedtls_x509_parse_der_nocopy()` + which allows copy-less parsing of DER encoded X.509 CRTs, + at the cost of additional lifetime constraints on the input + buffer, but at the benefit of reduced RAM consumption. + +API Changes + * Add a new X.509 API call `mbedtls_x509_parse_der_nocopy()`. + See the Features section for more information. + Bugfix * Fix a compilation issue with mbedtls_ecp_restart_ctx not being defined when MBEDTLS_ECP_ALT is defined. Reported by jwhui. Fixes #2242. From b2964cbe14c23d5d22d7bee024523a888955c2fe Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Wed, 30 Jan 2019 14:46:35 +0000 Subject: [PATCH 34/61] SSL/TLS client: Remove old session ticket on renegotiation Context: During a handshake, the SSL/TLS handshake logic constructs an instance of ::mbedtls_ssl_session representing the SSL session being established. This structure contains information such as the session's master secret, the peer certificate, or the session ticket issues by the server (if applicable). During a renegotiation, the new session is constructed aside the existing one and destroys and replaces the latter only when the renegotiation is complete. While conceptually clear, this means that during the renegotiation, large pieces of information such as the peer's CRT or the session ticket exist twice in memory, even though the original versions are removed eventually. This commit starts removing this memory inefficiency by freeing the old session's SessionTicket before the one for the new session is allocated. --- library/ssl_cli.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/library/ssl_cli.c b/library/ssl_cli.c index afced7a99..5655d3aab 100644 --- a/library/ssl_cli.c +++ b/library/ssl_cli.c @@ -3463,6 +3463,15 @@ static int ssl_parse_new_session_ticket( mbedtls_ssl_context *ssl ) if( ticket_len == 0 ) return( 0 ); + if( ssl->session != NULL && ssl->session->ticket != NULL ) + { + mbedtls_platform_zeroize( ssl->session->ticket, + ssl->session->ticket_len ); + mbedtls_free( ssl->session->ticket ); + ssl->session->ticket = NULL; + ssl->session->ticket_len = 0; + } + mbedtls_platform_zeroize( ssl->session_negotiate->ticket, ssl->session_negotiate->ticket_len ); mbedtls_free( ssl->session_negotiate->ticket ); From def9bdc152779cc1bff084f40f5bad74523c61bb Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Wed, 30 Jan 2019 14:46:46 +0000 Subject: [PATCH 35/61] Don't store the peer CRT chain twice during renegotiation Context: During a handshake, the SSL/TLS handshake logic constructs an instance of ::mbedtls_ssl_session representing the SSL session being established. This structure contains information such as the session's master secret, the peer certificate, or the session ticket issues by the server (if applicable). During a renegotiation, the new session is constructed aside the existing one and destroys and replaces the latter only when the renegotiation is complete. While conceptually clear, this means that during the renegotiation, large pieces of information such as the peer's CRT or the session ticket exist twice in memory, even though the original versions are removed eventually. This commit removes the simultaneous presence of two peer CRT chains in memory during renegotiation, in the following way: - Unlike in the case of SessionTickets handled in the previous commit, we cannot simply free the peer's CRT chain from the previous handshake before parsing the new one, as we need to verify that the peer's end-CRT hasn't changed to mitigate the 'Triple Handshake Attack'. - Instead, we perform a binary comparison of the original peer end-CRT with the one presented during renegotiation, and if it succeeds, we avoid re-parsing CRT by moving the corresponding CRT pointer from the old to the new session structure. - The remaining CRTs in the peer's chain are not affected by the triple handshake attack protection, and for them we may employ the canonical approach of freeing them before parsing the remainder of the new chain. Note that this commit intends to not change any observable behavior of the stack. In particular: - The peer's CRT chain is still verified during renegotiation. - The tail of the peer's CRT chain may change during renegotiation. --- library/ssl_tls.c | 160 +++++++++++++++++++++++++++------------------- 1 file changed, 96 insertions(+), 64 deletions(-) diff --git a/library/ssl_tls.c b/library/ssl_tls.c index 8710a5076..4bbe0d410 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -5435,6 +5435,21 @@ write_msg: return( ret ); } +static int ssl_check_peer_crt_unchanged( mbedtls_ssl_context *ssl, + unsigned char *crt_buf, + size_t crt_buf_len ) +{ + mbedtls_x509_crt const * const peer_crt = ssl->session->peer_cert; + + if( peer_crt == NULL ) + return( -1 ); + + if( peer_crt->raw.len != crt_buf_len ) + return( -1 ); + + return( memcmp( peer_crt->raw.p, crt_buf, crt_buf_len) ); +} + /* * Once the certificate message is read, parse it into a cert chain and * perform basic checks, but leave actual verification to the caller @@ -5525,35 +5540,29 @@ static int ssl_parse_certificate_chain( mbedtls_ssl_context *ssl ) return( MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE ); } + /* Make &ssl->in_msg[i] point to the beginning of the CRT chain. */ + i += 3; + /* In case we tried to reuse a session but it failed */ if( ssl->session_negotiate->peer_cert != NULL ) { mbedtls_x509_crt_free( ssl->session_negotiate->peer_cert ); mbedtls_free( ssl->session_negotiate->peer_cert ); + ssl->session_negotiate->peer_cert = NULL; } - if( ( ssl->session_negotiate->peer_cert = mbedtls_calloc( 1, - sizeof( mbedtls_x509_crt ) ) ) == NULL ) - { - MBEDTLS_SSL_DEBUG_MSG( 1, ( "alloc(%d bytes) failed", - sizeof( mbedtls_x509_crt ) ) ); - mbedtls_ssl_send_alert_message( ssl, MBEDTLS_SSL_ALERT_LEVEL_FATAL, - MBEDTLS_SSL_ALERT_MSG_INTERNAL_ERROR ); - return( MBEDTLS_ERR_SSL_ALLOC_FAILED ); - } - - mbedtls_x509_crt_init( ssl->session_negotiate->peer_cert ); - - i += 3; - + /* Iterate through and parse the CRTs in the provided chain. */ while( i < ssl->in_hslen ) { + /* Check that there's room for the next CRT's length fields. */ if ( i + 3 > ssl->in_hslen ) { MBEDTLS_SSL_DEBUG_MSG( 1, ( "bad certificate message" ) ); mbedtls_ssl_send_alert_message( ssl, MBEDTLS_SSL_ALERT_LEVEL_FATAL, - MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR ); + MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR ); return( MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE ); } + /* In theory, the CRT can be up to 2**24 Bytes, but we don't support + * anything beyond 2**16 ~ 64K. */ if( ssl->in_msg[i] != 0 ) { MBEDTLS_SSL_DEBUG_MSG( 1, ( "bad certificate message" ) ); @@ -5562,6 +5571,7 @@ static int ssl_parse_certificate_chain( mbedtls_ssl_context *ssl ) return( MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE ); } + /* Read length of the next CRT in the chain. */ n = ( (unsigned int) ssl->in_msg[i + 1] << 8 ) | (unsigned int) ssl->in_msg[i + 2]; i += 3; @@ -5574,67 +5584,89 @@ static int ssl_parse_certificate_chain( mbedtls_ssl_context *ssl ) return( MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE ); } + /* Check if we're handling the first CRT in the chain. */ + if( ssl->session_negotiate->peer_cert == NULL ) + { + /* During client-side renegotiation, check the server's end-CRTs + * hasn't changed compared to the initial handshake, mitigating + * the triple handshake attack. On success, reuse the original + * end-CRT instead of parsing it again. */ +#if defined(MBEDTLS_SSL_RENEGOTIATION) && defined(MBEDTLS_SSL_CLI_C) + if( ssl->conf->endpoint == MBEDTLS_SSL_IS_CLIENT && + ssl->renego_status == MBEDTLS_SSL_RENEGOTIATION_IN_PROGRESS ) + { + MBEDTLS_SSL_DEBUG_MSG( 3, ( "Check that peer CRT hasn't changed during renegotiation" ) ); + if( ssl_check_peer_crt_unchanged( ssl, &ssl->in_msg[i], n ) != 0 ) + { + MBEDTLS_SSL_DEBUG_MSG( 1, ( "new server cert during renegotiation" ) ); + mbedtls_ssl_send_alert_message( ssl, MBEDTLS_SSL_ALERT_LEVEL_FATAL, + MBEDTLS_SSL_ALERT_MSG_ACCESS_DENIED ); + return( MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE ); + } + + /* Move CRT chain structure to new session instance. */ + ssl->session_negotiate->peer_cert = ssl->session->peer_cert; + ssl->session->peer_cert = NULL; + + /* Delete all remaining CRTs from the original CRT chain. */ + mbedtls_x509_crt_free( ssl->session_negotiate->peer_cert->next ); + ssl->session_negotiate->peer_cert->next = NULL; + + i += n; + continue; + } +#endif /* MBEDTLS_SSL_RENEGOTIATION && MBEDTLS_SSL_CLI_C */ + + /* Outside of client-side renegotiation, create a fresh X.509 CRT + * instance to parse the end-CRT into. */ + + ssl->session_negotiate->peer_cert = + mbedtls_calloc( 1, sizeof( mbedtls_x509_crt ) ); + if( ssl->session_negotiate->peer_cert == NULL ) + { + MBEDTLS_SSL_DEBUG_MSG( 1, ( "alloc(%d bytes) failed", + sizeof( mbedtls_x509_crt ) ) ); + mbedtls_ssl_send_alert_message( ssl, MBEDTLS_SSL_ALERT_LEVEL_FATAL, + MBEDTLS_SSL_ALERT_MSG_INTERNAL_ERROR ); + return( MBEDTLS_ERR_SSL_ALLOC_FAILED ); + } + + mbedtls_x509_crt_init( ssl->session_negotiate->peer_cert ); + + /* Intentional fall through */ + } + + /* Parse the next certificate in the chain. */ ret = mbedtls_x509_crt_parse_der( ssl->session_negotiate->peer_cert, - ssl->in_msg + i, n ); + ssl->in_msg + i, n ); switch( ret ) { - case 0: /*ok*/ - case MBEDTLS_ERR_X509_UNKNOWN_SIG_ALG + MBEDTLS_ERR_OID_NOT_FOUND: - /* Ignore certificate with an unknown algorithm: maybe a - prior certificate was already trusted. */ - break; + case 0: /*ok*/ + case MBEDTLS_ERR_X509_UNKNOWN_SIG_ALG + MBEDTLS_ERR_OID_NOT_FOUND: + /* Ignore certificate with an unknown algorithm: maybe a + prior certificate was already trusted. */ + break; - case MBEDTLS_ERR_X509_ALLOC_FAILED: - alert = MBEDTLS_SSL_ALERT_MSG_INTERNAL_ERROR; - goto crt_parse_der_failed; + case MBEDTLS_ERR_X509_ALLOC_FAILED: + alert = MBEDTLS_SSL_ALERT_MSG_INTERNAL_ERROR; + goto crt_parse_der_failed; - case MBEDTLS_ERR_X509_UNKNOWN_VERSION: - alert = MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT; - goto crt_parse_der_failed; + case MBEDTLS_ERR_X509_UNKNOWN_VERSION: + alert = MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT; + goto crt_parse_der_failed; - default: - alert = MBEDTLS_SSL_ALERT_MSG_BAD_CERT; - crt_parse_der_failed: - mbedtls_ssl_send_alert_message( ssl, MBEDTLS_SSL_ALERT_LEVEL_FATAL, alert ); - MBEDTLS_SSL_DEBUG_RET( 1, " mbedtls_x509_crt_parse_der", ret ); - return( ret ); + default: + alert = MBEDTLS_SSL_ALERT_MSG_BAD_CERT; + crt_parse_der_failed: + mbedtls_ssl_send_alert_message( ssl, MBEDTLS_SSL_ALERT_LEVEL_FATAL, alert ); + MBEDTLS_SSL_DEBUG_RET( 1, " mbedtls_x509_crt_parse_der", ret ); + return( ret ); } i += n; } MBEDTLS_SSL_DEBUG_CRT( 3, "peer certificate", ssl->session_negotiate->peer_cert ); - - /* - * On client, make sure the server cert doesn't change during renego to - * avoid "triple handshake" attack: https://secure-resumption.com/ - */ -#if defined(MBEDTLS_SSL_RENEGOTIATION) && defined(MBEDTLS_SSL_CLI_C) - if( ssl->conf->endpoint == MBEDTLS_SSL_IS_CLIENT && - ssl->renego_status == MBEDTLS_SSL_RENEGOTIATION_IN_PROGRESS ) - { - if( ssl->session->peer_cert == NULL ) - { - MBEDTLS_SSL_DEBUG_MSG( 1, ( "new server cert during renegotiation" ) ); - mbedtls_ssl_send_alert_message( ssl, MBEDTLS_SSL_ALERT_LEVEL_FATAL, - MBEDTLS_SSL_ALERT_MSG_ACCESS_DENIED ); - return( MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE ); - } - - if( ssl->session->peer_cert->raw.len != - ssl->session_negotiate->peer_cert->raw.len || - memcmp( ssl->session->peer_cert->raw.p, - ssl->session_negotiate->peer_cert->raw.p, - ssl->session->peer_cert->raw.len ) != 0 ) - { - MBEDTLS_SSL_DEBUG_MSG( 1, ( "server cert changed during renegotiation" ) ); - mbedtls_ssl_send_alert_message( ssl, MBEDTLS_SSL_ALERT_LEVEL_FATAL, - MBEDTLS_SSL_ALERT_MSG_ACCESS_DENIED ); - return( MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE ); - } - } -#endif /* MBEDTLS_SSL_RENEGOTIATION && MBEDTLS_SSL_CLI_C */ - return( 0 ); } From bd9d51d969704a13a476f3fba81f56887cf75a88 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Wed, 30 Jan 2019 15:14:21 +0000 Subject: [PATCH 36/61] Adapt ChangeLog --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index 6c3e4763e..62946c892 100644 --- a/ChangeLog +++ b/ChangeLog @@ -31,6 +31,8 @@ Bugfix Fixes #2190. Changes + * Reduce RAM consumption during session renegotiation by not storing + the peer CRT chain and session ticket twice. * Include configuration file in all header files that use configuration, instead of relying on other header files that they include. Inserted as an enhancement for #1371 From 84879e32efe3fd32c122ffc3d8da91a8d0a19bf2 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Thu, 31 Jan 2019 07:44:03 +0000 Subject: [PATCH 37/61] Add compile-time guards around helper routine --- library/ssl_tls.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/ssl_tls.c b/library/ssl_tls.c index 4bbe0d410..f62ccf39c 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -5435,6 +5435,7 @@ write_msg: return( ret ); } +#if defined(MBEDTLS_SSL_RENEGOTIATION) && defined(MBEDTLS_SSL_CLI_C) static int ssl_check_peer_crt_unchanged( mbedtls_ssl_context *ssl, unsigned char *crt_buf, size_t crt_buf_len ) @@ -5449,6 +5450,7 @@ static int ssl_check_peer_crt_unchanged( mbedtls_ssl_context *ssl, return( memcmp( peer_crt->raw.p, crt_buf, crt_buf_len) ); } +#endif /* MBEDTLS_SSL_RENEGOTIATION && MBEDTLS_SSL_CLI_C */ /* * Once the certificate message is read, parse it into a cert chain and From e2734e2be4cc60a2ae6aab825faf249190e08b23 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Thu, 31 Jan 2019 07:44:17 +0000 Subject: [PATCH 38/61] Improve formatting of ssl_parse_certificate_chain() --- library/ssl_tls.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/library/ssl_tls.c b/library/ssl_tls.c index f62ccf39c..9c468f7de 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -5559,8 +5559,9 @@ static int ssl_parse_certificate_chain( mbedtls_ssl_context *ssl ) /* Check that there's room for the next CRT's length fields. */ if ( i + 3 > ssl->in_hslen ) { MBEDTLS_SSL_DEBUG_MSG( 1, ( "bad certificate message" ) ); - mbedtls_ssl_send_alert_message( ssl, MBEDTLS_SSL_ALERT_LEVEL_FATAL, - MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR ); + mbedtls_ssl_send_alert_message( ssl, + MBEDTLS_SSL_ALERT_LEVEL_FATAL, + MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR ); return( MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE ); } /* In theory, the CRT can be up to 2**24 Bytes, but we don't support @@ -5568,8 +5569,9 @@ static int ssl_parse_certificate_chain( mbedtls_ssl_context *ssl ) if( ssl->in_msg[i] != 0 ) { MBEDTLS_SSL_DEBUG_MSG( 1, ( "bad certificate message" ) ); - mbedtls_ssl_send_alert_message( ssl, MBEDTLS_SSL_ALERT_LEVEL_FATAL, - MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR ); + mbedtls_ssl_send_alert_message( ssl, + MBEDTLS_SSL_ALERT_LEVEL_FATAL, + MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR ); return( MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE ); } @@ -5581,8 +5583,9 @@ static int ssl_parse_certificate_chain( mbedtls_ssl_context *ssl ) if( n < 128 || i + n > ssl->in_hslen ) { MBEDTLS_SSL_DEBUG_MSG( 1, ( "bad certificate message" ) ); - mbedtls_ssl_send_alert_message( ssl, MBEDTLS_SSL_ALERT_LEVEL_FATAL, - MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR ); + mbedtls_ssl_send_alert_message( ssl, + MBEDTLS_SSL_ALERT_LEVEL_FATAL, + MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR ); return( MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE ); } @@ -5598,11 +5601,14 @@ static int ssl_parse_certificate_chain( mbedtls_ssl_context *ssl ) ssl->renego_status == MBEDTLS_SSL_RENEGOTIATION_IN_PROGRESS ) { MBEDTLS_SSL_DEBUG_MSG( 3, ( "Check that peer CRT hasn't changed during renegotiation" ) ); - if( ssl_check_peer_crt_unchanged( ssl, &ssl->in_msg[i], n ) != 0 ) + if( ssl_check_peer_crt_unchanged( ssl, + &ssl->in_msg[i], + n ) != 0 ) { MBEDTLS_SSL_DEBUG_MSG( 1, ( "new server cert during renegotiation" ) ); - mbedtls_ssl_send_alert_message( ssl, MBEDTLS_SSL_ALERT_LEVEL_FATAL, - MBEDTLS_SSL_ALERT_MSG_ACCESS_DENIED ); + mbedtls_ssl_send_alert_message( ssl, + MBEDTLS_SSL_ALERT_LEVEL_FATAL, + MBEDTLS_SSL_ALERT_MSG_ACCESS_DENIED ); return( MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE ); } @@ -5611,7 +5617,8 @@ static int ssl_parse_certificate_chain( mbedtls_ssl_context *ssl ) ssl->session->peer_cert = NULL; /* Delete all remaining CRTs from the original CRT chain. */ - mbedtls_x509_crt_free( ssl->session_negotiate->peer_cert->next ); + mbedtls_x509_crt_free( + ssl->session_negotiate->peer_cert->next ); ssl->session_negotiate->peer_cert->next = NULL; i += n; @@ -5628,8 +5635,9 @@ static int ssl_parse_certificate_chain( mbedtls_ssl_context *ssl ) { MBEDTLS_SSL_DEBUG_MSG( 1, ( "alloc(%d bytes) failed", sizeof( mbedtls_x509_crt ) ) ); - mbedtls_ssl_send_alert_message( ssl, MBEDTLS_SSL_ALERT_LEVEL_FATAL, - MBEDTLS_SSL_ALERT_MSG_INTERNAL_ERROR ); + mbedtls_ssl_send_alert_message( ssl, + MBEDTLS_SSL_ALERT_LEVEL_FATAL, + MBEDTLS_SSL_ALERT_MSG_INTERNAL_ERROR ); return( MBEDTLS_ERR_SSL_ALLOC_FAILED ); } From c1e18bdf064a1114d3ce8ba4cdf5eb51d1ddd557 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Thu, 31 Jan 2019 16:37:56 +0000 Subject: [PATCH 39/61] Fix memory leak --- library/ssl_tls.c | 1 + 1 file changed, 1 insertion(+) diff --git a/library/ssl_tls.c b/library/ssl_tls.c index 9c468f7de..13cb22b25 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -5619,6 +5619,7 @@ static int ssl_parse_certificate_chain( mbedtls_ssl_context *ssl ) /* Delete all remaining CRTs from the original CRT chain. */ mbedtls_x509_crt_free( ssl->session_negotiate->peer_cert->next ); + mbedtls_free( ssl->session_negotiate->peer_cert->next ); ssl->session_negotiate->peer_cert->next = NULL; i += n; From 46f34d0ac0e7246073d8ab4ff745f1f693020d96 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Fri, 8 Feb 2019 14:00:04 +0000 Subject: [PATCH 40/61] Fix style issue and wording --- library/ssl_tls.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/library/ssl_tls.c b/library/ssl_tls.c index 13cb22b25..4fa193252 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -5448,7 +5448,7 @@ static int ssl_check_peer_crt_unchanged( mbedtls_ssl_context *ssl, if( peer_crt->raw.len != crt_buf_len ) return( -1 ); - return( memcmp( peer_crt->raw.p, crt_buf, crt_buf_len) ); + return( memcmp( peer_crt->raw.p, crt_buf, crt_buf_len ) ); } #endif /* MBEDTLS_SSL_RENEGOTIATION && MBEDTLS_SSL_CLI_C */ @@ -5592,10 +5592,10 @@ static int ssl_parse_certificate_chain( mbedtls_ssl_context *ssl ) /* Check if we're handling the first CRT in the chain. */ if( ssl->session_negotiate->peer_cert == NULL ) { - /* During client-side renegotiation, check the server's end-CRTs - * hasn't changed compared to the initial handshake, mitigating - * the triple handshake attack. On success, reuse the original - * end-CRT instead of parsing it again. */ + /* During client-side renegotiation, check that the server's + * end-CRTs hasn't changed compared to the initial handshake, + * mitigating the triple handshake attack. On success, reuse + * the original end-CRT instead of parsing it again. */ #if defined(MBEDTLS_SSL_RENEGOTIATION) && defined(MBEDTLS_SSL_CLI_C) if( ssl->conf->endpoint == MBEDTLS_SSL_IS_CLIENT && ssl->renego_status == MBEDTLS_SSL_RENEGOTIATION_IN_PROGRESS ) From f38962955634c160d68059fceb18c76e5dd51159 Mon Sep 17 00:00:00 2001 From: Andrzej Kurek Date: Mon, 11 Feb 2019 03:44:29 -0500 Subject: [PATCH 41/61] Move a restartable ecp context to a conditional compilation block This was an unused variable when compiling with parameter validation but without ecp_restartable --- tests/suites/test_suite_ecp.function | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/suites/test_suite_ecp.function b/tests/suites/test_suite_ecp.function index 606ddd22a..0b2e02991 100644 --- a/tests/suites/test_suite_ecp.function +++ b/tests/suites/test_suite_ecp.function @@ -43,7 +43,9 @@ void ecp_invalid_param( ) unsigned char buf[42] = { 0 }; const unsigned char *null_buf = NULL; mbedtls_ecp_group_id valid_group = MBEDTLS_ECP_DP_SECP192R1; +#if defined(MBEDTLS_ECP_RESTARTABLE) mbedtls_ecp_restart_ctx restart_ctx; +#endif /* MBEDTLS_ECP_RESTARTABLE */ TEST_INVALID_PARAM( mbedtls_ecp_point_init( NULL ) ); TEST_INVALID_PARAM( mbedtls_ecp_keypair_init( NULL ) ); From 54efcb7ff0dd087053db984065adbc92594a6f30 Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Mon, 11 Feb 2019 21:55:09 +0000 Subject: [PATCH 42/61] Update query config with VSNPRINTF macro --- programs/ssl/query_config.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/programs/ssl/query_config.c b/programs/ssl/query_config.c index afbb09cc2..144e56060 100644 --- a/programs/ssl/query_config.c +++ b/programs/ssl/query_config.c @@ -234,6 +234,14 @@ int query_config( const char *config ) } #endif /* MBEDTLS_PLATFORM_SNPRINTF_ALT */ +#if defined(MBEDTLS_PLATFORM_VSNPRINTF_ALT) + if( strcmp( "MBEDTLS_PLATFORM_VSNPRINTF_ALT", config ) == 0 ) + { + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_VSNPRINTF_ALT ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_VSNPRINTF_ALT */ + #if defined(MBEDTLS_PLATFORM_NV_SEED_ALT) if( strcmp( "MBEDTLS_PLATFORM_NV_SEED_ALT", config ) == 0 ) { @@ -2362,6 +2370,14 @@ int query_config( const char *config ) } #endif /* MBEDTLS_PLATFORM_SNPRINTF_MACRO */ +#if defined(MBEDTLS_PLATFORM_VSNPRINTF_MACRO) + if( strcmp( "MBEDTLS_PLATFORM_VSNPRINTF_MACRO", config ) == 0 ) + { + MACRO_EXPANSION_TO_STR( MBEDTLS_PLATFORM_VSNPRINTF_MACRO ); + return( 0 ); + } +#endif /* MBEDTLS_PLATFORM_VSNPRINTF_MACRO */ + #if defined(MBEDTLS_PLATFORM_NV_SEED_READ_MACRO) if( strcmp( "MBEDTLS_PLATFORM_NV_SEED_READ_MACRO", config ) == 0 ) { From 2d7926674dab2cc9de44b6c01fb6f5a5f41ec8ad Mon Sep 17 00:00:00 2001 From: Jaeden Amero Date: Mon, 11 Feb 2019 12:18:39 +0000 Subject: [PATCH 43/61] psa_utils: Make fallthrough clear for compilers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Silence a compiler warning about implicit fallthrough by using a comment format the compiler understand to mean that the fallthrough is intentional. In file included from library/cipher.c:63:0: include/mbedtls/psa_util.h: In function ‘mbedtls_psa_translate_cipher_mode’: include/mbedtls/psa_util.h:91:15: error: this statement may fall through [-Werror=implicit-fallthrough=] if( taglen == 0 ) ^ include/mbedtls/psa_util.h:94:9: note: here default: ^~~~~~~ cc1: all warnings being treated as errors $ gcc --version gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --- include/mbedtls/psa_util.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/mbedtls/psa_util.h b/include/mbedtls/psa_util.h index 3684e9835..fbf25e638 100644 --- a/include/mbedtls/psa_util.h +++ b/include/mbedtls/psa_util.h @@ -91,6 +91,7 @@ static inline psa_algorithm_t mbedtls_psa_translate_cipher_mode( if( taglen == 0 ) return( PSA_ALG_CBC_NO_PADDING ); /* Intentional fallthrough for taglen != 0 */ + /* fallthrough */ default: return( 0 ); } From 1b20be59e2a1056425e92969504eb4a94fa72595 Mon Sep 17 00:00:00 2001 From: Andrzej Kurek Date: Fri, 15 Feb 2019 10:13:35 -0500 Subject: [PATCH 44/61] Write documentation for TEST_ASSERT --- tests/suites/helpers.function | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/suites/helpers.function b/tests/suites/helpers.function index 1255ff4be..269cdad2f 100644 --- a/tests/suites/helpers.function +++ b/tests/suites/helpers.function @@ -97,6 +97,14 @@ typedef enum * This macro is not suitable for negative parameter validation tests, * as it assumes the test step will not create an error. * + * Failing the test means: + * - Mark this test case as failed. + * - Print a message identifying the failure. + * - Jump to the \c exit label. + * + * This macro expands to an instruction, not an expression. + * It may jump to the \c exit label. + * * \param TEST The test expression to be tested. */ #define TEST_ASSERT( TEST ) \ From 064128c1b063e3de38acb2a6147ebd743886a631 Mon Sep 17 00:00:00 2001 From: Andrzej Kurek Date: Fri, 15 Feb 2019 10:20:05 -0500 Subject: [PATCH 45/61] Update submodule pointer to commit 0574e6a of mbed-crypto/development --- crypto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto b/crypto index dea02cc8b..0574e6a7b 160000 --- a/crypto +++ b/crypto @@ -1 +1 @@ -Subproject commit dea02cc8b3cee604cdba8295c90e585af68e7a83 +Subproject commit 0574e6a7bd0bec47e45bbd30db2e5236896b38ea From f75f912c31b52f200b54dd5ef763208db4412226 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Mon, 7 Jan 2019 15:36:51 +0000 Subject: [PATCH 46/61] Add functions to psa_util module to convert EC public keys --- include/mbedtls/psa_util.h | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/include/mbedtls/psa_util.h b/include/mbedtls/psa_util.h index fbf25e638..dca4fa4f5 100644 --- a/include/mbedtls/psa_util.h +++ b/include/mbedtls/psa_util.h @@ -43,6 +43,8 @@ #include "pk.h" #include "oid.h" +#include + /* Translations for symmetric crypto. */ static inline psa_key_type_t mbedtls_psa_translate_cipher_type( @@ -352,6 +354,48 @@ static inline psa_ecc_curve_t mbedtls_psa_parse_tls_ecc_group( return( (psa_ecc_curve_t) tls_ecc_grp_reg_id ); } +/* This function takes a buffer holding an EC public key + * exported through psa_export_public_key(), and converts + * it into an ECPoint structure to be put into a ClientKeyExchange + * message in an ECDHE exchange. + * + * Both the present and the foreseeable future format of EC public keys + * used by PSA have the ECPoint structure contained in the exported key + * as a subbuffer, and the function merely selects this subbuffer instead + * of making a copy. + */ +static inline int mbedtls_psa_tls_psa_ec_to_ecpoint( unsigned char *src, + size_t srclen, + unsigned char **dst, + size_t *dstlen ) +{ + *dst = src; + *dstlen = srclen; + return( 0 ); +} + +/* This function takes a buffer holding an ECPoint structure + * (as contained in a TLS ServerKeyExchange message for ECDHE + * exchanges) and converts it into a format that the PSA key + * agreement API understands. + */ +static inline int mbedtls_psa_tls_ecpoint_to_psa_ec( psa_ecc_curve_t curve, + unsigned char const *src, + size_t srclen, + unsigned char *dst, + size_t dstlen, + size_t *olen ) +{ + ((void) curve); + + if( srclen > dstlen ) + return( MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL ); + + memcpy( dst, src, srclen ); + *olen = srclen; + return( 0 ); +} + #endif /* MBEDTLS_USE_PSA_CRYPTO */ #endif /* MBEDTLS_PSA_UTIL_H */ From df51dbe17f6c31eecef309cd7ccaa39bf9808b11 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Mon, 18 Feb 2019 16:41:55 +0000 Subject: [PATCH 47/61] Add fields for PSA-based ECDHE to handshake structure This is the first in a series of commits adding client-side support for PSA-based ECDHE. Previously, the state of an ECDHE key agreement was maintained in the field mbedtls_ssl_handshake_params::ecdh_ctx, of type ::mbedtls_ecdh_context and manipulated through the ECDH API. The ECDH API will be superseeded by the PSA Crypto API for key agreement, which needs the following data: (a) A raw buffer holding the public part of the key agreement received from our peer. (b) A key slot holding the private part of the key agreement. (c) The algorithm to use. The commit adds fields to ::mbedtls_ssl_handshake_params representing these three inputs to PSA-based key agreement. Specifically, it adds a field for the key slot holding the ECDH private key, a field for the EC curve identifier, and a buffer holding the peer's public key. Note: Storing the peer's public key buffer is slightly inefficient, as one could perform the ECDH computation as soon as the peer sends its public key, either working with in-place or using a stack-buffer to reformat the public key before passing it to PSA. This optimization is left for a later commit. --- include/mbedtls/psa_util.h | 2 ++ include/mbedtls/ssl_internal.h | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/include/mbedtls/psa_util.h b/include/mbedtls/psa_util.h index dca4fa4f5..a678a777a 100644 --- a/include/mbedtls/psa_util.h +++ b/include/mbedtls/psa_util.h @@ -235,6 +235,8 @@ static inline int mbedtls_psa_get_ecc_oid_from_id( return( -1 ); } +#define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH 256 + static inline psa_ecc_curve_t mbedtls_psa_translate_ecc_group( mbedtls_ecp_group_id grpid ) { switch( grpid ) diff --git a/include/mbedtls/ssl_internal.h b/include/mbedtls/ssl_internal.h index 3159cd32b..be7f41b1d 100644 --- a/include/mbedtls/ssl_internal.h +++ b/include/mbedtls/ssl_internal.h @@ -57,6 +57,11 @@ #include "ecjpake.h" #endif +#if defined(MBEDTLS_USE_PSA_CRYPTO) +#include "psa/crypto.h" +#include "psa_util.h" +#endif /* MBEDTLS_USE_PSA_CRYPTO */ + #if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ !defined(inline) && !defined(__cplusplus) #define inline __inline @@ -280,7 +285,15 @@ struct mbedtls_ssl_handshake_params #endif #if defined(MBEDTLS_ECDH_C) mbedtls_ecdh_context ecdh_ctx; /*!< ECDH key exchange */ -#endif + +#if defined(MBEDTLS_USE_PSA_CRYPTO) + psa_ecc_curve_t ecdh_psa_curve; + psa_key_handle_t ecdh_psa_privkey; + unsigned char ecdh_psa_peerkey[MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH]; + size_t ecdh_psa_peerkey_len; +#endif /* MBEDTLS_USE_PSA_CRYPTO */ +#endif /* MBEDTLS_ECDH_C */ + #if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) mbedtls_ecjpake_context ecjpake_ctx; /*!< EC J-PAKE key exchange */ #if defined(MBEDTLS_SSL_CLI_C) From bb89e2727f532042ef7f3273f4058033851570e8 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Tue, 8 Jan 2019 12:54:37 +0000 Subject: [PATCH 48/61] Implement ServerKeyExchange parsing for PSA-based ECDHE suites - Reformat the server's ECDH public key to make it suitable for the PSA key agreement API. Currently, the key agreement API needs a full SubjectPublicKeyInfo structure, while the TLS ServerKeyExchange message only contains a ECPoint structure. --- library/ssl_cli.c | 80 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/library/ssl_cli.c b/library/ssl_cli.c index 06bcc731f..7665f332b 100644 --- a/library/ssl_cli.c +++ b/library/ssl_cli.c @@ -39,6 +39,10 @@ #include "mbedtls/ssl.h" #include "mbedtls/ssl_internal.h" +#if defined(MBEDTLS_USE_PSA_CRYPTO) +#include "mbedtls/psa_util.h" +#endif /* MBEDTLS_USE_PSA_CRYPTO */ + #include #include @@ -2109,6 +2113,64 @@ static int ssl_check_server_ecdh_params( const mbedtls_ssl_context *ssl ) MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED || MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED */ +#if defined(MBEDTLS_USE_PSA_CRYPTO) && \ + ( defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ + defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) ) +static int ssl_parse_server_ecdh_params_psa( mbedtls_ssl_context *ssl, + unsigned char **p, + unsigned char *end ) +{ + uint16_t tls_id; + uint8_t ecpoint_len; + mbedtls_ssl_handshake_params *handshake = ssl->handshake; + + /* + * Parse ECC group + */ + + if( end - *p < 4 ) + return( MBEDTLS_ERR_SSL_BAD_HS_SERVER_KEY_EXCHANGE ); + + /* First byte is curve_type; only named_curve is handled */ + if( *(*p)++ != MBEDTLS_ECP_TLS_NAMED_CURVE ) + return( MBEDTLS_ERR_SSL_BAD_HS_SERVER_KEY_EXCHANGE ); + + /* Next two bytes are the namedcurve value */ + tls_id = *(*p)++; + tls_id <<= 8; + tls_id |= *(*p)++; + + /* Convert EC group to PSA key type. */ + if( ( handshake->ecdh_psa_curve = + mbedtls_psa_parse_tls_ecc_group( tls_id ) ) == 0 ) + { + return( MBEDTLS_ERR_SSL_BAD_HS_SERVER_KEY_EXCHANGE ); + } + + /* + * Put peer's ECDH public key in the format understood by PSA. + */ + + ecpoint_len = *(*p)++; + if( (size_t)( end - *p ) < ecpoint_len ) + return( MBEDTLS_ERR_SSL_BAD_HS_SERVER_KEY_EXCHANGE ); + + if( mbedtls_psa_tls_ecpoint_to_psa_ec( handshake->ecdh_psa_curve, + *p, ecpoint_len, + handshake->ecdh_psa_peerkey, + sizeof( handshake->ecdh_psa_peerkey ), + &handshake->ecdh_psa_peerkey_len ) != 0 ) + { + return( MBEDTLS_ERR_SSL_HW_ACCEL_FAILED ); + } + + *p += ecpoint_len; + return( 0 ); +} +#endif /* MBEDTLS_USE_PSA_CRYPTO && + ( MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED || + MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED ) */ + #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) || \ defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) @@ -2510,6 +2572,24 @@ start_processing: else #endif /* MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED || MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED */ +#if defined(MBEDTLS_USE_PSA_CRYPTO) && \ + ( defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ + defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) ) + if( ciphersuite_info->key_exchange == MBEDTLS_KEY_EXCHANGE_ECDHE_RSA || + ciphersuite_info->key_exchange == MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA ) + { + if( ssl_parse_server_ecdh_params_psa( ssl, &p, end ) != 0 ) + { + MBEDTLS_SSL_DEBUG_MSG( 1, ( "bad server key exchange message" ) ); + mbedtls_ssl_send_alert_message( ssl, MBEDTLS_SSL_ALERT_LEVEL_FATAL, + MBEDTLS_SSL_ALERT_MSG_ILLEGAL_PARAMETER ); + return( MBEDTLS_ERR_SSL_BAD_HS_SERVER_KEY_EXCHANGE ); + } + } + else +#endif /* MBEDTLS_USE_PSA_CRYPTO && + ( MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED || + MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED ) */ #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) || \ defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) From 4a63ed421c514185c377e86c6ecf6978edd33aa0 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Tue, 8 Jan 2019 11:39:35 +0000 Subject: [PATCH 49/61] Implement ClientKeyExchange writing in PSA-based ECDHE suites - Populate the ECDH private key slot with a fresh private EC key designated for the correct algorithm. - Export the public part of the ECDH private key from PSA and reformat it to suite the format of the ClientKeyExchange message. - Perform the PSA-based ECDH key agreement and store the result as the premaster secret for the connection. --- library/ssl_cli.c | 110 ++++++++++++++++++++++++++++++++++++++++++++++ library/ssl_tls.c | 5 +++ 2 files changed, 115 insertions(+) diff --git a/library/ssl_cli.c b/library/ssl_cli.c index 7665f332b..62c36951c 100644 --- a/library/ssl_cli.c +++ b/library/ssl_cli.c @@ -3063,6 +3063,116 @@ static int ssl_write_client_key_exchange( mbedtls_ssl_context *ssl ) } else #endif /* MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED */ +#if defined(MBEDTLS_USE_PSA_CRYPTO) && \ + ( defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ + defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) ) + if( ciphersuite_info->key_exchange == MBEDTLS_KEY_EXCHANGE_ECDHE_RSA || + ciphersuite_info->key_exchange == MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA ) + { + psa_status_t status; + psa_key_policy_t policy; + + mbedtls_ssl_handshake_params *handshake = ssl->handshake; + + unsigned char own_pubkey[MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH]; + size_t own_pubkey_len; + unsigned char *own_pubkey_ecpoint; + size_t own_pubkey_ecpoint_len; + + psa_crypto_generator_t generator = PSA_CRYPTO_GENERATOR_INIT; + + i = 4; + + /* + * Generate EC private key for ECDHE exchange. + */ + + /* Allocate a new key slot for the private key. */ + + status = psa_allocate_key( &handshake->ecdh_psa_privkey ); + if( status != PSA_SUCCESS ) + return( MBEDTLS_ERR_SSL_HW_ACCEL_FAILED ); + + /* The master secret is obtained from the shared ECDH secret by + * applying the TLS 1.2 PRF with a specific salt and label. While + * the PSA Crypto API encourages combining key agreement schemes + * such as ECDH with fixed KDFs such as TLS 1.2 PRF, it does not + * yet support the provisioning of salt + label to the KDF. + * For the time being, we therefore need to split the computation + * of the ECDH secret and the application of the TLS 1.2 PRF. */ + policy = psa_key_policy_init(); + psa_key_policy_set_usage( &policy, + PSA_KEY_USAGE_DERIVE, + PSA_ALG_ECDH( PSA_ALG_SELECT_RAW ) ); + status = psa_set_key_policy( handshake->ecdh_psa_privkey, &policy ); + if( status != PSA_SUCCESS ) + return( MBEDTLS_ERR_SSL_HW_ACCEL_FAILED ); + + /* Generate ECDH private key. */ + status = psa_generate_key( handshake->ecdh_psa_privkey, + PSA_KEY_TYPE_ECC_KEYPAIR( handshake->ecdh_psa_curve ), + MBEDTLS_PSA_ECC_KEY_BITS_OF_CURVE( handshake->ecdh_psa_curve ), + NULL, 0 ); + if( status != PSA_SUCCESS ) + return( MBEDTLS_ERR_SSL_HW_ACCEL_FAILED ); + + /* Export the public part of the ECDH private key from PSA + * and convert it to ECPoint format used in ClientKeyExchange. */ + status = psa_export_public_key( handshake->ecdh_psa_privkey, + own_pubkey, sizeof( own_pubkey ), + &own_pubkey_len ); + if( status != PSA_SUCCESS ) + return( MBEDTLS_ERR_SSL_HW_ACCEL_FAILED ); + + if( mbedtls_psa_tls_psa_ec_to_ecpoint( own_pubkey, + own_pubkey_len, + &own_pubkey_ecpoint, + &own_pubkey_ecpoint_len ) != 0 ) + { + return( MBEDTLS_ERR_SSL_HW_ACCEL_FAILED ); + } + + /* Copy ECPoint structure to outgoing message buffer. */ + ssl->out_msg[i] = own_pubkey_ecpoint_len; + memcpy( ssl->out_msg + i + 1, own_pubkey_ecpoint, own_pubkey_ecpoint_len ); + n = own_pubkey_ecpoint_len + 1; + + /* Compute ECDH shared secret. */ + status = psa_key_agreement( &generator, + handshake->ecdh_psa_privkey, + handshake->ecdh_psa_peerkey, + handshake->ecdh_psa_peerkey_len, + PSA_ALG_ECDH( PSA_ALG_SELECT_RAW ) ); + if( status != PSA_SUCCESS ) + return( MBEDTLS_ERR_SSL_HW_ACCEL_FAILED ); + + /* The ECDH secret is the premaster secret used for key derivation. */ + + ssl->handshake->pmslen = + MBEDTLS_PSA_ECC_KEY_BYTES_OF_CURVE( handshake->ecdh_psa_curve ); + + status = psa_generator_read( &generator, + ssl->handshake->premaster, + ssl->handshake->pmslen ); + if( status != PSA_SUCCESS ) + { + psa_generator_abort( &generator ); + return( MBEDTLS_ERR_SSL_HW_ACCEL_FAILED ); + } + + status = psa_generator_abort( &generator ); + if( status != PSA_SUCCESS ) + return( MBEDTLS_ERR_SSL_HW_ACCEL_FAILED ); + + status = psa_destroy_key( handshake->ecdh_psa_privkey ); + if( status != PSA_SUCCESS ) + return( MBEDTLS_ERR_SSL_HW_ACCEL_FAILED ); + handshake->ecdh_psa_privkey = 0; + } + else +#endif /* MBEDTLS_USE_PSA_CRYPTO && + ( MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED || + MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED ) */ #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) || \ defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \ diff --git a/library/ssl_tls.c b/library/ssl_tls.c index f224d5e94..962223fd0 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -9367,6 +9367,11 @@ void mbedtls_ssl_handshake_free( mbedtls_ssl_context *ssl ) ssl_buffering_free( ssl ); #endif +#if defined(MBEDTLS_ECDH_C) && \ + defined(MBEDTLS_USE_PSA_CRYPTO) + psa_destroy_key( handshake->ecdh_psa_privkey ); +#endif /* MBEDTLS_ECDH_C && MBEDTLS_USE_PSA_CRYPTO */ + mbedtls_platform_zeroize( handshake, sizeof( mbedtls_ssl_handshake_params ) ); } From c14a3bb5a67f8324eb357d2d3620ba055d81bf02 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Mon, 14 Jan 2019 09:41:16 +0000 Subject: [PATCH 50/61] Make variable in ssl_write_client_key_exchange() more descriptive --- library/ssl_cli.c | 104 ++++++++++++++++++++++++++-------------------- 1 file changed, 58 insertions(+), 46 deletions(-) diff --git a/library/ssl_cli.c b/library/ssl_cli.c index 62c36951c..f2e227522 100644 --- a/library/ssl_cli.c +++ b/library/ssl_cli.c @@ -3018,7 +3018,9 @@ static int ssl_parse_server_hello_done( mbedtls_ssl_context *ssl ) static int ssl_write_client_key_exchange( mbedtls_ssl_context *ssl ) { int ret; - size_t i, n; + + size_t header_len; + size_t content_len; const mbedtls_ssl_ciphersuite_t *ciphersuite_info = ssl->transform_negotiate->ciphersuite_info; @@ -3030,16 +3032,16 @@ static int ssl_write_client_key_exchange( mbedtls_ssl_context *ssl ) /* * DHM key exchange -- send G^X mod P */ - n = ssl->handshake->dhm_ctx.len; + content_len = ssl->handshake->dhm_ctx.len; - ssl->out_msg[4] = (unsigned char)( n >> 8 ); - ssl->out_msg[5] = (unsigned char)( n ); - i = 6; + ssl->out_msg[4] = (unsigned char)( content_len >> 8 ); + ssl->out_msg[5] = (unsigned char)( content_len ); + header_len = 6; ret = mbedtls_dhm_make_public( &ssl->handshake->dhm_ctx, - (int) mbedtls_mpi_size( &ssl->handshake->dhm_ctx.P ), - &ssl->out_msg[i], n, - ssl->conf->f_rng, ssl->conf->p_rng ); + (int) mbedtls_mpi_size( &ssl->handshake->dhm_ctx.P ), + &ssl->out_msg[header_len], content_len, + ssl->conf->f_rng, ssl->conf->p_rng ); if( ret != 0 ) { MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_dhm_make_public", ret ); @@ -3050,10 +3052,10 @@ static int ssl_write_client_key_exchange( mbedtls_ssl_context *ssl ) MBEDTLS_SSL_DEBUG_MPI( 3, "DHM: GX", &ssl->handshake->dhm_ctx.GX ); if( ( ret = mbedtls_dhm_calc_secret( &ssl->handshake->dhm_ctx, - ssl->handshake->premaster, - MBEDTLS_PREMASTER_SIZE, - &ssl->handshake->pmslen, - ssl->conf->f_rng, ssl->conf->p_rng ) ) != 0 ) + ssl->handshake->premaster, + MBEDTLS_PREMASTER_SIZE, + &ssl->handshake->pmslen, + ssl->conf->f_rng, ssl->conf->p_rng ) ) != 0 ) { MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_dhm_calc_secret", ret ); return( ret ); @@ -3081,7 +3083,7 @@ static int ssl_write_client_key_exchange( mbedtls_ssl_context *ssl ) psa_crypto_generator_t generator = PSA_CRYPTO_GENERATOR_INIT; - i = 4; + header_len = 4; /* * Generate EC private key for ECDHE exchange. @@ -3133,9 +3135,10 @@ static int ssl_write_client_key_exchange( mbedtls_ssl_context *ssl ) } /* Copy ECPoint structure to outgoing message buffer. */ - ssl->out_msg[i] = own_pubkey_ecpoint_len; - memcpy( ssl->out_msg + i + 1, own_pubkey_ecpoint, own_pubkey_ecpoint_len ); - n = own_pubkey_ecpoint_len + 1; + ssl->out_msg[header_len] = own_pubkey_ecpoint_len; + memcpy( ssl->out_msg + header_len + 1, + own_pubkey_ecpoint, own_pubkey_ecpoint_len ); + content_len = own_pubkey_ecpoint_len + 1; /* Compute ECDH shared secret. */ status = psa_key_agreement( &generator, @@ -3185,7 +3188,7 @@ static int ssl_write_client_key_exchange( mbedtls_ssl_context *ssl ) /* * ECDH key exchange -- send client public value */ - i = 4; + header_len = 4; #if defined(MBEDTLS_SSL__ECP_RESTARTABLE) if( ssl->handshake->ecrs_enabled ) @@ -3198,8 +3201,8 @@ static int ssl_write_client_key_exchange( mbedtls_ssl_context *ssl ) #endif ret = mbedtls_ecdh_make_public( &ssl->handshake->ecdh_ctx, - &n, - &ssl->out_msg[i], 1000, + &content_len, + &ssl->out_msg[header_len], 1000, ssl->conf->f_rng, ssl->conf->p_rng ); if( ret != 0 ) { @@ -3217,19 +3220,19 @@ static int ssl_write_client_key_exchange( mbedtls_ssl_context *ssl ) #if defined(MBEDTLS_SSL__ECP_RESTARTABLE) if( ssl->handshake->ecrs_enabled ) { - ssl->handshake->ecrs_n = n; + ssl->handshake->ecrs_n = content_len; ssl->handshake->ecrs_state = ssl_ecrs_cke_ecdh_calc_secret; } ecdh_calc_secret: if( ssl->handshake->ecrs_enabled ) - n = ssl->handshake->ecrs_n; + content_len = ssl->handshake->ecrs_n; #endif if( ( ret = mbedtls_ecdh_calc_secret( &ssl->handshake->ecdh_ctx, - &ssl->handshake->pmslen, - ssl->handshake->premaster, - MBEDTLS_MPI_MAX_SIZE, - ssl->conf->f_rng, ssl->conf->p_rng ) ) != 0 ) + &ssl->handshake->pmslen, + ssl->handshake->premaster, + MBEDTLS_MPI_MAX_SIZE, + ssl->conf->f_rng, ssl->conf->p_rng ) ) != 0 ) { MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_ecdh_calc_secret", ret ); #if defined(MBEDTLS_SSL__ECP_RESTARTABLE) @@ -3261,26 +3264,28 @@ ecdh_calc_secret: return( MBEDTLS_ERR_SSL_INTERNAL_ERROR ); } - i = 4; - n = ssl->conf->psk_identity_len; + header_len = 4; + content_len = ssl->conf->psk_identity_len; - if( i + 2 + n > MBEDTLS_SSL_OUT_CONTENT_LEN ) + if( header_len + 2 + content_len > MBEDTLS_SSL_OUT_CONTENT_LEN ) { MBEDTLS_SSL_DEBUG_MSG( 1, ( "psk identity too long or " "SSL buffer too short" ) ); return( MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL ); } - ssl->out_msg[i++] = (unsigned char)( n >> 8 ); - ssl->out_msg[i++] = (unsigned char)( n ); + ssl->out_msg[header_len++] = (unsigned char)( content_len >> 8 ); + ssl->out_msg[header_len++] = (unsigned char)( content_len ); - memcpy( ssl->out_msg + i, ssl->conf->psk_identity, ssl->conf->psk_identity_len ); - i += ssl->conf->psk_identity_len; + memcpy( ssl->out_msg + header_len, + ssl->conf->psk_identity, + ssl->conf->psk_identity_len ); + header_len += ssl->conf->psk_identity_len; #if defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) if( ciphersuite_info->key_exchange == MBEDTLS_KEY_EXCHANGE_PSK ) { - n = 0; + content_len = 0; } else #endif @@ -3293,7 +3298,8 @@ ecdh_calc_secret: return( MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE ); #endif /* MBEDTLS_USE_PSA_CRYPTO */ - if( ( ret = ssl_write_encrypted_pms( ssl, i, &n, 2 ) ) != 0 ) + if( ( ret = ssl_write_encrypted_pms( ssl, header_len, + &content_len, 2 ) ) != 0 ) return( ret ); } else @@ -3310,21 +3316,22 @@ ecdh_calc_secret: /* * ClientDiffieHellmanPublic public (DHM send G^X mod P) */ - n = ssl->handshake->dhm_ctx.len; + content_len = ssl->handshake->dhm_ctx.len; - if( i + 2 + n > MBEDTLS_SSL_OUT_CONTENT_LEN ) + if( header_len + 2 + content_len > + MBEDTLS_SSL_OUT_CONTENT_LEN ) { MBEDTLS_SSL_DEBUG_MSG( 1, ( "psk identity or DHM size too long" " or SSL buffer too short" ) ); return( MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL ); } - ssl->out_msg[i++] = (unsigned char)( n >> 8 ); - ssl->out_msg[i++] = (unsigned char)( n ); + ssl->out_msg[header_len++] = (unsigned char)( content_len >> 8 ); + ssl->out_msg[header_len++] = (unsigned char)( content_len ); ret = mbedtls_dhm_make_public( &ssl->handshake->dhm_ctx, (int) mbedtls_mpi_size( &ssl->handshake->dhm_ctx.P ), - &ssl->out_msg[i], n, + &ssl->out_msg[header_len], content_len, ssl->conf->f_rng, ssl->conf->p_rng ); if( ret != 0 ) { @@ -3346,8 +3353,10 @@ ecdh_calc_secret: /* * ClientECDiffieHellmanPublic public; */ - ret = mbedtls_ecdh_make_public( &ssl->handshake->ecdh_ctx, &n, - &ssl->out_msg[i], MBEDTLS_SSL_OUT_CONTENT_LEN - i, + ret = mbedtls_ecdh_make_public( &ssl->handshake->ecdh_ctx, + &content_len, + &ssl->out_msg[header_len], + MBEDTLS_SSL_OUT_CONTENT_LEN - header_len, ssl->conf->f_rng, ssl->conf->p_rng ); if( ret != 0 ) { @@ -3388,8 +3397,9 @@ ecdh_calc_secret: #if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) if( ciphersuite_info->key_exchange == MBEDTLS_KEY_EXCHANGE_RSA ) { - i = 4; - if( ( ret = ssl_write_encrypted_pms( ssl, i, &n, 0 ) ) != 0 ) + header_len = 4; + if( ( ret = ssl_write_encrypted_pms( ssl, header_len, + &content_len, 0 ) ) != 0 ) return( ret ); } else @@ -3397,10 +3407,12 @@ ecdh_calc_secret: #if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) if( ciphersuite_info->key_exchange == MBEDTLS_KEY_EXCHANGE_ECJPAKE ) { - i = 4; + header_len = 4; ret = mbedtls_ecjpake_write_round_two( &ssl->handshake->ecjpake_ctx, - ssl->out_msg + i, MBEDTLS_SSL_OUT_CONTENT_LEN - i, &n, + ssl->out_msg + header_len, + MBEDTLS_SSL_OUT_CONTENT_LEN - header_len, + &content_len, ssl->conf->f_rng, ssl->conf->p_rng ); if( ret != 0 ) { @@ -3425,7 +3437,7 @@ ecdh_calc_secret: return( MBEDTLS_ERR_SSL_INTERNAL_ERROR ); } - ssl->out_msglen = i + n; + ssl->out_msglen = header_len + content_len; ssl->out_msgtype = MBEDTLS_SSL_MSG_HANDSHAKE; ssl->out_msg[0] = MBEDTLS_SSL_HS_CLIENT_KEY_EXCHANGE; From 0a94a64bbdeb16f77cc07abe48a06a26b1e889d7 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Fri, 11 Jan 2019 14:35:30 +0000 Subject: [PATCH 51/61] Add debugging output to confirm that PSA was used for ECDHE --- library/ssl_cli.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/ssl_cli.c b/library/ssl_cli.c index f2e227522..46ec50c15 100644 --- a/library/ssl_cli.c +++ b/library/ssl_cli.c @@ -3085,6 +3085,8 @@ static int ssl_write_client_key_exchange( mbedtls_ssl_context *ssl ) header_len = 4; + MBEDTLS_SSL_DEBUG_MSG( 1, ( "Perform PSA-based ECDH computation." ) ); + /* * Generate EC private key for ECDHE exchange. */ From 354e248d815ce41487798da3674a84eb55438f2d Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Tue, 8 Jan 2019 11:40:25 +0000 Subject: [PATCH 52/61] Add ssl-opt.sh tests for PSA-based ECDH with various ECC curves --- tests/ssl-opt.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh index 646ddd6be..0d703a3f7 100755 --- a/tests/ssl-opt.sh +++ b/tests/ssl-opt.sh @@ -774,6 +774,17 @@ run_test_psa() { -C "error" } +run_test_psa_force_curve() { + requires_config_enabled MBEDTLS_USE_PSA_CRYPTO + run_test "PSA - ECDH with $1" \ + "$P_SRV debug_level=4 force_version=tls1_2" \ + "$P_CLI debug_level=4 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ + 0 \ + -s "Protocol is TLSv1.2" \ + -S "error" \ + -C "error" +} + cleanup() { rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 @@ -932,6 +943,29 @@ run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 +requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED +run_test_psa_force_curve "secp521r1" +requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED +run_test_psa_force_curve "brainpoolP512r1" +requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED +run_test_psa_force_curve "secp384r1" +requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED +run_test_psa_force_curve "brainpoolP384r1" +requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED +run_test_psa_force_curve "secp256r1" +requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED +run_test_psa_force_curve "secp256k1" +requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED +run_test_psa_force_curve "brainpoolP256r1" +requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED +run_test_psa_force_curve "secp224r1" +requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED +run_test_psa_force_curve "secp224k1" +requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED +run_test_psa_force_curve "secp192r1" +requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED +run_test_psa_force_curve "secp192k1" + # Test current time in ServerHello requires_config_enabled MBEDTLS_HAVE_TIME run_test "ServerHello contains gmt_unix_time" \ From 3b7c4a0ff00c0ef25653eaf1e5f940dc3ceb0b2c Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Thu, 10 Jan 2019 08:49:23 +0000 Subject: [PATCH 53/61] Regenerate VisualStudio project file --- visualc/VS2010/mbedTLS.vcxproj | 1 + 1 file changed, 1 insertion(+) diff --git a/visualc/VS2010/mbedTLS.vcxproj b/visualc/VS2010/mbedTLS.vcxproj index 133fd065b..e33c7483c 100644 --- a/visualc/VS2010/mbedTLS.vcxproj +++ b/visualc/VS2010/mbedTLS.vcxproj @@ -281,6 +281,7 @@ + From 4af484e29a710fcea966bc3d53ebd60a55fc1748 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Tue, 29 Jan 2019 09:59:48 +0000 Subject: [PATCH 54/61] Regenerate VS2010 project file --- visualc/VS2010/mbedTLS.vcxproj | 1 - 1 file changed, 1 deletion(-) diff --git a/visualc/VS2010/mbedTLS.vcxproj b/visualc/VS2010/mbedTLS.vcxproj index e33c7483c..133fd065b 100644 --- a/visualc/VS2010/mbedTLS.vcxproj +++ b/visualc/VS2010/mbedTLS.vcxproj @@ -281,7 +281,6 @@ - From 28f78440d8d01a98a0737277013b33216c65151b Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Mon, 18 Feb 2019 16:47:50 +0000 Subject: [PATCH 55/61] Grep for debug output witnessing use of PSA in ECDHE ssl-opt.sh --- tests/ssl-opt.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh index 0d703a3f7..9e04353a7 100755 --- a/tests/ssl-opt.sh +++ b/tests/ssl-opt.sh @@ -769,6 +769,7 @@ run_test_psa() { -C "Failed to setup PSA-based cipher context"\ -S "Failed to setup PSA-based cipher context"\ -s "Protocol is TLSv1.2" \ + -c "Perform PSA-based ECDH computation."\ -c "Perform PSA-based computation of digest of ServerKeyExchange" \ -S "error" \ -C "error" @@ -780,7 +781,19 @@ run_test_psa_force_curve() { "$P_SRV debug_level=4 force_version=tls1_2" \ "$P_CLI debug_level=4 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ 0 \ + -c "Successfully setup PSA-based decryption cipher context" \ + -c "Successfully setup PSA-based encryption cipher context" \ + -c "PSA calc verify" \ + -c "calc PSA finished" \ + -s "Successfully setup PSA-based decryption cipher context" \ + -s "Successfully setup PSA-based encryption cipher context" \ + -s "PSA calc verify" \ + -s "calc PSA finished" \ + -C "Failed to setup PSA-based cipher context"\ + -S "Failed to setup PSA-based cipher context"\ -s "Protocol is TLSv1.2" \ + -c "Perform PSA-based ECDH computation."\ + -c "Perform PSA-based computation of digest of ServerKeyExchange" \ -S "error" \ -C "error" } From 135baef1bd45c78ca73d9861eb7155449591acd2 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Mon, 18 Feb 2019 17:03:36 +0000 Subject: [PATCH 56/61] Define maximum EC public key length depending on enabled curves --- include/mbedtls/psa_util.h | 81 +++++++++++++++++++++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) diff --git a/include/mbedtls/psa_util.h b/include/mbedtls/psa_util.h index a678a777a..b0c042827 100644 --- a/include/mbedtls/psa_util.h +++ b/include/mbedtls/psa_util.h @@ -235,7 +235,85 @@ static inline int mbedtls_psa_get_ecc_oid_from_id( return( -1 ); } -#define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH 256 +#define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH 1 + +#if defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) +#if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 192 + 7 ) / 8 ) + 1 ) +#undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH +#define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 192 + 7 ) / 8 ) + 1 ) +#endif +#endif /* MBEDTLS_ECP_DP_SECP192R1_ENABLED */ + +#if defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED) +#if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 224 + 7 ) / 8 ) + 1 ) +#undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH +#define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 224 + 7 ) / 8 ) + 1 ) +#endif +#endif /* MBEDTLS_ECP_DP_SECP224R1_ENABLED */ + +#if defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) +#if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 256 + 7 ) / 8 ) + 1 ) +#undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH +#define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 256 + 7 ) / 8 ) + 1 ) +#endif +#endif /* MBEDTLS_ECP_DP_SECP256R1_ENABLED */ + +#if defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED) +#if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 384 + 7 ) / 8 ) + 1 ) +#undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH +#define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 384 + 7 ) / 8 ) + 1 ) +#endif +#endif /* MBEDTLS_ECP_DP_SECP384R1_ENABLED */ + +#if defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED) +#if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 521 + 7 ) / 8 ) + 1 ) +#undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH +#define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 521 + 7 ) / 8 ) + 1 ) +#endif +#endif /* MBEDTLS_ECP_DP_SECP521R1_ENABLED */ + +#if defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED) +#if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 192 + 7 ) / 8 ) + 1 ) +#undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH +#define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 192 + 7 ) / 8 ) + 1 ) +#endif +#endif /* MBEDTLS_ECP_DP_SECP192K1_ENABLED */ + +#if defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED) +#if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 224 + 7 ) / 8 ) + 1 ) +#undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH +#define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 224 + 7 ) / 8 ) + 1 ) +#endif +#endif /* MBEDTLS_ECP_DP_SECP224K1_ENABLED */ + +#if defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED) +#if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 256 + 7 ) / 8 ) + 1 ) +#undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH +#define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 256 + 7 ) / 8 ) + 1 ) +#endif +#endif /* MBEDTLS_ECP_DP_SECP256K1_ENABLED */ + +#if defined(MBEDTLS_ECP_DP_BP256R1_ENABLED) +#if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 256 + 7 ) / 8 ) + 1 ) +#undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH +#define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 256 + 7 ) / 8 ) + 1 ) +#endif +#endif /* MBEDTLS_ECP_DP_BP256R1_ENABLED */ + +#if defined(MBEDTLS_ECP_DP_BP384R1_ENABLED) +#if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 384 + 7 ) / 8 ) + 1 ) +#undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH +#define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 384 + 7 ) / 8 ) + 1 ) +#endif +#endif /* MBEDTLS_ECP_DP_BP384R1_ENABLED */ + +#if defined(MBEDTLS_ECP_DP_BP512R1_ENABLED) +#if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 512 + 7 ) / 8 ) + 1 ) +#undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH +#define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 512 + 7 ) / 8 ) + 1 ) +#endif +#endif /* MBEDTLS_ECP_DP_BP512R1_ENABLED */ + static inline psa_ecc_curve_t mbedtls_psa_translate_ecc_group( mbedtls_ecp_group_id grpid ) { @@ -298,6 +376,7 @@ static inline psa_ecc_curve_t mbedtls_psa_translate_ecc_group( mbedtls_ecp_group } } + #define MBEDTLS_PSA_ECC_KEY_BITS_OF_CURVE( curve ) \ ( curve == PSA_ECC_CURVE_SECP192R1 ? 192 : \ curve == PSA_ECC_CURVE_SECP224R1 ? 224 : \ From 3497323f79c4a1f80a3d6a4806cae5cdfa223ea7 Mon Sep 17 00:00:00 2001 From: Jaeden Amero Date: Wed, 20 Feb 2019 10:32:28 +0000 Subject: [PATCH 57/61] Initialize PSA Crypto operation contexts It is now required to initialize PSA Crypto operation contexts before calling psa_*_setup(). Otherwise, one gets a PSA_ERROR_BAD_STATE error. --- library/cipher.c | 2 +- library/ssl_tls.c | 6 +++--- library/x509_crt.c | 2 +- library/x509write_csr.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/library/cipher.c b/library/cipher.c index 2465536c9..9ceea13d6 100644 --- a/library/cipher.c +++ b/library/cipher.c @@ -1238,7 +1238,7 @@ int mbedtls_cipher_crypt( mbedtls_cipher_context_t *ctx, (mbedtls_cipher_context_psa *) ctx->cipher_ctx; psa_status_t status; - psa_cipher_operation_t cipher_op; + psa_cipher_operation_t cipher_op = PSA_CIPHER_OPERATION_INIT; size_t part_len; if( ctx->operation == MBEDTLS_DECRYPT ) diff --git a/library/ssl_tls.c b/library/ssl_tls.c index f224d5e94..a0d2617c9 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -6529,7 +6529,7 @@ static void ssl_calc_finished_tls_sha256( unsigned char padbuf[32]; #if defined(MBEDTLS_USE_PSA_CRYPTO) size_t hash_size; - psa_hash_operation_t sha256_psa; + psa_hash_operation_t sha256_psa = PSA_HASH_OPERATION_INIT; psa_status_t status; #else mbedtls_sha256_context sha256; @@ -6605,7 +6605,7 @@ static void ssl_calc_finished_tls_sha384( unsigned char padbuf[48]; #if defined(MBEDTLS_USE_PSA_CRYPTO) size_t hash_size; - psa_hash_operation_t sha384_psa; + psa_hash_operation_t sha384_psa = PSA_HASH_OPERATION_INIT; psa_status_t status; #else mbedtls_sha512_context sha512; @@ -10203,7 +10203,7 @@ int mbedtls_ssl_get_key_exchange_md_tls1_2( mbedtls_ssl_context *ssl, mbedtls_md_type_t md_alg ) { psa_status_t status; - psa_hash_operation_t hash_operation; + psa_hash_operation_t hash_operation = PSA_HASH_OPERATION_INIT; psa_algorithm_t hash_alg = mbedtls_psa_translate_md( md_alg ); MBEDTLS_SSL_DEBUG_MSG( 1, ( "Perform PSA-based computation of digest of ServerKeyExchange" ) ); diff --git a/library/x509_crt.c b/library/x509_crt.c index 1b1f0a771..1f853baa3 100644 --- a/library/x509_crt.c +++ b/library/x509_crt.c @@ -1908,7 +1908,7 @@ static int x509_crt_check_signature( const mbedtls_x509_crt *child, if( mbedtls_md( md_info, child->tbs.p, child->tbs.len, hash ) != 0 ) return( -1 ); #else - psa_hash_operation_t hash_operation; + psa_hash_operation_t hash_operation = PSA_HASH_OPERATION_INIT; psa_algorithm_t hash_alg = mbedtls_psa_translate_md( child->sig_md ); if( psa_hash_setup( &hash_operation, hash_alg ) != PSA_SUCCESS ) diff --git a/library/x509write_csr.c b/library/x509write_csr.c index f2950ad2f..777a6325f 100644 --- a/library/x509write_csr.c +++ b/library/x509write_csr.c @@ -142,7 +142,7 @@ int mbedtls_x509write_csr_der( mbedtls_x509write_csr *ctx, unsigned char *buf, s size_t len = 0; mbedtls_pk_type_t pk_alg; #if defined(MBEDTLS_USE_PSA_CRYPTO) - psa_hash_operation_t hash_operation; + psa_hash_operation_t hash_operation = PSA_HASH_OPERATION_INIT; size_t hash_len; psa_algorithm_t hash_alg = mbedtls_psa_translate_md( ctx->md_alg ); #endif /* MBEDTLS_USE_PSA_CRYPTO */ From 1ce51e4dc3b459d2d27ed563b030055294468859 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Fri, 22 Feb 2019 10:25:47 +0000 Subject: [PATCH 58/61] Forbid setting MBEDTLS_ECP_RESTARTABLE and MBEDTLS_USE_PSA_CRYPTO_C Restartable ECC isn't supported in PSA yet. --- include/mbedtls/check_config.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/mbedtls/check_config.h b/include/mbedtls/check_config.h index 3d47899c7..083948dec 100644 --- a/include/mbedtls/check_config.h +++ b/include/mbedtls/check_config.h @@ -114,14 +114,15 @@ #endif #if defined(MBEDTLS_ECP_RESTARTABLE) && \ - ( defined(MBEDTLS_ECDH_COMPUTE_SHARED_ALT) || \ + ( defined(MBEDTLS_USE_PSA_CRYPTO_C) || \ + defined(MBEDTLS_ECDH_COMPUTE_SHARED_ALT) || \ defined(MBEDTLS_ECDH_GEN_PUBLIC_ALT) || \ defined(MBEDTLS_ECDSA_SIGN_ALT) || \ defined(MBEDTLS_ECDSA_VERIFY_ALT) || \ defined(MBEDTLS_ECDSA_GENKEY_ALT) || \ defined(MBEDTLS_ECP_INTERNAL_ALT) || \ defined(MBEDTLS_ECP_ALT) ) -#error "MBEDTLS_ECP_RESTARTABLE defined, but it cannot coexist with an alternative ECP implementation" +#error "MBEDTLS_ECP_RESTARTABLE defined, but it cannot coexist with an alternative or PSA-based ECP implementation" #endif #if defined(MBEDTLS_ECDSA_DETERMINISTIC) && !defined(MBEDTLS_HMAC_DRBG_C) From 241b524964d70b829c43c7774a1bc0e93dbe9354 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Fri, 22 Feb 2019 10:26:18 +0000 Subject: [PATCH 59/61] Disable restartable ECC in full config PSA test in all.sh --- tests/scripts/all.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 90f9632d9..b67696240 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -852,6 +852,7 @@ component_test_use_psa_crypto_full_cmake_asan() { msg "build: cmake, full config + MBEDTLS_USE_PSA_CRYPTO, ASan" scripts/config.pl full scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # too slow for tests + scripts/config.pl unset MBEDTLS_ECP_RESTARTABLE # restartable ECC not supported through PSA scripts/config.pl set MBEDTLS_PSA_CRYPTO_C scripts/config.pl set MBEDTLS_USE_PSA_CRYPTO CC=gcc cmake -D USE_CRYPTO_SUBMODULE=1 -D CMAKE_BUILD_TYPE:String=Asan . From caca307f42352ca09d358bbd0670964ea8413cf7 Mon Sep 17 00:00:00 2001 From: Jaeden Amero Date: Fri, 22 Feb 2019 10:48:48 +0000 Subject: [PATCH 60/61] crypto: Update submodule to Mbed Crypto 1.0.0d6 --- crypto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto b/crypto index 0574e6a7b..bf61ca7a0 160000 --- a/crypto +++ b/crypto @@ -1 +1 @@ -Subproject commit 0574e6a7bd0bec47e45bbd30db2e5236896b38ea +Subproject commit bf61ca7a0429ae81adfa82d1bbee4e58e3f6ecef From 85fd913950de673a7804e384a233cd85c050036f Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Fri, 22 Feb 2019 12:50:35 +0000 Subject: [PATCH 61/61] Fix typo in check_config.h --- include/mbedtls/check_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/mbedtls/check_config.h b/include/mbedtls/check_config.h index 083948dec..ea05938ed 100644 --- a/include/mbedtls/check_config.h +++ b/include/mbedtls/check_config.h @@ -114,7 +114,7 @@ #endif #if defined(MBEDTLS_ECP_RESTARTABLE) && \ - ( defined(MBEDTLS_USE_PSA_CRYPTO_C) || \ + ( defined(MBEDTLS_USE_PSA_CRYPTO) || \ defined(MBEDTLS_ECDH_COMPUTE_SHARED_ALT) || \ defined(MBEDTLS_ECDH_GEN_PUBLIC_ALT) || \ defined(MBEDTLS_ECDSA_SIGN_ALT) || \